Skip to main content

Key Concepts

  1. Cursor Pagination: Cursor pagination returns a subset of results along with a cursor that points to the next set of results. This method is more efficient than offset pagination, especially for large datasets.
  2. Limit: You can specify the maximum number of items to return in a single request using the limit parameter. The default and maximum value for limit is 100.

Request Parameters

limit
integer
default:"100"
required
Specifies the maximum number of items to return in the response.
cursor
string
Specifies the cursor that points to the next set of results.

Response Format

Each paginated response includes the following fields to help you navigate through the dataset.
content
array
required
An array of the requested items.
next
string
required
A URL to the next page of results, if any.
count
integer
required
The total number of items in the current response.
GET https://api.recruitifi.com/v1/jobs?limit=2
Authorization: Bearer <token>
{
  "content": [
    {
      "id": "job_1",
      "title": "Software Engineer",
      "description": "Job description for Software Engineer"
    },
    {
      "id": "job_2",
      "title": "Product Manager",
      "description": "Job description for Product Manager"
    }
  ],
  "next": "https://api.recruitifi.com/v1/jobs?cursor=NEXT_CURSOR",
  "count": 2
}

Handling Pagination

To handle pagination, follow these steps:
  1. Initial Request: Make an initial request to the endpoint with the desired limit.
  2. Check for Next Page: Inspect the next field in the response. If it contains a URL, there are more results to fetch.
  3. Subsequent Requests: Make a subsequent request to the URL provided in the next field to retrieve the next set of results.
  4. Repeat: Repeat steps 2 and 3 until the next field is null, indicating there are no more results.
By following this approach, you can efficiently navigate through large datasets using cursor pagination with the RecruitiFi API.