---
id: "pe_ubigeo"
kind: "datatype"
status: "draft"
is_pii: false
name: "Peruvian UBIGEO code"
regexp: "^(?:0[1-9]|1\\d|2[0-5])(?:\\d{2}){0,2}$"
categories: ["geo", "government"]
country: ["PE"]
langs: ["es"]
quality: 90
url: "https://registry.apicrafter.io/datatype/pe_ubigeo"
---

# Peruvian UBIGEO code (`pe_ubigeo`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Geographic location code of the Peruvian statistics institute (INEI): six digits, two each for the department (01 to 25), the province and the district, such as 150101 for the district of Lima. Two- and four-digit forms name a department or a province. Files that store it as a number lose the leading zero.

- Personal data (PII): no
- Categories: Geographic identifiers (geo), Government related (government)
- Countries: Peru (PE)
- Languages: Spanish (es)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^(?:0[1-9]|1\d|2[0-5])(?:\d{2}){0,2}$
```

## Examples

- `150101` — District of Lima
- `010101` — District of Chachapoyas, Amazonas
- `0801` — Province of Cusco
- `260101` (invalid example) — There are 25 department codes
- `15010` (invalid example) — Five digits

## Metacrafter rules

1 rules: 1 match the field name, 0 match values.

- `peubigeobyname` (field, `pe/pe_geo.yaml`)

## Supported by tools

- [`metacrafter`](https://registry.apicrafter.io/tool/metacrafter.md)

## Translations

- ru: Код UBIGEO (Перу)

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/UBIGEO>

## Quality

Score 90/100. Missing: mapping (Wikidata, Schema.org, ...).

JSON: <https://registry.apicrafter.io/api/v1/datatypes/pe_ubigeo.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/PE/geo/pe_ubigeo.yaml>
