Googlemaps API Key for Localhost

free google map api key for testing
google maps javascript api error: apinotactivatedmaperror
google browser key
google api
google maps client id
google api sign up
how to add google map api key in html
google now requires an api key

How do I get googlemaps api key to work on localhost?

I've created an API key and under referers I add the following:

Accept requests from these HTTP referrers (websites) (Optional)

Use asterisks for wildcards. If you leave this blank, requests will be 
accepted from any referrer. Be sure to add referrers before using this key 
in production. 

localhost

This doesnt work and if I exclude the api key it doesnt work either?

1- first go to this address: https://console.developers.google.com/apis

2- create a api key for your project,

3- click on Library and

4- click on any api that you want,

5- click on Enable (top right),

6- click on Credentials, click edit key

7- in "Key restriction" select "HTTP referrers (web sites)"

8- then type your website address or "localhost"(for test in localhost) in textbox field and enter for add to list, (add "localhost", "127.0.0.1", "localhost:port" and etc)

9- then use key in your project..

Get an API Key | Geocoding API, New Users: Before you can start using the Google Maps Platform APIs and SDKs, you must sign up and create a billing account. To learn more, see Get Started  To get an API key: Go to the Google Cloud Platform Console. Click the project drop-down and select or create the project for which you want to add an API key. Click the menu button and select APIs & Services > Credentials. On the Credentials page, click Create credentials > API key. The API key created dialog displays your newly created API key.

You can follow this way. It works at least for me :

in Credential page :

  1. Select option with IP address ( option no. 3 ).

  2. Put your IP address from your provider. If you don't it, search your IP address by using this link : https://www.google.com/search?q=my+ip

  3. Save it.

  4. Change your google map link as follow between the scrip tag :

    https://maps.googleapis.com/maps/api/js?libraries=places&key=AIzxxxxxxxx"

  5. Wait for about 5 minutes or more to let your API key to propagate.

Now your google map should works.

Web development tutorial, If using a local testing server, you will need to use an API key specific to your testing server. If the address for your testing server is localhost, you can use the  To get an API key: Visit the Google Cloud Platform Console. Click the project drop-down and select or create the project for which you want to add an API key. Click the menu button and select APIs & Services > Credentials. On the Credentials page, click Create credentials > API key. The API key created dialog displays your newly created API key.

If you are working on localhost, create a separate APIkey for your development and then remove restrictions on that key so that your localhost can use it. Remember to not use this key on production, so you don't expose your key to hunters online.

I had the same issue and all attempts to get the restrictions working on my localhost environment was not successful until I created a separate apikey specifically for development and then removed its restrictions. However I don't use that key on production environment, and once am done with developments, I will delete the API key immediately.

I Know this post is late, but for people that will likely face this issue in the future, this is the best route to go.

quick tip: you can get google map api key for localhost, in the form after "My web site URL:". The API key they give you works for your localhost. For some reason I did not expect this would work. Google does not require a Google Maps API key for localhost. However, the Google Maps location module may be written to require this on all occasions in order to function. However, the Google Maps location module may be written to require this on all occasions in order to function.

Google Api key for localhost testing, I have setup an api key for using amongst others the Google Maps Api, and have setup referrers, including one for localhost on a specific port. From the dialog displaying the API key, select Restrict key to set a browser restriction on the API key. 6. In the Key restriction section, select HTTP referrers (web sites) , then type your website address or "localhost"(for test in localhost) in textbox field and enter for add to list, (add "localhost", "127.0.0.1", "localhost:port" and etc).

You have to check the specific error within the javascript console (e.g. Ctrl + Shift + K in Firefox for Windows).

According to Steven Gliebe (2016), there are four common cases for this problem. If I may summarize it, as this:

  1. MissingKeyMapError >> Get Google Maps API Key (but also consider alternative no.2)
  2. RefererNotAllowedMapError >> Register your localhost:port in your google developer dashboard.
  3. ApiNotActivatedMapError >> Enabling the Google Maps API in Google API Library page
  4. InvalidKeyMapError >> Add your key to your scripts/ codes properly

After doing some code modification, please clear your browser cache as necessary.

In case there are other errors, you can check Google Maps API Error Codes Documentation page.

How To Use Google Maps API Keys For Free, The use of a Google API Key can be restricted to a configurable set of Most keys will be usable from the origin localhost and/or 127.0.0.1 to  Forum General Google API on Localhost, what url to use on the API key. Google API on Localhost, what url to use on the API key Posted 5 years ago by johan.

Google Maps free for testing on localhost (as of February 2016 , , Google Maps free for testing on localhost (as of February 2016 , Add your Google Maps API key to googleConfig.xml (as desribed in the  “ Google Maps Platform was almost a foregone conclusion due to its familiarity, reliability, accuracy, flexibility, ongoing innovation, and relationships with other data providers. It met all our requirements and provided virtually limitless integration capabilities.

Google API on Localhost, what url to use on the API key, Heya! I am implementing google api, and I have a API key. I have also put this key into the config files. However the key requires authorized  Find local businesses, view maps and get driving directions in Google Maps.

How do I create a localhost WebServer to loads the Google Maps , Based on the server, key will be mapped. Like that you need to do. To load the Google Maps JavaScript API, use a script tag like the one in the  quick tip: you can get google map api key for localhost Posted by dado on June 14, 2006 at 10:25am You need not have a live web server to develop/test google mapping with the gmap module or whichever.

Comments
  • Possible duplicate of How to set Google API key restriction - HTTP referrers
  • This is what I did as well, but I wonder: does this mean that ANYONE working locally (localhost / 127.0.0.1) might use my API KEY (and possibly infer costs for me after the new pricing on 2018-06-11 takes place?)
  • @tmanolatos Yes, that is what it means. It is not good practice to give your production key localhost rights, since anyone can use your key while running locally. Instead you should maintain two keys. One for production which can be seen by anyone and hence should only be allowed on your domain. One for development which should be treated as credentials (do not share it) and allows access from localhost.
  • @tmanolatos Yes, but you must build two key, one to test app, and one for the main app,
  • I am getting this response after following the above steps: { "error_message" : "API keys with referer restrictions cannot be used with this API.", "results" : [], "status" : "REQUEST_DENIED" } Here is the URL, where DEV_KEY is substituted with my api key: maps.googleapis.com/maps/api/geocode/…
  • It returns correct JSON when I use my PROD_KEY api key.
  • broken link is broken
  • @Dementic console.developers.google.com/flows/…
  • @AEGrey - not for me, for future users.