Thanks to visit codestin.com
Credit goes to github.com

Skip to content

limit is not respected in the response for the list_quotes function #886

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

Open
yiweny opened this issue Jun 12, 2025 · 0 comments
Open

limit is not respected in the response for the list_quotes function #886

yiweny opened this issue Jun 12, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@yiweny
Copy link

yiweny commented Jun 12, 2025

Describe the bug

from polygon import RESTClient
from dataclasses import asdict

client = RESTClient()

date = "2025-06-12"

quotes = [asdict(q) for q in client.list_quotes("AAPL", limit=1)]

print(f"Number of quotes: {len(quotes)}")

will run infinitely because the next_url will always be returned as part of the http response regardless of the limit and we will always iterate to the next page when the response contains next_url
To Reproduce

Expected behavior
This code currently runs infinitely.
Because the code always paginate when there's next_url

            if "next_url" in decoded:

Screenshots

Additional context

@yiweny yiweny added the bug Something isn't working label Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant