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 — GeoNames (postal codes, place names, administrative names, coordinates, alternative names) 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-pt-sample
| Field | Type | Description | Constraints | Title |
|---|---|---|---|---|
| country_code | string | ISO 3166-1 alpha-2 country code — always PT | { "pattern": "^PT$", "required": true } | Country Code |
| postal_code | string | Portuguese postal code, formatted 'NNNN-NNN' | { "pattern": "^\\d{4}-\\d{3}$", "required": true } | Postal Code |
| place_name | string | Place / locality / street segment name for the postal code | Place Name | |
| admin_name1 | string | District (Distrito) or autonomous region name | Administrative Name 1 | |
| admin_code1 | string | ISO 3166-2:PT code, prefix stripped (01-18, 20, 30) | Administrative Code 1 | |
| admin_name2 | string | Municipality (Concelho) name | Administrative Name 2 | |
| admin_code2 | string | Municipality code (distrito+concelho, 4 digits) | Administrative Code 2 | |
| admin_name3 | string | Parish / locality (Freguesia) name | Administrative Name 3 | |
| admin_code3 | string | Official CAOP DICOFRE parish code: the 4-digit municipality code plus 2 characters (digits, or letters where a municipality has more than 99 parishes, e.g. 0302FA). Empty where neither the parish name nor the coordinate resolves it — see README | Administrative Code 3 | |
| latitude | number | Latitude, decimal degrees (WGS84) | Latitude | |
| longitude | number | Longitude, decimal degrees (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 | Alternative or historic name for the place where known, from the GeoNames gazetteer | Alternative City Name |
Download
Download sample CSVAbout
- Last updated
- 6 October 2026
- Total rows
- 100
- Format
- CSV
- File size
- 8.33 kB
About this dataset
Postal Codes Dataset for Portugal (PT)
This dataset lists Portuguese postal codes (format NNNN-NNN) with place names, districts and regions
(ISO 3166-2:PT), concelhos and freguesias, and WGS84 coordinates.
Column definitions, row count, size and last-updated date are in datapackage.yaml.
Data Sources
- Postal codes, place names, administrative names and codes, and coordinates: © GeoNames, postal code export for Portugal, CC BY 4.0.
- Alternative city names: the GeoNames gazetteer for Portugal, same licence.
- Freguesia codes and names: Carta Administrativa Oficial de Portugal (CAOP 2025, DGT) with INE Censos 2021, republished by Aldeias Portuguesas, CC BY-SA 4.0.
Changes made to the source data: admin_code1 derived as the ISO 3166-2:PT code from the district or region
name (not GeoNames' own numbering); admin_code3 and admin_name3 replaced by the official CAOP freguesia
code and name, matched by name or by the point falling inside the freguesia polygon; alternative_city_name
added from the gazetteer.
Not endorsed by, or affiliated with, GeoNames, DGT, INE or Aldeias Portuguesas.
Known limitations
- GeoNames' own freguesia code is its own numbering, not the official DICOFRE code. Where a row could not be
matched to a CAOP freguesia, that code is cleared rather than kept, so
admin_code3can be empty. admin_code3is a six-character DICOFRE code that can contain letters (for example0302FA).- The primary key is (
postal_code,place_name).
Usage
The dataset files are available in CSV format and can be accessed and downloaded using
the links provided in datapackage.yaml. Read the administrative codes as text, never as numbers: they can
start with zero (0101).
For other inquiries, contact datahub@datopian.com