Overview
The Blockworks API uses page-based pagination for endpoints that return large collections of data. This allows you to efficiently retrieve results in manageable chunks rather than loading everything at once.How It Works
All paginated endpoints follow the same pattern:- Request: Include
?page=and (optionally)?limit=query parameters. - Response: Contains
dataarray,totalcount, and currentpage. - Navigation: Increment
pageuntil you’ve retrieved all results.
Basic Example
Response Structure
Best Practices
- Respect rate limits by adding delays between requests when paging through large datasets.
- Cache results when possible to avoid re-fetching the same data.
- Use filters (
project,category, etc.) to reduce the total number of pages needed.
Example Output
Here’s what you might see when paging through assets withlimit=10:
- The current page number × limit ≥ total count
- The
dataarray is shorter than yourlimit - The
dataarray is empty
Related Endpoints
- List Assets - Paginated asset directory
- List Metrics - Paginated metrics catalog