darksky
darksky

Reputation: 21019

Google Places Details - REQUEST_DENIED

I am using the Google Places API, specifically the Places Search and Places Details.

The Places Search is working perfectly. When trying to get the details of one of the places returned by the search, I get a REQUEST_DENIED.

Here's the Places Details API: https://developers.google.com/places/documentation/details

According to Google, the REQUEST_DENIED status is: REQUEST_DENIED indicates that your request was denied, generally because of lack of a sensor parameter. Of course, the API is inaccurate as that is obviously not the only reason. In fact, when looking at the JavaScript library, it gives a different reason for REQUEST_DENIED. It states that the reason as: REQUEST_DENIED: The webpage is not allowed to use the PlacesService.

I am passing the sensor parameter. Here's the request that I'm trying to pass:

https://maps.googleapis.com/maps/api/place/details/json?key=MYKEYHERE?reference=CqQBlgAAAAdB_-Ga9gk_D8abGjz87Wub3yNBhjfj9xte74Z1wgyuvseOayauYGztcTf3oMW5W3hJ0kqLiT8EM4Uow6Vlk5yqUSD6H3gIwB5LrrBgjYzHsbPfF_5_WyncSsAA9eFMWNHY4lgEdInj90HOuS0PfbG-JJm37NMOfksUoUSOlStQ2ARdogsg4XN3LEiWLO7lyAeWvNueWVMF_POTVpeFrgcSEIVX2qMHe1rcML_LSiEnXBAaFA0BorgBjWsyltpA5BvyYjiOXt8Z&sensor=false

Anyone has any idea what's wrong with that? I'm trying to retrieve this with a HTTP GET method. I am also not using JavaScript, but writing this in Python. I get the same response when trying to process this request in Python, or just pasting it into the browser. Note that I am actually replacing my key where I put MYKEYHERE.

Upvotes: 1

Views: 779

Answers (2)

pushbit
pushbit

Reputation: 1268

The query string syntax is invalid. Parameters must be separated by ampersands.

Change ?key=MYKEYHERE?reference= to ?key=MYKEYHERE&reference=. I tested it with my key and received a response for "Pizza Port".

Upvotes: 2

vlio20
vlio20

Reputation: 9295

ok, Here is what worked for me:

https://maps.googleapis.com/maps/api/place/details/json?reference=CjQoAAAA4ynl7-ZIzpaYrdEYNSkf_oB80GHsunwyyg13Zk5EJqnfsg-4O6ryyfDnZgmujjkEEhC96j2B-AFclOdKWHPR8zhvGhQIy_DKfiD5Or7HSEMj-a8tJVDccA&key=KEY&sensor=true

try to run other places apis to make sure that there is no problem with your key. For example take this autocomplete api:

https://maps.googleapis.com/maps/api/place/autocomplete/json?sensor=false&key=KEY&types=geocode&input=is

Upvotes: 1

Related Questions