Iโm selecting several services and only getting limited data. How do I attemtped to receive โunlimitedโ data back?
'data: { results: [], total_pages: 87 }'
when I do not specify a "pages" parm I only get 25 results
when I specify a "pages" of 100 I go NO data back.
Do I have to call the API once to determine the number of pages then again setting the number of pages?
รnase a la conversaciรณn, aรฑada un comentario a continuaciรณn:
Hi,
To query the whole data, you need to first send a request with page=1 or without a page parameter (note that thereโs no โpagesโ parameter, thereโs only โpageโ). Consume the data in the results, then check the โtotal_pagesโ and send a new request for each page. i.e. if total_pages = 5, then you need to send extra requests with page=2, page=3, page=4, and page=5
Maximum amount of items for each request is 25 for Search Ultra endpoint. So if thereโre 100 results, youโll need to send 4 requests to get them all.
When you are setting โpageโ to 100, and the total pages are 87, that means you are querying a page that does not exists, thus the endpoint returns an empty array.
Hope this helps. Let me know if you any other questions.