Features Pricing Docs Contact Dashboard

πŸ—ΊοΈ Static Maps API

Generate a map image from a single URL. Embed it in emails, reports, social cards, or any server-rendered page β€” no JavaScript needed.

PNG & JPEG Markers Polylines GeoJSON overlay Auto bbox fit 6 Map styles

✨ Live Demo

πŸ—ΊοΈ Enter your API key and click Generate
β€”

πŸ”— Endpoint

GET https://api.latlng.work/v1/static

Returns a image/png or image/jpeg response directly. Suitable for use in <img src="..."> tags.

Parameters

ParamTypeDefaultDescription
key *stringβ€”API key via query param or X-Api-Key header
centerstringβ€”lng,lat β€” required unless using bbox
zoomnumberβ€”Zoom level 0–20 β€” required unless using bbox
bboxstringβ€”minLng,minLat,maxLng,maxLat β€” auto-fits zoom to bounds
widthinteger800Image width in pixels (max 2048)
heightinteger600Image height in pixels (max 2048)
stylestringdarklight Β· dark Β· grayscale Β· black Β· white Β· contrast
formatstringpngpng or jpeg
markersstringβ€”Pipe-separated: lng,lat,color,label|lng,lat,color,label
pathstringβ€”Polyline: weight:color:opacity|lng,lat|lng,lat|… (repeatable)
geojsonstringβ€”URL-encoded GeoJSON to overlay

πŸ’» Code Examples

# Simple city center
https://api.latlng.work/v1/static?center=-74.006,40.7128&zoom=12&width=800&height=400&style=dark&key=YOUR_KEY

# Auto-fit to New York City bounding box
https://api.latlng.work/v1/static?bbox=-74.25,40.49,-73.7,40.92&width=1200&height=600&style=light&key=YOUR_KEY

# With a marker
https://api.latlng.work/v1/static?center=-74.006,40.7128&zoom=14&markers=-74.006,40.7128,22c55e,A&key=YOUR_KEY
const params = new URLSearchParams({
  center: '-74.006,40.7128',
  zoom: '12',
  width: '800',
  height: '400',
  style: 'dark',
  key: 'YOUR_KEY'
});

// Use in an img element
const img = document.getElementById('my-map');
img.src = `https://api.latlng.work/v1/static?${params}`;

// Or fetch as a blob
const response = await fetch(`https://api.latlng.work/v1/static?${params}`);
const blob = await response.blob();
const url = URL.createObjectURL(blob);
import requests

params = {
    'center': '-74.006,40.7128',
    'zoom': 12,
    'width': 800,
    'height': 400,
    'style': 'dark',
    'key': 'YOUR_KEY'
}

response = requests.get('https://api.latlng.work/v1/static', params=params)
with open('map.png', 'wb') as f:
    f.write(response.content)

# With a marker
params['markers'] = '-74.006,40.7128,22c55e,NYC'
response = requests.get('https://api.latlng.work/v1/static', params=params)
<!-- Simple embed -->
<img
  src="https://api.latlng.work/v1/static?center=-74.006,40.7128&zoom=12&width=800&height=400&key=YOUR_KEY"
  alt="Map of New York City"
  width="800" height="400"
>

<!-- With marker (anchor on a specific location) -->
<img
  src="https://api.latlng.work/v1/static?center=-74.006,40.7128&zoom=14&markers=-74.006,40.7128,22c55e,A&key=YOUR_KEY"
  alt="Location map"
>

πŸ“Œ Common Use Cases

πŸ“§
Email templates

Embed a map showing an event location or delivery address directly in transactional emails.

πŸ–ΌοΈ
Social sharing cards

Generate og:image previews with a map background for listings, events, or real estate.

πŸ“„
PDF / reports

Include maps in server-rendered PDFs without a headless browser or Puppeteer.

⚑
Static sites

Show a location map without loading an interactive map library. Faster, no JS needed.

Get your free API key from the dashboard. Free plan includes 100 static map requests/day. Upgrade for 10,000/month on Pro.
πŸ“‹ Attribution required: Map data is Β© OpenStreetMap contributors (ODbL). When embedding static map images in a public-facing application, you must display this attribution visibly near the map image β€” in a caption, footer, or overlay text.