Skip to content

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

Open
@yiweny

Description

@yiweny

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions