Datatypes › Spain › Geographic identifiers › postindex
Spanish postal code
ID espostcode
Pattern of postindexPersonal data (PII)categoricalDraft
This record is a draft: it has not been reviewed yet and may be incomplete or wrong. Do not rely on it for compliance decisions. Help improve it (see CONTRIBUTING.md).
Postal code (código postal) in Spain: five digits. The first two digits, 01 to 52, identify one of the 50 provinces or the autonomous cities of Ceuta and Melilla. Mexican postal codes are a separate type, mx_postcode.
- Pattern of
- Postal code/index
postindex - Categories
- Geographic identifiers
- Countries
- Spain
- Languages
- Spanish
- FTA
POSTAL_CODE.POSTAL_CODE_ES- python-stdnum
stdnum.es.postal_code- Quality
- 95/100 · missing: translation
- Metacrafter rules
- 1 rule (1 by field name, 0 by value)
espostcodefieldfield, es/es_geo.yaml
- Supported by tools
- FTA (Fast Text Analysis), metacrafter, python-stdnum, validator.js
Regular expression
^(?:0[1-9]|[1-4]\d|5[0-2])\d{3}$
Python re syntax.
Test a value
Examples
| Value | Description |
|---|---|
| 07002 | Palma, Majorca |
| 27722 | Veigas, Asturias |
| 28039 | |
| 53000 invalid | no province 53 (python-stdnum example) |
Sources
- wikipedia: Postal codes in Spain (en.wikipedia.org)
- doc: arthurdejong.org/python-stdnum/doc/2.2/stdnum.es.postal_code.html
- other: chromium-i18n.appspot.com/ssl-address/data/ES
Use this record
- Page URL:
https://registry.apicrafter.io/datatype/espostcode - JSON: API v1 · legacy shape (used by metacrafter) · Markdown (for LLMs)
- Improve it: edit
data/datatypes/ES/geo/espostcode.yamlon GitHub