To maintain optimal performance and prevent excessive response sizes, the Tupel API implements pagination for collections of resources.
Pagination Method
Tupel uses page-based pagination, meaning responses are divided into pages. Key details:
- Default page size: Default is 10 objects per request, but this can be customized
- Maximum page size: 100 objects per request
- Query parameters:
page
(integer, starting from 1)page_size
(integer, between 1-100)- Pagination behavior: If there are more results, the API provides a next URL
Response Structure
List endpoints return a consistent structure that includes pagination metadata:
{
"count": 105, // Total number of items across all pages
"next": "https://tupel.com/api/payments/?page=2", // URL for the next page (null if on last page)
"previous": null, // URL for the previous page (null if on first page)
"items": [ // Array of resource objects for the current page
{ ... },
{ ... },
// Items for the current page
]
}
Best Practices
- Always check for the presence of
next
before requesting additional pages - Use the complete URLs provided in
next
andprevious
fields rather than constructing your own - Consider implementing caching if traversing many pages
- For large datasets, prefer filtered queries to reduce the number of pages needed
- Use the
page_size
parameter to optimize response size for your application needs
Page Size
You can customize the number of objects returned per page using the page_size
parameter:
- If not specified, defaults to 10 objects per page
- Maximum allowed value is 100
- Minimum allowed value is 1