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-pk-sample
| Field | Type | Description | Constraints | Title |
|---|---|---|---|---|
| country_code | string | ISO 3166-1 alpha-2 -- always PK | Country Code | |
| postal_code | string | Pakistani postal code (5 digits) | { "pattern": "^\\d{5}$" } | Postal Code |
| place_name | string | Delivery post office name | Place Name | |
| admin_name1 | string | Province/territory -- 7/7 covered | Administrative Name 1 | |
| admin_code1 | string | ISO 3166-2:PK code | Administrative Code 1 | |
| admin_name2 | string | Not populated -- Pakistan Post's own directory has no second admin tier (only province + parent GPO, a routing concept, not a government division) | Administrative Name 2 | |
| admin_code2 | string | Not populated | Administrative Code 2 | |
| admin_name3 | string | Not populated | Administrative Name 3 | |
| admin_code3 | string | Not populated | Administrative Code 3 | |
| latitude | number | GeoNames latitude (WGS84) | Latitude | |
| longitude | number | GeoNames longitude (WGS84) | Longitude | |
| accuracy | string | GeoNames accuracy of latitude/longitude. GeoNames documents 1=estimated, 4=geonameid, 6=centroid of addresses or shape; other values (e.g. 3) occur upstream without documentation. Empty where GeoNames gives none. | Accuracy | |
| alternative_city_name | string | Not populated in this release | Alternative City Name |
Download
Download sample CSVAbout
- Last updated
- 2 October 2026
- Total rows
- 100
- Format
- CSV
- File size
- 6.26 kB
About this dataset
Pakistan (PK): migration notes
Internal record of the P5 migration from the old scripts 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 in the zip.
- Issue: pc-28e.7.44 (closed 2026-10-02)
- Commit:
b76af60(worktree commit4e48049), landed in batch 2 - Parity verdict:
explained(row_orderonly); signed off by the user - Producer:
custom, refresh disabled
Sources
| Input | URL | Notes |
|---|---|---|
| GeoNames postal export | https://download.geonames.org/export/zip/PK.zip | The only input; same URL as the old builder |
Parity against the live zip (2026-10-02)
Rows: 2,563 live and 2,563 fresh, none only on one side, 0 changed cells. Line endings went from CRLF to LF.
Cause: GeoNames reordered its export (upstream drift). Sorted, the two files are identical. Two pairs of rows swapped within a postal code:
| Postal code | Live order | Fresh order |
|---|---|---|
| 40520 | Chak Ram Das, Chak Mubarak | Chak Mubarak, Chak Ram Das |
| 63050 | Jamalpur Edso, Jamalpur | Jamalpur, Jamalpur Edso |
The informational sample check reported unexplained against postal.datahub.io/pk/pk.csv. It doesn't feed the gate, and the cause was not traced.
Decisions
| Decision | By | Basis |
|---|---|---|
Accept row_order | User, 2026-10-02 (session 2479b1c9-…, "agree to all" to the batch-2 sign-off question) | Recorded in the sign-off section of docs/parity/p5.md |
Leave the one accuracy 3 row as an upstream value | Agent | Present in live and fresh |
Reword the accuracy description to admit undocumented values | Orchestrator (commit 5311ad3, batch 2); reported to the user with the batch-2 results | The standard text said "GeoNames documents no other values" |
| Remove row, distinct-code and collision counts from README and description; keep "7/7 covered" | Orchestrator instruction (README counts rule, plan §4 P5) | Counts drift |
Transforms carried over
From build_postal_codes_product.py (now removed, with publish_r2.py):
admin_code1→ ISO 3166-2:PK by name across the 7 provinces/territories. GeoNames' own 02–08 code is an internal number.- Literal "nan" → empty;
alternative_city_nameis empty.admin_name2/admin_name3stay empty. - The old asserts are now
ProducerErrors: 12 columns and country PK per row, every province maps, unique (postal_code, place_name), all 7 provinces present, no float-formatted accuracy. No row-count assert.
Open questions
- Resolved (2026-10-05, pc-28e.7.60): README now says "GeoNames accuracy code" with no code list. Was:
README.mdstill lists the accuracy codes as "(1/4/6)", though the data has a 3. Only the descriptor was reworded. .licensing-notes.mdandATTRIBUTION.txt("2,563 rows") still contain counts. The agent flagged this; it is left for the end-of-epic sweep (pc-hfz).
Provenance
Reconstructed 2026-10-05 from the agent transcript 2479b1c9-c4dd-47e5-be82-34ccf8d49a80/subagents/agent-a04ef573a310c3c65.jsonl, the orchestrator session 2479b1c9-…, the commit messages (b76af60, 5311ad3), docs/parity/p5.md and the bd close reason.