Efficient handling of large datasets is essential for scalable API integrations. The Kini API supports a pagination system to manage large volumes of data efficiently across multiple endpoints, ensuring smooth performance and reducing response payload sizes.
Important: Upcoming Pagination Changes
Starting 15 January, the Kini API will exclusively support paginated responses for the GET /jobs and GET /candidates endpoints. To prepare for this change, you can enable pagination now by including the parameter
pagination=true
in your requests.
How Pagination Works
Pagination Parameters
The Kini API uses the following parameters to control pagination:
Parameter | Description |
---|---|
page | Specifies the page number to retrieve. Default is 1 . |
limit | Specifies the number of records per page. Maximum allowed is 50 . |
Example Request
To retrieve the second page of jobs with a limit of 20 records per page:
GET /jobs?page=2&limit=20
Response Format
Each paginated response includes metadata to help you navigate through the dataset.
Response Fields
Field | Description |
---|---|
results | Array of records for the current page. |
count | Total number of records available across all pages. |
next | URL for the next page of results. Null if there are no more pages. |
previous | URL for the previous page of results. Null if on the first page. |
Example Response
{
"count": 125,
"next": "https://api.getkini.com/jobs?page=3&limit=20",
"previous": "https://api.getkini.com/jobs?page=1&limit=20",
"results": [
{
"id": 42,
"title": "Software Developer",
"status": "active"
},
{
"id": 43,
"title": "Data Scientist",
"status": "active"
}
]
}
Best Practices
- Set a Reasonable Limit:
Use the limit parameter to control the number of records per request and avoid using the maximum limit unless necessary to reduce response size and improve performance. - Use
next
andprevious
URLs
Rely on the next and previous fields from the response for seamless navigation between pages. - Handle Empty Pages Gracefully
Check if the results array is empty to identify when there are no more records to process. - Combine Pagination with Filters
Use filters in combination with pagination to narrow down the dataset and reduce the total number of pages.
Example Use Cases
Fetch All Jobs
Iterate through all pages to retrieve the complete dataset:
- Start with the first page (
page=1
). - Use the
next
field to request subsequent pages untilnext
isnull
.