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:

ParameterDescription
pageSpecifies the page number to retrieve. Default is 1.
limitSpecifies 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

FieldDescription
resultsArray of records for the current page.
countTotal number of records available across all pages.
nextURL for the next page of results. Null if there are no more pages.
previousURL 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

  1. 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.
  2. Usenext and previous URLs
    Rely on the next and previous fields from the response for seamless navigation between pages.
  3. Handle Empty Pages Gracefully
    Check if the results array is empty to identify when there are no more records to process.
  4. 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:

  1. Start with the first page (page=1).
  2. Use the next field to request subsequent pages until next is null.