question

Upvotes
Accepted
51 15 19 15

How to access the records of all the pages returned via /entity/search?

The max number of the "limit" parameter of /entity/search is 100 as described in the Data Fusion API Document, so I requested the data using /entity/search setting 100 for the parameter and received the responce.

limitThe maximum number of records to return per page. Default of 50, max of 100.

The value of "totalCount' field in the response is 279,893, but when I try to show list all the label of the response, I can show only 100 values in the "label" field on the first page and can't show the other 279,793 as you can see in the attached.

Could you please let me know how to access the remaining values of the "label" field on the 2+ pages?

Your prompt clarification would be very helpful!

@Ryosuke.Nakamura

data-fusion
capture.png (47.0 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvote
Accepted
36 0 2 1

@hiroko.yamaguchi, @Ryosuke.Nakamura

There are two options:

  • Utilize the start/limit query parameters to page through results
  • Utilize the `resumeToken` parameter - An optional pagination/iteration state token used to assist in pagination of large result sets.

start/limit

With an entity search, Data Fusion defaults to showing the first 50 results: 0-49. You can use the `start` parameter to change the starting entity, and the `limit` parameter to change the number of returned entities (max 100).

To page through results, you could subsequently increase your start parameter, like this:

// First call
start=0&limit=100

// Second call
start=100&limit=100

// Third call
start=200&limit=100

// etc... 

This method allows you to make the API calls asynchronously.


resumeToken

The other option is to utilize the resumeToken parameter. To request a resumption token, your first API call must specify a value of "*". Here's an example:

&resumeToken=*

The response body will now include a `nextResumeToken` key:

To continue paging through results, each subsequent call should utilize the previous calls nextResumeToken value. Once the value of nextResumeToken is equal to the previous nextResumeToken, you have reached the end of the results.


resumetoken.png (54.2 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.