SEPOMEX catalog: the official file vs. an API
The Servicio Postal Mexicano publishes the Catálogo Nacional de Códigos Postales and gives it away free. If you came here looking for how to download it, this page is what you get, what you are left to solve, and where the line sits between the two.
What the catalog is
One national catalog, compiled by the Mexican postal service, covering all 32 estados: postal codes, asentamientos with their settlement type, municipios and cities. It is the source every postal-code product in Mexico is built on, including this one. If any of those words is new, the address glossary defines each one against this same catalog.
It is published from this address:
correosdemexico.gob.mx/SSLServicios/ConsultaCP/CodigoPostal_Exportar.aspx
What the official export hands over
-
A form, not an endpoint.
You pick one estado or “Todos” and download. There is no stable URL to point at, so there is nothing to fetch on a schedule.
-
Three formats.
Excel with one sheet per estado, plain text delimited by the pipe character, or XML.
-
A last-updated date.
That is the whole of the version information: no history, and no published difference between one release and the next.
What it leaves you to solve
None of this is a criticism of the catalog. It is a national reference file published for free, not a product, and these are simply the jobs it does not do for you.
-
A legacy text encoding.
The text export is Latin-1, not UTF-8, so every accented colonia name arrives wrong until it is converted.
-
Flat rows, not a relational model.
Every row repeats its estado, municipio and city as text. Turning that into tables you can join — and keeping the identifiers steady while you do — is on you.
-
Noticing what changed.
With no published history, the only way to know what moved between two releases is to hold both and compare them yourself.
-
Doing it again.
Every refresh is another trip through the form, and then the same conversion and reconciliation as the first time.
The alternative
The same catalog, read over HTTP
PostalKit keeps that catalog normalized into related tables — estados, municipios, cities, postal codes and colonias — with identifiers that stay put, and re-checks the official source on the first of every month. If the published file has not changed, nothing moves, so a difference in the data always means the source really changed.
Which version you are reading is a request away:
GET /v1/account/db-version.
- postal codes
- 31,880 postal codes
- colonias
- 159,019 colonias
- municipios
- 2,478 municipios
- estados
- 32 estados
One call, JSON back, a Bearer token for authentication. The free plan is 100 requests a month and asks for no card. Everything else is in the API reference.