Try to find a clean, machine-readable list of Algeria's communes with coordinates. I will wait.
What you get instead: a Wikipedia table that still says 48 provinces (Algeria has had 58 since 2019 and 69 since April 2026), a PDF from a ministry, a store-locator webpage that renders markers from a JSON blob it does not want you to read, and a national open-data portal whose domain does not resolve. There is no data.gov.dz that works. The official sources are real, but they are published as brochures, not as data.
So I packaged them. GeoAlgeria is now 15 npm packages, more than 55,000 records, every one joining on a single wilaya_code, shipped as JSON, CSV, GeoJSON and TypeScript types. Here is what it covers, and the honest story of how each piece got built, because the building is the interesting part.
The backbone: 69 wilayas, modeled through two reforms
Everything joins to the administrative divisions, so they had to be right.
Algeria reorganized twice in recent memory: Law 19-12 (2019) took the country from 48 to 58 wilayas, and Law 26-06 (2026) took it to 69. Most datasets online froze at 48. The flagship geoalgeria package models the current 69 wilayas, 555 dairas and 1,528 communes, with bilingual French and Arabic names, real postal codes and coordinates, and it treats dairas as first-class entities instead of flattening them.
npm install geoalgeria
import geoalgeria from "geoalgeria";
const communes = geoalgeria.communes(); // 1,528, with code_commune + wilaya_code
const wilayas = geoalgeria.wilayas(); // 69
That wilaya_code is the spine. Every other package joins to it.
The store locators that did not want to be read
Telecom operators publish their retail networks as maps. The maps are powered by data. The data is right there in the page, just inconvenient.
Mobilis sits behind an Imperva WAF. Hit its endpoints too fast unauthenticated and you get an HTML "Request Rejected" page instead of JSON, so the fetch script primes a cookie jar from the locator page, sends a referer, throttles, and re-primes on rejection rather than silently treating a block as an empty result. The payoff: 165 agencies (geocoded, bilingual) plus 12,180 approved points of sale.
Djezzy was friendlier in a stranger way. Its boutique list ships inline in the page as HTML-entity-encoded JSON. Decode the entities, pull the flat objects, and you have 128 geocoded stores with category, hours and an opening code. No API, no WAF, just "latitude":"27.87194" repeated 128 times.
Neither source carries administrative codes, only an address string and a coordinate pair. So both packages attach wilaya_code and commune by a nearest-centroid join against the flagship commune set. Wilaya assignment is effectively exact. Commune is best-effort, and the README says so.
The ministry GeoServer that was a goldmine
Sometimes a ministry quietly runs a real GIS. The Ministère de la Jeunesse et des Sports serves two public point layers from a GeoServer. Pulled as GeoJSON, cleaned and typed, those became two packages in one afternoon: 5,141 sports facilities (27 types, with capacity, accessibility and operational status) and 2,334 youth establishments. When you find one of these, you mine it completely, because the next source rarely cooperates.
The dataset that had no geography at all
The higher-education package was the opposite problem. The ministry publishes a page of institution names and website links. Zero coordinates. The geography did not exist, so I built it: matched each institution to a location and geocoded it.
Automated geocoding lies confidently. It placed the École Nationale Polytechnique in Constantine and the Université de la Formation Continue in Tipaza. Both are in Algiers. You only catch that by knowing the country, spot-checking against the ground truth, and correcting by hand. The lesson that repeats across this whole project: a geocoder gives you coordinates, not correctness.
The mosques that were hiding in Wikidata
Here is the one that flips the premise of this whole article.
People repeat that Algeria has no open geocoded data. While building a mosque dataset, I ran a Wikidata SPARQL query almost as a formality:
SELECT ?item ?coord WHERE {
?item wdt:P31/wdt:P279* wd:Q32815 . # instance of (a subclass of) mosque
?item wdt:P17 wd:Q262 . # in Algeria
?item wdt:P625 ?coord . # with coordinates
}
It returned roughly 19,000 mosques, geocoded, all inside the country, almost all labeled, under a public-domain (CC0) license. That is near the official national count. The registry everyone says does not exist was sitting in Wikidata the whole time. It just was not packaged for a developer to npm install.
I used Wikidata as the base and merged OpenStreetMap on top: any OSM mosque within about 150 meters of a Wikidata one is treated as the same place and lends its French name and denomination, while OSM mosques with no match become their own records. The result is @geoalgeria/mosquees: 20,759 mosques across all 69 wilayas, 15,138 Arabic names, 7,874 French, with source, wikidata QID and osm_id provenance on every record.
import mosquees from "@geoalgeria/mosquees";
const all = mosquees.mosquees(); // 20,759
const inAlgiers = all.filter(m => m.wilaya_code === "16");
It is a community composite, not an official registry, and the metadata says exactly that, framed against the ~18,449 the ministry counts. Which brings me to the part that matters more than the count.
Shipping what is real, labeling what it is
Open data is only useful if you can trust it, so two things are non-negotiable.
A validation gate runs on every commit. For each dataset, CI checks that the record count matches the metadata, that the CSV row count and the GeoJSON feature count both reconcile, that there are zero duplicate ids, that every wilaya_code is an integer in [1, 69], and that required identity fields are present on every record. A dataset that drifts does not merge.
Every package states its limits. Telecom is operator-published 5G presence points, not measured RF coverage. Points of sale are commune-level, not geocoded. Mosques are a composite, not an official list. Commune linkage from coordinates is nearest-centroid, not polygon containment. None of that is hidden in a footnote. The motto is install it, do not scrape it, and ship what is real, label what it is.
What is actually inside
Fifteen packages, one join key:
- Administrative divisions (69 wilayas, 555 dairas, 1,528 communes)
- Algérie Poste offices and ATMs, ANEM employment agencies
- Mobilis and Djezzy retail networks, cross-operator 5G coverage
- Banks and 1,704 branches, ANAC civil airports, delivery carriers and stop-desks
- Youth establishments, sports facilities, higher education, vocational training, tourism
- And 20,759 mosques
Everything ships JSON for a light npm footprint, with CSV, GeoJSON and SQL riding in each GitHub release, and TypeScript types throughout.
The takeaway
"This country has no open data" is usually wrong. The data exists. It is trapped in PDFs, behind WAFs, inside store-locator webpages, and, more often than people check, already structured in Wikidata and OpenStreetMap. The missing layer was never the data. It was someone packaging it, joining it on one stable key, validating it on every commit, and being honest about what it is and is not.
If you build anything touching Algeria, it is one install away.
npm install geoalgeria
- npm: https://www.npmjs.com/package/geoalgeria
- GitHub: https://github.com/yasserstudio/geoalgeria
- Docs and the full package list: https://geoalgeria.com/data
If you spot a wrong coordinate, open an issue. Knowing the country is the one thing a geocoder cannot do.
Top comments (1)
This is fascinating! How did you handle the initial