Mapbox Maps Static Images Get Static Map

1 credits/call
ae_mapbox_maps_static_images_get_static_map

Generate a static map image from a custom style, with support for markers, paths, and GeoJSON overlays.

MapsImage
1 credits/call

Pricing

1 credits/call
ConditionCharge
Each call1 credits/call

Parameters

Optional parameters use the platform defaults when omitted.

ParameterTypeRequiredDescriptionDefault
logobooleanNoControls whether there is a Mapbox logo on the image. Defaults to true.—
overlaystringYesOne or more comma-separated features that can be applied on top of the map at request time. Format can be a mix of geojson, marker, or path.—
paddingstringNoDenotes the minimum padding per side of the image. Can only be used with auto or bbox. Accepts 1-4 integers without units.—
addlayerobjectNoAdds a Mapbox style layer to the map's style at render time. Can be combined with before_layer.—
layer_idstringConditionalDenotes the layer in the style that the filter specified in setfilter is applied to.—
locationstringYesMap position: a literal coordinate string lon,lat,zoom[,bearing[,pitch]], a bracketed bounding box [minLon,minLat,maxLon,maxLat], or auto. Examples: -122.4241,37.78,15.25 or [-77.043686,38.892035,-77.028923,38.904192]. Do not pass the placeholders bbox or lon,lat,zoom,bearing,pitch. Longitude -180..180, latitude -85.0511..85.0511, zoom 0..22, bearing 0..360, pitch 0..60. auto fits an overlay and requires an overlay.—
style_idstringYesThe ID of the style from which to create a static map.—
usernamestringYesThe username of the account to which the style belongs.—
setfilterstringNoJSON-encoded Mapbox filter expression as a string, for compatibility with the current Wrapper. Example: ["==","name_en","Canada"]. Serialize the expression with JSON.stringify before passing setfilter; do not pass a JSON array and do not URL-encode it manually. Requires layer_id identifying an existing style layer. Cannot be combined with addlayer.—
dimensionsstringYesImage dimensions in format widthxheight. Width and height must be between 1 and 1280 pixels.—
attributionbooleanNoControls whether there is attribution on the image. Defaults to true.—
before_layerstringNoControls where the overlay is inserted in the style. All overlays will be inserted before the specified layer.—

Invocation example

Copy the request and explore its response example.

POST/agent-api/v1/tool/executeX-Api-Key
Request coderequest.sh
curl --request POST \
  --url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_mapbox_maps_static_images_get_static_map' \
  --header "X-Api-Key: $AGENTEARTH_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "params": {
    "attribution": true,
    "dimensions": "1280x894",
    "location": "21.3,54.3,6",
    "logo": false,
    "overlay": "{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[21.0,54.0],[21.01,54.0]]},\"properties\":{\"stroke\":\"#000000\",\"stroke-opacity\":0,\"stroke-width\":0}}",
    "style_id": "light-v11",
    "username": "mapbox"
  }
}'
Response exampleresponse.json
JSON
{
  "message": "{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[21.0,54.0],[21.01,54.0]]},\"properties\":{\"stroke\":\"#000000\",\"stroke-opacity\":0,\"stroke-width\":0}} is not a supported overlay method"
}