How to Generate Google Maps Screenshots
Capture a Google Maps view once or generate repeatable map images with the Static API, complete with code, attribution and troubleshooting.
Short answer: For a one-off image, open Google Maps and use your device’s built-in screenshot control. For repeatable, parameterized images, call the Google Maps Static API with an API key from a billing-enabled Google Cloud project. Keep Google attribution visible and check the current terms for your publication context.
1. Choose the right workflow
| Need | Best fit | Why |
|---|---|---|
| One map view once | Device screenshot | Fastest and requires no API setup. |
| Many locations, fixed dimensions, markers or paths | Maps Static API | Every input is in a URL, so jobs can be repeated from code. |
| Screenshot of a live interactive Maps page | Browser capture | Preserves the rendered page, controls and current state. |
2. Take a one-off Google Maps screenshot
- Open Google Maps and search for the place, address or coordinates.
- Set the zoom, map type and visible panels. Close anything that should not appear.
- Leave Google Maps attribution visible.
- Use your computer or phone’s screenshot control, then crop only if attribution remains intact.
- Before publishing, review the Google Geo Guidelines and terms that apply to your use.
Google’s Geo Guidelines explicitly list capturing a screenshot from Google Maps as an option when other export choices do not fit. That does not provide universal approval for every commercial, print or redistribution scenario.
3. Generate a repeatable image with Maps Static API
3.1 Create credentials
- Create or select a Google Cloud project.
- Enable the Maps Static API.
- Create an API key, restrict it to the services you use, and enable billing.
- Set quotas and budget alerts. Pricing, quotas and terms can change; use the current usage and billing documentation.
The API returns a GIF, PNG or JPEG from an HTTP request. Keep the key out of browser code and public repositories.
3.2 Request parameters
| Parameter | Use | Example |
|---|---|---|
center |
Address or latitude,longitude | 40.7484,-73.9857 |
zoom |
Detail level | 14 |
size |
Width × height | 640x400 |
scale |
Higher-density output where supported | 2 |
maptype |
roadmap, satellite, terrain or hybrid |
roadmap |
markers |
Pins | color:red|40.7484,-73.9857 |
path |
Lines or routes | color:0x0000ff|weight:4|... |
format |
Image encoding | png |
3.3 cURL
curl -G "https://maps.googleapis.com/maps/api/staticmap" \
--data-urlencode "center=40.7484,-73.9857" \
--data "zoom=14" \
--data "size=640x400" \
--data "scale=2" \
--data "maptype=roadmap" \
--data-urlencode "markers=color:red|40.7484,-73.9857" \
--data "format=png" \
--data "key=YOUR_API_KEY" \
-o map.png
3.4 Python
import os
import requests
params = {
'center': '40.7484,-73.9857',
'zoom': 14,
'size': '640x400',
'scale': 2,
'maptype': 'roadmap',
'markers': 'color:red|40.7484,-73.9857',
'format': 'png',
'key': os.environ['GOOGLE_MAPS_API_KEY'],
}
r = requests.get('https://maps.googleapis.com/maps/api/staticmap', params=params, timeout=30)
r.raise_for_status()
with open('map.png', 'wb') as f:
f.write(r.content)
3.5 Node.js
const fs = require('node:fs/promises');
const p = new URLSearchParams({
center: '40.7484,-73.9857',
zoom: '14',
size: '640x400',
scale: '2',
maptype: 'roadmap',
markers: 'color:red|40.7484,-73.9857',
format: 'png',
key: process.env.GOOGLE_MAPS_API_KEY
});
const res = await fetch(`https://maps.googleapis.com/maps/api/staticmap?${p}`);
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
await fs.writeFile('map.png', Buffer.from(await res.arrayBuffer()));
4. Add locations, routes and styling
Markers
Use descriptors such as color:red|label:A|40.7484,-73.9857. Repeat markers for groups that need different colors or labels. URL-encode values containing reserved characters.
Paths
A path descriptor accepts color, weight and coordinates. For long routes, use Google’s encoded-polyline form rather than creating an oversized query string.
Map type
Use roadmap for streets, satellite for imagery, terrain for relief, or hybrid for imagery with labels.
5. Attribution, embedding and sharing
- Keep Google attribution visible.
- For web pages, Google says the image should be served directly from the Static API rather than copied to your server and served locally.
- The Static API FAQ says an image used outside browser-based applications must link to Google Maps.
- Geo Guidelines discuss a limited set of static images with attribution for non-commercial uses such as news, blogs, educational, recreational or instructional work.
- Recheck current terms before launching a paid or high-volume workflow.
6. Browser capture when you need the rendered map
The Static API creates an image from parameters; it does not reproduce an arbitrary interactive Maps page. For the visible page itself, use browser automation to open the URL, wait for map tiles, hide unwanted panels and capture the viewport or full page. Browser capture can be affected by consent dialogs, sign-in state, timing and bot checks. Keep attribution visible and comply with Google’s terms.
7. Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. It accepts a URL and returns PNG, JPEG, WebP or PDF. See the ScreenshotNeo docs for options.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://www.google.com/maps/@40.7484,-73.9857,14z -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://www.google.com/maps/@40.7484,-73.9857,14z"}, timeout=90)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://www.google.com/maps/@40.7484,-73.9857,14z' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
Cookie banners, newsletter popups and chat widgets are removed before the shot. Bot checks, blank pages and failed loads are never billed; response headers identify the page verdict and billing status. An MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.
8. Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| HTTP 400 or error image | Missing key, malformed coordinate, unsupported size or unencoded separators. | Check every parameter and URL-encode values. |
| Request denied | API disabled, billing disabled, key restriction mismatch or quota exceeded. | Check the Google Cloud project, API, billing account, restrictions and quota. |
| Wrong location | Ambiguous address or unexpected zoom. | Use latitude,longitude and set zoom explicitly. |
| Markers or paths missing | Descriptor syntax or URL length. | Test one marker, encode pipes, then add points incrementally. |
| Blurry image | Small dimensions or density mismatch. | Request larger dimensions and use scale=2 where appropriate. |
| Browser screenshot is blank | Consent, timing, blocked resources or bot checks. | Wait for tiles, handle consent where permitted and inspect network logs. |
| Attribution missing | Cropping removed required notices. | Restore attribution and recheck current terms. |
9. Performance, reliability and cost
- Performance: avoid regenerating unchanged requests and request only the dimensions you need.
- Reliability: use bounded timeouts, retry transient failures with backoff, validate content type and store request parameters beside each image.
- Cost: Static API calls require billing-enabled projects and follow current pricing and quotas. Set budgets before batch generation.
- Security: keep keys server-side, restrict them, rotate exposed keys and never commit them to source control.
10. FAQ
Can I use a Google Maps screenshot instead of the API?
For a one-off image, Google’s Geo Guidelines identify a screenshot as an option. Publishing still depends on current terms, attribution and your use case.
Is the Static API a screenshot of the live Maps website?
No. It renders a static image from request parameters. Use browser capture for the live page’s exact controls or state.
Do I need billing for Maps Static API?
Yes. The documented setup requires an API key and billing-enabled Google Cloud project.
Can I remove Google attribution?
Do not remove required attribution. Follow current Google documentation for your display context.
What should I automate first?
Start with deterministic center, zoom, size and format. Add markers and paths one at a time before batching.


