What is an API key and how do I get one?
API key is an acronym for application programming interface key, which in Polish means application programming interface key. The development of the acronym does not say much about either the function of this tool or its usefulness. In general, the API key is used by some programs to identify and control the user using a particular interface.The term usually appears in the context of generating it by Google. What exactly is it about?
What is the Google API key used for?
Google API is the name for a group of application programming interfaces created by Google (for example, Google Maps, Translate). Using them, it is possible to connect to and integrate Google services.
The Google API key allows you to authenticate and authorize a user who would like to use Google API services. For site owners who would like to use these services, the key is required as of June 22, 2016.
How to generate an API key?
The process of generating a Google API key is not difficult and you only need to follow the following few steps:
- If you don’t have an account on Google APIs, the first step is to create one on this page: https://cloud.google.com/maps-platform/
- Then, you need to set up a new project for which you want to activate the service.
- Google will ask you to add a billing account – there is no way to skip this option. You need to select the “Create billing account” option.
- The third step is already more complicated. You need to select the tab on the left named “Library” and select the “Google Maps APIs” section. After selecting this option, you will see a list of possible services to include: Google Static Maps API and Google Maps JavaScript API.
- The last step is to generate a key for all the services selected earlier. To do this, select “Credentials” from the menu on the left, and then “Credentials: Create Credentials – API key”. Finally, you need to provide a name for the key.
- After saving the changes, an API key will appear, which should be copied to the clipboard.
After all the above steps, it is a good idea to lock the API key so that it is used only for a specific domain. This will prevent other unauthorized people from using our key, which is important in the context of payments.
Is there a fee to use a Google API key?
Each user gets a kind of credit equivalent to $200. This credit refers to the number of Google Maps displays on the user’s site. If the limit is exceeded, the user assigned to the key will have to pay for each display. The $200 per month limit includes:
- display maps on mobile devices without restrictions;
- display of mobile dynamic maps without restrictions;
- map embedding without restrictions;
- embedding extended maps up to 14,000 uploads;
- Static maps up to 100,000 loadings;
- Dynamic maps up to 28,000 loadings;
- Static street view of up to 28,000 panoramas;
- dynamic street view of up to 14,000 panoramas.
These limits are sufficient for the vast majority of sites. However, if you want to make sure that the $200 limit is not exceeded, then go to the “Payment Settings” tab in your Google Maps Platform account. Select “Budgets and Alerts” and create a budget up to $200. This should fully provide you with free use of the Google API key.