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.yml to inspect schema and resources
- 2. Download data resources listed in datapackage.yml
- 3. Read README.md for full context
Data Files
Explore with AIPostal Codes Data Resource for Hong Kong, HK
| Field | Description | Title |
|---|---|---|
| country_code | ISO 3166-1 alpha-2 code for the country. | Country Code |
| postal_code | Postal code for the location. | Postal Code |
| place_name | Name of the city, town, or place. | Place Name |
| admin_name1 | Primary administrative division (e.g., state, region). | Administrative Name 1 |
| admin_code1 | Code for the primary administrative division. | Administrative Code 1 |
| admin_name2 | Secondary administrative division (e.g., county, district). | Administrative Name 2 |
| admin_code2 | Code for the secondary administrative division. | Administrative Code 2 |
| admin_name3 | Tertiary administrative division (e.g., municipality, borough). | Administrative Name 3 |
| admin_code3 | Code for the tertiary administrative division. | Administrative Code 3 |
| latitude | Latitude coordinate of the place. | Latitude |
| longitude | Longitude coordinate of the place. | Longitude |
| accuracy | Accuracy level of the latitude and longitude coordinates. | Accuracy |
| alternative_city_name | Alternative name(s) for the city or place. | Alternative City Name |
Download
Download CSVAbout
- Last updated
- 17 September 2026
- Total rows
- ...
- Format
- CSV
- File size
- 69.5 kB
About this dataset
Hong Kong (HK) — internal licensing notes
Source research, 2026-09-17 — audit only, no build, no R2/git/datapackage.yml changes
Confirmed: Hong Kong has no operational postal code system. This is a structural fact, independently re-verified against the primary source, not inferred from the near-empty file already sitting in R2.
What was checked
- Official source — Hongkong Post itself
(
hongkongpost.hk/en/about_us/tips/postcode/index.html, fetched 2026-09-17): explicit statement, "postcode system is not adopted in Hong Kong", with a stated reason — the mechanized sorting system already handles mail efficiently, and a unique code down to building/street level would require up to 15 digits, judged impractical. Guidance for forms that require a postcode field: leave it blank, or fill in000,0000,000000, orHKG. This is the official primary source, checked first, per this project's official-sources-before-GeoNames rule. - Hongkong Post — general mail-services pages: no district-code or postcode-adjacent scheme found beyond the FAQ above. The recommended address format is descriptive: recipient, flat/floor, building name, street number/name, and district (per Hongkong Post's Mailing Address Format) — no numeric or alphabetic zone code is part of it.
- Hong Kong Government Address Lookup Service (ALS) — a real, separate
official system exists, but it is not a postal-code system:
data.gov.hk/als.gov.hk(moved from the old domain 2024-07-25) publishes a government-aggregated, building-level structured address gazetteer (English + Chinese) with 18-district codes used internally (e.g. Central and Western = C, Eastern = E, Southern = S, Wan Chai = W, Sham Shui Po = SSP, Kowloon City = KC, …). This is an address-lookup/ geocoding service, not a postcode standard, but it is a genuine, official, building-level government dataset — flagged below as a stronger candidate source than GeoNames for a future admin/locality build, consistent with the "GeoNames is fallback, not default" rule. Not fetched or evaluated for licence terms in this pass (out of scope for an audit that found no postal-code product to build against yet). - The "999077" code: this number, which is the sole row shipped in the current R2 file (see below), is not a Hong Kong domestic postal code. It is a placeholder China Post assigns to Hong Kong for inbound/cross-border mail from mainland China; China Post does not operate inside Hong Kong, so the code is rarely used and not recognized by the public. Shipping it as "the" Hong Kong postal code without this context would mislead a customer into thinking Hong Kong has a 6-digit postcode system — it does not.
- GeoNames postal export (
download.geonames.org/export/zip/HK.zip, fetched 2026-09-17): 200 OK, 1,501-byte zip, extracts to a 1-rowHK.txt:HK 999077 Hong Kong Special Administrative Region 22.25 114.1667 4(tab-delimited; no place-name detail, no admin1/2/3 fields at all). This is GeoNames' own re-export of the 999077 dummy code — confirms the current R2 file is a faithful, unmodified copy of GeoNames' postal-zip product for HK, not a broken/truncated build of something richer. GeoNames genuinely has only one row for HK. - GeoNames main gazetteer dump
(
download.geonames.org/export/dump/HK.zip, fetched 2026-09-17): 200 OK, 121 KB, 2,735 total rows. Filtered to feature classP(populated places): 1,342 rows.admin1bucket coverage among P rows: 18/18 GeoNames district buckets present (HCW, HEA, HSO, HWC = the 4 Hong Kong Island districts; KKC, KKT, KSS, KWT, KYT = the 5 Kowloon districts; NIS, NKT, NNO, NSK, NST, NTM, NTP, NTW, NYL = the 9 New Territories districts), cross-checked name-for-name againstadmin1CodesASCII.txtand matching Wikipedia's "Districts of Hong Kong" list exactly. 68 rows sit on GeoNames' reserved00bucket and 3 rows have a blank admin1 field — same shape as the ZW/SY precedent (leave blank, never guess). - ISO 3166-2:HK: Wikipedia's
ISO_3166-2:HKpage (fetched 2026-09-17) confirms no ISO 3166-2 subdivision codes exist for Hong Kong at all — the article states HK "itself has no ISO 3166-2 subdivisions listed." This is a real gap versus every other admin-only/locality build in this catalogue (ZW, SY, etc. all had a real ISO 3166-2 crosswalk to buildadmin_code1against). For HK,admin_code1would have to come from GeoNames' own non-ISO bucket codes (HCW/HEA/… above) or from the government ALS district abbreviations (C/E/S/W/SSP/KC/…, which don't match GeoNames' codes either) — a genuine open design question for a future build pass, not resolved here.
Current repo state (verified, not assumed)
datasets/hk/datapackage.yml: predates the current schema conventions used elsewhere (e.g. ZW) — it has nois_premiumordata_availablefield, and itssources:block ("Multiple sources" / a datahub.io collections link) does not match this project's current no-sources-array-in-datapackage rule. Not corrected in this pass — audit only.- No
.licensing-notes.mdexisted forhkbefore this pass. - The R2 "main" bucket (
postal-codes, private) — fetched directly via this repo's own.envcredentials, read-only:hk/hk.csv— 285 bytes,Last-Modified: 2026-07-30. Content:Bug found:country_code,postal_code,place_name,admin_name1,admin_code1,admin_name2,admin_code2,admin_name3,admin_code3,latitude,longitude,accuracy,alternative_city_name HK,999077,Hong Kong Special Administrative Region,nan,,nan,,nan,,22.25,114.1667,4,Babban Yankin Mulkin Hong Kong na Ƙasar Sinadmin_name1,admin_name2, andadmin_name3all contain the literal stringnan, not an empty cell — a telltale pandas artifact (DataFrame.to_csv()run withoutna_rep=''over a column that wasNaN). This is a real, if minor, data-quality defect in the shipped file, independent of the postal-code question, and was present at the file's original 2026-07-30 write (not introduced later).hk/geonames/latest/0.csvandhk/geonames/2026-09-01/0.csv— same 285 bytes, same content (samenanbug),Last-Modified: 2026-09-01. These paths, and the fact that every ISO alpha-2 country prefix exists in the main bucket (ad/throughzw/, confirmed via a full top-level listing), show this is a generic monthly bulk GeoNames refresh job that runs blindly across all ~250 country codes (dated-snapshot +latestpattern, matching the US/AU/NZ "consolidated" pipelines documented in this repo'sdoc.md) — not a job written for or aware of Hong Kong specifically. It re-fetched GeoNames' single 999077 row again a month later and produced the same bug, unchanged._meta/catalog.json:hkis not listed as its own entry in the first 1,500 characters inspected (the file is one large array keyed bycountry_code); other 1-row/0-row countries (e.g.AIat 214 bytes/1 row,AF/AGat 159 bytes/0 rows) follow the exact same shape, confirming HK's near-empty file is not anomalous among countries with no real GeoNames postal coverage.
- The public/storefront copy —
postal-codes-samplesbucket, served athttps://postal.datahub.io/hk/hk.csv(which is whatdatasets/hk/datapackage.yml's resourcepathactually points to): 276 bytes, sameLast-Modified: 2026-07-30, but does not have thenanbug —admin_name1/2/3are genuinely empty here:So the two buckets have diverged: the main/private bucket's copy carries thecountry_code,postal_code,place_name,admin_name1,admin_code1,admin_name2,admin_code2,admin_name3,admin_code3,latitude,longitude,accuracy,alternative_city_name HK,999077,Hong Kong Special Administrative Region,,,,,,,22.25,114.1667,4,Babban Yankin Mulkin Hong Kong na Ƙasar Sinnandefect, the public-facing storefront copy (what a customer or datahub.io visitor actually sees today) does not. Neither copy is "broken" in the sense of being truncated or malformed — both are single-row, header-plus-one-record files that faithfully reflect GeoNames' own 1-row export for HK. The near-emptiness is correct; thenanstring in the private copy is a separate, minor defect.
GeoNames licence
CC BY 4.0, attribution-only, no ODbL/OSM involvement in either the postal zip export or the main gazetteer dump used for the candidate counts above — same terms already relied on for ZW/SY/BO/ET/UG/LY in this catalogue.
Free locality-directory candidate — assessment only, NOT built
Viable in principle, same shape as ZW/SY/BO/ET/UG/LY, with one open design question those precedents didn't have:
- GeoNames' main dump gives 1,342 populated places, covering 18/18 real Hong Kong districts (verified against Wikipedia's district list, not just GeoNames' own labels).
- No ISO 3166-2:HK codes exist to crosswalk against — unlike every
other admin-only build in this catalogue. A future build would need to
pick one of: (a) GeoNames' own non-ISO admin1 bucket codes (HCW, HEA,
HSO, …), (b) the Hong Kong Government's own district abbreviations (C,
E, S, W, SSP, KC, …, surfaced via ALS/
data.gov.hk/CSDI), or (c) leaveadmin_code1blank and carry onlyadmin_name1. This is a genuine open decision, not a blocker — but it should be made deliberately, not defaulted, before any build starts. - A stronger official alternative to GeoNames may exist: the Hong
Kong Government's Address Lookup Service (
als.gov.hk, formerly ondata.gov.hk) is a building-level, bilingual, government-maintained address gazetteer with real district coding — this was not fetched or licence-checked in this pass, but per this project's GeoNames-is-fallback-not-default rule, it should be the first thing checked before defaulting to GeoNames' dump if a build is picked up. - Whichever source is used,
postal_codewould be empty on every row (or the whole product could reasonably omit the 999077 dummy entry entirely, since it is not a domestic HK code and including it risks exactly the misleading impression described above) — same convention as the no-postal-code countries already shipped.
Verdict
- No-postal-code status: CONFIRMED, directly from Hongkong Post's own FAQ page (primary source, checked first), independently consistent with GeoNames' own 1-row export and every third-party summary found. This is a permanent structural fact (Hong Kong's own postal operator has stated this is a deliberate policy — mail volume and building-level addressing make a code unnecessary — not an in-progress or stalled rollout like Libya/Syria's cases). Same class as Zimbabwe/Bolivia/Curaçao/Côte d'Ivoire: permanent close-out as a postal-code product, not a "revisit later" case.
- Current 285-byte main-bucket file: CORRECT in substance (faithfully
reflects that GeoNames has exactly one, non-domestic, placeholder row
for HK) but carries a real, independently-confirmed data-quality
bug — literal
"nan"strings in three admin-name columns — that the public-facing samples-bucket copy does not have. Worth a follow-up fix pass on its own merits, separate from any locality-directory build decision. - Free locality-directory build: VIABLE, same class as
ZW/SY/BO/ET/UG/LY, pending a deliberate decision on
admin_code1sourcing (no ISO crosswalk exists here) and a look at the Hong Kong Government ALS as a possibly-better-than-GeoNames official source before defaulting to the GeoNames dump. - Nothing was built, uploaded, or modified in this pass.
datasets/hk/datapackage.ymlanddatasets/hk/README.mdare untouched; no R2 object was written; no git change beyond this notes file.
Build, 2026-09-17 — free locality directory built, LOCAL ONLY
Following the audit above, built the free postal-code-less locality
directory for Hong Kong. Local only, as instructed: no R2 upload, no
git commit/push, _meta/catalog.json and datasets/hk/datapackage.yml
untouched.
- Source refetched fresh:
download.geonames.org/export/dump/HK.zip, 200 OK, 121,014 bytes — byte-identical size to the audit fetch above. Saved todatasets/hk/sources/HK.zip(+ extractedHK.txt,readme.txt) alongside a fresh copy of GeoNames'admin1CodesASCII.txt(datasets/hk/sources/ geonames_admin1CodesASCII.txt). - Row counts confirmed independently: 2,735 total source rows,
1,342 feature-class-
P(populated place) rows — matches the audit exactly. Admin1-bucket breakdown re-verified: all 18/18 real Hong Kong district buckets present (HCW, HEA, HSO, HWC, KKC, KKT, KSS, KWT, KYT, NIS, NKT, NNO, NSK, NST, NTM, NTP, NTW, NYL), plus 68 rows on GeoNames' reserved00bucket and 3 rows with a blank admin1 field — 71 unresolved rows total, shipped with blankadmin_name1rather than a guessed district. - Decisions made explicit in the build:
postal_code: empty on all 1,342 rows. The old single row's999077(China Post's cross-border placeholder, not a real HK code) does not appear anywhere in the output — asserted in the build script.admin_code1: empty on all 1,342 rows, by design — Hong Kong has no ISO 3166-2 subdivisions at all (Wikipedia'sISO_3166-2:HKarticle re-confirmed at build time). Disclosed indatapackage.json's field description,ATTRIBUTION.txt, andREADME.md, not silently left blank.admin_name1: the 18 district names, taken from GeoNames'admin1CodesASCII.txtHK.* buckets and normalised to the plain display form Wikipedia's "Districts of Hong Kong" article uses (a few GeoNames labels carry a redundant "District" suffix, e.g. "Eastern District" → "Eastern", "Sham Shui Po District" → "Sham Shui Po"; the underlying GeoNames bucket code is unaffected).- No
admin_name2/admin_code2/admin_name3/admin_code3populated — not available at this tier from the source used.
- Files written:
datasets/hk/scripts/build_postal_codes_product.py(new, modeled ondatasets/ly/scripts/build_postal_codes_product.pyanddatasets/sy/scripts/build_postal_codes_product.py), and underdatasets/hk/data/:hk.csv(1,342 rows, 69,550 bytes),hk.zip(21.4 KB),datapackage.json,README.md,ATTRIBUTION.txt.licence_statusindatapackage.json:licence_id: CC-BY-4.0,decision: compatible,channel: postal-codes-r2,collected_at: 2026-09-17. - Validated the delivered artifact, not just the in-memory build:
the build script re-reads the written
hk.csvback off disk and asserts row count, header shape, and thatpostal_code/admin_code1are empty on every written row (not just the in-memory rows before writing).python3 -m frictionless validate datapackage.json, run from insidedatasets/hk/data/(cwd = delivery-style directory, so the relative resource path resolves the way a consumer's would): VALID. - Spot-checked the written CSV directly: no
999077substring anywhere in the file; no literal,nan,sequence anywhere (the exact defect found in the shipped main-bucket R2 file above); all 18 district names present inadmin_name1with nonzero row counts (194 Yuen Long down to 6 Wan Chai), plus 71 blank-district rows. - Old mislabeled single row: not modified or removed from R2/the
storefront in this pass (out of scope per the local-only instruction)
— this build produces a new, separate local artifact set under
datasets/hk/data/. The existing 285-byte / 276-byte999077files in R2 and atpostal.datahub.io/hk/hk.csvare untouched. Replacing them, updatingdatasets/hk/datapackage.yml, and any R2/catalog changes are explicitly out of scope here and would need a separate, approved pass.