Through their Google Maps Platform, Google have created an exciting opportunity for businesses to use a range of categorised and accessible Application Programming Interfaces, (or APIs), to create a diversity of innovative business solutions, apps and experiences, using the vast amount of data available through Google Maps.
In order to create our first project, we must begin by creating an API Key using the Google Cloud Platform Console. This key will act as a unique code that the API will use to identify as the calling application or user. Each time you use a Google Maps Platform product, you must include an API Key to validate your request, so let’s begin by generating your first API Key.
Select the Maps, Routes and Places checkboxes and press continue. These are the three categories of API the platform has to offer
If this is your first time generating an API key you will need to name your project first. Enter your chosen project name and click the next button in the bottom-right corner of the window.
When the billing prompt appears, select Create Billing Account.
Select your country and click on the Continue button.
Add an address for your billing account along with your organisation name, then scroll down for the payment methods and enter your preferred method.
Now that your billing is set up, look to the API Manager menu in the sidebar and click on the Credentials option.
When the Credentials window appears, click on the Create Credentials button.
In the next pop-up window, click on API Key and you will see that your individual API key has been generated.
To ensure your API Key is not misused by other parties, eating into your quota, you must restrict its access. At the bottom-right of the API Key created window, click on the Restrict Key button.
Start by selecting the option HTTP referrers (web sites) and then, in the box under Accept requests from these HTTP referrers (web sites), replace “yourdomain.com” with your own domain name, listing both “ *.domain.com/* ” and “ *domain.com/* ” separated by a comma, noting that this exact format must be followed or the Google Maps API will not accept what you have entered into the field. Click the Save button to save your Key Restrictions.
It is time to enable the API functions that you require for your project. Go to the API Manager sidebar menu and click on Library. Select the Google Maps JavaScript API panel.
Some APIs are automatically enabled, while others need to be manually enabled. If the JavaScript API is not enabled, click Enable on the Google Maps JavaScript API window. If necessary, any API that you access in the future can be enabled in the same way.