---
id: "es_air_station_code"
kind: "datatype"
status: "draft"
is_pii: false
name: "Spanish air quality station national code"
regexp: "^(?:0?[1-9]|[1-4]\\d|5[0-2])\\d{6}$"
categories: ["environment"]
country: ["ES"]
langs: ["common"]
quality: 90
url: "https://registry.apicrafter.io/datatype/es_air_station_code"
---

# Spanish air quality station national code (`es_air_station_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.

National code of a station of the Spanish air quality monitoring networks, built from the INE code of the province (two digits), the INE code of the municipality (three digits) and the number of the station within the municipality (three digits), as in 28079008 for station 8 of Madrid. A code of a province below 10 is also written without its leading zero (4066003). The ministry for the ecological transition and the regional networks use it as the key of their measurement tables (COD_ESTACION, codigo_nacional). The European code of a station (ES1890A) is a different identifier.

- Parent datatype: [`id`](https://registry.apicrafter.io/datatype/id.md)
- Personal data (PII): no
- Categories: Environment (protected areas, biodiversity, water, weather, emissions, waste) (environment)
- Countries: Spain (ES)
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

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

## Examples

- `4066003` — the example of the service sheet of the ministry (province 04, municipality 066, station 003)
- `28079008` — a station in Madrid
- `03009003` — a station in Alcoi in the tables of the Generalitat Valenciana
- `ES1890A` (invalid example) — the European code

## Metacrafter rules

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

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

## Supported by tools

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

## Translations

- es: Código nacional de estación de calidad del aire
- ru: Национальный код станции контроля качества воздуха (Испания)

## Sources

- doc: <https://web.archive.org/web/20240909091139/https://sig.mapama.gob.es/Docs/PDFServicios/CA_Estaciones.pdf>

## Quality

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

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