You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add futures beta support
* Fix lint
* Fix indent
* Add websocket support
* Fix lint
* Fix lint errors
* Make sure we support launchpad
* Removed order param and added IEX back
* Clean up imports
* Sync futures client and models with spec
* Added pagination flag and fixed base url parsing
* Added note about pagination flag
Copy file name to clipboardExpand all lines: README.md
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,41 @@ for quote in quotes:
62
62
print(quote)
63
63
```
64
64
65
+
### Pagination Behavior
66
+
67
+
By default, the client paginates results for endpoints like `list_trades` and `list_quotes` behind the scenes for you. Understanding how pagination interacts with the `limit` parameter is key.
68
+
69
+
#### Default (Pagination Enabled)
70
+
71
+
Pagination is enabled by default (`pagination=True`):
72
+
73
+
*`limit` controls the page size, not the total number of results.
74
+
* The client automatically fetches all pages, yielding results until none remain.
75
+
76
+
Here's an example:
77
+
78
+
```python
79
+
client = RESTClient(api_key="<API_KEY>")
80
+
trades = [t for t in client.list_trades(ticker="TSLA", limit=100)]
81
+
```
82
+
83
+
This fetches all TSLA trades, 100 per page.
84
+
85
+
#### Disabling Pagination
86
+
87
+
To return a fixed number of results and stop, disable pagination:
trades = [t for t in client.list_trades(ticker="TSLA", limit=100)]
92
+
```
93
+
94
+
This returns at most 100 total trades, no additional pages.
95
+
96
+
### Performance Tip
97
+
98
+
If you're fetching large datasets, always use the maximum supported limit for the API endpoint. This reduces the number of API calls and improves overall performance.
99
+
65
100
### Additional Filter Parameters
66
101
67
102
Many of the APIs in this client library support the use of additional filter parameters to refine your queries. Please refer to the specific API documentation for details on which filter parameters are supported for each endpoint. These filters can be applied using the following operators:
0 commit comments