Skip to main content

GET /map.{svg,png}

The GET endpoint turns query parameters into a static SVG or PNG map. Because the entire request is a URL, you can drop it straight into an <img> tag, a Markdown image, or an email. The response is permanently cached, so repeat loads are essentially free.

:::tip When to use GET vs POST Use GET when you have up to roughly 40 regions and your data fits comfortably in a URL (~2 KB). For larger datasets, structured JSON bodies, or CSV uploads, use POST /render/map instead. :::

Live example

https://api.maproll.io/map.png?scope=world&data=US:200,CN:150,IN:80,BR:60,RU:120,DE:95,FR:40,GB:55,JP:90&theme=dark&legendTitle=Sample

World choropleth — dark theme

Query parameters

ParamTypeDefaultAllowed valuesNotes
scopestringrequiredworld, RO, …See Scopes.
datastringid:value[:#hex], id:#hex, or id:label pairs, comma-separatedFour pair shapes; see Data syntax below. Numeric and string values cannot mix.
regionsstringid,id,… comma-separatedHighlight-only mode (no values). Accepted alongside data, but silently ignored when data is present — data takes over region fill entirely. Use one or the other.
themestringdarkdark light light-blue light-mono dark-blue dark-monoSee Themes.
formatstringderived from extensionsvg pngNormally set by the URL path (.svg / .png).
widthinteger12001–8000Output width in pixels.
heightintegerauto1–8000Output height in pixels. Omit to let the projection determine the aspect ratio.
projectionstringper-scopenaturalEarth1 albersUsa conicConformal mercator equalEarthSee Projections.
colorScalestringsequentialsequential diverging categoricalSee Color scales.
classificationstringquantilequantile jenks equal customBinning method for sequential scales. Defaults to quantile. See Classification.
breaksstringComma-separated numbers, 1–20 valuesCustom bin edges when classification=custom.
legendbooleantruetrue false 1 0Show or hide the legend.
legendTitlestringAny stringLabel shown above the legend. The 64-char cap applies to POST bodies only; GET does not enforce a length limit.
legendLayoutstringverticalvertical horizontal continuousSee Legend.
titlestringAny stringMap title shown at the top. The 120-char cap applies to POST bodies only. See Title & subtitle.
subtitlestringAny stringSmaller text below the title. The 160-char cap applies to POST bodies only.
attributionbooleantruetrue false 1 0Shows "© OpenStreetMap contributors". Disable only if your embed context has its own attribution.
logobooleanfalsetrue false 1 0Shows the maproll wordmark. See Attribution & logo.
northArrowbooleanfalsetrue false 1 0Renders a north arrow. See Overlays.
scaleBarbooleanfalsetrue false 1 0Renders a scale bar.
graticulebooleanfalsetrue false 1 0Renders latitude/longitude grid lines.
markersstringSee format belowPoint markers with optional icon, label, and position. See Markers.
patternsstringid:pattern,…Per-region fill patterns. See Patterns.
annotationsstringid:text,…Per-region tooltip text. See Annotations.
routesstringSee format belowGreat-circle arcs between pairs of points or ISO codes. See Routes.
labelsstringISO or id,id,…Region labels on the map. ISO labels all polygons. See Region labels.
labelMinAreanumber0–1000000Minimum polygon area (SVG units²) below which labels are suppressed.
proportionalstringSame id:value[:#hex] syntax as dataSized circles at region centroids. See Proportional symbols.
proportionalMaxnumberGreater than 0, up to 200Maximum circle radius in pixels.
proportionalMinnumber0–100Minimum circle radius in pixels.
bboxstringminLon,minLat,maxLon,maxLatCrops the projection viewport to a geographic rectangle. See Size & format → Viewport crop.
regionStrokestringtheme default#rrggbbOutline colour for every region. Applied to the whole regions group — per-region strokes are not supported.
regionStrokeWidthnumbertheme default0–20Outline width in SVG units.
regionFillstringnoneThe only accepted value. Forces every region's fill to none for an outline-only render.

Data syntax

The data parameter encodes one of four per-pair shapes. The renderer picks the meaning from the shape of each pair — there's no per-parameter mode switch.

data=id:value # numeric choropleth value
data=id:value:#rrggbb # numeric value + per-region color override
data=id:#rrggbb # color-only paint (no value, no scale binning)
data=id:label # text label → categorical bucket (auto-categorical)
  • id — canonical region identifier (ISO 3166-1 alpha-2 for countries, ISO 3166-2 for sub-national regions). Case-insensitive.
  • value — finite number. May be negative or decimal.
  • #rrggbb — 6-digit hex color. As the second field (id:#hex) it paints the region directly; as the third (id:value:#hex) it overrides the scale just for that region. See Color overrides.
  • label — non-empty string, max 64 chars, no embedded #. Each distinct label gets a distinct color from the theme's categorical palette; the legend names the buckets. See Color scales → Categorical.

Mix freely except across numeric ↔ string values. Color-only pairs (id:#hex) coexist with either kind, but a request that mixes US:200 and CN:NATO is rejected with 400 mixed_data_types.

Examples:

# Sequential ramp on three countries
data=US:200,CN:150,DE:95

# One region pinned red, others follow the scale
data=US:200,CN:150,DE:95:%23ff0000

# Paint three countries directly, no scale, no legend
data=US:%23dc2626,CN:%232563eb,DE:%2316a34a # + legend=false

# Two qualitative buckets — auto-selects colorScale=categorical
data=US:NATO,GB:NATO,CN:BRICS,RU:BRICS

# Romanian counties
data=RO-B:500,RO-CJ:200,RO-IS:150

The # character must be URL-encoded as %23 in query strings.

The markers parameter uses semicolons to separate markers (because each marker already uses colons internally):

markers=lat,lon[:icon][:label][:labelPosition][:size]

size is an integer pixel size, 1–200. In place of a named icon, a 20- or 30-digit APP-6 / MIL-STD-2525 SIDC is also accepted. An unrecognised icon name does not fail the request — the marker renders a fallback glyph and the name is reported in the X-Geo-Warnings response header.

The routes parameter also uses semicolons:

routes=from>to[:#rrggbb][:width][:solid|dashed][:arrow][:sea]

Where from and to are either ISO codes (e.g. US) or lat,lon literals (e.g. 44.43,26.10). The optional fields after to are identified by their shape rather than their position, so they may appear in any order: #rrggbb is the colour, a 1–2 digit number is the width (1–20), solid/dashed is the style, arrow adds an arrowhead, and sea routes along sea lanes instead of a great circle.

Response

See Response headers & caching.