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 International 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-ma-sample
| Field | Type | Description | Constraints | Title |
|---|---|---|---|---|
| country_code | string | ISO 3166-1 alpha-2 -- always MA | Country Code | |
| postal_code | string | Moroccan postal code (5 digits) | { "pattern": "^\\d{5}$" } | Postal Code |
| place_name | string | Locality name | Place Name | |
| admin_name1 | string | Region -- 12/12 covered | Administrative Name 1 | |
| admin_code1 | string | ISO 3166-2:MA region code (MA-01 .. MA-12) | Administrative Code 1 | |
| admin_name2 | string | Province/prefecture name (59 distinct) -- as supplied by GeoNames; Morocco has no official numeric code at this tier | Administrative Name 2 | |
| admin_code2 | string | GeoNames-internal identifier, NOT an official Moroccan province code -- Morocco's ISO 3166-2:MA register defines codes only at region (admin_code1) level | Administrative Code 2 | |
| admin_name3 | string | Not populated -- no locality/community tier in this source | Administrative Name 3 | |
| admin_code3 | string | Not populated | Administrative Code 3 | |
| latitude | number | GeoNames latitude (WGS84) | Latitude | |
| longitude | number | GeoNames longitude (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 | Not populated in this release | Alternative City Name |
Download
Download sample CSVAbout
- Last updated
- 2 October 2026
- Total rows
- 100
- Format
- CSV
- File size
- 9.2 kB
About this dataset
Postal Codes Dataset for Morocco (MA)
This dataset lists Moroccan postal codes with place names, regions, provinces and prefectures, and coordinates, across every region, with ISO 3166-2:MA region codes.
Column definitions, row count, size and last-updated date are in datapackage.yaml.
Data Sources
- Postal codes, place names, administrative divisions and coordinates: © GeoNames postal code export for Morocco, CC BY 4.0.
Changes made to the source data: region codes (admin_code1) given as ISO 3166-2:MA (the MA- prefix added to GeoNames' own two-digit region codes); other values copied as supplied.
Not endorsed by, or affiliated with, GeoNames.
See ATTRIBUTION.txt for the full attribution notice.
Known limitations
admin_code2is a GeoNames-internal identifier, not an official Moroccan province or prefecture code. ISO 3166-2:MA defines codes only at the region level, so there is no official code to substitute. The value is retained for joins but should not be treated as authoritative.- Disputed territory: some rows are localities inside Western Sahara (
admin_code1MA-11 Laayoune-Sakia El Hamra, or MA-12 Dakhla-Oued Ed-Dahab), a territory whose sovereignty is internationally disputed. They are filed under ordinary Moroccan region and postal codes with no separate marker, as GeoNames and Barid Al-Maghrib both treat them. This dataset carries that treatment through unchanged and takes no position on sovereignty. admin_name3,admin_code3andalternative_city_nameare empty.
Usage
The dataset files are available in CSV format and can be accessed and downloaded using
the links provided in datapackage.yaml. Read admin_code2 as text, never as a number: it keeps its leading zeros.
For other inquiries, contact datahub@datopian.com