If your website uses Google Maps, then you've probably seen something along the lines of "Enter your Google Maps API key" during setup. You probably thought, "what is an API key and why do I need one?" Don't worry, we'll walk you through the steps required to get Google Maps up and running on your site.
What's an API Key and Why Do I Need One?
That's a great question! API stands for Application Programming Interface, and basically it's a way for your website to get data from a server – in this case, the Google Maps server. An API key is a way for Google to ensure that only authorized websites are using their services, and to bill the users if the service isn't free.
So in other words, your Google Maps API key is just a way to let Google know who is using their service and who to bill if necessary.
OK, so let's get that API key so you can get up and running with Google Maps!
Sign into your Google account and go to your Google Cloud Platform Console. If you don't have a Google account you can create one for free. Once you've signed in to the Google Cloud Platform Console, you can choose a project. If you don't already have a project (most small businesses won't), you'll need to create one.
Enter your project name. It doesn't have to be anything fancy, it just needs to make sense to you. You can enter a location if you want to, but it's not required. Click "Create."
Choose your new project from the list.
Next, you'll need to link a billing account to your project. You may need to add your billing information if you haven't already. Google provides $200 of free usage per month, which means that you get about 28,000 map loads per month for free. Later on we'll discuss ways to limit the number of map loads to ensure that you don't get billed for usage. It's important to note that the $200 applies to all Google Cloud Platform services, so if you're using multiple services the $200 tier applies to all of them.
If you do have a high-traffic website you may have to pay for your Google Maps usage. We've included pricing as of February 2020 below – refer to the Google pricing page for the current rates. And of course, you can contact us if you need help.
Next you'll need to enable your Google Maps API.
Once you've enabled your Google Maps API it's a good idea to set a quota. This way, you can ensure that you're usage will remain below the billing limit. We recommend setting your daily quota to 1,000 but you can go a little lower if you want to be absolutely sure that you won't be billed.
We'll point out here that your website visitors will receive an error message if you exceed your quota. So if Google Maps are a critical piece of your website or application it's probably better to set a realistic quota and pay for the required usage. Losing potential customers is probably more costly than the $0.007 you'll spend to display the map.
Finally, let's set some restrictions on your Google Maps API key. This step is optional, but it's a really good idea because even if someone should get hold of your API key they won't be able to use it on their website.