Google Map Api Key Error

Created At: 2022-03-24 23:55:24 Updated At: 2022-03-25 00:06:33

Here we will see some errors and how to solve for Google Map Api Key errors

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

For this error try the below solutions

 a. Try to unrestrict the Api. Just choose none

B. Try a different solution with restrict IP

So the right thing to do is to create another API KEY, and choose the correct restrictions for this matter. In your case, choose "IP addresses" (under "Application restrictions"), and use "ADD AN ITEM" to add your server ip. Notice that leaving a blank list won't work, and will result in google changing your restrictions to "None".

Also, don't forget to add the relevant APIs under "API restrictions" (in your case "Geocoding API").

One last thing - Google is blocking the use of this API until you link your app to Google Cloud Billing Account. So if you didn't do it yet, once you successfully get a response, it will say you have to do it first (it has a free starting package).

Steps to restrict IP

  1. Go to the Google API Console.
  2. Select the project that was created for you when you signed up.
  3. From the list of API keys, select the key you're using.
  4. In the Restrictions section, select IP addresses (web servers, cron jobs, etc.).
  5. Under Accept requests from these server IP addresses, enter the IP addresses from which your key is to be accepted, one per line. You may also enter a subnet using CIDR notation (e.g. 192.168.0.0/22).

Comment

Add Reviews