3

I am developing an application that should present the user near restaurants. For this purpose I want to use Google Places to get the locations and names in order to draw the places on map, using Google Maps. I am confused about the API Keys. I first generated one API key for Google Maps API (android key) and Google Maps works fine with it, but when I try to use Google Places API Web Service with the same key it tells me :

error_message: This IP, site or mobile application is not authorized to use this API key. ... REQUEST_DENIED

Then, I searched and learned that I should generate server key, not android key. I made server key, and there was an option to enter IP address. It said that was optional, so, at first, I didn't enter any IP address, but I got the same mistake above. Then, I put my device's IP address and it worked good last night. Today, I got the same mistake. I am assuming that it's because the IP address changed. Now, the question is : Am I working with the right API key ? How can I fix this ?

I fixed! The problem Google Places API Web Service instead of Google Places API Android. When I enabled this API, it started working with android api key.

green
  • 393
  • 1
  • 5
  • 18
  • Possible duplicate of [Show Current Location and Nearby Places and Route between two places using Google Maps API in Android](http://stackoverflow.com/questions/8428209/show-current-location-and-nearby-places-and-route-between-two-places-using-googl) – Mohammad Tauqir Dec 30 '15 at 01:42
  • Just remove the IP address from the Server api key and it should work – Daniel Nugent Dec 30 '15 at 01:51
  • This might have worked a year ago, but it doesn't anymore. When you select an IP address restriction it still says (optional), but if you don't specify and IP, the key is saved as an "Unrestricted key." – John Ward Nov 13 '16 at 03:40

0 Answers0