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.
- Start here for a Map API key:
You get taken to the screen pictured below. Click the blue ‘GET STARTED’ button.
- 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:
- Give your new API key a memorable name, so you can easily find it in future and won’t accidentally delete it:
- 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:
- Click ‘AGREE AND CONTINUE’ to proceed:
- We’re okay with this confirmation, so click ‘NEXT’ to continue:
- Everything is ready. Copy the API key shown (the string of letters and numbers). Click ‘DONE’ when ready:
- 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.