UNPKG

geoalgeria

Version:

69 wilayas, 551 dairas, 1541 communes of Algeria: bilingual names, postal codes, coordinates, plus 3908 post offices & 2026 ATMs. JSON, CSV, GeoJSON, SQL, TypeScript.

332 lines (234 loc) • 22.7 kB
**English** | [Français](README.fr.md) | [العربية](README.ar.md) # GeoAlgeria > The Algerian geodata package, 69 wilayas, 551 dairas, 1,541 communes. One `npm install` away. Still copy-pasting wilaya lists from PDFs? Still using datasets stuck at 48 wilayas? GeoAlgeria is the first CI-validated, npm-installable Algerian geodata, updated for the 2026 reform. JSON, CSV, GeoJSON, SQL, TypeScript. [![CI](https://github.com/yasserstudio/geoalgeria/actions/workflows/ci.yml/badge.svg)](https://github.com/yasserstudio/geoalgeria/actions/workflows/ci.yml) [![npm](https://img.shields.io/npm/v/geoalgeria)](https://www.npmjs.com/package/geoalgeria) [![npm downloads](https://img.shields.io/npm/dm/geoalgeria)](https://www.npmjs.com/package/geoalgeria) [![License: see LICENSE](https://img.shields.io/badge/License-MIT%20code%2C%20mixed%20data-green.svg)](LICENSE) --- ## Quick Facts Algeria has **69 wilayas** (provinces) and **1,541 communes** (municipalities), official since **April 2026**, each wilaya divided into dairas (districts). This reflects two territorial reforms: Law 19-12 (2019, added wilayas 49–58) and Law n° 26-06 of 4 April 2026 (adding wilayas 59–69), published in the [*Journal Officiel* n° 25 of 5 April 2026](https://www.joradp.dz/FTP/jo-francais/2026/F2026025.pdf). GeoAlgeria models all 69 post-reform wilayas with postal codes, GPS coordinates, and bilingual names. This release ships all **1,541 commune records** and **551 dairas in the dataset**. That is this dataset's own count, not an official total: no post-2026 national daira total has been published (decree 26-206 of 25 May 2026 names the chefs-lieux only), and the 564 this README used to call official included 9 phantom dairas produced by 13 duplicate commune records, as the [changelog](CHANGELOG.md) records for v1.1.2. Last validated: September 2026. **142 of the 551 are settled by decree.** Executive decree n° 26-253 of 15 July 2026, published in the *Journal Officiel* n° 52 of 21 July 2026, fixes the communes each daira chief administers in wilayas 3, 5, 7, 12, 13, 14, 17, 26, 28, 32 and 59–69, and names 142 dairas there. It leaves the other 48 wilayas under decree n° 91-306 of 24 August 1991, whose lists this dataset holds and which come to 409. The reading of the annex is in [`research/_dairas/`](../../research/_dairas/). --- ## Why GeoAlgeria? Tired of datasets that still think Algeria has 48 wilayas? Same. | Feature | geoalgeria | leblad | algeria-cities | |---------|:-:|:-:|:-:| | All 69 wilayas (2026 reform) | ✅ | ❌ (58) | ✅ | | Dairas as first-class entities | ✅ | ❌ | ❌ | | Postal codes per commune | ✅ | ✅ | ❌ | | Coordinates per commune | ✅ | ❌ | ✅ | | E-commerce ready (flat, denormalized) | ✅ | ❌ | ❌ | | Delivery zone templates | ✅ | ❌ | ❌ | | npm package + TypeScript | ✅ | ✅ | ❌ | | SQL dump (MySQL/PG/SQLite) | ✅ | ❌ | ✅ | | CI-validated on every commit | ✅ | ❌ | ❌ | | GeoJSON export | ✅ | ❌ | ✅ | | Arabic + French bilingual | ✅ | ✅ | ✅ | | Last updated | 2026 | 2021 | 2023 | Ready to try it? Jump to [Install](#install) or grab the [raw JSON](data/ecommerce/communes.json) directly. Also referred to as: Algerian provinces (wilayas), districts (dairas), municipalities (communes), cities of Algeria, code postal Algérie, liste des communes d'Algérie JSON, Algeria GeoJSON, wilayas 2026, base de données wilayas Algérie, Algeria administrative divisions dataset. --- ## Who's This For? - **E-commerce devs** – address forms, shipping zone config, postal code validation - **Backend engineers** – seed your DB with one SQL file - **Frontend devs** – cascading dropdowns (wilaya → daira → commune) - **GIS / data analysts** – GeoJSON with 1,541 point features - **Civic tech builders** – government apps, citizen portals - **Students & researchers** – clean, structured, well-documented data --- ## Install ```bash npm install geoalgeria ``` ```javascript const dz = require('geoalgeria'); // or, in an ESM app or with a bundler: import dz from 'geoalgeria'; dz.wilayas; // all 69 wilayas dz.communes; // all 1,541 communes dz.dairas; // all 551 dairas dz.ecommerce; // flat dataset for address forms dz.postOffices; // 3,908 Algérie Poste offices dz.atms; // 2,026 ATMs dz.getWilaya(16); // { name_fr: "Alger", name_ar: "الجزائر", ... } dz.getCommunesByWilaya(16); // 57 communes in Algiers dz.getDairasByWilaya(16); // dairas in Algiers dz.findCommune('Oran'); // search by name (FR or AR, Former names too) dz.findByPostalCode('16000'); // lookup by postal code dz.getPostOfficesByCommune(1731); // post offices in a commune (by code_commune) ``` TypeScript types included out of the box. The default import needs `esModuleInterop`, because the package is CommonJS; `import dz = require('geoalgeria')` works without it. A bundler (Next.js, Vite, webpack) includes all ten JSON files, the post office and ATM mirrors among them. If you need one part only, import its file on its own: `import communes from 'geoalgeria/data/ecommerce/communes.json'` in a bundler, or with `with { type: 'json' }` in plain Node. **Using this in production?** [Tell us about it](https://github.com/yasserstudio/geoalgeria/discussions), we feature community projects in the README. --- ## Use Without npm ### CDN (no install needed) ```html <script> fetch('https://cdn.jsdelivr.net/npm/geoalgeria/data/ecommerce/communes.json') .then(r => r.json()) .then(communes => { /* build your dropdown */ }); </script> ``` ### E-commerce / address forms Grab `data/ecommerce/communes.json`, flat, denormalized, no joins: ```json { "id": 541, "commune_name_fr": "Aïn El Ibel", "commune_name_ar": "عين الإبل", "daira_name_fr": "Aïn El Ibel", "wilaya_code": 17, "wilaya_name_fr": "Djelfa", "wilaya_name_ar": "الجلفة", "postal_code": "17011" } ``` A postal code is the code of the commune's principal Algérie Poste office, and its first two digits are that office's wilaya at the time the code was issued. Like `code_commune`, the prefix does not necessarily equal `wilaya_code`: Algérie Poste kept the old numbering through the 2026 reform, so Aflou is `03001` in wilaya 59. 108 of the 1,540 coded communes are in that case, all of them in wilayas 59–69. ### Database seeding Download `data/sql/full.sql` from this repo, then: ```bash # PostgreSQL psql -d mydb -f full.sql # MySQL mysql mydb < full.sql # SQLite sqlite3 mydb.sqlite < full.sql ``` ### GIS / Mapping Download `data/geojson/communes.geojson` from this repo, standard GeoJSON, works with Leaflet, Mapbox, QGIS, etc. > **Note:** the npm package ships **JSON, CSV, GeoJSON and SQL** since the v2 correctness pass, so `data/geojson/communes.geojson` is in the tarball too. The [GitHub Release](https://github.com/yasserstudio/geoalgeria/releases) zip bundles the same `data/` tree for people who do not use npm. --- ## All Files | File | Format | Records | Best for | |------|--------|---------|----------| | `data/algeria.json` | JSON | 69 wilayas + communes | Single-file usage | | `data/wilayas.json` | JSON | 69 | Wilaya list only | | `data/dairas.json` | JSON | 551 | Daira list with commune counts | | `data/name-history.json` | JSON | 210 | Former spellings of wilaya and commune names, with the text that replaced each | | `data/phone-code-provenance.json` | JSON | 11 | Why wilayas 59–69 carry the `phone_code` they carry: the official texts searched and the reason for each `null` | | `data/wilaya-capitals.metadata.json` | JSON | 69 | The chef-lieu of each wilaya, with the decree, article, item and page that fixes it | | `data/osm-links.metadata.json` | JSON | 1 | Coverage, tiers, join rule and Overpass snapshots behind `osm_relation_id` / `wikidata` | | `data/communes_w*.json` | JSON | 1,541 | Detailed commune data | | `data/csv/wilayas.csv` | CSV | 69 | Spreadsheets, imports | | `data/csv/communes.csv` | CSV | 1,541 | Spreadsheets, imports | | `data/geojson/wilayas.geojson` | GeoJSON | 69 | Maps, GIS | | `data/geojson/communes.geojson` | GeoJSON | 1,541 | Maps, GIS | | `data/sql/full.sql` | SQL | 69 + 1,541 | Normalized database | | `data/ecommerce/communes.json` | JSON | 1,541 | Address forms, dropdowns | | `data/ecommerce/communes.csv` | CSV | 1,541 | Flat import | | `data/ecommerce/communes.sql` | SQL | 1,541 | Single-table database | | `data/delivery/*.json` | JSON | 69 per provider | Shipping zone calculation | | `data/poste/postoffices.json` | JSON | 3,908 | Post offices (real codes, coords) | | `data/poste/atms.json` | JSON | 2,026 | ATM locations | | `data/poste/csv/*`, `data/poste/geojson/*` | CSV/GeoJSON | – | Postal data for spreadsheets / maps | > `data/poste/` is sourced from [Algérie Poste](https://baridimap.poste.dz). `commune_code` is normalized to join each commune's `code_commune`; `source_commune_code` preserves a differing provider-native value. `code_commune` is the unique `WWCC` identifier from the [ONS 2021 Code Géographique National](https://www.ons.dz/IMG/pdf/code_geo_2021.pdf). Communes promoted into wilayas 59–69 retain their 2021 mother-wilaya prefix. Each wilaya carries `capital_commune_code`, the `code_commune` of its capital (chef-lieu), so the capital's names are read from the commune record, and its postal code and coordinates are mirrored on the wilaya: a wilaya's `postal_code` is its chef-lieu's own code, which is why wilaya 59 reads `03001` and not a code of its own. It comes from the decrees that fix the chefs-lieux (n° 84-79 of 1984, n° 21-117 of 2021, n° 26-206 of 2026), never from the wilaya's name, which gets 4 of 69 wrong. Per-wilaya sources: [`data/wilaya-capitals.metadata.json`](data/wilaya-capitals.metadata.json). Every commune and wilaya also carries `osm_relation_id` and `wikidata`: the OpenStreetMap administrative relation this record is linked to (`admin_level=8` for a commune, `admin_level=4` for a wilaya) and that relation's own Wikidata item, so a consumer joins to OpenStreetMap or Wikidata without matching on a name. 1,540 of the 1,541 communes and all 69 wilayas carry a relation; 1,538 communes and all 69 wilayas carry a Wikidata item. Nothing is guessed: the linkage is the one the commune-centre audit decided on the relation's `ref:ONS` / `ref` tag, Overpass `timestamp_osm_base` 2026-09-29T12:54:47Z, plus a second tier of three communes whose relation carries the right `ref:ONS` code under non-standard tags and was therefore invisible to that audit's query; a relation with no `wikidata` tag leaves that field null, and the one commune with no commune relation at all (4703) keeps both fields null. The item is the relation's own tag in every case bar one: commune 3424's relation is tagged with a village inside the commune, so that field is null and the exclusion is recorded in the sidecar rather than the wrong item published. The two ids are on the JSON records (`data/algeria.json`, `data/communes_w*.json`, `data/wilayas.json`); the CSV, GeoJSON and SQL mirrors do not carry them. Coverage, the join rule and the records with no link: [`data/osm-links.metadata.json`](data/osm-links.metadata.json). Both values are OpenStreetMap-derived, so **ODbL 1.0, © OpenStreetMap contributors** (see `NOTICE`). ## Schema See [`data/README.md`](data/README.md) for full field documentation. --- ## Contributing See [CONTRIBUTING.md](https://github.com/yasserstudio/geoalgeria/blob/main/CONTRIBUTING.md). We welcome: - Data corrections (with official sources) - Commune-code corrections backed by an official source - Delivery zone data from real carrier accounts (Yalidine, ZR Express, Maystro) - New export formats (XML, YAML, PHP arrays, etc.) - Translations and transliteration fixes **First time contributing?** Look for issues labeled `good first issue`, many just need adding coordinates for a single commune. --- ## Versioning This dataset uses [Semantic Versioning](https://semver.org/). See [CHANGELOG.md](CHANGELOG.md). --- ## The GeoAlgeria ecosystem `geoalgeria` is the administrative base layer. Domain datasets install alongside it and join on `wilaya_code`: | Package | What | | --- | --- | | [`@geoalgeria/poste`](https://www.npmjs.com/package/@geoalgeria/poste) | Post offices & ATMs (Algérie Poste) | | [`@geoalgeria/emploi`](https://www.npmjs.com/package/@geoalgeria/emploi) | Employment agencies (ANEM: AWEM + ALEM) | | [`@geoalgeria/mobilis`](https://www.npmjs.com/package/@geoalgeria/mobilis) | Mobilis agencies & approved points of sale | | [`@geoalgeria/telecom`](https://www.npmjs.com/package/@geoalgeria/telecom) | Cross-operator 5G coverage (Djezzy, Mobilis, Ooredoo) | | [`@geoalgeria/aviation`](https://www.npmjs.com/package/@geoalgeria/aviation) | Civil airports with ICAO codes (ANAC) | | [`@geoalgeria/banques`](https://www.npmjs.com/package/@geoalgeria/banques) | Licensed banks, institutions & branches (RIB/SWIFT) | | [`@geoalgeria/livraison`](https://www.npmjs.com/package/@geoalgeria/livraison) | Delivery carriers & geocoded stop-desks | | [`@geoalgeria/jeunesse`](https://www.npmjs.com/package/@geoalgeria/jeunesse) | Youth & sports institutions (Ministry of Youth and Sports) | | [`@geoalgeria/enseignement-superieur`](https://www.npmjs.com/package/@geoalgeria/enseignement-superieur) | Higher-education network – universities, grandes écoles, ENS, centres (MESRS) | | [`@geoalgeria/tourisme`](https://www.npmjs.com/package/@geoalgeria/tourisme) | Tourism infrastructure – hotels, attractions, historic sites, thermal springs, parks (ASAL, OSM, Wikidata) | | [`@geoalgeria/formation-professionnelle`](https://www.npmjs.com/package/@geoalgeria/formation-professionnelle) | Vocational training – CFPA, INSFP, IFEP, private centers (MFEP / takwin.dz) | | [`@geoalgeria/sports`](https://www.npmjs.com/package/@geoalgeria/sports) | Sports facilities – stadiums, pools, courts, tracks (Ministry of Youth and Sports) | | [`@geoalgeria/djezzy`](https://www.npmjs.com/package/@geoalgeria/djezzy) | Djezzy boutiques – geocoded retail stores with category & hours (djezzy.dz) | | [`@geoalgeria/mosquees`](https://www.npmjs.com/package/@geoalgeria/mosquees) | Mosques – Wikidata + OpenStreetMap composite, bilingual, all 69 wilayas | | [`@geoalgeria/sante`](https://www.npmjs.com/package/@geoalgeria/sante) | Public health establishments – EPH, EPSP, EHS, CHU (Ministry of Health), bilingual, geocoded via OSM + Wikidata | | [`@geoalgeria/cliniques`](https://www.npmjs.com/package/@geoalgeria/cliniques) | Clinics & proximity-care facilities – 1,917 polycliniques, salles de soins, centres de santé, maternités & private clinics from OpenStreetMap, classified by type, bilingual, 66 wilayas | | [`@geoalgeria/culture`](https://www.npmjs.com/package/@geoalgeria/culture) | Cultural atlas – protected sites, museums, theatres, libraries + cultural establishments (Ministry of Culture), bilingual, fully geocoded | | [`@geoalgeria/agriculture`](https://www.npmjs.com/package/@geoalgeria/agriculture) | Agriculture-sector institutions – services directorates (DSA), forest conservations, research/training institutes, chambers of agriculture, public offices & groups (Ministry of Agriculture), bilingual, geocoded | | [`@geoalgeria/ecoles`](https://www.npmjs.com/package/@geoalgeria/ecoles) | Schools – 11,858 primaires, CEM, lycées & préscolaires classified by cycle, bilingual, all 69 wilayas (OpenStreetMap) | | [`@geoalgeria/gares-routieres`](https://www.npmjs.com/package/@geoalgeria/gares-routieres) | Intercity bus stations – 74 SOGRAL gares routières across 52 wilayas, geocoded with surfaces & commune/wilaya linkage | | [`@geoalgeria/ferroviaire`](https://www.npmjs.com/package/@geoalgeria/ferroviaire) | Rail & urban transit – 692 train/tram/metro/aerial-tramway/gondola nodes (SNTF/SETRAM/SEMA), Wikidata + OpenStreetMap composite, bilingual | | [`@geoalgeria/buses`](https://www.npmjs.com/package/@geoalgeria/buses) | Urban bus networks – 50 ETUSA (Alger) lines with termini, stop counts, communes & stations served (line-level v1) | | [`@geoalgeria/industrie-pharmaceutique`](https://www.npmjs.com/package/@geoalgeria/industrie-pharmaceutique) | Pharmaceutical manufacturers – 171 approved medicine & medical-device makers from the Ministry of Pharmaceutical Industry register, bilingual, geocoded | | [`@geoalgeria/pharmacies`](https://www.npmjs.com/package/@geoalgeria/pharmacies) | Pharmacies (officines) – 3,797 geocoded across 67 wilayas from OpenStreetMap, bilingual where named | | [`@geoalgeria/ooredoo`](https://www.npmjs.com/package/@geoalgeria/ooredoo) | Ooredoo stores – 572 EO / City Shop / Espace Services with real coordinates; completes the telecom retail trio | | [`@geoalgeria/transport`](https://www.npmjs.com/package/@geoalgeria/transport) | Transport umbrella – installs aviation + ferroviaire + gares-routieres + buses in one step | | [`@geoalgeria/pharma`](https://www.npmjs.com/package/@geoalgeria/pharma) | Pharma umbrella – installs industrie-pharmaceutique + pharmacies in one step | | [`@geoalgeria/protection-civile`](https://www.npmjs.com/package/@geoalgeria/protection-civile) | Civil protection / fire & rescue units – 880 DGPC units across all wilayas with Arabic names, address/phone/fax & a status tier, geocoded, post-2026-reform wilaya linkage | Full list and the monorepo: [github.com/yasserstudio/geoalgeria](https://github.com/yasserstudio/geoalgeria). --- ## Built With This Data Using geoalgeria in your project? [Open a discussion](https://github.com/yasserstudio/geoalgeria/discussions) and we'll feature it here. --- ## Support Every star helps the next Algerian developer find clean data instead of broken PDFs. **[Star this repo](https://github.com/yasserstudio/geoalgeria)** if it saved you time. Found wrong data? [Open an issue](https://github.com/yasserstudio/geoalgeria/issues/new/choose), we fix it within 48h, guaranteed. --- ## Sponsor GeoAlgeria is free: MIT code and an MIT compilation, with three ODbL parts and the mirrored Algérie Poste data named below. If it saves you time, [**sponsor its maintenance**](https://github.com/sponsors/yasserstudio), sponsorships fund keeping the data current through every reform and expanding GeoAlgeria toward *all* kinds of open Algeria data. --- ## Preview View all 69 wilayas on a map: [`algeria.geojson`](algeria.geojson) (GitHub renders this automatically) --- ## FAQ **How many wilayas does Algeria have in 2026?** 69. The original 48, plus 10 added in 2019 (Law 19-12), plus 11 made official in April 2026 ([Law n° 26-06, *Journal Officiel* n° 25 of 5 April 2026](https://www.joradp.dz/FTP/jo-francais/2026/F2026025.pdf)). Transition period ends December 31, 2026; full autonomy from January 1, 2027. **Where can I find a list of all Algerian communes in JSON?** Right here, `data/ecommerce/communes.json` has all 1,541 communes in a flat, ready-to-use format. **What are the new wilayas added in 2026?** Wilayas 59-69 (numbered by mother wilaya code order): 59 Aflou (from Laghouat), 60 Barika (from Batna), 61 El Kantara (from Biskra), 62 Bir El Ater (from Tébessa), 63 El Aricha (from Tlemcen), 64 Ksar Chellala (from Tiaret), 65 Aïn Ouessara (from Djelfa), 66 Messaad (from Djelfa), 67 Ksar El Boukhari (from Médéa), 68 Bou Saâda (from M'Sila), 69 El Abiodh Sidi Cheikh (from El Bayadh). **How can I get Algeria postal codes in JSON format?** Install `geoalgeria` via npm or download `data/ecommerce/communes.json` directly. It maps commune names in French and Arabic to their postal codes across all 1,541 communes (1 has no citable code yet). **What is the best Algeria geodata package for developers?** GeoAlgeria is the most complete option as of 2026, it is the only npm package with all 69 wilayas, postal codes, coordinates, dairas, and delivery zone templates in one install. CI-validated on every commit. **Where can I find the 2026 list of Algeria's wilayas?** GeoAlgeria carries all 69 wilayas with French and Arabic names, postal codes, and GPS coordinates. Available as JSON, CSV, GeoJSON, and SQL. `npm install geoalgeria` --- ## Licence & attribution Package **code** is [MIT](LICENSE), and so is the **compilation**: wilayas, dairas, communes, their bilingual names, postal codes and administrative codes. Free for personal and commercial use. Three parts of the data come from **OpenStreetMap**, are **© OpenStreetMap contributors** and are licensed under the **[ODbL 1.0](https://opendatacommons.org/licenses/odbl/1-0/)** instead: - the 69 wilaya boundary polygons in `data/geojson/wilaya-boundaries.geojson`; - 323 of the 1,541 commune centre coordinates, each taken from that commune's own `admin_level=8` relation (318 from its `admin_centre` node, 56 on 2026-09-27, 189 on 2026-09-29, 5 on 2026-10-01 and 68 on 2026-10-01 by the coordinate review, which writes a value only where independent sources vote for it, and 5 from the relation centroid in 2.1.0), wherever those values appear; - 6 of the 69 wilaya capital points, which are the same values again: a wilaya's coordinates are the centre of its capital commune, so wilayas 7, 16, 25, 32, 52 and 61 carry one of the coordinates above. The other 63 wilaya capital points are not OpenStreetMap-derived. If you use or redistribute any of those parts you must **attribute OpenStreetMap contributors** and keep derived databases under a compatible licence. The mirrored postal data under `data/poste/` carries **Algérie Poste's** own terms, not the MIT License: **Data © Algérie Poste; redistributed for reference**, the same terms [`@geoalgeria/poste`](https://www.npmjs.com/package/@geoalgeria/poste) states. Verify against Algérie Poste for authoritative, real-time information. Because the data is under three sets of terms, the manifest declares `SEE LICENSE IN LICENSE` rather than an SPDX expression. Per-part attribution and the affected rows are in [NOTICE](NOTICE). Made with care by [Yasser's studio](https://yasser.studio) | [geoalgeria.com](https://geoalgeria.com) [API docs & field reference →](https://geoalgeria.com/data/docs/geoalgeria) · [Browse all packages →](https://geoalgeria.com/data) --- Made by [Yasser's studio](https://yasser.studio) · [LinkedIn](https://www.linkedin.com/in/yasserberrehail/) · [X](https://x.com/yassersstudio) · [support@yasser.studio](mailto:support@yasser.studio) GeoAlgeria is free, and it stays free. The same studio also makes maps, websites, mobile apps and open data for clients.