Part of a Data Solution
- Explore →
Postal Codes Solution
Every worldwide postal-code dataset in one bundle — the ultimate global reference for precise postal codes.
Premium
You're viewing a free sample
Get the complete dataset — all rows and files — delivered instantly after checkout, with lifetime access to the latest version.
- Secure checkout via Stripe
- Instant download after payment
- Lifetime access to the latest version
- Creative Commons Attribution 4.0 International license
API Access
Access dataset files directly from scripts, code, or AI agents.
Browse dataset files
API Access
Access dataset files directly from scripts, code, or AI agents.
Each file has a stable URL (r-link) that you can use directly in scripts, apps, or AI agents. These URLs are permanent and safe to hardcode.
Start with these files — they give you everything you need to understand and access the dataset.
- 1. Fetch datapackage.yaml to inspect schema and resources
- 2. Download data resources listed in datapackage.yaml
- 3. Read README.md for full context
Data Files
postal-codes-mx-sample
| Field | Type | Description | Constraints | Title |
|---|---|---|---|---|
| country_code | string | ISO 3166-1 alpha-2 -- always MX | Country Code | |
| postal_code | string | Mexican postal code (5 digits) | { "pattern": "^\\d{5}$" } | Postal Code |
| place_name | string | Colonia (neighbourhood) name from GeoNames -- empty on rows recovered only from SEPOMEX's official code list (no name in that source) | Place Name | |
| admin_name1 | string | State (32 federal entities) | Administrative Name 1 | |
| admin_code1 | string | ISO 3166-2:MX code | Administrative Code 1 | |
| admin_name2 | string | Municipio, from GeoNames | Administrative Name 2 | |
| admin_code2 | string | GeoNames municipio code | Administrative Code 2 | |
| admin_name3 | string | From GeoNames -- equals admin_name2 on roughly a fifth of rows, a distinct sub-municipal value on the rest, per the source | Administrative Name 3 | |
| admin_code3 | string | From GeoNames | Administrative Code 3 | |
| latitude | number | SEPOMEX official polygon centroid where available, else GeoNames-estimated | Latitude | |
| longitude | number | See latitude | Longitude | |
| accuracy | string | POSTAL_CODE where sourced from a SEPOMEX official polygon centroid; otherwise GeoNames' own code (1=estimated, 4=gazetteer match, 6=centroid of addresses/shape) | Accuracy | |
| alternative_city_name | string | Not populated in this release | Alternative City Name |
Download
Download sample CSVAbout
- Last updated
- 12 October 2026
- Total rows
- 100
- Format
- CSV
- File size
- 11.5 kB
About this dataset
Postal Codes Dataset for Mexico (MX)
This dataset contains Mexican postal codes across all states, built by consolidating GeoNames with SEPOMEX's own official code list and boundary polygons.
Column definitions, row count, size and last-updated date are in datapackage.yaml.
Data Sources
- Place names and administrative tiers: © GeoNames, postal code export for Mexico, CC BY 4.0.
- Authoritative postal code list and boundary polygons: © SEPOMEX (Servicio Postal Mexicano), Mexico's postal operator, "Códigos postales por entidad federativa", published via datos.gob.mx, CC BY 4.0.
Changes made to the source data: postal codes that appear only in the SEPOMEX list are added to the GeoNames records; coordinates are upgraded from a GeoNames estimate to the centroid of the SEPOMEX polygon (reprojected from the source Lambert Conformal Conic projection to WGS84) on every code it covers, labelled accuracy = POSTAL_CODE; admin_code1 is derived to ISO 3166-2:MX from state names rather than GeoNames' INEGI numbering.
Not endorsed by, or affiliated with, GeoNames or SEPOMEX.
Known limitations
- Postal codes that come only from SEPOMEX's official list have a verified state and an official polygon-centroid coordinate, but no colonia/municipio name, because SEPOMEX's own data provides none.
Usage
The dataset files are available in CSV format and can be accessed and downloaded using
the links provided in datapackage.yaml.
postal_code and admin_code1 must be read as text (dtype=str) — a naive pd.read_csv() can otherwise mis-handle leading zeros, which some Mexican codes carry.
For other inquiries, contact datahub@datopian.com