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
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
Postal Codes Data Resource for Canada, CA
| Field | Description | Title |
|---|---|---|
| country_code | ISO 3166-1 alpha-2 code for the country — always CA. | Country Code |
| postal_code | Six-character postal code, formatted 'A1A 1A1'. Primary key — one row per postal code. | Postal Code |
| place_name | Name of the city, town, or place. | Place Name |
| admin_name1 | Province or territory name (e.g., Ontario). | Administrative Name 1 |
| admin_code1 | Province or territory two-letter code (e.g., ON). | Administrative Code 1 |
| admin_name2 | County-tier administrative division — Census Division name (e.g., Peel, Division No. 13). | Administrative Name 2 |
| admin_code2 | Four-digit Census Division UID (SGC 2021) matching the county-tier division. | Administrative Code 2 |
| admin_name3 | Community name — settlement-level locality below the county tier. | Administrative Name 3 |
| admin_code3 | Code for the tertiary administrative division (reserved). | Administrative Code 3 |
| latitude | Latitude coordinate of the place (WGS84, decimal degrees). | Latitude |
| longitude | Longitude coordinate of the place (WGS84, decimal degrees). | Longitude |
| accuracy | Accuracy level of the latitude and longitude coordinates (1–6). | Accuracy |
| alternative_city_name | Alternative name(s) for the city or place, pipe-separated. | Alternative City Name |
Download
Download sample CSVAbout
- Last updated
- 17 July 2026
- Total rows
- ...
- Format
- CSV
- File size
- 7.49 kB
- Source
- Multiple sources
About this dataset
Canada (CA) — internal licensing notes
Status: sold product is clean. The R2 bucket is not. Two separate findings below — don't conflate them.
The problem (datahub-next#941 §1.1, opened 2026-08-08)
StatCan's Postal Code Conversion File (PCCF) End-use Licence has three
clauses that each independently prohibit commercial use: Clause 1 (no
distribution/making public), Clause 3 (no deriving a product for commercial
sale — bites on derivation, so PCCF can't even sit open beside a build as a
validation reference), Clause 8 (publication capped at a 1% extract; a
nationwide crosswalk over 899,779 codes is not that). GeoNames CA_full was
inspected during that review and found to have admin2_nonempty = 0, admin3_nonempty = 0 across all 900,676 rows — meaning 100% of the
admin2 content in the pre-rebuild product was PCCF-derived.
What was done — the clean-room rebuild (issue comment, 2026-08-11)
"Canada is rebuilt and live on r2. two open sources only — GeoNames postal
codes (CC BY 4.0) + StatCan 2021 boundary files (OGL–Canada, permits
commercial sale). PCCF never opened, not even to validate."
Coverage: 899,779 codes, 13/13 provinces, 293/293 census divisions, 3,724/5,161 subdivisions (the rest have no postal delivery). Fill: admin2 99.98%, admin3 99.96% — up from the old PCCF build's 94.2%/79.3%.
I independently re-verified this claim on 2026-08-19 (before I knew this
issue existed) while auditing script reproducibility across the
postal-codes product: found two competing pipelines existed
(scripts/ca/ on origin/main — PCCF-dependent; local ca/scripts/ —
explicitly a "clean-room rebuild" per its own docstring, which states it
"must never read, join against, or 'check itself' with" PCCF). Confirmed the
clean-room build is what's actually live — ca/ca.csv and
ca/consolidated/latest/ca.csv (the path the paid product's
premium_source_key actually points to) both match the local clean-room
output on byte size. BUILD_LOG.md documents fetch SHA-256s and a
cross-check against 6 known cities.
What the issue comment does NOT mention — found 2026-08-19
The raw, licence-gated PCCF file itself is still sitting in the same R2
bucket this paid product ships from: ca/pccf/canada_pccf.csv, 65,761,853
bytes, dated 2026-07-17 (before the 2026-08-11 rebuild). ca/scripts/ publish_r2.py has an --include-pccf deletion flag built specifically for
this, evidently never invoked. PCCF's Clause 1 ("shall not lend, rent, lease,
sublicense, distribute, make public, transfer or sell any part") does not
distinguish between "the sold product" and "a file sitting in the same
bucket" — having it there at all is a live gap the rebuild didn't close.
This deletion was NOT executed — it's irreversible (the only copy of the
file) and not mine to trigger unilaterally. Also left unresolved: the
superseded ca/consolidated/latest/* and dated snapshot paths that the same
flag was meant to clean up (a storage-cost issue, not a licensing one, since
they now hold clean-room data).
Open questions the issue itself flagged, still unanswered
- The 5-province StatCan supplement's own origin/licence was never traced
- GeoNames' own upstream source for full 6-character Canadian codes is unclear — their published source list says Canada is "FSA only" (~1,600 FSAs) but the file ships 900,676 full codes
- What, if anything, the two existing customers (orders shipped 2026-07-30, 2026-08-04) need to be told
Source: datahub-next#941 (opened by @anuveyatsu, 2026-08-08), comment by @amautadev, 2026-08-11; independent re-verification and the PCCF-file finding, 2026-08-19 (this session).
CLOSED (attribution only) — 2026-08-24 (datahub-next#941 §4)
Added standalone ca/ATTRIBUTION.txt (GeoNames CC BY 4.0 + Open Government
Licence – Canada, with an explicit note that this dataset was never
validated against PCCF) — now in R2 and inside ca.zip. package.py
updated to write and zip it on every run; publish_r2.py updated to upload
it. Also found and fixed a stale _meta/catalog.json CA entry: it still
pointed at the pre-rebuild file sizes from 2026-07-30
(ca.csv 73,965,760 bytes) instead of the clean-room rebuild live since
2026-08-11 (ca.csv 81,550,696 bytes) — rebuilt from the actual R2 listing.
This does NOT close the PCCF finding above. ca/pccf/canada_pccf.csv
is still sitting in the bucket, still not deleted — that decision was
already flagged as irreversible and not mine to trigger unilaterally, and
remains open.