Forum

Message Boards Message Boards

Back

EO Data Finder API pagination problem

Threads
Previous
Toggle
EO Data Finder API pagination problem
Answer
13 February 2020 3:41
Unable to navigate to last results using maxRecords= and index= parameters
0 (0 Votes)

RE: EO Data Finder API pagination problem
Answer
13 February 2020 3:45 as a reply to Rob Marjot.
Dear Forum Administrator and supporters,

Using the EO Finder JSON end point...
https://finder.creodias.eu/resto/api/collections/Sentinel2/search.json
... I am able to find 346 products @L2A for Tile 31UFU using this request:
https://finder.creodias.eu/resto/api/collections/Sentinel2/search.json?_pretty=true&processingLevel=LEVEL2A&productIdentifier=%_T31UFU_%&startDate=1970-01-01T00:00:00Z

By default only the most-recent 20 products are included in the response (although documentation says this should be only 10).


Suppose I wish to retrieve all 346 results page by page (20 each), then I would use parameters maxRecords=20 and index=341 to retrieve the last 6 products. However, such request yields no results:
https://finder.creodias.eu/resto/api/collections/Sentinel2/search.json?_pretty=true&processingLevel=LEVEL2A&productIdentifier=%_T31UFU_%&startDate=1970-01-01T00:00:00Z&maxRecords=20&index=341

Can you please help? Maybe I am missing something?

Thanks,
Rob
0 (0 Votes)

RE: EO Data Finder API pagination problem
Answer
26 February 2020 10:34 as a reply to Rob Marjot.
It was clarified by Creodias' support that the number that is in the JSON reponse ".totalResults" is an estimate. The pagination works, just ignore the totalResults and recursively follow the URL that is in

.properties.links[.rel="next"].href

until .features in the JSON response is an empty list.

Since pagination relies on ordering, it's wise to set the following parameters in your query:
maxRecords=
sortParam=
sortOrder=(descending|ascending)

Working with the index= parameter is not advised
0 (0 Votes)