Skip to content Skip to sidebar Skip to footer

Google Map API Key Error "Your Site URL To Be Authorized"

I have searched many links and read documents related to google api key, but every time I am getting the only error of Your site URL to be authorized I am creating a PhoneGap hybri

Solution 1:

I Dont know if this will help anyone but I spent a good hour trying to figure out this problem and ended up realizing I had the wrong API enabled. You need Google Maps JavaScript API enabled.Also sometimes you need to specify https.


Solution 2:

1.Leave it blank 2.You need to enable the google maps api for your project.


Solution 3:

  1. You need to enable the google maps api for your project.

  2. if your API key have no limitation and it still not work - trying to add signed_in=true to url. It helps for me.


Solution 4:

This error means that the current URL loading the Maps JavaScript API has not been added to the list of allowed referrers. Please check the referrer settings of your API key in the Cloud Console. (source: https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error)

Go to the Google Cloud credentials page to add your website url: https://console.cloud.google.com/projectselector2/google/maps-apis/credentials

  1. Select the API key that you want to set a restriction on. The API key property page appears.

  2. Under Key restrictions, set the following restrictions:

    • Application restrictions:
      1. To accept requests from the list of website that you supply, select HTTP referrers (web sites) from the list of Application restrictions.
      2. Specify one or more referrer web sites. For example, *.google.com accepts all sites ending in google.com, such as https://developers.google.com. Note: file:// referers need a special representation to be added to the key restriction. The file:// part should be replaced with __file_url__ before being added to the key restriction. For example, file:///path/to/ should be formatted as __file_url__//path/to/*. After enabling file:// referers, it is recommended you regularly check your usage, to make sure it matches your expectations.
  3. Save your changes

  4. You must include an API key with every Maps JavaScript API request. In the following example, replace YOUR_API_KEY with your API key.

    <script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"></script>

(source: https://developers.google.com/maps/documentation/javascript/get-api-key#restrict_key)


Post a Comment for "Google Map API Key Error "Your Site URL To Be Authorized""