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

Get API Key

The Places API uses an API key to identify your application. Including a key in your request allows you to monitor your application's API usage in the Google Cloud Platform Console, enables access to generous free daily quota, and ensures that Google can contact you about your application if necessary. For more information, see Google Cloud Platform Console Help.

  • Standard API customers need an API key set up in a project of your choice.
  • Places API customers with a Premium Plan license need an API key set up in the Google Maps Premium Project (the project created for you when you ordered the Google Maps APIs Premium Plan). If you have not yet purchased access to the API, please contact sales.

Get an API key

If you are using the standard Places API

To get started using the Places API, click the button below, which guides you through the process of activating the Places API and getting an API key.

Get a Key

Alternatively, follow these steps to get an API key:

  1. Go to the Google Cloud Platform Console.
  2. Create or select a project.
  3. Click Continue to enable the API.
  4. On the Credentials page, get an API key (and set the API key restrictions).
    Note: If you have an existing unrestricted API key, or a key with server restrictions, you may use that key.
  5. To prevent quota theft and secure your API key, see Using API Keys.
  6. (Optional) Enable billing. See Usage Limits and Billing for more information.

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.

If you have purchased the Google Maps APIs Premium Plan

To get started using the Places API with the Google Maps APIs Premium Plan, click the button below which which guides you through the process of getting an API key. Note: To access all your Premium Plan benefits, including usage limits, in the project drop-down menu, be sure to select the project created for you when you purchased the Google Maps APIs Premium Plan.*

Get a Key

Alternatively, follow these steps to get an API key for use with the Premium Plan:

  1. Go to the Google Cloud Platform Console.
  2. From the Project drop-down menu, select the Google Maps Premium project.*
  3. Click Continue.
  4. On the Credentials page, get an API key (and set the API key restrictions).
    Note: If you have an existing unrestricted API key, or a key with server restrictions, you may use that key.
  5. To prevent quota theft and secure your API key, see Using API Keys.

You can also look up an existing key in the Google Cloud Platform Console.

For more information on using the Google Cloud Platform Console, see Google Cloud Platform Console Help.

Types of API key restrictions

Google Maps Platform APIs are available for Android or iOS apps, Web browsers, and via HTTP web services. APIs in any platform can use a generic (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. Learn more about keys and credentials.

Specify a key in your request

Your key must be passed with each request as the value of a key parameter.

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

Requests made without a key will fail.

Limit IP addresses

To prevent other applications from using your key and consuming your quota, you can limit the IP addresses that can use your API key to send requests:

  1. Go to the Google Cloud Platform Console.
  2. Select the project that was created for you when you signed up.
  3. From the list of API keys, select the key you're using.
  4. In the Restrictions section, select IP addresses (web servers, cron jobs, etc.).
  5. Under Accept requests from these server IP addresses, enter the IP addresses from which your key is to be accepted, one per line. You may also enter a subnet using CIDR notation (e.g. 192.168.0.0/22).

These steps apply whether you are using the Standard Plan or the Premium Plan. For more information, see Pricing and Plans.

发送以下问题的反馈:

此网页
Places API