Stay organized with collections Save and categorize content based on your preferences.
Google Maps Platform products are secured from unauthorized use by restricting API calls to those that provide proper authentication credentials. These credentials are in the form of an API key - a unique alphanumeric string that associates your Google billing account with your project, and with the specific API or SDK.
This guide shows how to create, restrict, and use your API key for Google Maps Platform.
Before you beginBefore you start using the Geocoding API, you need a project with a billing account and the Geocoding API enabled. To learn more, see Set up in Cloud console.
Creating API keysThe 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:
ConsoleGo to the Google Maps Platform > Credentials page.
gcloud services api-keys create \ --project "PROJECT" \ --display-name "DISPLAY_NAME"
Read more about the Google Cloud SDK , Cloud SDK installation , and the following commands:
Restricting API keysGoogle strongly recommends that you restrict your API keys by limiting their usage to those only APIs needed for your application. Restricting API keys adds security to your application by protecting it from unwarranted requests. You are financially responsible for charges caused by abuse of unrestricted API keys. For more information, see API security best practices.
When restricting an API key in the Cloud console, Application restrictions override any APIs enabled under API restrictions. Follow best practices by creating a separate API key for each app, and for each platform on which that app is available.To restrict an API key:
ConsoleGo to the Google Maps Platform > Credentials page.
List existing keys.
gcloud services api-keys list --project="PROJECT"
Clear existing restrictions on existing key.
gcloud services api-keys update "projects/PROJECT/keys/KEY_ID" \ --clear-restrictions
Set new restrictions on existing key.
gcloud services api-keys update projects/PROJECT/locations/global/keys/KEY_ID \ --api-target=service=geocoding-backend.googleapis.com --allowed-ips="IP_ADDRESS"
Read more about the Google Cloud SDK , Cloud SDK installation , and the following commands:
Adding the API key to your requestYou must include an API key with every Geocoding API request. In the following example, replace YOUR_API_KEY
with your API key.
https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=YOUR_API_KEY
HTTPS is required for requests that use an API key.
Note: When using Web Services, all special characters inside the parameters must be URL encoded. URLs must be properly encoded to be valid and are limited to 2048 characters for all web services. Be aware of this limit when constructing your URLs. Different browsers, proxies, and servers may have different URL character limits as well.Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-02 UTC."],[[["Google Maps Platform uses API keys for authentication and billing purposes, requiring at least one key per project."],["API keys can be created and managed through the Google Cloud Console or the Cloud SDK."],["Restricting API keys to specific applications and IPs enhances security by limiting unauthorized usage."],["All Geocoding API requests must include the API key as a parameter and use HTTPS."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4