Postal Codes Dataset for Portugal, PT

Postal Codes Dataset for Portugal, PT including name of the city, town, or place, various administrative divisions and alternative city names.

Report an issue
Downloads
813
Last updated
Rows
206,942
Size
21.7 MB
Format
csv
License · +1 more
CC-BY-4.0

Data Files

1 file

postal-codes-pt-sample

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_code3 can be empty.
  • admin_code3 is a six-character DICOFRE code that can contain letters (for example 0302FA).
  • 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

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.

  1. Fetch datapackage.yaml to inspect schema and resources
  2. Download data resources listed in datapackage.yaml
  3. Read README.md for full context
/logistics/postal-codes-pt/3 files
  • ATTRIBUTION.txthttps://datahub.io/logistics/postal-codes-pt/_r/-/ATTRIBUTION.txt
  • README.mddocumentationhttps://datahub.io/logistics/postal-codes-pt/_r/-/README.md
  • datapackage.yamlmetadata & schemahttps://datahub.io/logistics/postal-codes-pt/_r/-/datapackage.yaml