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-th-sample
| Field | Type | Description | Constraints | Title |
|---|---|---|---|---|
| country_code | string | ISO 3166-1 alpha-2 country code -- always TH | Country Code | |
| postal_code | string | Thai postal code (5 digits) | { "pattern": "^\\d{5}$" } | Postal Code |
| place_name | string | District (Khet/Amphoe) name as GeoNames records it | Place Name | |
| admin_name1 | string | Province (Changwat) -- 74 of 77 provinces represented | Administrative Name 1 | |
| admin_code1 | string | GeoNames admin1 code for the province | Administrative Code 1 | |
| admin_name2 | string | District -- populated only for Na Tan (Ubon Ratchathani); empty elsewhere in the GeoNames source, not a data gap introduced here | Administrative Name 2 | |
| admin_code2 | string | Not available in this release | Administrative Code 2 | |
| admin_name3 | string | Not available in this release | Administrative Name 3 | |
| admin_code3 | string | Not available in this release | Administrative Code 3 | |
| latitude | number | GeoNames-estimated latitude (WGS84) | Latitude | |
| longitude | number | GeoNames-estimated 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 | First alternate name GeoNames records for place_name (e.g. 'Amphoe X'), where one exists; empty otherwise | Alternative City Name |
Download
Download sample CSVAbout
- Last updated
- 6 October 2026
- Total rows
- 100
- Format
- CSV
- File size
- 6.96 kB
About this dataset
Thailand (TH): 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.53 (closed 2026-10-02)
- Commit:
5819a50(worktree commitad2d5dd, same content), landed in batch 3 - Parity verdict:
explained(row_orderonly); signed off under the standing rule - Producer:
custom, refresh disabled
Sources
| Input | URL | Notes |
|---|---|---|
| GeoNames postal export | https://download.geonames.org/export/zip/TH.zip | |
| GeoNames gazetteer dump | https://download.geonames.org/export/dump/TH.zip | For alternative_city_name. Added to the descriptor's sources in this commit |
The old builder already fetched both over the network. The kongvut/thai-province-data district/sub-district upgrade stays out (licence unresolved, per .licensing-notes.md).
Parity against the live zip (2026-10-02)
Rows: 903 live and 903 fresh, none only on one side. 0 changed cells. The only class is row_order: the same row set, reordered within postal codes (e.g. at 10140, live row 6 is Thung Khru, fresh row 6 is Rat Burana; 123 lines change position). The live CSV is CRLF, the fresh one LF.
The informational sample check against https://postal.datahub.io/th/th.csv came back unexplained (unclassified 57, float_suffix_dropped 66). The agent attributed it to the public sample being the old release with float accuracy; it is outside the gate and was not traced further.
Decisions
| Decision | By | Basis |
|---|---|---|
Accept the row_order verdict and land | Standing rule (row_order/CRLF-only, user, 2026-10-02) | Equal rows, 0 changed cells |
custom producer rather than the shared geonames one | Agent | The shared producer cleans names and lets the last dump entry win; the live file uses the first, with names verbatim |
Drop the old exact-count asserts (903 rows, admin_name2 filled on 13 rows) | Orchestrator instruction | Brief: structural checks only |
Remove row, distinct-code, blank-accuracy, admin_name2-fill and alt-name-fill counts; keep "74 of 77 provinces" | Orchestrator instruction (the user's README counts rule) | |
Standard GeoNames accuracy description | Orchestrator instruction | |
Replace the licence_status.decision sentence with "CC BY 4.0, compatible with this product – this dataset is cleared to sell" | Agent | Brief: keep the meaning in plain words |
Transforms carried over
From build_postal_codes_product.py (2026-08-28):
- Cells copied verbatim with the csv module (no pandas), so no literal "nan" and no "4.0" accuracy. The "nan" check is case-sensitive because Nan is a real province.
alternative_city_name= first non-empty, non-numeric alternate name of the first dump entry whose asciiname equalsplace_name. It is re-derived from today's dump, so it moves when GeoNames' gazetteer does.admin_code1stays GeoNames' own two-digit code, as in the live file (not ISO 3166-2:TH).- The old asserts are now
ProducerErrors: malformed row / wrong country, 5-digit postal code, two-digit province code, no "nan", no float accuracy,admin_code2/admin_name3/admin_code3still empty, unique (postal_code, place_name).
Open questions
ATTRIBUTION.txtstill says "903 rows"; it belongs to the pc-hfz sweep.
Provenance
Reconstructed 2026-10-05 from the agent transcript 2479b1c9-c4dd-47e5-be82-34ccf8d49a80/subagents/agent-af44f17db267ae217.jsonl, the orchestrator session 2479b1c9-… (also checked 068ca403-… and 803a95aa-…: no th decisions), the commit message, the bd close reason and docs/parity/p5.md.