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 Places 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

Your key must be passed with each request as the value of a key parameter. Requests made without a key will fail.

https://maps.googleapis.com/maps/api/place/nearbysearch/json
  ?location=-33.8670522,151.1957362
  &radius=500
  &types=food
  &name=harbour
  &key=YOUR_API_KEY

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 IP addresses (web servers, cron jobs, etc.).
    • Add the server IP addresses (see the examples).
    • Click Save.

Do not use this key outside of your server code. For example, do not embed it in a web page or in a mobile application.

Detailed guide for Premium Plan customers

When using the Places API with a Google Maps APIs Premium Plan license, you must authenticate your application with an API key.

By using an API key to authenticate your applications, you can:

Get more information on reports available to Premium Plan customers.

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 the project created for you when you purchased the Premium Plan. The project name starts with Google Maps APIs for Business or Google Maps for Work or Google Maps.
  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 IP addresses (web servers, cron jobs, etc.).
    • Add the server IP addresses (see the examples).
    • Click Save.

Restricting an API key

Google Maps Platform APIs are available for Android or iOS apps, Web browsers, and via HTTP web services. APIs in any platform can use an unrestricted API key. You can optionally add a restriction (for example, IP address) to the API key. Once restricted, a key will only work on platforms that support that type of restriction.

To add restrictions to 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 IP addresses (web servers, cron jobs, etc.).
    • Add the server IP addresses (see the examples).
      You may also enter a subnet using CIDR notation (e.g. 192.168.0.0/22).
    • Click Save.

Send feedback about...