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-lk-sample
| Field | Type | Description | Constraints | Title |
|---|---|---|---|---|
| country_code | string | ISO 3166-1 alpha-2 -- always LK | Country Code | |
| postal_code | string | Sri Lankan postal code (5 digits) | { "pattern": "^\\d{5}$" } | Postal Code |
| place_name | string | Post office / locality name | Place Name | |
| admin_name1 | string | Province (9 total) | Administrative Name 1 | |
| admin_code1 | string | ISO 3166-2:LK province code | Administrative Code 1 | |
| admin_name2 | string | District -- 24/25 covered | Administrative Name 2 | |
| admin_code2 | string | ISO 3166-2:LK district code | Administrative Code 2 | |
| admin_name3 | string | Not populated -- no third admin tier in this source | 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
- 7.58 kB
About this dataset
Sri Lanka (LK): 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.31 (closed 2026-10-02)
- Commit:
04a888e(worktree commitd310297, identical diff), landed in batch 2; accuracy wording later changed in5311ad3 - 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/LK.zip | The only input the old builder used |
Sri Lanka Post publishes no bulk download; the community github.com/slwdc/Postal-Codes (MIT) was rejected earlier as incomplete (per the produce.py docstring, 2026-09-11).
Parity against the live zip (2026-10-02)
Rows: 1,837 live and 1,837 fresh, none only on one side, 0 changed cells. One class, row_order; the postal_code sequence is identical. Live is CRLF, fresh is LF. The informational sample check was format-only.
Cause: GeoNames reordered its export. The one swap: within 11104 (live lines 1506–1507) live has Wattala then Watinapaha; fresh has Watinapaha first.
Decisions
| Decision | By | Basis |
|---|---|---|
Accept row_order | User, 2026-10-02 ("agree to all", session 2479b1c9) | Batch 2 sign-off in docs/parity/p5.md |
| Accuracy description admits undocumented values | Agent flagged accuracy 3 on 2 rows (50500 Kebithigollewa, 00600 Kirulapone) and one empty (42000 Mullativu), same as live; orchestrator reworded all batch-2 descriptors in 5311ad3 | Reported to the user with batch 2; "agree to all" |
| Keep Kilinochchi (LK-42) as a disclosed gap, not backfilled | Agent: a faithful port | GeoNames has no rows for it; the old builder disclosed it the same way |
Remove row and distinct-code counts and "0 collisions" from README; drop the stale licence_status.decision sentence; standard accuracy description | Orchestrator instruction (P5 brief) | Kept "24/25 districts" |
Transforms carried over
From build_postal_codes_product.py:
admin_code1→ ISO 3166-2:LK province code (LK-1..LK-9) by a name crosswalk; GeoNames' own codes (29, 30, …) are internal numbers.admin_name1"Province of Uva" → "Uva Province".admin_code2→ ISO district code by a name crosswalk; GeoNames' own codes (KY, MT, …) are local abbreviations.alternative_city_nameempty; no third admin tier.- The old asserts are
ProducerErrors: row shape/country, literal "nan", float accuracy, unmapped province or district, duplicate (postal_code, place_name). New checks: every province and every mapped district present. No row-count assert. build_postal_codes_product.pyandpublish_r2.pyremoved.
Open questions
ATTRIBUTION.txt("1,837 rows") and.licensing-notes.mdstill carry counts; left for the end-of-epic sweep (pc-hfz, which subsumes pc-3d2).
Provenance
Reconstructed 2026-10-05 from the agent transcript 2479b1c9-c4dd-47e5-be82-34ccf8d49a80/subagents/agent-a81954bc7fd84486c.jsonl, the orchestrator session 2479b1c9-…, the commit messages (04a888e, 5311ad3), the bd close reason and docs/parity/p5.md.