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.
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
Explore with AIpostal-codes-bo
| Field | Type | Description | Title |
|---|---|---|---|
| country_code | string | ISO 3166-1 alpha-2 code for the country. | Country Code |
| postal_code | string | Postal code for the location. Always empty -- Bolivia has no official postal code system. | Postal Code |
| place_name | string | Name of the city, town, or place. | Place Name |
| admin_name1 | string | Department. Empty where GeoNames assigns the place to no department. | Administrative Name 1 |
| admin_code1 | string | ISO 3166-2:BO department code. Empty where admin_name1 is empty. | Administrative Code 1 |
| admin_name2 | string | Secondary administrative division (e.g., county, district). | Administrative Name 2 |
| admin_code2 | string | Code for the secondary administrative division. | Administrative Code 2 |
| admin_name3 | string | Tertiary administrative division (e.g., municipality, borough). | Administrative Name 3 |
| admin_code3 | string | Code for the tertiary administrative division. | Administrative Code 3 |
| latitude | number | Latitude coordinate of the place. | Latitude |
| longitude | number | Longitude coordinate of the place. | Longitude |
| accuracy | string | Not populated -- GeoNames' gazetteer dump has no postal-export accuracy scale. | Accuracy |
| alternative_city_name | string | Alternative name(s) for the city or place. | Alternative City Name |
Download
Download CSVAbout
- Last updated
- 6 October 2026
- Total rows
- 25,804
- Format
- CSV
- File size
- 1.42 MB
About this dataset
Bolivia (BO): migration notes
Internal record of the P6 migration from the old script to the producer: the discrepancies found, their causes, and who decided what. This is a dated record, so the numbers are as of the migration and not kept current. It is not shipped with the data.
- Issue: pc-28e.8.4
- Parity verdict:
format-only(gate: pass, exit 0), against the live public CSV - Producer:
custom, refresh disabled,postal_code_required: false
Sources
| Input | URL | Notes |
|---|---|---|
| GeoNames gazetteer dump | https://download.geonames.org/export/dump/BO.zip | Member BO.txt; the old builder read a local copy (sources/BO_dump.txt) of the same file |
| GeoNames admin1 names | https://download.geonames.org/export/dump/admin1CodesASCII.txt | The old builder's sources/geonames_admin1CodesASCII.txt |
Both URLs are stable, unversioned "latest" files; nothing to resolve. Fetch time, size and sha256 of each go into bo.inputs.json.
Parity against the live public CSV (2026-10-05)
Rows: 25,804 live and 25,804 fresh, none only on one side, 0 changed cells, no cell classes. The fresh CSV is byte-identical to the live one once the live file's CRLF line endings are turned into LF (checked with tr -d '\r' | cmp). Row order is identical too. No upstream drift showed up in the dump or admin1 table since the 2026-09-04 build.
Decisions
| Decision | By | Basis |
|---|---|---|
| Accept CRLF→LF | Standing rule (a) | Equal rows, 0 changed cells |
pipeline.postal_code_required: false | Agent, per the SST plan | build.py refuses empty postal codes otherwise; the plan names this flag for the no-postcode free datasets |
Latitude/longitude number; accuracy stays string | Agent, per the type rule | accuracy is empty on every row (the dump has no accuracy scale), so it isn't numeric |
primaryKey: [place_name, admin_name1, latitude, longitude] | Agent | The old builder's own uniqueness assert; unique in the produced CSV; frictionless VALID with it |
| Field descriptions for admin_name1/admin_code1/accuracy rewritten to say what BO actually has | Agent | The generic ones were wrong for this dataset (ISO code, empty for unresolved places, accuracy never populated) |
| Unresolved admin1 (code missing from the table) keeps empty department, not an error | Agent: a faithful port | The old builder did the same; live has such rows |
Transforms carried over
From build_postal_codes_product.py (2026-09-04):
- Feature class
Ponly; every dump row must beBOand 19 columns wide. admin_name1/admin_code1fromadmin1CodesASCIIvia the 9-department crosswalk to ISO 3166-2:BO (display-name fixes "El Beni", "Potosi", "Department" suffixes dropped). An unmapped department name is aProducerError.postal_code,accuracy, admin 2/3 andalternative_city_nameempty; lat/lon verbatim.- Sort by (
admin_code1,place_name), stable on dump order. - Old asserts are now
ProducerErrors: literal "nan", duplicate (place_name, admin_name1, latitude, longitude), any department without places. The>= 20000row-count floor was dropped (no hardcoded counts).
Not ported
- The old builder's zip, generated README/ATTRIBUTION/datapackage.json (build.py's job, or obsolete), and
publish_r2.py.
Open questions
- None for the user.
.licensing-notes.mdstill quotes historical row counts; left for the pc-hfz sweep.