Skip to content

How to get Google Maps API key?

  • by
  • 3 min read

If you’re developing an app that uses Google Maps, you’re going to need an API key to make queries to the Maps API. The API key is a unique identifier used to authenticate requests associated with your project for usage and billing purposes. Without this key, you can’t integrate the API into a project. 

In this article, we’re going over how you can get the Google Maps API key.

Keep in mind that before you begin using the Maps Static API, you’re going to need a project with a billing account and the Maps Static API enabled. 

Also read: How to find coordinates in Google Maps?


Getting a Google Maps API key

Step 1: Head over to your Google Cloud Console and log in with your Google account. Once logged in, select a project to start.

How to get Google Maps API key? | Candid.Technology

Step 2: If you haven’t already, select the API that best matches your need and enable it for use in your project.

How to get Google Maps API key? | Candid.Technology

We’re going ahead with the Maps JavaScript API, which is used to make maps for websites. You can choose whichever API works best for you. You can enable multiple APIs as well. 

Step 3: Click the Enable button to enable the API. 

How to get Google Maps API key? | Candid.Technology

Step 4: Now click on the hamburger menu icon in the top left, hover over APIs and Services and click on Credentials. 

How to get Google Maps API key? | Candid.Technology

Step 5: Click on the Create Credentials button up top followed by API Key

How to get Google Maps API key? | Candid.Technology

Step 6: Google will generate and show you the API key. You can click Close to close the key window or click on Restric Key to protect yourself from unauthorised use in a production environment. 

How to get Google Maps API key? | Candid.Technology

Restricting your key can not only protect you against unauthorised usage but also from quota theft. You can set either application restrictions — which control which websites, IPs or applications can use your key or an API restriction, which restricts the key to specific APIs. 

How to get Google Maps API key? | Candid.Technology

It’s highly recommended that you restrict your keys as standard practice. Another thing to keep in mind is that you only get one application restriction per key, so use it wisely.

Depending on your usage, a digital signature might also be needed. This signature allows Google servers to verify that any site requesting a query using your key is authorised to do so. It’s recommended that you use both digital signing and API key restrictions regardless of usage.

Also read: How to create a custom map with Pins in Google Maps?

nv-author-image

Yadullah Abidi

Yadullah is a Computer Science graduate who writes/edits/shoots/codes all things cybersecurity, gaming, and tech hardware. When he's not, he streams himself racing virtual cars. He's been writing and reporting on tech and cybersecurity with websites like Candid.Technology and MakeUseOf since 2018. You can contact him here: yadullahabidi@pm.me.

>