---
id: "es_ccaa_code"
kind: "datatype"
status: "draft"
is_pii: false
name: "Spanish autonomous community code (INE)"
regexp: "^(?:0[1-9]|1[0-9])$"
categories: ["geo"]
country: ["ES"]
langs: ["common"]
quality: 90
url: "https://registry.apicrafter.io/datatype/es_ccaa_code"
---

# Spanish autonomous community code (INE) (`es_ccaa_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.

Two-digit code of an autonomous community or autonomous city of Spain in the list of the National Statistics Institute (INE), from 01 for Andalucía to 17 for La Rioja, 18 for Ceuta and 19 for Melilla; 13 is the Comunidad de Madrid and 10 the Comunitat Valenciana. Statistical and administrative tables give it in columns named cod_comunidad, codigo_de_ca, cod_ccaa or cod_autonomia, often without the leading zero.

- Personal data (PII): no
- Categories: Geographic identifiers (geo)
- Countries: Spain (ES)
- Languages: Common to most languages (common)
- Classification: categorical

## Detection

Regular expression (Python `re`):

```
^(?:0[1-9]|1[0-9])$
```

## Examples

- `13` — Madrid, Comunidad de
- `07` — Castilla y León
- `19` — Melilla
- `20` (invalid example)

## Metacrafter rules

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

- `esccaacodebyname` (field, `es/es_codes.yaml`)

## Supported by tools

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

## Translations

- es: Código de comunidad autónoma (INE)
- ru: Код автономного сообщества Испании (INE)

## Sources

- doc: <https://www.ine.es/daco/daco42/codmun/cod_ccaa.htm>

## Quality

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

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