Google Places API : Page Token Errors

人盡茶涼 提交于 2019-12-01 16:48:45

问题


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?!?!?!?!?!


回答1:


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



来源:https://stackoverflow.com/questions/11367307/google-places-api-page-token-errors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!