world-postal-codes / README.md
lakerguy16's picture
Upload 2 files
194e8d2 verified
|
Raw History Blame Contribute Delete
3.15 kB
metadata
license: cc-by-4.0
pretty_name: World postal codes and administrative units
size_categories:
  - 1M<n<10M
task_categories:
  - table-question-answering
tags:
  - geography
  - postal-codes
  - zip-codes
  - geonames
  - administrative-divisions
  - gazetteer
configs:
  - config_name: postal_codes
    data_files: postal_codes-*.parquet
    default: true
  - config_name: places
    data_files: places.parquet

World postal codes and administrative units

1,836,751 postal codes in 124 countries, each with its place name and the administrative units it belongs to (state / province / region, county / district, municipality), plus 172,038 places (every town with 1,000+ people) with their state and county or district, population, coordinates and matching postal codes.

What it answers:

  • What is the postcode / zip code / PIN code / PLZ of a town? Look up the postal_codes config by place_name and country_code.
  • Which state, county, district or province is a town in? Use admin1 (state/province/region) and admin2 (county/district) in either config.
  • Which places does a postal code cover? Filter postal_codes by postal_code.
from datasets import load_dataset
pc = load_dataset("lakerguy16/world-postal-codes", "postal_codes", split="train")
places = load_dataset("lakerguy16/world-postal-codes", "places", split="train")

Or with pandas / DuckDB straight from Parquet:

import duckdb
duckdb.sql("SELECT postal_code, place_name, admin1, admin2 FROM 'hf://datasets/lakerguy16/world-postal-codes/postal_codes-*.parquet' "
           "WHERE country_code = 'AU' AND place_name = 'Geelong'")

Live lookup for AI agents and scripts: a free JSON API and MCP server with the same data at place-lookup.mnpi.workers.dev (https://place-lookup.mnpi.workers.dev/mcp).

Columns

postal_codes: country_code (ISO 3166-1 alpha-2), country, postal_code, place_name, admin1, admin1_code, admin2, admin2_code, admin3, admin3_code, latitude, longitude, accuracy (GeoNames: 1 = estimated, 4 = geonameid, 6 = centroid of addresses or shape).

places: geonameid, name, ascii_name, country_code, country, admin1, admin2, feature_code, population, latitude, longitude, timezone, postal_codes (codes whose place name matches the town and whose point lies within 25 km of it; may be empty).

Coverage

Largest countries by postal-code rows: PT 206,942, AE 178,171, IN 155,570, JP 146,883, MX 144,655, SG 121,154, PE 96,943, ID 81,058, PL 72,899, FR 51,611, RU 43,538, US 41,490, RO 37,915, ES 37,867, TR 36,307, KR 35,583, UA 29,571, GB 27,450, DE 23,296, LT 21,870, AR 20,260, AT 19,225, SE 18,887, AU 18,566, IT 18,415. Countries without a national postal-code file in GeoNames are only in places.

Source, license and updates

Built from GeoNames postal code and gazetteer exports (CC BY 4.0). This dataset is CC BY 4.0; please credit GeoNames. Rebuilt monthly; last build 2026-11-19 UTC. Postal-code coverage and accuracy vary by country (see GeoNames' notes); for legal or delivery use, check the national postal operator.