Guide: Google Maps API Key Setup (2025)
Getting a Google Maps API key is the first step for any developer or marketer who wants to embed maps, pull location data, or build location-based features. This guide google maps api key walkthrough covers every step — from creating your Google Cloud account to securing your key and avoiding unexpected charges.
No fluff. Just the exact steps you need.
Why You Need a Google Maps API Key
The API key is your authentication token. Without it, Google won't serve map tiles, geocoding results, or directions data to your app.
Here's what the key actually does:
- Grants access to Google Maps Platform services (Maps JavaScript API, Geocoding API, Places API, etc.)
- Tracks your usage so Google can apply the right billing tier
- Links to your billing account — charges only apply after you exceed the free monthly credit ($200/month as of 2025)
- Lets you restrict access so only your domain or app can use the key
Every project that touches Google Maps needs one. There's no workaround.
Step 1: Create a Google Cloud Platform Account
Go to console.cloud.google.com. Sign in with your Google account — or create one if you don't have one.
If this is your first time, Google will walk you through a short onboarding. You'll need to accept the Terms of Service and set up a billing account (more on that in Step 4).
New accounts get a $300 free credit valid for 90 days. That's separate from the ongoing $200/month Maps credit.
Step 2: Create a New Project
Every API key lives inside a project. Projects keep your keys, billing, and usage data organized.
- Click the project dropdown at the top of the GCP Console (it usually shows "My First Project" or similar)
- Click New Project
- Give it a clear name — something like "Maps Integration" or your company name
- Click Create
The console will switch to your new project automatically. All the next steps happen inside this project.
Step 3: Enable the Google Maps APIs You Need
Not all Maps APIs are enabled by default. You have to turn on each one you plan to use.
- In the left sidebar, go to APIs & Services → Library
- Search for "Maps"
- Click on the API you need — for most web projects, start with Maps JavaScript API
- Click Enable
Repeat for any other APIs your project needs. Common ones include:
| API | Use case |
|---|---|
| Maps JavaScript API | Interactive maps on websites |
| Geocoding API | Convert addresses to coordinates |
| Places API | Search for businesses and POIs |
| Directions API | Route planning |
| Distance Matrix API | Travel time between multiple points |
If you're not sure which ones you need, enable Maps JavaScript API first. You can add more later without creating a new key.
Step 4: Set Up Billing
This step trips up a lot of developers. Google requires a billing account even if you stay within the free tier.
- In the GCP Console, go to Billing in the left sidebar
- Click Link a billing account
- Create a new billing account if you don't have one
- Enter your credit card details
You won't be charged unless your usage exceeds the $200/month free credit. For most small projects, that covers roughly:
- 28,000 map loads per month
- 40,000 geocoding requests per month
Set up a budget alert (Billing → Budgets & Alerts) so you get an email if you're approaching a threshold. This prevents surprise bills.
Step 5: Create Your API Key
Now the actual key creation:
- Go to APIs & Services → Credentials
- Click + Create Credentials at the top
- Select API key
- Google generates your key immediately — it looks like
AIzaSyD... - Copy it and store it somewhere safe (a password manager works well)
That's it. The key is active immediately.
Step 6: Secure Your API Key
An unsecured API key is a liability. If someone finds it in your public GitHub repo or client-side code, they can rack up charges on your account.
Two restrictions to set right away:
Application Restrictions
Limits which apps or websites can use the key.
- HTTP referrers — for websites. Add your domain:
https://yourdomain.com/* - IP addresses — for server-side apps. Add your server's IP.
- Android/iOS apps — for mobile apps. Add your app's package name or bundle ID.
API Restrictions
Limits which Google APIs the key can call.
- In the key's settings, click Restrict key
- Select only the APIs you enabled in Step 3
- Click Save
This way, even if the key leaks, it can only call Maps APIs — not Gmail, Drive, or anything else.
Best Practices for Managing Your API Key
A few habits that save headaches later:
Never hardcode the key in client-side JavaScript. Anyone can view your page source and extract it. Use environment variables on the server side and proxy requests.
Use separate keys for separate environments. One key for development, one for production. That way you can rotate or revoke one without breaking the other.
Monitor usage weekly. Check APIs & Services → Dashboard to see request counts per API. Spikes can indicate abuse or a bug in your code.
Rotate keys periodically. Create a new key, update your app, then delete the old one. Quarterly rotation is a reasonable cadence for most projects.
Set quota limits. In the key's settings, you can cap daily requests per API. This acts as a hard ceiling on costs.
Embedding Google Maps on Your Website
With your key ready, here's the minimal HTML to display a map:
<!DOCTYPE html>
<html>
<head>
<title>My Map</title>
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap" async defer></script>
<script>
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
center: { lat: 40.7128, lng: -74.0060 },
zoom: 12
});
}
</script>
</head>
<body>
<div id="map" style="height: 400px; width: 100%;"></div>
</body>
</html>
Replace YOUR_API_KEY with your actual key. The async defer attributes load the script without blocking page rendering.
For WordPress sites, plugins like WP Google Maps or Elementor's map widget handle the embed — you just paste the key into the plugin settings.
Troubleshooting Common API Key Issues
"This page can't load Google Maps correctly"
Usually means the key is missing, wrong, or the Maps JavaScript API isn't enabled. Double-check both.
Map loads but shows a grey box
The API loaded but initMap() didn't run. Check your browser console for JavaScript errors.
"REQUEST_DENIED" error
Your key has restrictions that block the request. Either the referrer doesn't match, or the API isn't in the allowed list. Temporarily remove restrictions to test, then re-add them.
Billing error / API disabled
If your billing account has an issue (expired card, failed payment), Google disables the APIs. Fix the billing issue in the GCP Console under Billing → Account Management.
Quota exceeded
You've hit your daily or monthly limit. Check APIs & Services → Quotas. You can request a quota increase or upgrade your billing plan.
Google Maps API Pricing (2025)
Google gives you $200/month in free credits. After that, you pay per request:
| API | Price after free tier |
|---|---|
| Maps JavaScript API | $7 per 1,000 loads |
| Geocoding API | $5 per 1,000 requests |
| Places API (basic) | $17 per 1,000 requests |
| Directions API | $5 per 1,000 requests |
For high-volume use cases — like scraping thousands of business listings — the Places API costs add up fast. At $17 per 1,000 requests, pulling 50,000 business records costs $850 in API fees alone, before any development time.
That's where pre-indexed databases become a practical alternative.
Using Google Maps Data for Lead Generation — Without API Limits
The Google Maps API is built for embedding maps and geocoding addresses. It's not designed for bulk business data extraction. The Places API caps results at 60 per search, and scraping at scale violates Google's Terms of Service.
If your goal is to build lead lists from Google Maps — not embed maps on a website — a pre-indexed database is a faster and cheaper path.
IBLead indexes 50M+ businesses across 37 countries, updated weekly. You search by city, postal code, category, Google rating, or review count. Then you export to CSV instantly — no API calls, no waiting, no per-request billing.
The data includes business name, address, phone, email (enriched from the website), Google rating, review count, and 50++ fields per listing. IBLead also detects 160+ technologies on each business's website — useful for targeting businesses running specific CMS platforms or ad tools.
At $52 for 10,000 leads, it's a fraction of what the Places API would cost for the same volume.
Start free — 200 credits, no card required
FAQ: Google Maps API Key
Is the Google Maps API free?
Yes, up to $200/month in usage. After that, you pay per request. Most small websites stay within the free tier. High-volume data extraction is where costs climb quickly.
Can I use one API key for multiple websites?
Technically yes, but it's bad practice. Use separate keys per project so you can track usage and revoke access independently.
What happens if I don't secure my API key?
Anyone who finds it can use it. Your billing account gets charged for their usage. Google has automated detection for some abuse patterns, but it's not foolproof. Always restrict your key.
How long does it take to get a Google Maps API key?
About 10 minutes if you already have a Google account. The main time sink is setting up billing — have your credit card ready.
Is there a Google Maps API alternative for bulk business data?
Yes. If you need business listings at scale rather than map embeds, pre-indexed databases like IBLead are more practical. They don't have per-request pricing or the Places API's 60-result limit per search.
Summary
Getting your guide google maps api key set up takes six steps: create a GCP account, start a project, enable the APIs you need, add billing, generate the key, and restrict it. The whole process takes under 15 minutes.
The key unlocks map embeds, geocoding, and routing for your apps. For most websites, you'll stay within the $200/month free tier without any charges.
If you're using Google Maps for lead generation rather than map embeds, the API's per-request pricing and result limits make bulk extraction expensive and slow. A pre-indexed database gives you the same data — faster, cheaper, and without ToS risk.
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.