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

Pagination doesn't seem to work #39

Open
zseta opened this issue Jan 12, 2022 · 1 comment
Open

Pagination doesn't seem to work #39

zseta opened this issue Jan 12, 2022 · 1 comment

Comments

@zseta
Copy link

zseta commented Jan 12, 2022

I've been trying to figure out how to paginate through results, as it's mentioned in the API docs, and also in your wrapper it's implemented. But when I try to use it it doesn't return any results.

Eg.:

This code:

api = openaq.OpenAQ()
data = api.measurements(city='Delhi', parameter='pm25', limit=200, page=2)[1]

Returns this:

{
    "meta": {
        "name": "openaq-api",
        "license": "CC BY 4.0d",
        "website": "https://u50g7n0cbj.execute-api.us-east-1.amazonaws.com/",
        "page": 2,
        "limit": 200,
        "found": 4042410,
        "pages": 20213
    },
    "results": []
}

This is not correct because there should be things on page two, I imagine.
It's probably not the wrapper's fault, the API just doesn't seem to work properly if page parameter is defined, just wanted to bring this to attention.

@dhhagan
Copy link
Owner

dhhagan commented Jan 12, 2022

Hi @zseta I just tried to replicate using curl and find the same result. It seems to be a fundamental limitation with the API - it may be worth raising an issue on their GitHub repo and mentioning this issue.

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

2 participants