Overview
API pagination is a technique used to divide large datasets into smaller, manageable pages. Instead of returning all records in a single response, pagination delivers data in multiple segments, improving performance, reducing response size, and enabling efficient data retrieval.
In eZintegrations, the API Data Source provides multiple built-in pagination methods based on industry-standard API architectures. These out-of-the-box pagination types help users fetch complete datasets from different APIs, regardless of how the source system implements pagination.
When to Use API Pagination
API pagination should be used when working with endpoints that return large volumes of data. It helps prevent timeouts, memory issues, and excessive network usage.
- When APIs return thousands of records
- When response size affects performance
- When data must be processed in batches
- When complete dataset extraction is required
Types of Pagination Supported in eZintegrations
eZintegrations supports the following industry-standard pagination methods to ensure compatibility with diverse API designs.
1. Next URL Pagination
Next URL pagination provides a direct link in the response to retrieve the next page of data.
How It Works
- The initial request returns records and a
nextornext_urlfield. - The field contains the complete URL for the next page.
- The system automatically follows this URL.
Use Case: Commonly used in REST APIs that provide navigation links.
{
"data": [...],
"next_url": "https://api.example.com/data?page=2"
}
2. Offset Pagination
Offset pagination retrieves records using a starting position and a fixed limit.
How It Works
- Requests include
offsetandlimitparameters. - The offset value increases with each request.
Use Case: Suitable for APIs that support numeric positioning.
GET /data?offset=20&limit=10
3. Total Page Count Pagination
Total page count pagination uses page numbers and total page information to control navigation.
How It Works
- The API returns the total number of pages.
- Requests are sent sequentially using page numbers.
Use Case: Used when APIs provide metadata such as total pages.
{
"page": 1,
"total_pages": 5,
"data": [...]
}
4. Pagination with Body
Pagination with body sends pagination parameters inside the request payload.
How It Works
- Page number, offset, or limit is included in the request body.
- Typically used with POST requests.
Use Case: Common in enterprise and GraphQL-style APIs.
{
"page": 2,
"page_size": 50
}
5. Cursor Pagination
Cursor pagination uses a unique reference value to identify the next data segment.
How It Works
- The API returns a cursor value.
- The cursor is passed in the next request.
- Pagination continues until no cursor is returned.
Use Case: Ideal for large datasets and real-time systems.
{
"data": [...],
"next_cursor": "abc123xyz"
}
6. Encoded Next Token Pagination
Encoded token pagination uses encrypted or encoded values to represent the next page position.
How It Works
- The API returns an encoded token.
- The token is passed in the next request.
- The server decodes the token to determine the next page.
Use Case: Common in cloud and secure APIs.
{
"items": [...],
"next_token": "eyJwYWdlIjoyfQ=="
}
7. Custom Pagination
Custom pagination allows manual configuration for APIs that do not follow standard patterns.
How It Works
- Users configure parameters and response fields manually.
- Custom headers and response keys are supported.
- eZintegrations adapts to the API format.
Use Case: Used for proprietary and legacy systems.
Benefits of Using Pagination in eZintegrations
Using built-in pagination ensures reliable and efficient data extraction across different APIs.
- Ensures complete data retrieval
- Improves performance and stability
- Reduces response size
- Prevents timeout and memory issues
- Supports multiple API architectures
- Enables automated multi-page processing
Frequently Asked Questions
What is API pagination?
API pagination is a method of dividing large API responses into smaller pages to improve performance and reliability.
Why is pagination important in eZintegrations?
Pagination ensures complete data extraction while preventing large responses that may cause timeouts or failures.
Which pagination method should I use?
The appropriate method depends on how the source API provides paging information, such as URLs, offsets, cursors, or tokens.
Does eZintegrations support custom pagination?
Yes, eZintegrations supports custom pagination for APIs that do not follow standard formats.
Notes
- Pagination behavior depends on the source API implementation.
- Always review API documentation before configuring pagination.
- Incorrect pagination settings may result in incomplete data.
Summary
API pagination enables efficient data retrieval by dividing large responses into smaller pages. eZintegrations supports multiple industry-standard pagination methods, including customizable options, to ensure compatibility with diverse API designs. Selecting the appropriate pagination type allows reliable and scalable data extraction from external systems.