Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time window bug for v2/averages #329

Open
majesticio opened this issue Feb 2, 2024 · 0 comments
Open

Time window bug for v2/averages #329

majesticio opened this issue Feb 2, 2024 · 0 comments

Comments

@majesticio
Copy link
Contributor

It appears that if requesting averages in a time window less than ~4 months the data will return 0 results:

locations_id = 635657

url = f"https://api.openaq.org/v2/averages"

params = {
    "parameters_id": 2,
    "date_from": "2023-05-01",
    "date_to": "2023-09-30",
    "locations_id": locations_id,
    "limit": 1000
}
res = requests.get(url, params=params )
data = res.json()
results = data["results"]
print(data["meta"])

-> {'name': 'openaq-api', 'license': '', 'website': '/', 'page': 1, 'limit': 1000, 'found': 0}

Increasing the time window, for instance to "date_to: "2024-01-01" returns results which also include the original time window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant