Sign up to Our

NEWSLETTER


 
To answer your question faster, you can search our knowledgebase articles before submitting a ticket.
Knowledgebase
How to get a Google Map API key?
Posted by on 29 July 2020 03:10 PM

Since June 2016, Using Google Maps (on public websites) requires an API key. Here we explain how to get one and set it in the right place at the WPL.

** NOTE: When you get your Google Maps API key, you can set your daily quota for queries in the Google API console. Google Maps web APIs  25,000 free requests per day, which means the service stays free during the day until you reach this number. Here is Google map platforms pricing table




>> Getting Started 

Navigate to the Google Maps Platform and click on the Get Started button in the top right corner of the site.

. Enable Google Maps Platform

Select the Maps, Routes and Places check boxes and press continue.

 

Google APi

. Select a Project

If this is your first time creating an API key, you will have to create a Project first.

 googl2

  • Give your Project a name. 
  • Click the next button at the bottom-right of the window.

. Set up your billing

Wait for the billing prompt and select Create Billing Account

google3

Select Submit and enable billing.

Once your billing has been set up, you can move creating your API Key.

How to Create API Credentials

Click on the Credentials option on the API Manager menu in the right sidebar.

Google8

Click on the Create Credentials button on the Credentials window:


Google9

Generate your API Keys:
* Note: In using WPL Plugin you need to get two API Keys: 
1- Server Side:
There isn't any setting for this API key. You need to generate an API key and put in Server side placeholder in WPL side  here: WPL > Settings > Global >  Google API key (Server Side): 



2-  Client side:
The client side API needs to get restricted for 2 options:
    . Maps JavaScript API
    .Geocoding API


> Click on
API Key on the next pop-up window.

Google10

  • Copy the generated API key to your clipboard.
  • Return to your WPL > Settings > Global >  and paste the API Key into the box labeled “Google API key (Client Side)” 




How to restrict the Client side API key: 

After pasting the API Key your WordPress site and saving the settings, return to the Google API Manager. You will want to restrict access to your API Key to avoid having it “hijacked” and going over your quota. Click the Restrict key button on the API key created window as shown above.


google12

Select HTTP referrers (web sites) and enter the following domains under Accept requests from these HTTP referrers (web sites) replacing yourdomain.com with your domain name. The domain name has to be exactly with the same format that you can see in the snapshot below:
     
Domain name



In the API restrictions, please specify API restrictions:

API

Click the Save button to save your Key Restrictions.



*Note: In any case If you can't find Map Javascript and Geocoding in the drop down list enable them through the API Library. 

Click the Library link in the API Manager sidebar menu. Click on the Google Maps JavaScript API panel and Geocoding

Google14



The JavaScript API will probably already be enabled as shown in the screenshot below. If the JavaScript API is not enabled, then click Enable on the Google Maps Javascript API window.

google15

Please watch this video to find  How to get Google API



 


Comments (2)
Andrei Ploshkin
16 August 2016 12:49 PM
What for I have to set Google API key? The settings is empty now and Google Map seems to be working.
Melanie M.
20 November 2016 04:29 AM
From June 22nd, 2016 Google won't provide service for keyless requests, so you should set a Google API key into WPL- > Settings -> Global -> Google API key.
Please check following article for further information:
http://googlegeodevelopers.blogspot.co.uk/2016/06/building-for-scale-updates-to-google.html