Data Input
maproll accepts region data in three formats: a compact URL query string for quick embeds, a JSON array for programmatic use, and a CSV body for spreadsheet-style workflows. All three produce the same rendered output.
Examples
GET — URL query string
https://api.maproll.io/map.svg?scope=world&data=US:200,CN:150,IN:80,BR:60,RU:120,DE:95,FR:40&theme=dark&legendTitle=Sample
GET — highlight-only (no values)
Use regions= when you want to fill countries a single accent color without driving a color scale.
https://api.maproll.io/map.svg?scope=world®ions=RO,DE,FR,IT,ES,PT,NL,BE&theme=light-mono
POST — JSON body
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 }
],
"theme": "dark",
"legendTitle": "GDP"
}'
POST — CSV body
Scope, theme, and other render options are passed as query params; the CSV body carries just the data.
printf 'id,value\nRO,120\nDE,95\nFR,40\n' | \
curl -X POST 'https://api.maproll.io/render/map?scope=world&theme=light&format=svg' \
-H 'content-type: text/csv' --data-binary @-
Parameters
GET endpoint
| Param | Type | Default | Notes |
|---|---|---|---|
data | string | — | Comma-separated id:value pairs. Optional third field: id:value:#hex for a per-region color override. Semicolons also accepted as separators. |
regions | string | — | Comma-separated IDs with no values — highlight mode. Cannot be combined with data on the same request. |
POST endpoint — regions array
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes | Region identifier (ISO 3166-1 alpha-2 for world scope; ISO 3166-2 for sub-country scopes). Max 16 characters. Uppercased automatically. |
value | number | no | Finite number. Omit to use highlight mode for that entry. |
color | string | no | 6-digit hex, e.g. #ff0000. Overrides the scale-derived fill. See Color Overrides. |
pattern | string | no | One of stripes, stripes-diagonal, dots, crosshatch, solid-outline. See Patterns. |
annotation | string | no | Free-text string appended to the SVG <title> tooltip on hover. Max 200 characters. |
POST endpoint — CSV body
The CSV body must have an id column and optionally a value column. A color column (#rrggbb) and a pattern column are also honored when the header is present. Extra columns are ignored.
id,value,color
RO,120,#ff0000
DE,95,
FR,40,#00ff00
Notes
- Max 5,000 region entries per request across all three input methods.
- Values must be finite numbers.
NaN,Infinity, andnullare rejected (or treated as highlight-only fornullin the JSON body). - IDs are case-insensitive —
ro,RO, andRoall resolve to the same region. data=color override syntax: the third colon-delimited field must be URL-encoded —#becomes%23. Example:RO:120:%23ff0000.- When
data=andregions=are both absent, the map renders all regions in the theme's base land color with no legend. - Unknown IDs are silently skipped; the response includes an
X-Geo-Warnings: unknown-ids:XX,YYheader listing them.
Related
- Color Overrides — per-region hex fills
- Patterns — SVG pattern fills
- Highlight-only recipe —
regions=mode in depth - GET /map reference — full query-parameter table
- POST /render/map reference — full JSON and CSV body schemas