It’s hard for me to get a valid autocomplete response from the Google Places API. I use code based on [their example} ( https://developers.google.com/places/training/autocomplete-android ) (which interestingly seems to use the wrong country code "uk" ).
I have enabled the Places API in the Google Code console. My API key was generated when I first turned on the Maps API a couple of weeks ago, and the MapFragment that I use works fine, so I have no reason to suspect that the API key is invalid.
URL used https://maps.googleapis.com/maps/api/place/autocomplete/json?input=New+York&sensor=false&key=my_valid_api_key&components=country:us
I always get {"status":"REQUEST_DENIED","predictions":[]}as my answer.
I have checked several times that my URL is configured correctly and meets the requirements for Auto-completion of the endpoints API places , but I do not get the answer that I expect.
I saw several suggestions on how to fix this on SO and elsewhere, but none of them worked for me (i.e. using http instead of https, use port 443, etc.). I tried all these reasonable combinations without changing the answer.
Please help me find what I am doing wrong.
source
share