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-im
| Field | Type | Description | Constraints | Title |
|---|---|---|---|---|
| country_code | string | ISO 3166-1 alpha-2 -- always IM. | Country Code | |
| postal_code | string | Isle of Man outcode (e.g. IM1, IM4); GeoNames does not reach full unit-postcode level for IM. | { "pattern": "^IM\\d$" } | Postal Code |
| place_name | string | Locality/settlement name served by the outcode, verbatim from GeoNames (apostrophes and hyphens intact). | Place Name | |
| admin_name1 | string | Not populated -- the Isle of Man has no ISO 3166-2 subdivisions at any tier. | Administrative Name 1 | |
| admin_code1 | string | Not populated. | Administrative Code 1 | |
| admin_name2 | string | Not populated -- GeoNames holds no sheading/parish/local-authority data for IM; the country name its export repeats here is dropped. | Administrative Name 2 | |
| admin_code2 | string | Not populated. | 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 | integer | 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 | Manx Gaelic name, where GeoNames records one (gazetteer + alternate-names join, language 'gv'); empty otherwise. | Alternative City Name |
Download
Download CSVAbout
- Last updated
- 6 October 2026
- Total rows
- 87
- Format
- CSV
- File size
- 3.83 kB
About this dataset
Isle of Man (IM): 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.
- Issue: pc-28e.8.12
- Commit: the worktree commit
P6 im: SST producer; parity format-only (crlf) (pc-28e.8.12) - Parity verdict:
format-only(gate: pass, exit 0) against the live public CSV - Producer:
custom, refresh disabled
Sources
| Input | URL | Notes |
|---|---|---|
| GeoNames postal export | https://download.geonames.org/export/zip/IM.zip | Member IM.txt. The old builder read a local copy at sources/postal_raw/IM.txt |
| GeoNames main gazetteer dump | https://download.geonames.org/export/dump/IM.zip | Member IM.txt; place_name → geonameid (feature class P) for the Manx-name join. Old local copy sources/gazetteer/IM.txt; URL from the old builder's docstring and generated datapackage |
| GeoNames alternate-names dump | https://download.geonames.org/export/dump/alternatenames/IM.zip | Member IM.txt; ISO 639 gv (Manx Gaelic) names. Old local copy sources/alternatenames/IM.txt; URL from the same places |
- All three URLs are stable, not versioned. Sizes and sha256 are recorded in
data/im.inputs.json;--no-fetchreuses the cache. - The descriptor
sourceslisted only the postal export; the two dumps were added, as the old builder's own datapackage listed them.
Parity against the live public CSV (2026-10-05)
Rows: 87 live and 87 fresh, none only on one side, 0 changed cells, no cell classes, same row order. The only difference is line endings: live uses CRLF, the producer writes LF (3915 vs 3827 bytes). Covered by the standing CRLF→LF sign-off.
No discrepancies to trace. The Manx-name join reproduces all live alternative_city_name values (e.g. Douglas → Doolish, Peel → Purt ny h-Inshey, Union Mills → Mwyllin Doo Aah).
Decisions
| Decision | By | Basis |
|---|---|---|
| Accept CRLF→LF | Standing rule (user, P5 standing sign-off) | Format only, equal rows, 0 changed cells |
latitude/longitude → number, accuracy → integer | Standing rule (real types, user decision), derived from the produced CSV | accuracy is 4 or empty |
primaryKey: [postal_code, place_name] | Standing rule, derived from the produced CSV | Unique in the output (place_name alone is not: Douglas and Ballasalla each appear under two outcodes); the old builder's datapackage used the same key |
postal_code pattern constraint ^IM\d$ | Agent: port choice | From the old builder's generated schema; the producer also checks it |
| Field descriptions from the old builder's generated schema (counts removed); accuracy description set to the standard text | Agent: port choice / standing doc rule | The P3 generic descriptions didn't say the admin columns are deliberately empty |
Count removed from the descriptor description ("87 outcode-level postal codes" → "outcode-level postal codes (IM1-IM9)") | Standing doc rule (no counts) | |
| Replace the old row-count assert with structural checks (columns, IM country code, admin values only empty or the known "Isle of Man"/"IOM", postal-code pattern, unique PK, the five once-corrupted names present intact) | Agent: port choice | Brief: no exact row-count asserts |
| README.md left as is | Agent | It is a generic description with no counts, no licence_status line and no "sample/contact sales" or "no data yet" text, so none of the doc rules apply |
Transforms carried over
From build_postal_codes_product.py (2026-09-17):
- Cells copied verbatim with csv (no pandas): no literal "nan", accuracy
4not4.0, apostrophes/hyphens intact in place names. - admin_name1..3 / admin_code1..3 all empty (admin_name2/admin_code2 "Isle of Man"/"IOM" is the country name, not an admin tier; IM has no ISO 3166-2 subdivisions).
- alternative_city_name: first class-P gazetteer entry by exact name → first
gvalternate name of that geonameid. - Rows keep the postal export's order.
- Old asserts →
ProducerError.
Not ported
- The old builder's generated README/ATTRIBUTION/datapackage.json and zip: build.py and the committed descriptor/README own those; free datasets get no zip.
publish_r2.py: removed; publishing is the shared pipeline's job.
Open questions
- None needing the user.
.licensing-notes.mdwas left verbatim; there is no ATTRIBUTION.txt in the dataset directory (pc-hfz sweep).