How to Create Google Maps API Key
Before you start using the Maps Embed API, You need to create a project and enable a billing account.
Creating a Billing Account
If you have never used google cloud console to create google map API keys for your project then below are some easy steps to create a billing account:
Step 2:Click on menu button to create billing account
Step 3:Choose Billing option to set up your billing account.
Step 4:Set up your Billing account.
- If this is your first billing account.
- Click on Add billing account
- Follow the remaining steps to set up your first billing account.
- If you already have billing account.
- Click on Billing Dropdown and choose Manage billing accounts. What’s more, you will see the list of current billing accounts projects.
- Select Create account.
- Follow the instruction for further process.
Notes:Once you have created billing account and project you are qualified for Google Cloud Platform $300 free trial and Google Maps Platform recurring $200 monthly credit.
Once you are set up, you can start utilizing the Google Maps Platform APIs and SDKs. Learn how to create google map API key for your project.
How to create API keys?
Step 2:On Project selector page, click on Select a project dropdown and select or create your Google Cloud project for which you want to generate an API Key.
Step 3:Click the menu button and select APIs & Services > Credentials.
Step 4:On the Credentials page, click Create credentials > API key.
The API key created dialog displays your newly created API key.
Step 5:Click Close.
The newly created API key is listed on the Credentials page under API keys.
How to set an application restriction for API keys?
Step 1:Once you are logged into the Google Cloud Platform, visit project selector page, click on Select a project dropdown and select or create your Google Cloud project for which you want to generate an API Key.
Step 2:On the Credentials page, click the name of the API key that you want to secure.
Step 3:On the Restrict and rename API key page, set the restrictions:
- Under Key restrictions, select Application restrictions.
- Select any one restriction type.
Step 4:Click Save.
Below are short description about all restriction list.
|HTTP referrers||Accept requests from the list of websites that you supply.
Below the types, specify one or more referrer web sites. Wildcard characters are acceptable for naming similar web sites. For example,
Adding a /* after the domain URL like example.com/* will make the request possible from any page within your website.
|IP addresses||Accept requests from the list of web server IP addresses that you supply.
Below the types, specify one IPv4 or IPv6 address or a subnet using CIDR notation (e.g. 192.168.0.0/22). If you need to enter another entry, a new box appears after you complete adding the previous entry.
|Android apps||Add your package name and SHA-1 signing-certificate fingerprint to restrict usage to your Android app.
Below the types, add the SHA-1 signing-certificate fingerprints and your Android package name from your AndroidManifest.xml file.
|iOS apps||Accept requests from the iOS app with the bundle identifier that you supply.
Below the types, select the appropriate iOS bundle identifier from the list.
How to set an API restriction for API keys?
Step 2:Select API key on which you want to set restriction
Step 3:: Under API Restriction, Select Restrict key.
Step 4:Click Select APIs Dropdown and choose APIs or SDKs which you want to restrict. You can select multiple APIs
Step 5:Click Save.
In the event that your map is showing but browser console(press F12 and open console tab) shows the “Geocoding Service” API error it means the Geocoding API is not enable. You will need to enable the Geocoding API under APIs in the Google Cloud Platform Console to resolve this error. To do so please refer How to enable map APIs?
How to enable map APIs?
Step 2:From the projects list, select a project or create a new one.
Step 3:Go to the API & Services > Dashboard and click on Enable API and Services at the top of the page.
These are the list of APIs.
Step 4:Click on API which you want to enable for your project. If you need help finding the API, use the search field.
Step 5:Click ENABLE.
Note:Before creating API key, you must need to enable those APIs which all will be used into your project.
Use of Google Map APIs
Map SDK for Android
you can include maps based Google Maps information to your Android application.
Map SDK for IOS
you can add maps based on Google maps data to your IOS application.
you can customize maps with your own content and symbolism for display on web pages and mobile devices.
Get detailed information about 100 million places.
Snap GPS focuses to streets to distinguish the streets a vehicle was going along, compensating for GPS mistake.
Directions between multiple locations.
Distance Matrix API
Travel time and distance for multiple destinations.
Convert addresses into geographic directions (geocoding), which you can use to put markers or position the guide. This API likewise permits you to change over geographic directions into a location (invert geocoding).
Maps Elevation API
Query all locations on the surface of earth, including depth locations on the ocean floor (which return negative qualities), for rise information with the Maps Elevation API. Sampled requests are available for elevation data along ways, permitting elevation change count along routes
Maps Embed API
Make places easily discoverable with interactive Google Maps.
Maps Static API
Straightforward, embeddable guide picture with insignificant code.
Playable Locations API
Candidate areas for real-world games built with Maps.
Semantic Tile API
Google Maps geospatial information for Maps SDK for Unity
Street View Publish API
Distributes 360 photographs to Google Maps, alongside position, direction, and availability metadata. Applications can offer an interface for situating, associating, and transferring client produced Street View pictures.
Street View Static API
Time Zone API
Time region information for anywhere in the world.