skip to Main Content

I am using NearBySearch from Microsoft Azure. In the official documentation it says that when you make a query the totalResults that the API can return is X. However, you can also read that there is a limit on the number of items returned which is at most 100.

In the case that the totalResults >= limit == 100, the API will only display the first 100 results, thus not showing the remaining ones.

Question: Would you be able to suggest a way to retrieve the additional results using the NearBySearch function?

Note: On the Google API NearBySearch there is a parameter called next_page_token, which allows to view all the possible results. Is there something similar in Azure?

2

Answers


  1. Would you be able to suggest a way to retrieve the additional results
    using the NearBySearch function?

    Looking at the documentation, I noticed that there is an offset parameter (ofs) which by default is zero. You should be able to use that to get the next set of results if the total results are more than the limit specified by you.

    enter image description here

    Login or Signup to reply.
  2. You have a limit of 100 results each query. If you have 150 totalResults. You can execute the query with ofs= 0 and limit= 100 to get the first 100 entries. After that you execute the second query with the ofs=100 (because it is like an index). Your limit is 100. After that you will get the next 100 results. Because there are only 50 results left, your numResults will be 50.

    I hope it is understandable

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search