Skip to main content

POST /render/map

The POST endpoint accepts either a JSON body (application/json) or a CSV body (text/csv) and returns an SVG or PNG map. Use POST when your data has more than ~40 regions, when you need to pass structured nested objects (markers, routes, annotations), or when you are uploading a CSV file directly from a script or pipeline.

Content types

Send the full request as a JSON body. All rendering parameters and data live in the body — no query string needed.

Body schema:

{
"scope": "world",
"regions": [
{ "id": "RO", "value": 120 },
{ "id": "DE", "value": 95, "color": "#1a6bcc" },
{ "id": "FR", "value": 40, "pattern": "stripes" },
{ "id": "US", "value": 200, "annotation": "Largest economy" }
],
"theme": "dark",
"format": "png",
"width": 1200,
"height": null,
"projection": "naturalEarth1",
"colorScale": "sequential",
"classification": "quantile",
"breaks": [],
"legend": true,
"legendTitle": "GDP rank",
"legendLayout": "vertical",
"title": "World GDP",
"subtitle": "2024 estimates",
"attribution": true,
"logo": false,
"northArrow": false,
"scaleBar": false,
"graticule": false,
"labels": "ISO",
"labelMinArea": 5000,
"proportional": [
{ "id": "US", "value": 200, "color": "#ff6600" }
],
"proportionalMax": 40,
"proportionalMin": 4,
"markers": [
{
"lat": 44.43,
"lon": 26.10,
"icon": "pin",
"label": "Bucharest",
"labelPosition": "right",
"color": "#ff0000",
"size": 16,
"rotation": 0
}
],
"routes": [
{
"from": "RO",
"to": "DE",
"color": "#ffffff",
"width": 2,
"style": "dashed",
"arrow": true
}
]
}

All fields except scope are optional.

Field reference:

FieldTypeDefaultNotes
scopestringrequiredSee Scopes.
regionsarrayUp to 5000 items. Each item: id (required), value (number or null), color (#rrggbb), pattern, annotation.
themestringdarkdark light light-blue light-mono dark-blue dark-mono
formatstringsvgsvg or png
widthinteger12001–8000 pixels
heightinteger or nullnull1–8000 pixels. null = auto (projection aspect ratio).
projectionstringper-scopenaturalEarth1 albersUsa conicConformal mercator equalEarth
colorScalestringsequentialsequential diverging categorical
classificationstringquantilequantile jenks equal custom
breaksnumber[]Custom bin edges (1–20 values). Used when classification is custom.
legendbooleantrue
legendTitlestringMax 64 chars
legendLayoutstringverticalvertical horizontal continuous
titlestringMax 120 chars
subtitlestringMax 160 chars
attributionbooleantrue
logobooleanfalse
northArrowbooleanfalse
scaleBarbooleanfalse
graticulebooleanfalse
labels"ISO" or string[]"ISO" labels all polygons; array labels specific IDs.
labelMinAreanumber0–1000000 SVG units². Suppresses labels on small polygons.
proportionalarraySized circles. Each item: id, value, optional color.
proportionalMaxnumberMax circle radius in pixels (0–200).
proportionalMinnumberMin circle radius in pixels (0–100).
markersarrayUp to 1000 items. Each: lat, lon, optional icon, size, color, rotation, label, labelPosition.
routesarrayUp to 500 items. Each: from, to, optional fromLatLon, toLatLon, color, width (1–20), style, arrow.

curl example:

curl -X POST https://api.maproll.io/render/map \
-H 'Content-Type: application/json' \
-d '{
"scope": "world",
"regions": [
{"id": "RO", "value": 120},
{"id": "DE", "value": 95},
{"id": "FR", "value": 40},
{"id": "US", "value": 200}
],
"theme": "dark",
"format": "png",
"legendTitle": "GDP rank"
}' \
--output map.png

Limits

  • Maximum body size: 4 MB.
  • Maximum regions per request: 5000.
  • Maximum markers per request: 1000.
  • Maximum routes per request: 500.

Response

See Response headers & caching.