What is a Google Maps API key?
Google Maps, so they can benefit from you using their service, give you a number of free ‘API calls’. Google’s “free credit” covers approx 27k API calls which, although sounds generous, most users will use 3-5 API calls performing an address lookup.
For example, when someone types in an address into a search bar, they are generally using 3-5 API calls each search to do this as each digit/letter can be a ‘call’.
In order for you to use this service from Google, they need you to set up an ‘API key’. That key, unlocks the ability for users to complete ‘API Calls.’ If you do not have a key, Google does not allow you to use their service, as they wouldn’t be able to track the number of calls your clients are completing on your website, and thus wouldn’t be able to bill you if you went over the free number of calls.
What can you do to limit the number of API calls from the website?
We recommend setting up a budget in Google Cloud Console which will allow you to limit any additional spend to $x amount. We normally suggest a limit of $50 or $100 and we monitor this.
You need to setup an account with Google Cloud Console to access Google Maps features. Once you have completed the steps below you will be able to generate an API key which is added to the backend of your website under Site Settings -> Advanced.
- Read Google’s API documentation and click the “Get Started” button when you are ready to proceed.
- You will be guided through the process of creating a “project” within Google Cloud Console.
- Once you have created a project, go to APIs and Services where you need to enable the following APIs and Services:
Maps JavaScript API
Places API
Geocoding API and
Maps Embed API - Under Credentials you can restrict your API Key to use for your domain only. We strongly recommend this to prevent someone else from being able to use your key on their website. Select the API key you would like to restrict.
- Under “Key restrictions” select the option for “HTTP referrers (websites)” which will display a section called “Website restrictions” where you will enter your domain. Please enter both the www and non-www URLs, see example below:
https://www.example.com
https://example.com
Under “API restrictions” you can leave this set to “Don’t restrict key” unless we advise you otherwise. Save your changes. - After you have restricted your API key, please login to the backend of your Launchpad Website, go to Site Settings and under the Advanced tab there is an option to enter a Google Maps API key. Copy and paste your key into the field provided and click Update to save your changes.
Please ensure that you setup Billing for your project. For more information on Google Maps API Billing & Pricing, please click here.