> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usecroma.com/llms.txt
> Use this file to discover all available pages before exploring further.

# DNP TerriData

> Colombia's territorial statistics from the DNP: about 1,750 indicators on poverty, education, health, labour, public finance, safety and more, for the nation, every department and every municipality, year by year.

TerriData is the Departamento Nacional de Planeación's (DNP) panel of territorial
statistics. It gathers, for Colombia, its 32 departments and every municipality,
the indicators that DANE, the ministries and other agencies publish: monetary and
multidimensional poverty, school coverage and test results, health coverage and
mortality, the labour market, municipal and departmental public finance, crime,
housing and public services, demographics, the environment and more. Each value
keeps the agency that produced it.

The whole panel, organized and ready to query: a territory's full profile, one
indicator's history, or every municipality ranked on one indicator, each in a
single fast call.

<Note>
  The whole source, organized and ready to query: every endpoint on this page answers in milliseconds. Every response carries `as_of`: how current the data is. [How datasets work](/datasets).
</Note>

## Search indicators

`POST /co/terridata/indicators-search/v1` <a className="dataset-pill" href="/datasets">Dataset</a>

Finds indicators by name and dimension. Start here to get the code the other
endpoints take.

| Field | Type | Notes |
| - | - | - |
| `query` | string | Optional. Words to find in the indicator's name, in Spanish, e.g. `pobreza multidimensional`. |
| `dimension_code` | enum | Optional. Two-digit dimension, e.g. `14` poverty, `04` education, `05` health, `16` labour market, `07` public finance. |
| `page` | integer | Optional. 1-based page. Default `1`. |
| `per_page` | integer | Optional. Results per page, 1-100. Default `20`. |

```bash theme={"dark"}
curl https://api.croma.run/co/terridata/indicators-search/v1 \
  -H "Authorization: Bearer $CROMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "pobreza multidimensional" }'
```

Returns `as_of`, the applied filters, `total`, `total_is_exact`, `page`,
`per_page`, `total_pages`, `count` and `indicators[]` (see below).

## Series by territory

`POST /co/terridata/series/v1` <a className="dataset-pill" href="/datasets">Dataset</a>

Returns a territory's indicators, each with every year's value.

| Field | Type | Notes |
| - | - | - |
| `territory_code` | string | **Required.** Five-digit DANE code: a municipality (`05001` Medellín), a department (`05000` Antioquia) or `01001` for Colombia. |
| `indicator_code` | string | Optional. One indicator's nine-digit code, from the indicator search. |
| `dimension_code` | enum | Optional. Two-digit dimension, e.g. `14` poverty, `04` education, `05` health, `16` labour market, `07` public finance. |
| `query` | string | Optional. Words to find in the indicator's name, in Spanish, e.g. `pobreza multidimensional`. |
| `page` | integer | Optional. 1-based page. Default `1`. |
| `per_page` | integer | Optional. Results per page, 1-100. Default `20`. |

```bash theme={"dark"}
curl https://api.croma.run/co/terridata/series/v1 \
  -H "Authorization: Bearer $CROMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "territory_code": "05001", "dimension_code": "14" }'
```

Returns `as_of`, `found`, the territory, the applied filters, `total`,
`total_is_exact`, `page`, `per_page`, `total_pages`, `count` and `series[]` (see below).

## Ranking

`POST /co/terridata/ranking/v1` <a className="dataset-pill" href="/datasets">Dataset</a>

Compares every municipality or department on one indicator.

| Field | Type | Notes |
| - | - | - |
| `indicator_code` | string | **Required.** The indicator's nine-digit code, from the indicator search. |
| `year` | integer | Optional. The year to compare, e.g. `2024`. `0` (default) compares each territory's latest value. Default `0`. |
| `level` | enum | Optional. `municipality` (default) or `department`. Default `municipality`. |
| `department_code` | string | Optional. Two-digit DANE code: only that department's municipalities. |
| `order` | enum | Optional. `desc` (highest first, default) or `asc`. Default `desc`. |
| `page` | integer | Optional. 1-based page. Default `1`. |
| `per_page` | integer | Optional. Results per page, 1-100. Default `20`. |

```bash theme={"dark"}
curl https://api.croma.run/co/terridata/ranking/v1 \
  -H "Authorization: Bearer $CROMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "indicator_code": "140030015", "per_page": 10 }'
```

Returns `as_of`, `found`, the indicator with its unit and agency, the applied
filters, `total`, `page`, `per_page`, `total_pages`, `count` and `results[]` (see below).

## Response

Every response carries `as_of`: how current the data is.

### `series[]`

| Field | Notes |
| - | - |
| `series_id` | `<territory_code>-<indicator_code>`. |
| `territory_code`, `territory_name`, `territory_level` | The territory: five-digit DANE code, name, and `country`, `department` or `municipality`. |
| `department_code`, `department_name` | Its department (`01`, `Colombia` for the nation). |
| `indicator_code`, `indicator` | Nine-digit code and name, in Spanish. |
| `dimension_code`, `dimension`, `subcategory` | Where the indicator sits in the panel. |
| `unit` | Unit of measure, in Spanish (`Porcentaje`, `Número`, `Pesos corrientes`, ...). |
| `data_source` | The agency that produced the figure (`DANE`, `MEN`, `DNP`, ...). |
| `first_year`, `last_year` | The years the series spans. |
| `latest_value`, `latest_text` | The latest value, as a number or as text. |
| `observations[]` | Every value, oldest first: `{ year, month, value, text }`. `month` is set when the figure is monthly or taken at a cut-off. |

### `indicators[]`

`indicator_code`, `indicator`, `dimension_code`, `dimension`, `subcategory`, `unit`, `data_source`, `territories` and `municipalities` (how many report it), `first_year`, `last_year` and `observations` (how many values the panel holds for it).

### `results[]` (ranking)

`rank`, `territory_code`, `territory_name`, `department_code`, `department_name`, `year`, `month` and `value`.

Numbers are numbers; names, units and categories stay in Spanish as the source writes them.

<Card title="Full reference" icon="code" href="/api-reference/overview">
  Schemas, all response fields, and an interactive playground.
</Card>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.