To use the Maps Embed API, you must register your app project on the Google Cloud Platform Console and get a Google API key which you can add to your app or website.
Quick guide to getting a key
Step 1: Get an API Key from the Google Cloud Platform Console
Click the button below, which guides you through the process of registering a project in the Google Cloud Platform Console, and generates an API key.Get Started
- Tip: During development and testing, you can register a project in the Google Cloud Platform Console and use a generic, unrestricted API key. Before moving your app or website into production, you should secure your API key by adding browser restrictions to the key. Read more about restricting an API key.
- For more information, see the detailed guide to getting an API key.
Step 2: Add the API key to your application
When loading the Maps Embed API, substitute
YOUR_API_KEY in the code below with the
API key you got from the previous step.
For more information on
parameters options for the code above,
read the guide to forming the URL for
the Maps Embed API.
More about API keys
- The API key allows you to monitor your application's API usage in the Google Cloud Platform Console. See Google Cloud Platform Console help for more information.
- Registering for an API key ensures that Google can contact you about your application if necessary.
Detailed guide to getting an API key
Follow these steps to get an API key:
- Go to the Google Cloud Platform Console.
- Create or select a project.
- Click Continue to enable the API.
On the Credentials page, get an API key.
Note: If you have an existing unrestricted API key, or a key with browser restrictions, you may use that key.
- From the dialog displaying the API key, select Restrict key to set a browser restriction on the API key.
- In the Key restriction section, select HTTP referrers (web sites), then follow the on-screen instructions to set referrers, then click Save. Read more about restricting API keys.
For more information on using the Google Cloud Platform Console, see API Console Help.
Restricting an API key
Google Maps Platform APIs are available for web browsers, Android or iOS apps, and via HTTP web services. APIs in any platform can use a generic (unrestricted) API key. You can optionally add a restriction (for example, HTTP referrer) to the API key. Once restricted, a key will only work on platforms that support that type of restriction.
Tip: Before moving your app or website to production, you should secure your API key. Keys for the Maps Embed API use the HTTP referrers (web sites) key restriction. Learn more about keys and credentials.
To add web browser restrictions to an existing, generic API key, do the following:
- Go to the Credentials page of the Google Cloud Platform Console.
- Select the project that contains the API key you want to edit.
- On the Credentials page, from the list of API keys, select the name of the API key to edit the details of the key.
- In the Key restriction section of the page, select HTTP referrers (web sites), follow the on-screen instructions to set referrers, then click Save.