On third page not getting next page token google place api?

Viewed 786

On third page not getting next page token google place api?

I am using Google place text search API in my Ruby on rails application, everything is working fine but after third page I am not getting any next page token so for every text search I am getting only 60 result. Is I am missing something please suggest any help would be appreciable. This happen for every text.

  • My request for first page :-

    https://maps.googleapis.com/maps/api/place/textsearch/json?key=#{my_key}&query=#{my_query}
    
  • My request for other page with token:-

    https://maps.googleapis.com/maps/api/place/textsearch/json?key=#{my_key}&pagetoken=#{next_page_token}
    

And usually I am searching on google it show 100's of result for same place text. How can I get result more than 60.

1 Answers

This is intended behavior for Google's Places API, as you can only get up to 60 places, split across 3 pages (3 queries). This is why there is no next_page_token on the third page.

By default, each Nearby Search or Text Search returns up to 20 establishment results per query; however, each search can return as many as 60 results, split across three pages. If your search will return more than 20, then the search response will include an additional value — next_page_token.

Reference here.

Related