Multi-source API
Elasticsearch DSL

Pagination

11min

Pagination information for the /v1/multi_source/company/collect endpoint.

Shortcuts

Overview

Profile IDs are provided in batches of 1000 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.

Where can I see the page count?

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

Example

  • x-next-page-afterdisplays the last ID on the page.
  • x-total-pages lists the total number of pages with ID results.
  • x-total-resultsshows the total number of IDs returned by your search.

Using pagination in cURL requests

This tutorial requires prior knowledge of how to compile and execute POST requests in Multi-source API.

Elasticsearch DSL endpoint

Use parameterx-next-page-after to retrieve a second page of IDs.

  1. Navigate to the Headers section and click it:
Document image


2. Find the following information:

  • x-next-page-after
  • x-total-pages
  • x-total-results
Document image




  • x-next-page-after displays the last ID on the page.
  • x-total-pages lists the total number of pages available for your search.
  • x-total-resultsshows the total number of IDs available.

3. Add parameter ?after={last_ID} to the POST request to see the next results page:

4. Execute the request, and you will see the next page in the Body section:

JSON


Pagination using sorting

Pagination, when sorting by ID, works the same way as pagination without sorting.

  1. Add parameter ?after={last_ID} to the POST request: Refer to the example below for the exact parameter placement:
Pagination (sorted by id)


Send the request, and you will see the next page in the (Response) Body.



Pagination using score sorting has a different ID format. The format difference is seen by the x-next-page-after parameter.

The number preceding the comma is for the score, and the one after the score - is the last ID on the page.

Document image


Add parameter ?after={last_ID} to the POST request to see the next results page. Refer to the example below for the exact parameter placement:

Pagination (sorted by score)


Send the request, and you will see the next page in the (Response) Body.