How to get Google API Key for Google Maps widget

Starting using our Google Maps widget you might have stumbled over the request to add your Google API Key. In this article we're going to tell you how to create (which will take you only a couple of minutes!) and finally start using our Google Maps widget. 

In this article:

  1. Creating API key
  2. Restricting API key
  3. Enabling required APIs

Creating API key

1. First go to Google Maps Platform and click on Get Started:

2. Fill in your personal information and create a billing account, providing your credit/debit card information.

Please keep in mind that Google won't charge you after creating a billing account: after accepting the terms you automatically start a 12-month trial with $300 positive balance as a free credit per year. Inserting your credit card information is Google's requirement: you won't be able to use your API key unless you do it. 

If you are already using Google Cloud Platform, you'll need to add you billing information on this page:

3. Create a new project or choose an existing one:

If you're creating a new project, insert its name, select the organization and its location:

4. Go to APIs and Services -> Credentials. That's the page where all your API keys will be stored:

5. Choose Create Credentials -> API Key

You'll see this window as soon your API key is created:


That's it, your API key is ready to use! Now you'll be able to access it in  API & Services -> Credentials:

Restricting your API key

6. Restrict your API key. You can either limit the websites (HTTP referrers), web servers (IP addresses) or mobile apps which can use it. You might want to make your API key accessible for your own domain and Elfsight apps only. In this case add two items -   *.elfsight.com/* and your domain name:

Please keep in mind that you need to change the way a referrer's inserted depending on the URLs which will use the key. Please pay attention to the instruction on the left of the page:

You can do the same thing with IP addresses, mobile apps and even specify the APIs your API key can call.

Enabling required APIs

7. To use our Google Maps widget you'll need to enable three APIs: Maps JavaScript API, Geocoding API, Directions API. To do it go to Dashboard-> Enable APIs and Services -> Maps:

Enable Maps JavaScript, Geocoding and Directions APIs:

You're all set! Now you can copy and paste your API key and enjoy using our Google Maps widget!

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us