Pagination
Both TypeScript and Python SDKs handle pagination automatically. The SDKs return paginated responses that you can iterate through to access all data.Basic Pagination
Processing All Data
Here’s how to collect all data from paginated responses:Pagination Best Practices
- Use async iteration (TypeScript): The
for await...of
syntax is the recommended way to handle pagination - Use while loops (Python): The
while res is not None
pattern is the standard approach - Process incrementally: For large datasets, consider processing each page as it comes rather than collecting all data in memory
- Handle errors: Wrap pagination in try-catch blocks for robust error handling (see Error Handling)
- Respect rate limits: The SDK handles rate limiting automatically, but be mindful of API usage