Pagination in GET APIs
Last updated on
27 February 2026
Overview
Pagination allows you to retrieve API results in smaller chunks instead of fetching all records at once. This improves performance, reduces server load, and makes large datasets easier to manage.
Pagination can be applied to any GET API by passing pagination parameters in the request URL.
If pagination parameters are not provided, the API returns the first 100 records.
Click this link to download and get started.
How to Implement Pagination
After creating a GET API, you can enable pagination by adding one of the following query parameter combinations to the request URL:
- Page-based Pagination
?page=<page_number>&size=<number_of_records> - Offset-based Pagination
?offset=<starting_position>&size=<number_of_records>
Pagination Parameters
- page:
- Specifies the page number to retrieve.
- Page numbering is 1-based (starts from 1).
- Must be used together with the
sizeparameter. - Applicable only to GET APIs.
- Example:
https://your-base-url/custom-api/order?page=2&size=25
- size:
- Specifies the number of records to return per request.
- Must be used with either
pageoroffset. - If not provided, the API returns all records.
- Example:
size=25
- offset:
- Specifies the starting position of records to return.
- Offset is 1-based (the first record starts at offset = 1).
- Must be used together with the
sizeparameter. - If both
offsetandpageare provided,offsettakes priority andpageis ignored. - Example:
https://your-base-url/custom-api/order?offset=11&size=10
Examples
- Example 1: Page-based Pagination:
- a. Request:
GET https://your-base-url/custom-api/order?page=1&size=10 - Result: Returns the first 10 records.
- b. Request:
GET https://your-base-url/custom-api/order?page=2&size=10 - Result: Returns the next 10 records.
- a. Request:
- Example 2: Offset-based Pagination:
- a. Request:
GET https://your-base-url/custom-api/order?offset=1&size=10 - Result: Returns the first 10 records.
- b. Request:
GET https://your-base-url/custom-api/order?offset=11&size=10 - Result: Returns records from position 11 to 20.
- a. Request:
Help improve this page
Page status: No known problems
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion