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) — internal licensing notes
Source research, 2026-09-03 — tier-1 check done before defaulting to GeoNames
Per the project's own lesson (GeoNames is fallback, not default), checked
Pakistan Post's official site first, not GeoNames. Found and downloaded
the real official source: pakpost.gov.pk/images/national post code directory.pdf — the "National Post Code Directory," Part-I (Delivery
Post Offices), 45 pages, 2,563 rows, columns: office name, post code,
account office (parent GPO), province, attached branch office codes.
Extracted cleanly via pdfplumber (genuine text-based tables, not
scanned images).
Decisive cross-check: compared this official PDF extraction directly against GeoNames' PK export. Every single one of 2,563 (postal_code, place_name) pairs matches exactly, both directions, 0 discrepancies. GeoNames' PK data already reflects this exact official source — verified, not assumed — with WGS84 coordinates added on top. This means using GeoNames for PK is not a fallback-of-convenience here; it is confirmed to be the official source content, at zero extra build complexity from maintaining a separate PDF-parsing pipeline.
Verified directly against the raw source file:
admin_name1/admin_code1— Province/territory, 7/7 covered (Punjab, Sindh, Khyber Pakhtunkhwa, Balochistan, Gilgit-Baltistan, Azad Jammu and Kashmir, Federal Capital/Islamabad). GeoNames' own codes (02-08) are internal numbers, unrelated to ISO 3166-2:PK's real 2-letter codes (PK-BA,PK-PB, etc.) — verified against Wikipedia's ISO_3166-2:PK page 2026-09-03, name-based crosswalk required (same hazard class as JP/IN/CZ in this batch).- No admin2/admin3 tier exists in either the PDF or GeoNames — Pakistan Post's own directory stops at province + "account office" (a postal routing concept, the parent GPO a smaller office reports to, not a government administrative division). Disclosed as genuinely absent, not dropped.
- 0 exact duplicates, 0 (postal_code, place_name) collisions, 0 literal
"nan"strings. - The PDF's own province spellings have typos ("Punjba", "SIndh") — GeoNames' version is already correctly spelled, another sign it is a cleaned derivative of this same source rather than an independent gazetteer guess.
licence_status
{
"channel": "postal-codes-r2",
"source_url": "https://download.geonames.org/export/zip/PK.zip",
"licence_id": "CC-BY-4.0",
"collected_at": "2026-09-03",
"decision": "compatible",
"decided_by": "claude-session-2026-09-03",
"decided_at": "2026-09-03"
}
Proposed tier
B ($49). Real cross-verification work against an official government PDF (not a trivial GeoNames pass-through), 7/7 province coverage, clean data. Same shape as JP/IN/CZ's ISO-crosswalk builds.
Build — 2026-09-03
Built via datasets/pk/scripts/build_postal_codes_product.py.
| value | |
|---|---|
| Final rows | 2,563 |
| Provinces/territories covered | 7/7 |
| Distinct postal codes | 2,560 |
| (postal_code, place_name) collisions | 0 |
Frictionless validation: valid: True. Zero literal "nan" strings,
zero float-formatted accuracy, zero duplicates.
Status: built and validated locally only. Nothing published to R2, nothing committed to git yet.