Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Places API : Page Token Errors

I'm basically querying the google places API for stores in atlanta.

https://maps.googleapis.com/maps/api/place/search/json?location=33.7488,-84.3874&radius=50000&sensor=false&key=YOUR_KEY_HERE&types=amusement_park|art_gallery|bakery|bar|beauty_salon|bicycle_store|book_store|bowling_alley|cafe|car_repair|car_wash|clothing_store|florist|furniture_store|gym|hair_care|home_goods_store|jewelry_store|laundry|liquor_store|museum|night_club|pet_store|pharmacy|restaurant|shoe_store|spa|store|veterinary_care|zoo

This as expected returns a result with a page token to get another page of data with the same query.

https://maps.googleapis.com/maps/api/place/search/json?key=YOUR_KEY_HERE&page_token=PAGE_TOKEN_HERE

According to their API this second URL is all I need to get the 2nd page of data. But it ALWAYS returns "REQUEST_DENIED".

"{\n   \"html_attributions\" : [],\n   \"results\" : [],\n   \"status\" : \"REQUEST_DENIED\"\n}\n"

It's not clear WHY I'm getting request denied. I'm nowhere NEAR my daily limit. If I try to run the 2nd URL with ALL the given parameters from the first URL with the Token Included it acts as if I'm requesting the 1st page all over again and ignores the page_token entirely.

Has anybody gotten this page_token to work?!?!?!?!?!

like image 489
Tony Ashworth Avatar asked Jul 06 '12 17:07

Tony Ashworth


1 Answers

This is a bug in the documentation and will be fixed asap. The correct parameter to use is pagetoken NOT page_token.

like image 138
Chris Green Avatar answered Oct 22 '22 00:10

Chris Green