Pagination
The SuprSonic API uses cursor-based pagination with HATEOAS links to help you efficiently navigate through large datasets. All list endpoints support pagination with consistent parameters and response formats.Pagination Parameters
Parameter | Type | Default | Description |
---|---|---|---|
page | integer | 1 | Page number (1-based) |
limit | integer | 20 | Items per page (1-100) |
Example Request
Pagination Response Structure
All paginated responses include metadata and navigation links:Pagination Metadata
Pagination Object
Field | Type | Description |
---|---|---|
page | integer | Current page number |
limit | integer | Items per page |
total | integer | Total number of items |
totalPages | integer | Total number of pages |
hasNext | boolean | Whether there’s a next page |
hasPrev | boolean | Whether there’s a previous page |
HATEOAS Links
Navigation links preserve all query parameters from your original request:Link | Description |
---|---|
self | Current page |
first | First page |
prev | Previous page (if exists) |
next | Next page (if exists) |
last | Last page |
Pagination with Filters
When using filters, pagination links automatically preserve your search parameters:Implementation Examples
JavaScript/Node.js
Python
Best Practices
1. Use Appropriate Page Sizes
2. Handle Pagination Errors
3. Cache and Store Results
Performance Considerations
- Optimize page size: Balance between request frequency and response time
- Use filters: Reduce total items to paginate through
- Implement caching: Cache responses for frequently accessed pages
- Monitor rate limits: Implement exponential backoff for rate-limited requests
- Stream processing: Use iterators for large datasets to avoid memory issues