Creating a New Google API Key
- Log into you Google account.
- In your App list go to the Google Cloud Platform Console.
- Next is to click on the drop-down menu at the top to create a new project
- In the pop-up tab click on New Project
- Name your project and select the location folder (Remember to keep naming conventions direct)
- Select your newly created project in the top bar where you created your new project
- In the left hand pane go to APIs & Services and select Credentials
- Click on the Create Credentials drop-down and select API key
- A new API key will now be generated.
*N.B – Remember to Enable Your API Maps under the APIs & Services > Library
Adding the Google API Key
You should insert an API key with a Javascript API request. Below is and example of inserting your newly generated API key into a script tag.
/* Replace YOUR-API-KEY with your generated API key as seen below*/
<script src="http://maps.google.com/maps/api/js?key=YOUR-API-KEY&callback=initMap" type="text/javascript"></script>
It is strongly recommended to restrict your API key from unauthorized users for security purposes.