For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Logo
Resources
Log inGet a demo
Get startedAPI referenceImplementation
Get startedAPI referenceImplementation
    • Overview
      • Authentication
      • Pagination
      • SDKs
      • Rate limits
      • Sync frequency
      • Versioning

Get started

  • Overview
  • Introduction
  • Unified API
  • Linked Account
  • Merge Link
  • Use cases

Implementation

  • Sandboxes
  • SDKs
  • API access
  • Syncing data
  • Writing data
  • Data minimization
  • Supplemental data
  • Errors
  • Integration metadata

API reference

  • ATS
  • HRIS
  • Accounting
  • Ticketing
  • CRM
  • File Storage
  • Knowledge Base
  • Chat

Resources

  • Help Center
  • Merge.dev
  • Changelog
© Merge 2026Terms of usePrivacy policy
UnifiedAgent HandlerGateway
UnifiedAgent HandlerGateway
Resources
Log inGet a demo
On this page
  • Overview
  • Query parameters
  • Sample HTTP request
  • Getting the cursor
  • Using the cursor
Merge API basics

Pagination

Learn how to paginate bulk data requests to the Merge API.
Was this page helpful?
Previous

Authentication

Next

Merge SDKs


Overview

Any data you interact with via the Merge API is able to be paginated. Pagination is specified via the cursor and page_size query parameters. Ensure that all query parameters, aside from cursor and page_size, remain consistent across pagination to maintain the integrity of your data retrieval. The next and previous cursors are attached to paginated API responses. Their values inform the cursor where to point to next.


Query parameters

ParameterTypeDescription
cursorStringDenotes the starting position in the data list from where a paginated API endpoint should return bulk data. Get this value from the next or previous property of any previous paginated response. When next or previous is null there are no more pages to paginate through.
page_sizeIntegerLimit on number of objects to return per request. Defaults to 30, maximum of 100.

Sample HTTP request

Below is an sample request using pagination in HTTP. The page_size is set to 20, and the cursor is pointing to a value for the next page.

GET /api/ats/candidates?page_size=20&cursor=cD0yMDIxLTA3LTI4KzE5JTNBMzglM0EzNi42NzUxNTMlMkIwMCUzQTAw
X-Account-Token: {Linked Account Token Here}
Authorization: Bearer {Production API Key Here}

Getting the cursor

In the response payload of an API request to a paginated endpoint, you can find next and previous cursors.

Paginated API Response Payload
1{
2 "next": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw",
3 "previous": null,
4 "results": [
5 {...},
6 {...},
7 {...}
8 ]
9}

Using the cursor

These cursors can be attached to future requests to paginated API endpoints to query the next (or previous) page of results, as demonstrated in the following code sample using the Merge SDK:

1# See SDK docs for configuration information
2import merge
3from merge.client import Merge
4
5merge_client = Merge(api_key="<YOUR_API_KEY>", account_token="<YOUR_ACCOUNT_TOKEN>")
6
7cursor = ""
8
9while cursor != None:
10 try:
11 next_employees_page = merge_client.hris.employees.list(next=cursor)
12 pprint(next_employees_page)
13 cursor = next_employees_page.next
14 except Exception as e:
15 print("Exception when calling EmployeesApi->employees_list: %s" % e)

If you don’t want to use the Merge SDK and want to form your own API requests instead, you can do so as illustrated below:

1import requests
2
3endpoint_url = "https://api.merge.dev/api/hris/companies"
4
5headers = {"Accept": "application/json", "Authorization": "Bearer YOUR_API_KEY", "X-Account-Token": "END_USER_ACCOUNT_TOKEN"}
6response = requests.request("GET", endpoint_url, headers=headers)
7print(response.json()["results"])
8cursor = response.json()["next"]
9
10while cursor:
11 page_url = f"{endpoint_url}?cursor={cursor}"
12 response = requests.request("GET", page_url, headers=headers)
13 print(response.json()["results"])
14 cursor = response.json()["next"]