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.| Topic | Details |
|---|---|
| Pagination style | Page-based with ?page= and ?limit= query parameters. |
| Limit (results per page) | Default is 100, max is 1000 |
| Response structure | { data: [], total: number, page: number } |
| Affects these endpoints | List Assets, List Metrics |
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