New pricing changes went into effect on July 16, 2018. For more information, check out the Guide for Existing Users.

Get API Key

To use the Maps JavaScript API, you must get an API key which you can then add to your mobile app, website, or web server. The API key is used to track API requests associated with your project for usage and billing. To learn more about API keys, see the API Key Best Practices and the FAQs.

Console

You can use the Google Cloud Platform Console to manage projects, get API keys, and add API key restrictions. For more information about the console, see the Google Cloud Platform Console Help.

Quick guide

Step 1: Get an API key

Click the button below, to get an API key using the Google Cloud Platform Console. You will be asked to (1) pick one or more products, (2) select or create a project, and (3) set up a billing account. Once your API key is created you will be prompted to restrict the key's usage. (For more information, see Restricting an API key.)

Get Started

Step 2: Add the API key to your request

When loading the Maps Embed API, substitute YOUR_API_KEY in the code below with the API key you got from the previous step.

https://www.google.com/maps/embed/v1/MODE?key=YOUR_API_KEY&parameters

For more information about MODE and parameters options in the code above, see Forming the URL for the Maps Embed API.

Detailed guide

Follow these steps to get an API key and add restrictions:

  1. Go to the Google Cloud Platform Console.
  2. From the Project drop-down menu, select or create the project for which you want to add an API key.
  3. From the Navigation menu, select APIs & Services > Credentials.
  4. On the Credentials page, click Create credentials > API key.
    The API key created dialog displays your newly created API key.
  5. On the dialog, click Restrict Key.
    (For more information, see Restricting an API key.)
  6. On the API key page, under Key restrictions, set the Application restrictions.
    • Select HTTP referrers (web sites).
    • Add the referrers (follow the instructions).
    • Click Save.

Restricting an API key

Google Maps APIs are available for web browsers, Android or iOS apps, and via HTTP web services. APIs in any platform can use an 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.

To add restrictions for an API key, do the following:

  1. Go to the Google Cloud Platform Console.
  2. From the Project drop-down menu, select the project that contains the API key you want to secure.
  3. From the Navigation menu, select APIs & Services > Credentials.
  4. On the Credentials page, click the name of the API key that you want to secure.
  5. On the API key page, under Key restrictions, set the Application restrictions.
    • Select HTTP referrers (web sites).
    • Add the referrers (follow the instructions).
    • Click Save.

Send feedback about...

Maps Embed API
Need help? Visit our support page.