> For the complete documentation index, see [llms.txt](https://docs.coresignal.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coresignal.com/api-introduction/requests/elasticsearch-dsl/results-pagination.md).

# Results Pagination

### Why is pagination needed?

Results containing IDs are provided in batches of 1,000 IDs per page.

Sometimes, a request might yield more IDs than can be displayed on a single page. In such situations, you'll need to use pagination to obtain all the requested IDs from the POST request.

### Response header information

Response headers contain information such as **the total result count**, **page number**, and **the last ID** on the page:

* `x-next-page-after` – displays the last ID on the page. This field contains `last_updated` and `ID` information. Here `last_updated` format differs between entities.
* `x-total-pages` – lists the total number of pages with ID results.
* `x-total-results` – shows the total number of IDs returned by your search.

An example of Company API response headers:

```json
x-next-page-after: "2025-03-03",3771705 
x-total-pages: 57 
x-total-results: 56940 
```

### Sorting in pagination

Pagination using **ID** sorting works the same way as pagination without sorting.

Pagination using **score** sorting has a different ID format. The format difference is seen by the `x-next-page-after` parameter, where results show: the **score**, the **last updated** date, and the **last ID** on the page.

An example of Company API response headers:

{% code title="Sorting by score" %}

```json
x-next-page-after: 26.806067,"2025-02-25",6428995 
x-total-pages: 57 
x-total-results: 56940 
```

{% endcode %}

### Using pagination in cURL requests

Add a parameter `?after={x-next-page-after}` to the POST request to see the next results page. Example of Company request:

```json
curl -X 'POST' \
'https://api.coresignal.com/cdapi/v2/company_multi_source/search/es_dsl?after="2025-03-03",3771705' \
  -H 'accept: application/json' \
  -H 'apikey: {API Key}' \
  -H 'Content-Type: application/json' \
  -d '{
    "query": {}, //Insert your query
}'
```

### Limiting search results per page

Query parameter `?items_per_page={int}` allows you to specify the number of results retrieved per Search results page. The current limit is 1,000. Thus, this parameter lets you set a smaller limit value for the results page.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.coresignal.com/api-introduction/requests/elasticsearch-dsl/results-pagination.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
