Skip to content
API Reference

Static Maps API Reference

Try the API in your browser

Base URL

https://staticmap.maptoolkit.net

Endpoints

GET /

Render a static map image

Renders a static map image from query parameters. At minimum size and either center+zoom or bounds/bbox (or at least one overlay feature) must be provided.

ParameterInTypeRequiredDescription
api_keyquerystringYesAPI key for authentication.
sizequerystringYesOutput image dimensions as {width}x{height}. Maximum 4096x4096 pixels.
centerquerystringNoMap center as {lat},{lng}.
zoomquerynumberNoZoom level (0–20).
boundsquerystringNoBounding box as {minlat},{minlng},{maxlat},{maxlng}.
bboxquerystringNoBounding box as {minlng},{minlat},{maxlng},{maxlat} (GeoJSON order).
stylequerystringNoStyle ID or inline Mapbox GL style JSON. Defaults to maptoolkit-maptoolkit.summer.
maptypequerystringNoDeprecated. Use style instead.
formatquerystringNoOutput image format. Default: png. One of: png, jpeg, webp.
ratioqueryintegerNoPixel density multiplier (1 = standard, 2 = retina, 4 = ultra-high-DPI). Default: 1. One of: 1, 2, 4.
factorqueryintegerNoDeprecated. Use ratio instead. One of: 1, 2, 4.
creditsquerystringNoAttribution overlay name. Default: osm.
attributionquerystringNoSet to false to suppress the attribution overlay. One of: false.
exptimequeryintegerNoCache TTL in seconds. -1 bypasses the cache. Default: 7200.
delta_zoomqueryintegerNoInteger offset added to the resolved zoom level.
statesquerystringNoState filter forwarded to the style URL template.
markerqueryNoMarker overlay. Pipe-delimited: center:{lat},{lng}|icon:{url}|anchor:{center|bottom}. Repeat for multiple markers.
pathqueryNoPolyline overlay. Pipe-delimited: points:{lng1},{lat1}|{lng2},{lat2}|...|width:{px}|color:{RRGGBBAA}. Repeat for multiple paths.
geojsonqueryNoGeoJSON geometry overlay. Pipe-delimited: geometry:{GeoJSON}|width:{px}|color:{RRGGBBAA}. Repeat for multiple overlays.
kmlqueryNoURL of a KML file to overlay. Repeat for multiple files.
path_iconsquerystringNoDirectional icons along paths. true for defaults, or icon:{name}|size:{scale}|spacing:{px}.
marker_z_orderquerystringNoZ-order strategy for marker rendering. Default: auto. One of: source, auto.
debugquerybooleanNoEnables server-side timing logs.
StatusDescription
200Successfully rendered map image.
400

Bad request. Possible error messages:

Parameter validation errors:

  • invalid size — Missing or invalid size parameter (must match \d+x\d+)
  • invalid centercenter does not match format lat,lng
  • invalid boundsbounds does not match format lat1,lng1,lat2,lng2
  • invalid bboxbbox does not match format lng1,lat1,lng2,lat2
  • invalid zoomzoom is not a valid number or is outside range 0–20 (after delta_zoom)
  • invalid ratioratio/factor is not 1, 2, or 4
  • invalid exptimeexptime is not a valid integer
  • invalid creditscredits does not match \w+ or the file does not exist
  • invalid style — Style string does not match [\w\-]+ (when not a JSON object)

Coordinate validation errors:

  • invalid longitude — Longitude is outside range −180 to 180
  • invalid latitude — Latitude is outside range −85 to 85

Feature validation errors:

  • invalid marker: {marker} — Marker does not contain a valid center:{lat},{lng}
  • invalid path: {path} — Path does not contain a valid points: section
  • invalid geojson: {geojson} — GeoJSON geometry cannot be parsed as JSON

External resource errors:

  • Error parsing KML {url}: {message} — KML document cannot be parsed or converted
  • Error fetching KML {url}: {message} — HTTP request for KML URL failed
  • Cannot load style: {message} — Style URL could not be loaded (falls back to cached style if available)

Timeout errors:

  • redering aborted — Request timeout (60 seconds) or client abort

POST /

Render a static map image (POST)

Same rendering logic as GET / but accepts parameters in the request body. Useful when query strings would exceed URL length limits (e.g. large GeoJSON payloads). The api_key must still be passed as a query parameter.

ParameterInTypeRequiredDescription
api_keyquerystringYesAPI key for authentication.
StatusDescription
200Successfully rendered map image.
400

Bad request. Possible error messages:

Parameter validation errors:

  • invalid size — Missing or invalid size parameter (must match \d+x\d+)
  • invalid centercenter does not match format lat,lng
  • invalid boundsbounds does not match format lat1,lng1,lat2,lng2
  • invalid bboxbbox does not match format lng1,lat1,lng2,lat2
  • invalid zoomzoom is not a valid number or is outside range 0–20 (after delta_zoom)
  • invalid ratioratio/factor is not 1, 2, or 4
  • invalid exptimeexptime is not a valid integer
  • invalid creditscredits does not match \w+ or the file does not exist
  • invalid style — Style string does not match [\w\-]+ (when not a JSON object)

Coordinate validation errors:

  • invalid longitude — Longitude is outside range −180 to 180
  • invalid latitude — Latitude is outside range −85 to 85

Feature validation errors:

  • invalid marker: {marker} — Marker does not contain a valid center:{lat},{lng}
  • invalid path: {path} — Path does not contain a valid points: section
  • invalid geojson: {geojson} — GeoJSON geometry cannot be parsed as JSON

External resource errors:

  • Error parsing KML {url}: {message} — KML document cannot be parsed or converted
  • Error fetching KML {url}: {message} — HTTP request for KML URL failed
  • Cannot load style: {message} — Style URL could not be loaded (falls back to cached style if available)

Timeout errors:

  • redering aborted — Request timeout (60 seconds) or client abort

Try it

The console below sends live requests against the endpoints above. You can browse it without an API key; Execute needs one, because every endpoint requires the api_key query parameter and returns 403 without it. Use Authorize to add your key. See First Steps if you do not have one yet.