Skip to content

Limit parameter not respected across various endpoints #921

@bradfordlynch

Description

@bradfordlynch

Describe the bug
Endpoints such as /v3/trades and /v3/quotes support a limit parameter which according to the documentation "Limit the number of results returned, default is 1000 and max is 50000." However, this appears to be operating more like a page size than a limit on the number of results returned. At the very least the documentation should be updated for clarity.

To Reproduce
Run the following code:

quotes = []
for t in pg_client.list_quotes(
	ticker="AAPL",
	order="asc",
	limit=10,
	sort="timestamp",
	):
    quotes.append(t)

    if len(quotes) > 100:
        break

print(len(quotes))
# Result 101

Expected behavior
Based on the documentation, I would have expected the length of quotes to be 10 not 101. Note that this is basically the example from the docs and if you run it it will run for a very long time as it pages through the quotes for AAPL.

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