Closed kalisio-nicolas closed 9 months ago
@majesticio can you take a look at this?
@kalisio-nicolas Hello, this is actually expected behavior. When you use parameter_id=3
it will return location objects that contain that parameter, it doesn't reshape the data for you. Likewise, when you call a location by its ID the API will return that location object, the parameter=
query params won't reshape the data, but date_from
and date_to
will get the desired range of measurement objects from that location. Hope this helps!
closing since this is expected behavior in v2
Issue Description:
Hello, I am encountering unexpected behavior when using the
parameter_id
parameter in thev2/latest
endpoint. Specifically, I am attempting to filter results for a specific parameter, such asOzone mass concentration
by providing its corresponding identifier, such as3
. However, the endpoint is returning measurements for other parameters, such aspm10
andco
which should not be included.Here is the URL I am using:
https://api.openaq.org/v2/latest?country_id=2¶meter_id=3
Expected Behavior:
parameter_id
parameter, I expect the endpoint to filter and return only measurements for the specified parameter, in this case,Ozone mass concentration
(parameter_id=3).Actual Behavior:
Ozone mass concentration
,pm10
,co
and possibly others. Additionally, the presence of theparameter_id
parameter appears to affect the number of results returned, meaning that the parameter is being treated as a filter, but not as expected.With the
measurements
endpoint, filtering by type works as expected, and in addition, the old parameterscountry
andparameter
still function. Especially, with the oldparameter
, we could include multiple parameters in a single request, such aspm10
andpm25
in one query. However, with thelatest
endpoint, we can only useparameter_id
, which can only accept one variable per request, and it also does not behave as expected. https://api.openaq.org/v2/measurements?location_id=65998&limit=1000&date_from=2023-09-18T00:00:00Z¶meter=pm25¶meter=pm10Am I missing something ? Or is this a bug ? thanks for your help.