Generating a Google Maps API key in 2019


#1

What is an API?

An API key is the name given to some form of secret token which is submitted alongside web service (or similar) requests in order to identify the origin of the request. The key may be included in some digest of the request content to further verify the origin and to prevent tampering with the values.
Source: https://stackoverflow.com/questions/1453073/what-is-an-api-key, 8th January 2019

Google Maps is one such service that requires an API key. You will need an API key to use stacks like Locator. Some other stacks (like certain YouTube embed stacks) also need an API key. It has been hinted that Google may start requiring API keys in future, for other services. Because API keys afford more traceability and an ability to control misuse.

The API website often updates and changes. But the basic language and methodology for getting an API key remains much the same, as it always has.

There is now increased emphasis made on the requirement to provide payment details, during the API creation. This is a mandatory requirement. But you would need to have an extremely popular website (receiving thousands or millions of visits a month) before you come anywhere near the billable threshold. Most RapidWeaver users, myself included, fall comfortably within the free ‘credit’ allocation.

This guide is written for people using stacks like Locator, needing to create a new API key for the first time.

Use a newer web browser, like Safari, Firefox or Chrome. Don’t bother with trying to do it on your phone or tablet. It would be wise to enable popups and disable your adblocker, to make the process go smoother. Log-into your Google account, before starting.

The red circles in the following screenshots show the actions you need to complete, in this exact order. Click the screenshot images to see them bigger.

  1. Start here for a Map API key:
    https://developers.google.com/maps/documentation/javascript/get-api-key#key
    You get taken to the screen pictured below. Click the blue ‘GET STARTED’ button.

  1. It is safer and easier to just enable all 3 of these checkboxes. A stack like Locator needs maps, directions and geolocation, which coincidently, requires all three checkboxes to be enabled for normal stack usage:

  1. Give your new API key a memorable name, so you can easily find it in future and won’t accidentally delete it:

  1. You will need to setup a billing account. But if you have made any purchase from Google within the past few years (including from the ‘Play’ store) they will likely have your credit card details stored already. Just because they are Google:

  1. Click ‘AGREE AND CONTINUE’ to proceed:

  1. We’re okay with this confirmation, so click ‘NEXT’ to continue:

  1. Everything is ready. Copy the API key shown (the string of letters and numbers). Click ‘DONE’ when ready:

  1. Enter the API key into the stack settings:

Allow a few minutes for things to settle into place. At busy times, a new API key might be a few minutes in the making.

Now your stack (in this is example, the Locator stack) should be working correctly. We can see the map displayed on the screen, to confirm this. There are no errors shown on the screen or browser console about our API key not working. Yay!

Sometimes Google might ask you for a bit more information or additional confirmations. This would be especially true if you are new to creating APIs. Google might ask you for your contact details, and email address and the name / location of your website.

Stacks that use other mapping services may not require an API key. But obviously these may not offer the same degree of functionality that a stack like Locator offers. Additionally some APIs (like the Apple Maps API) are only available to developers paying very expensive (1k +) yearly fees and the mapping coverage is typically not as extensive or accurate in some regions of the world.

As is already stated on the product page for stacks like Locator, if you need help with generating an API key, this is a service you need to pay and hire a developer to oversee. We simply cannot factor-in the extensive time needed, versus the tiny price you initially pay for these stacks. But almost everyone buying stacks like Locator never encounters any problems with creating the API key. Which is why we continue to make and sell stacks like this one.

The instructions presented above show it is a relatively painless process, if you follow each step carefully and provide the details Google asks for. And because Google is essentially the provider of the service, you can always ask them if you want to cheap-out on hiring an expert to oversee things for you.

Something else I would add is that if you are ever using stacks that you know to make-use of APIs, be sure to be on the mailing list to receive news about important updates or changes. As this recent thread on the main RapidWeaver forums illustrates, a widely publicised change to the Yahoo API (we all got sent the email in September) broke dozens of RSS stacks, excluding mine. Who is to blame is open for debate and is best reserved for another discussion. But certainly one thing you can take-away here is the notion that if these customers had prior warning the Yahoo RSS API was ending on 1st January, they could have made preparations in good time, to avoid their websites breaking. An important lesson to learn.

Ultimately an API is a method of borrowing data or services from another provider. That parent company is totally within their right to change or discontinue things. Some APIs are quite volatile and change frequently. APIs like Facebook and Twitter are bloody awful to work with! Others like Google, PayPal and Amazon S3 are much more developer-friendly. If you keep a close eye on things, you can avoid potential problems.


#2

Another great contribution, thank you.


#3

Good one @willwood - Google / FB etc change their UIs very frequently so it’s confusing for users to sign up for simple API keys and harder to keep up with screens for docs. Nice work.


#4

@willwood Another much needed and excellent guide.

This place is fast becoming the best source of well written clear RW information.


#5

@willwood This is awesome, thanks! Now we just need a guide like this for all the “social feed stacks” out there, and how to generate the proper Facebook keys…


#6

Very nicely written, Will. I have two different google accounts for Maps APIs (different billing accounts for them)- it drives me mad trying to navigate around their website.


#7

Agreed - but it’s difficult as it’s changing about every 3 months…
There are generic videos though as it’s a common turn key solution:
e.g.


#8

I abandoned the traditional Google Map display that has been very popular over the last 5 years or so, when creating maps for customers. Customers need to create and own the API key and talking them through the API creation process is just too much for most. The inevitable will also happen when the customer makes contact because the map doesn’t work, can’t remember the key, forgets the API email or password, etc…

Instead, I switched to a very simple solution, which is to just add a button called MAP or GOOGLE MAP which links to the correct location opening a new browser tab or window. This method has many advantages: always works, doesn’t need an API key but importantly, it allows visitors to gain access to directions from the new Google Map tab. This can be a big benefit for restaurants, shops, etc., because potential visitors can get turn by turn navigation on their bluetooth car connected mobile (which a great many people have these days). The other big benefit is that this method is dependant on a normal URL to work and if it doesn’t work it can be blamed on Google.

Alternatively, using Tav’s Limelight Google Map child, gives you an API free traditional web page map view at a fixed zoom level. Works great.


#9

@Webdeersign Given the choice, I would not use Google APIs. But the Locator stack (which this topic largely refers to) was a stack that several people wanted to see created and provided funding for in 2016.

A lot of what the Locator stack does simply is not feasible by having a Google Map load in a new tab. This stack has a lot of advanced functionality which the standard Google Maps can’t handle.

This topic is not so much about alternatives to the Google Maps API or my Locator stack, but more-so how to generate an API key if you are in a position of needing one. There are people out there who don’t mind going through the process of creating an API key, but need a helping hand in doing so.


#10

Good points and I wasn’t aware it was aimed at Locator.

I just though it was mentioning that there are alternatives if you don’t want to use or are not up to generating an API key, and don’t need the features of Locator which go beyond the standard Google Map web page.