openaq/openaq-api

[QUESTION] Is there a way to know if a location has data without making a call for measurements?

JuriKiin opened this issue · 2 comments

I'm trying to load data for multiple locations. In order to limit the amount of API calls, I'm wondering what's the best way to check if a location has data before adding it to a list?

(In order to prevent empty locations from appearing in that list)

Hi @JuriKiin

Are you filtering from locations in a certain area? Then you can use the count value from the locations endpoint.

If you have a list of locations (US-0001, US-0002 etc), you would need to individually request the location and look at the count value, as well.

Does that answer your question?