page
and per_page
parameters control how search results are divided into manageable chunks. This is essential for handling large datasets efficiently and improving application performance.
Quick start
Here’s how to get the first 25 transactions:Pagination parameters
Parameter | Description | Default | Range/Limit | Type |
---|---|---|---|---|
page | Specifies which page of results to retrieve | 1 | Minimum: 1 | integer |
per_page | Number of records returned in each page | 10 | Maximum: 250 | integer |
Common pagination patterns
1
Basic pagination
Start with the first page and a reasonable page size.
2
Navigate to specific page
Jump to a specific page when you know the approximate location of your data.
3
Large result sets
Use maximum page size for bulk data processing.
4
Combined with sorting
Paginate through sorted results for consistent ordering across pages.
Response structure
The pagination information is included in every search response:Key response fields
Field | Description | Type |
---|---|---|
found | Number of records matching your search criteria | integer |
out_of | Total number of records in the collection | integer |
page | Current page number | integer |
hits | Array of result objects for the current page | array |
Best practices
- Start with reasonable page sizes: Use 20-50 records for UI display, 100-250 for data processing.
- Always sort paginated results: Use
sort_by
to ensure consistent ordering across pages. - Handle empty pages gracefully: Check if
hits
array is empty before processing results. - Monitor performance: Larger page sizes may impact response time.
Related topics
Sorting
Combine pagination with sorting for consistent result ordering across pages.
Filtering
Use filters to reduce result sets before applying pagination.
Search overview
Return to the main Search API documentation for a complete overview.