How Pagination Works
When you request a list of resources (like posts), the API automatically includes pagination information in the response. This allows you to:- Control how many items are returned per request
- Navigate to specific pages
- Understand the total size of the dataset
- Build pagination UI components
Query Parameters
The maximum number of items to return per page.Range: 1-200 items per page
The page number to retrieve. Pages start at 1.Minimum: 1
Pagination Response
Every paginated response includes apagination
object with the following fields:
Metadata about the current page and navigation options.
Request Examples
Get the first page with default limit (10 items):
cURL
Paginated Endpoints
The following endpoints support pagination:Posts
Get all published posts with pagination support.
Categories
Browse all content categories with pagination.
Authors
List all authors with their associated content.
Tags
Retrieve all content tags with pagination.
Best Practices
Optimize Performance: Use smaller page sizes (5-20 items) for better performance, especially on mobile devices.
Handle Empty Results: Always check if the
posts
array is empty and handle the empty state in your UI.Navigation Logic: Use
nextPage
and previousPage
values to build navigation controls. These fields will be null
when navigation in that direction isn’t possible.Error Handling
Invalid page number
Invalid page number
When you request a page that doesn’t exist, the API returns a structured error response:Always check for the
error
field in your response before processing pagination data.Invalid limit value
Invalid limit value
- Values below 1 will default to 1
- Values above 200 will be capped at 200
- Non-numeric values will default to 10
Empty datasets
Empty datasets
When there are no posts,
totalPages
will be 0 and totalItems
will be 0. The posts
array will be empty.