Guide to Getting Your Google Maps API Key Easily
Getting your Google Maps API key easily is possible — as long as you follow the right steps in the correct order. This guide covers everything: creating a Google Cloud Platform account, activating the API, generating the key, and securing access. Whether you are a beginner or an experienced developer, you will have your operational key in less than 20 minutes.
What is a Google Maps API key?
An API key is a unique string generated by Google. It identifies your application to Google's servers and allows access to Maps services.
In practical terms, it's an "application password." Without it, Google rejects requests. With it, you can display maps, calculate routes, geolocate addresses, and much more.
It also serves Google to measure your consumption and bill you if you exceed the free quotas. That's why securing it properly is just as important as creating it.
Why use the Google Maps API?
Google Maps is the global reference for everything related to mapping and location data. Its API is used by millions of applications.
The use cases are numerous:
- Display an interactive map on a website or mobile app
- Calculate routes between two points (car, bike, walking)
- Geocode addresses (convert an address to GPS coordinates)
- Integrate Street View into an interface
- Access local business data via Places API
Each use corresponds to a different API. Google Maps Platform includes about twenty distinct services, all accessible via an API key.
Step 1: Create a Google Cloud Platform account
Everything starts on Google Cloud Platform (GCP). It is the central console that manages all Google services for developers.
You need an active Gmail account. If you don't have one, create one first at gmail.com.
Then, go to cloud.google.com and click on "Get started for free". Google offers €300 in free credits for 90 days for new accounts. A credit card is required for registration, but you won't be charged until you exceed the free quotas.
Fill out the registration form: country, account type (individual or business), payment information. Once validated, you will access the GCP dashboard.
Step 2: Create a dedicated GCP project
In GCP, everything is organized by projects. A project groups the activated APIs, generated keys, quotas, and associated billing.
It is highly recommended to create a dedicated project for each application or use case. This makes it easier to manage costs and access.
Here’s how to do it:
- At the top of the interface, click on the project selector (folder icon next to the Google Cloud logo)
- In the window that opens, click on "New project"
- Give your project a clear name — for example, "Maps-MySite" or "Geocoding-App"
- Leave the default organization if you don't have one
- Click on "Create"
Creation takes a few seconds. A notification appears at the top right when it's ready. Then select this project as the active project via the selector.
Step 3: Activate the desired Google Maps API
Google Maps Platform includes several distinct APIs. You should only activate those you need — each activated API consumes quotas separately.
Access the API library
In the left sidebar menu, click on "APIs & Services" then "Library". A search engine displays all available APIs.
Main Google Maps APIs
| API | Main Use |
|---|---|
| Maps JavaScript API | Interactive maps on the web |
| Maps SDK for Android | Maps in Android apps |
| Maps SDK for iOS | Maps in iOS apps |
| Geocoding API | Address ↔ GPS coordinates conversion |
| Places API | Search and local business data |
| Directions API | Route calculation |
| Geolocation API | Location by network (without GPS) |
| Street View Static API | Street View images in apps |
| Distance Matrix API | Distances and travel times in bulk |
For a classic website with a map, activate Maps JavaScript API. To access local business data, activate Places API.
Activate an API
- Search for the API in the library
- Click on its name to access its detail page
- Click on the "Enable" button
The activation is immediate. Repeat the operation for each necessary API.
Step 4: Generate the Google Maps API key
This is the central step. Once the API is activated, you can create the key that will allow your application to use it.
Access the Credentials section
In the "APIs & Services" menu, click on "Credentials". This page lists all the API keys and other identifiers for your project.
Create the key
- Click on "+ Create credentials" at the top of the page
- Select "API key" from the dropdown menu
- Google automatically generates a key — it looks like this:
AIzaSyD-9tSrke72PouQMnMX-a7eZSW0jkFMBWY - Copy this key immediately and store it in a secure place (password manager, environment variable, etc.)
- Click on "Close"
Important: never share this key publicly. Do not commit it to a public Git repository. Do not display it in an accessible URL.
Step 5: Integrate the key into your application
The way to use the key depends on the language and context of your project.
In JavaScript (website)
To load the Maps JavaScript API in an HTML page, add this script in your <head> or before the closing <body>:
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap" async defer></script>
Replace YOUR_API_KEY with your actual key. The function initMap is called once the API is loaded — this is where you initialize your map.
In Python (server requests)
To use the Geocoding or Places API from a Python script:
import requests
api_key = "YOUR_API_KEY"
address = "10 Rue de la Paix, Paris"
url = f"https://maps.googleapis.com/maps/api/geocode/json?address={address}&key={api_key}"
response = requests.get(url)
data = response.json()
print(data['results'][0]['geometry']['location'])
This code returns the GPS coordinates of the provided address.
Best practice: environment variables
Never hard-code your key in the code. Use an environment variable:
import os
api_key = os.environ.get("GOOGLE_MAPS_API_KEY")
Or a .env file with the python-dotenv library. This prevents accidental leaks during a push to GitHub.
Step 6: Restrict and secure your API key
An unrestricted key can be used by anyone if discovered. Google can then charge you for calls you did not make. Restriction is therefore non-negotiable.
Access restriction settings
In "APIs & Services" > "Credentials", click on the pencil icon next to your key. You will access the detailed configuration page.
Available types of restrictions
Application restrictions — limit the sources allowed to use the key:
- HTTP referrers: for keys used on websites. You list the allowed domains, e.g.,
mysite.com/*or*.mysite.com/*. Any request from another domain is rejected. - IP addresses: for keys used server-side. You list the allowed IPs.
- Android applications: restriction by SHA-1 fingerprint of the certificate and package name.
- iOS applications: restriction by Bundle ID.
API restrictions — limit the APIs that this key can call:
- Select "Restrict key" and check only the APIs you actually use.
- A key dedicated to Maps JavaScript API should not be able to call Places API if you don't need it.
Best practice: one key per use
Create separate keys for each context: one for the web front-end, one for the server back-end, one for the mobile app. If a key is compromised, you revoke it without impacting the others.
Understanding Google Maps Platform billing
Google Maps Platform is not free beyond a certain volume. Each API has its own pricing.
Google offers $200 in free credits per month to all accounts. For most small projects, this is enough to stay within the free limits.
Beyond that, prices vary by API:
- Maps JavaScript API: ~ $7 for 1,000 map loads
- Geocoding API: ~ $5 for 1,000 requests
- Places API (Nearby Search): ~ $32 for 1,000 requests
Set up budget alerts in GCP ("Billing" menu) to be notified if your consumption exceeds a defined threshold. You can also cap expenses to avoid unpleasant surprises.
Alternatives to the Google Maps API for business prospecting
The Google Maps API is ideal for displaying maps and geocoding addresses in an application. But if your goal is to extract local business data for business prospecting, the approach is different.
The Google Places API provides access to local business data — but it is costly at scale, limited to 20 results per request, and does not provide emails or website technologies.
To generate prospect lists from Google Maps, IBLead is a direct alternative. The database covers over 50M businesses in 37 countries, with 50+ data fields per listing: name, address, phone, email, Google rating, number of reviews, website technologies, and more.
No real-time scraping, no waiting. Everything is already indexed and updated weekly. You filter by city, category, rating, technologies — and export to CSV in 2 minutes. At €44 for 10,000 contacts, it's €0.004 per lead.
FAQ — Google Maps API Key
Is the Google Maps API key free?
Yes, within the limits of the $200 monthly credit offered by Google. For most small projects, this credit covers all consumption. Beyond that, Google charges based on the calls made.
How long does it take to get a Google Maps API key?
About 10 to 20 minutes if you start from scratch (including GCP account creation). If you already have a GCP account and a configured project, generating the key takes less than 2 minutes.
Can multiple API keys be used in the same project?
Yes. It is even recommended to create one key per use (front-end, back-end, mobile) to facilitate management of restrictions and revocation in case of issues.
What to do if my API key is compromised?
Go immediately to "APIs & Services" > "Credentials", click on your key and select "Regenerate key". The old key is instantly invalidated. Update your key in all your applications.
What is the difference between the Google Maps API and the Places API?
Maps JavaScript API is used to display interactive maps in a browser. Places API is used to search for places, obtain their details (address, hours, reviews, photos), and perform address autocompletion. Both can be used together in the same project.
Ready to generate prospects from Google Maps?
If you are looking to extract local business data for your prospecting — without coding, without managing an API, without waiting — IBLead gives you access to over 50M pre-indexed listings in 37 countries.
Try it with 200 credits.
Ready to get started?
Access every Google Maps business, enriched with emails and legal data.
Try IBLead freeRelated articles
10 Proven Tips to Get Customers to Leave More Google Reviews on Maps
Learn 10 actionable strategies to increase Google Maps reviews. Timing, incentives, QR codes, and response tactics that actually work.
7 Cold Email Mistakes to Avoid: Examples & Templates
Avoid these 7 cold email mistakes to avoid examples that kill response rates. Real examples, AIDA templates, and proven fixes for better outreach.
ABM Google Maps Data: The Complete Strategic Guide
Learn how abc account based marketing google maps data drives 208% more revenue. Build precise target lists with 50M+ pre-indexed businesses.