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
- MIT License 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.yml to inspect schema and resources
- 2. Download data resources listed in datapackage.yml
- 3. Read README.md for full context
Data Files
Postal Codes Data Resource for Brazil, BR
| Field | Description | Title |
|---|---|---|
| country_code | ISO 3166-1 alpha-2 code for the country. | Country Code |
| postal_code | Postal code for the location. | Postal Code |
| place_name | Name of the city, town, or place. | Place Name |
| admin_name1 | Primary administrative division (e.g., state, region). | Administrative Name 1 |
| admin_code1 | Code for the primary administrative division. | Administrative Code 1 |
| admin_name2 | Secondary administrative division (e.g., county, district). | Administrative Name 2 |
| admin_code2 | Code for the secondary administrative division. | Administrative Code 2 |
| admin_name3 | Tertiary administrative division (e.g., municipality, borough). | Administrative Name 3 |
| admin_code3 | Code for the tertiary administrative division. | Administrative Code 3 |
| latitude | Latitude coordinate of the place. | Latitude |
| longitude | Longitude coordinate of the place. | Longitude |
| accuracy | Accuracy level of the latitude and longitude coordinates. | Accuracy |
| alternative_city_name | Alternative name(s) for the city or place. | Alternative City Name |
Download
Download sample CSVAbout
- Last updated
- 7 November 2024
- Total rows
- ...
- Format
- CSV
- File size
- 8.98 kB
- Sources
- SeuAliado/OpenCEP (MIT License) — primary bulk CEP data
- Mendeley Data, "Códigos de CEP do Brasil por UF, CIDADE, BAIRRO E LOGRADOURO" by Ivan Zimmermann (CC BY 4.0) — secondary CEP data, consolidated for coverage
- IBGE Localidades API — official state and municipality reference
- kelvins/municipios-brasileiros (MIT License) — municipality dictionary
- License
- MIT License
About this dataset
Brazil (BR) — internal licensing notes
Not mentioned in datahub-next#941 — no known licensing flag on this country from that issue, but it has its own real, disclosed licensing caveat found independently this session (below) — worth cross-referencing against #941's general framework (a scraped-source-with-no-stated-licence risk, same shape as several items in #941 §2/§3).
Sources and licences
SeuAliado/OpenCEP(MIT) — primary bulk CEP data. Confirmed via the repo's own LICENSE file; actively maintained (updated the same week this was checked), 401 stars.- Mendeley Data, "Códigos de CEP do Brasil por UF, CIDADE, BAIRRO E LOGRADOURO" by Ivan Zimmermann (CC BY 4.0, confirmed via the dataset page) — secondary CEP data, consolidated for coverage. Data current through 2018.
- IBGE Localidades API — official Brazilian government admin reference.
kelvins/municipios-brasileiros(MIT) — municipality dictionary.- ruacep.com.br scrape (~7,000 of 1,233,231 rows) — no stated data-reuse
licence. The site is copyrighted ("todos os direitos reservados") with
no published reuse terms, confirmed by direct check of its footer/ToS
links. This slice cannot be cleanly separated back out of the already-merged
dataset without re-deriving from the other four sources individually.
Disclosed as a residual, non-blocking risk in
research.jsonand the shipped README — a human decision on whether to accept, exclude, or force a re-derivation is still open.
Given this shape — a multi-source consolidation with one real unresolved
licensing caveat on part of the data — this is priced Tier A ($99) per
docs/PRICING_TIERS.md's own decision rule, the same category as Canada's
pre-#941 situation (base + crosswalk + a licensing caveat no other field
carries).
Session finding, 2026-08-19
The real generator script (brazil_postal_code_parse.py) only ever existed
in a separate repo (datopian/Fedex-dataset), never committed to either
repo touched this session — pulled in along with its two small archive
dependencies specifically so this repo doesn't depend on that other repo
surviving. Verified the postal-codes-product conversion is SHA256-identical
to what's live on R2: 1,233,231 rows (the one postalCode "00000" backfill
row, a municipality with no CEP in any source, correctly excluded — this
product is a list of postal codes).
Two live-fetch reliability bugs found and fixed in the generator script
itself while re-running it self-contained (network issues, unrelated to the
licensing question): Mendeley's Cloudflare front 403s requests/urllib3
via TLS fingerprinting regardless of User-Agent header; the 342MB OpenCEP zip
has no retry/resume in requests (a single dropped connection loses the
whole download). Both switched to curl.
This session's self-containment fix was validated statically, not via a
second full live re-fetch (the OpenCEP download proved unreliable over
this connection even with retries) — the underlying transformation logic is
unchanged from the version that WAS already verified SHA256-identical
earlier the same day; only paths and fetch-reliability code changed. See
scripts/README.md for the full reasoning.
CLOSED — 2026-08-24 (datahub-next#941 §4)
Added standalone br/ATTRIBUTION.txt mirroring the README's existing "Data
Sources" section (SeuAliado/OpenCEP MIT, Mendeley Data CC BY 4.0, IBGE
official, kelvins/municipios-brasileiros MIT, plus the ruacep.com.br
chain-of-title caveat) — now in R2 and inside br.zip.
build_postal_codes_product.py updated to write and zip it, publish_r2.py
updated to upload it, on every run. _meta/catalog.json's BR entry rebuilt
to include it. No pre-existing defect found.