---
id: "br_municipality_code"
kind: "pattern"
status: "draft"
is_pii: false
categories: ["geo", "government"]
country: ["BR"]
quality: 100
url: "http://registry.apicrafter.io/datatype/br_municipality_code"
---

# Brazilian municipality code (IBGE) (`br_municipality_code`)

> **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.

Seven-digit code of a Brazilian municipality assigned by IBGE, the Brazilian Institute of Geography and Statistics. The first two digits are the code of the state, for example 35 for São Paulo, and the last digit is a check digit.

- Pattern of: `br_municipality`
- Personal data (PII): no
- Categories: Geographic identifiers (geo), Government related (government)
- Countries: Brazil (BR)
- Classification: categorical

## Detection

Regular expression (Python `re`):

```
^[1-5]\d{6}$
```

## Examples

- `3550308` — São Paulo
- `3304557` — Rio de Janeiro
- `5300108` — Brasília
- `355030` (invalid example) — the older six-digit form without the check digit

## Mappings

- fta: `STATE_PROVINCE.MUNICIPALITY_CODE_BR`
- wikidata: `P1585`

## Supported by tools

- `fta`

## Translations

- ru: Код муниципалитета Бразилии (IBGE)

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/Municipalities_of_Brazil>
- wikidata: <https://www.wikidata.org/wiki/Property:P1585>
- other: <https://github.com/tsegall/fta/blob/main/SemanticTypes.md>

## Quality

Score 100/100.

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