Pagination Strategies
Offset Pagination (Default)
Offset pagination uses page numbers and page sizes. This is the default pagination strategy for collection endpoints.Parameters
page[size]- Number of items per page (default: 15, max: 100)page[number]- Page number to retrieve (starts at 1)
Example Request
Example Response
Limit Pagination
Limit pagination allows you to specify a maximum number of results without explicit page numbers. This is useful for “load more” functionality.Parameters
page[limit]- Maximum number of items to return (default: 15, max: 100)
Example Request
Example Response
Pagination Constraints
The API enforces the following constraints on pagination parameters:- Default page size: 15 items
- Maximum page size: 100 items
- Minimum page size: 1 item
Implementation Details
Fromapp/Http/Api/Criteria/Paging/Criteria.php:14-16:
Pagination Metadata
Offset-paginated responses include alinks object with navigation URLs:
- The
lastlink is alwaysnullbecause the total page count is not calculated - This improves performance for large datasets
- The
nextlink will benullwhen you’ve reached the last page
Combining with Other Parameters
Pagination can be combined with filtering, sorting, and field selection:- Returns 25 items per page
- Gets the first page
- Filters anime from 2020
- Sorts by name in descending order
- Includes related animethemes
Best Practices
Choose the Right Page Size
Balance between:- Smaller page sizes (10-25) - Faster responses, more requests
- Larger page sizes (50-100) - Fewer requests, slower responses
Use Limit for Simple Lists
If you only need the first N results without pagination:Preserve Query Parameters
When navigating between pages, use the URLs provided in thelinks object. These URLs preserve all query parameters including filters, sorts, and includes.
Examples
Get First Page of Anime (Default)
Get Specific Page with Custom Size
Get Top 100 Most Recent Anime
Paginate Through Artists
Related Topics
- Filtering - Filter results before pagination
- Rate Limits - Understand request limits