google-places-api

Google Places API Error1


I am getting following error message:

This IP, site or mobile application is not authorized to use this API key. Request received from IP address 203.196.191.151, with empty referer", html_attributions: [ ], results: [ ], status: "REQUEST_DENIED"


Solution

  • This is as stated in the documentation for Javascript (ie browser based) API keys:

    Restrict your API keys to be used by only the IP addresses, referrer URLs, and mobile apps that need them: By restricting the IP addresses, referrer URLs, and mobile apps that can use each key, you can reduce the impact of a compromised API key.

    The key you are using has such a restriction on it. Set the required IP or referrer in the cloud console.

    You can specify the hosts and apps that can use each key from the console by opening the Credentials page and then either creating a new API key with the settings you want, or editing the settings of an API key.