---
title: "Country Region Map API — Province & state choropleths | Imejis"
description: "Generate province and state choropleth images for Canada, Germany, Australia, Brazil and India — each region shaded by value on a fitted projection. Fresh data per API call. Start free with Imejis."
url: "https://www.imejis.io/components/map/country-regions"
---

# Country Region Map API — Province & state choropleths | Imejis

Province / state choropleths for Canada, Germany, Australia, Brazil and India.

## Use cases

- Sales / users / revenue by province or state
- Regional coverage and availability maps beyond the US
- Election, poll and survey results by state or province

## Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `data` | `object[]` | `[]` | Regions: array of { id, value, label? } — id is an ISO-3166 code or name. |
| `basemap` | `'world' \| 'us-states' \| 'canada-provinces' \| 'germany-states' \| 'australia-states' \| 'brazil-states' \| 'india-states'` | `"world"` | Which bundled basemap to draw: 'world' countries, 'us-states', 'canada-provinces', 'germany-states', 'australia-states', 'brazil-states' or 'india-states'. |
| `mode` | `'choropleth' \| 'bubble'` | `"choropleth"` | 'choropleth' shades regions by value; 'bubble' draws a flat map with a proportional circle at each region's center. |
| `projection` | `'equirectangular' \| 'mercator'` | `"equirectangular"` | Map projection: 'equirectangular' (flat) or 'mercator'. |
| `matchBy` | `'auto' \| 'iso2' \| 'iso3' \| 'name'` | `"auto"` | How a row's id joins to a region: 'auto', 'iso2', 'iso3' or 'name'. |
| `colorMode` | `'ramp' \| 'diverging' \| 'categorical'` | `"ramp"` | 'ramp' shades by intensity in one hue; 'diverging' colors +/− values; 'categorical' colors by each row's category. |
| `colors` | `color[]` | `[]` | Ramp swatches (lightest→darkest); also the palette for categorical mode. |
| `baseColor` | `color` | `"#2563eb"` | Ramp hue used when no swatches are given. |
| `emptyColor` | `color` | `"#e5e7eb"` | Fill for regions with no matching data value. |
| `positiveColor` | `color` | `"#16a34a"` | Positive color in diverging mode. |
| `negativeColor` | `color` | `"#dc2626"` | Negative color in diverging mode. |
| `scaleMax` | `number` | `0` | Value mapped to the most saturated color (0 = auto from the data). |
| `levels` | `number` (min 1) | `5` | Number of intensity buckets in ramp mode. |
| `strokeColor` | `color` | `"#ffffff"` | Color of region borders. |
| `strokeWidth` | `number` (min 0) | `0.5` | Width of region borders (px). |
| `bubbleColor` | `color` | `"#2563eb"` | Fill for the proportional bubbles in bubble mode. |
| `bubbleSize` | `number` (min 0) | `1` | Bubble size multiplier in bubble mode (1 = default). |
| `showLabels` | `boolean` | `false` | Draw a label on each region that has data (value or name). |
| `labelField` | `'value' \| 'name'` | `"value"` | What each region label shows: 'value' or the region 'name'. |
| `labelSize` | `number` (min 0) | `1` | Per-region label size multiplier (1 = default). |
| `showLegend` | `boolean` | `true` | Draw a low→high legend strip. |
| `labelColor` | `color` | `"#64748b"` | Legend + label text color. |
| `opacity` | `number` | `1` | Overall component opacity from 0 (transparent) to 1 (opaque). |
| `borderWidth` | `number` | `0` | Border thickness in pixels around the component. |
| `borderColor` | `color` | `"transparent"` | Border color (any CSS color). |
| `borderStyle` | `'solid' \| 'dashed' \| 'dotted' \| 'double' \| 'none'` | `"solid"` | Border line style. |
| `borderRadius` | `number` | `0` | Corner radius in pixels. |
| `boxShadow` | `string` | — | CSS box-shadow applied to the component, e.g. "0 4px 6px rgba(0,0,0,0.1)". |

## Design JSON (this variant)

```json
{
  "title": "Map sample",
  "description": "A choropleth world map shaded by value",
  "dimensions": {
    "width": 860,
    "height": 460
  },
  "background": {
    "color": "#ffffff"
  },
  "components": [
    {
      "id": "sample-map",
      "key": "map",
      "type": "map",
      "position": {
        "x": 20,
        "y": 20
      },
      "rotation": 0,
      "size": {
        "width": 820,
        "height": 420
      },
      "dynamic": true,
      "properties": {
        "data": [
          {
            "id": "ON",
            "value": 95
          },
          {
            "id": "QC",
            "value": 72
          },
          {
            "id": "BC",
            "value": 68
          },
          {
            "id": "AB",
            "value": 60
          },
          {
            "id": "MB",
            "value": 34
          },
          {
            "id": "SK",
            "value": 30
          },
          {
            "id": "NS",
            "value": 28
          },
          {
            "id": "NB",
            "value": 24
          },
          {
            "id": "NL",
            "value": 20
          },
          {
            "id": "PE",
            "value": 12
          }
        ],
        "basemap": "canada-provinces",
        "projection": "equirectangular",
        "colorMode": "ramp",
        "baseColor": "#dc2626",
        "emptyColor": "#eef2f7",
        "showLegend": true,
        "opacity": 1,
        "strokeWidth": 0.7
      }
    }
  ]
}
```

## Examples

### Sales by Canadian province

Canada sales shaded in a red ramp, keyed by province code.

API overrides that reproduce this example:

```json
{
  "map.basemap": "canada-provinces",
  "map.data": [
    {
      "id": "ON",
      "value": 95
    },
    {
      "id": "QC",
      "value": 72
    },
    {
      "id": "BC",
      "value": 68
    },
    {
      "id": "AB",
      "value": 60
    },
    {
      "id": "MB",
      "value": 34
    },
    {
      "id": "SK",
      "value": 30
    },
    {
      "id": "NS",
      "value": 28
    },
    {
      "id": "NB",
      "value": 24
    },
    {
      "id": "NL",
      "value": 20
    },
    {
      "id": "PE",
      "value": 12
    }
  ],
  "map.colorMode": "ramp",
  "map.baseColor": "#dc2626",
  "map.emptyColor": "#eef2f7",
  "map.strokeWidth": 0.7
}
```

### Users by German state

German states in a blue ramp, keyed by state code.

API overrides that reproduce this example:

```json
{
  "map.basemap": "germany-states",
  "map.data": [
    {
      "id": "BY",
      "value": 92
    },
    {
      "id": "NW",
      "value": 88
    },
    {
      "id": "BW",
      "value": 80
    },
    {
      "id": "HE",
      "value": 62
    },
    {
      "id": "NI",
      "value": 58
    },
    {
      "id": "BE",
      "value": 55
    },
    {
      "id": "SN",
      "value": 44
    },
    {
      "id": "RP",
      "value": 40
    },
    {
      "id": "SH",
      "value": 34
    },
    {
      "id": "BB",
      "value": 30
    },
    {
      "id": "ST",
      "value": 28
    },
    {
      "id": "TH",
      "value": 26
    },
    {
      "id": "HH",
      "value": 48
    },
    {
      "id": "MV",
      "value": 22
    },
    {
      "id": "SL",
      "value": 16
    },
    {
      "id": "HB",
      "value": 18
    }
  ],
  "map.colorMode": "ramp",
  "map.baseColor": "#2563eb",
  "map.emptyColor": "#eef2f7",
  "map.strokeWidth": 0.7
}
```

## API overrides

Push fresh regions per render with '<key>.data' (or just '<key>') as [{ id, value }]; id is an ISO-3166 code (US, FRA) or country name, and the map recolors to match.

Flat override payload (`key.property` addressing) with the sample design's current values — send only the keys you want to change:

```json
{
  "map.data": [
    {
      "id": "US",
      "value": 920
    },
    {
      "id": "CA",
      "value": 410
    },
    {
      "id": "MX",
      "value": 250
    },
    {
      "id": "BR",
      "value": 300
    },
    {
      "id": "AR",
      "value": 160
    },
    {
      "id": "CL",
      "value": 120
    },
    {
      "id": "CO",
      "value": 140
    },
    {
      "id": "GB",
      "value": 610
    },
    {
      "id": "FR",
      "value": 540
    },
    {
      "id": "DE",
      "value": 700
    },
    {
      "id": "ES",
      "value": 300
    },
    {
      "id": "IT",
      "value": 340
    },
    {
      "id": "PT",
      "value": 130
    },
    {
      "id": "NL",
      "value": 260
    },
    {
      "id": "SE",
      "value": 180
    },
    {
      "id": "NO",
      "value": 150
    },
    {
      "id": "PL",
      "value": 210
    },
    {
      "id": "UA",
      "value": 120
    },
    {
      "id": "RU",
      "value": 480
    },
    {
      "id": "TR",
      "value": 260
    },
    {
      "id": "EG",
      "value": 190
    },
    {
      "id": "ZA",
      "value": 230
    },
    {
      "id": "NG",
      "value": 210
    },
    {
      "id": "KE",
      "value": 110
    },
    {
      "id": "MA",
      "value": 100
    },
    {
      "id": "SA",
      "value": 280
    },
    {
      "id": "AE",
      "value": 240
    },
    {
      "id": "IN",
      "value": 480
    },
    {
      "id": "CN",
      "value": 700
    },
    {
      "id": "JP",
      "value": 560
    },
    {
      "id": "KR",
      "value": 320
    },
    {
      "id": "ID",
      "value": 260
    },
    {
      "id": "TH",
      "value": 180
    },
    {
      "id": "VN",
      "value": 190
    },
    {
      "id": "AU",
      "value": 340
    },
    {
      "id": "NZ",
      "value": 120
    }
  ],
  "map.basemap": "world",
  "map.projection": "equirectangular",
  "map.colorMode": "ramp",
  "map.baseColor": "#2563eb",
  "map.emptyColor": "#e5e7eb",
  "map.showLegend": true,
  "map.opacity": 1
}
```

```bash
curl --location 'https://render.imejis.io/v1/{{YOUR_DESIGN_ID}}' \
--header 'dma-api-key: {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
    "map.data": [
        {
            "id": "US",
            "value": 920
        },
        {
            "id": "CA",
            "value": 410
        },
        {
            "id": "MX",
            "value": 250
        },
        {
            "id": "BR",
            "value": 300
        },
        {
            "id": "AR",
            "value": 160
        },
        {
            "id": "CL",
            "value": 120
        },
        {
            "id": "CO",
            "value": 140
        },
        {
            "id": "GB",
            "value": 610
        },
        {
            "id": "FR",
            "value": 540
        },
        {
            "id": "DE",
            "value": 700
        },
        {
            "id": "ES",
            "value": 300
        },
        {
            "id": "IT",
            "value": 340
        },
        {
            "id": "PT",
            "value": 130
        },
        {
            "id": "NL",
            "value": 260
        },
        {
            "id": "SE",
            "value": 180
        },
        {
            "id": "NO",
            "value": 150
        },
        {
            "id": "PL",
            "value": 210
        },
        {
            "id": "UA",
            "value": 120
        },
        {
            "id": "RU",
            "value": 480
        },
        {
            "id": "TR",
            "value": 260
        },
        {
            "id": "EG",
            "value": 190
        },
        {
            "id": "ZA",
            "value": 230
        },
        {
            "id": "NG",
            "value": 210
        },
        {
            "id": "KE",
            "value": 110
        },
        {
            "id": "MA",
            "value": 100
        },
        {
            "id": "SA",
            "value": 280
        },
        {
            "id": "AE",
            "value": 240
        },
        {
            "id": "IN",
            "value": 480
        },
        {
            "id": "CN",
            "value": 700
        },
        {
            "id": "JP",
            "value": 560
        },
        {
            "id": "KR",
            "value": 320
        },
        {
            "id": "ID",
            "value": 260
        },
        {
            "id": "TH",
            "value": 180
        },
        {
            "id": "VN",
            "value": 190
        },
        {
            "id": "AU",
            "value": 340
        },
        {
            "id": "NZ",
            "value": 120
        }
    ],
    "map.basemap": "world",
    "map.projection": "equirectangular",
    "map.colorMode": "ramp",
    "map.baseColor": "#2563eb",
    "map.emptyColor": "#e5e7eb",
    "map.showLegend": true,
    "map.opacity": 1
}'
```

`{{YOUR_DESIGN_ID}}` and `{{YOUR_API_KEY}}` are placeholders: first create
the design in your account (paste the sample design JSON above into the
editor at https://app.imejis.io, or create it programmatically via the
imejis MCP server's `create_design` + `update_design` tools), then render
it with the design's id and one of your API keys.

Agents: the MCP server at https://api.imejis.io/api/mcp exposes this same
catalog as structured data via the `list_component_types` tool (property
kinds, allowed values, bounds, ready-to-use sample designs).

## Related

- [Map component](https://www.imejis.io/components/map.md) — full reference and FAQs
- [Diverging](https://www.imejis.io/components/map/diverging.md) — Signed values on a diverging red→green scale — for growth and change.
- [Dark](https://www.imejis.io/components/map/dark.md) — A choropleth on a dark card with a bright ramp — built for social.
- [US states](https://www.imejis.io/components/map/us-states.md) — A US state choropleth (Albers-USA, Alaska & Hawaii as insets).
- [Bubble](https://www.imejis.io/components/map/bubble.md) — Proportional-symbol map — a circle at each region sized by value, on a flat basemap.
- [Categorical](https://www.imejis.io/components/map/categorical.md) — Color regions by a category (not a number) — for groupings like sales regions.
