How Do I - Create a Google API Key

Create Google Project

First, be sure that you have created a Google Project. You can follow Google’s instructions here.

Create API Key

The API key is a unique identifier that authenticates requests associated with your project for usage and billing purposes. You must have at least one API key associated with your project.

To create an API key:

  1. Log into your Google account.

  2. Go to the Google Maps Platform > Credentials page.

    Go to the Credentials page

  3. On the Credentials page, click Create credentials > API key.
    The API key created dialog displays your newly created API key.

    Click Close.
    The new API key is listed on the Credentials page under API keys.
    (Remember to restrict the API key before using it in production.)


Restrict API Key

Restricting API keys adds security to your application by ensuring only authorized requests are made with your API key. We strongly recommend that you follow the instructions to set restrictions for your API keys. For more information, see API security best practices.

To restrict an API key:

  1. Log into your Google account.

  2. Go to the Google Maps Platform > Credentials page.

    Go to the Credentials page

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

  4. Under Key restrictions, set the following restrictions:

    • Application restrictions:

      1. Set to None, or choose one of the other options as desired.

    • API restrictions:

      1. Click Restrict key.

        1. Select the following from the Select APIs dropdown:

          1. Places API

          2. Maps Javascript API

        2. If these are not listed, enable them.

  5. To finalize your changes, click Save.

  6. Make a copy of your API key and keep it safe.