{"openapi":"3.1.0","info":{"title":"wilayas","version":"1.1.0","description":"Algeria's 69 wilayas, their daïras and 1,541 communes, from the official texts. Static files; data version 2026-10-09. Not an official government service.","license":{"name":"CC0-1.0 (data), MIT (code)","identifier":"CC0-1.0"}},"servers":[{"url":"https://wilayas.djazair.dev/v1"}],"tags":[{"name":"Index","description":"What the API holds, and its version"},{"name":"Wilayas","description":"The 69 wilayas of the 2026 division, one by one or all at once"},{"name":"Daïras","description":"The daïras, each coded by its seat"},{"name":"Communes","description":"The 1,541 communes"},{"name":"Changes","description":"What the 2026 division changed: wilayas created and communes moved"},{"name":"Sources","description":"The official texts and lists every record cites"},{"name":"Divisions","description":"The 58 wilayas of the 2019 division, and its communes"}],"externalDocs":{"description":"Source and documentation","url":"https://github.com/djazairdev/wilayas"},"paths":{"/index.json":{"get":{"summary":"Counts, versions, licences and the list of files","tags":["Index"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/index"}}}}}}},"/wilayas.json":{"get":{"summary":"The 69 wilayas","tags":["Wilayas"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/wilayas"}}}}}}},"/wilayas.csv":{"get":{"summary":"The 69 wilayas, as CSV","tags":["Wilayas"],"responses":{"200":{"description":"OK","content":{"text/csv":{"schema":{"type":"string"}}}}}}},"/wilayas/{code}.json":{"get":{"summary":"One wilaya, with its daïras and communes","tags":["Wilayas"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/wilaya"}}}},"404":{"description":"No such code"}},"parameters":[{"name":"code","in":"path","required":true,"description":"The wilaya code, 01 to 69","schema":{"$ref":"#/components/schemas/wilaya_code"},"example":"31"}]}},"/wilayas/{code}/communes.json":{"get":{"summary":"One wilaya's communes","tags":["Wilayas"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/communes"}}}},"404":{"description":"No such code"}},"parameters":[{"name":"code","in":"path","required":true,"description":"The wilaya code, 01 to 69","schema":{"$ref":"#/components/schemas/wilaya_code"},"example":"31"}]}},"/wilayas/{code}/communes.csv":{"get":{"summary":"One wilaya's communes, as CSV","tags":["Wilayas"],"responses":{"200":{"description":"OK","content":{"text/csv":{"schema":{"type":"string"}}}},"404":{"description":"No such code"}},"parameters":[{"name":"code","in":"path","required":true,"description":"The wilaya code, 01 to 69","schema":{"$ref":"#/components/schemas/wilaya_code"},"example":"31"}]}},"/wilayas/{code}/dairas.json":{"get":{"summary":"One wilaya's daïras","tags":["Wilayas"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dairas"}}}},"404":{"description":"No such code"}},"parameters":[{"name":"code","in":"path","required":true,"description":"The wilaya code, 01 to 69","schema":{"$ref":"#/components/schemas/wilaya_code"},"example":"31"}]}},"/dairas.json":{"get":{"summary":"All the daïras","tags":["Daïras"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dairas"}}}}}}},"/dairas.csv":{"get":{"summary":"All the daïras, as CSV","tags":["Daïras"],"responses":{"200":{"description":"OK","content":{"text/csv":{"schema":{"type":"string"}}}}}}},"/dairas/{code}.json":{"get":{"summary":"One daïra, with its communes","tags":["Daïras"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/daira"}}}},"404":{"description":"No such code"}},"parameters":[{"name":"code","in":"path","required":true,"description":"The daïra code: its seat's commune code","schema":{"$ref":"#/components/schemas/commune_code"},"example":"3101"}]}},"/communes.json":{"get":{"summary":"The 1,541 communes","tags":["Communes"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/communes"}}}}}}},"/communes.csv":{"get":{"summary":"The 1,541 communes, as CSV","tags":["Communes"],"responses":{"200":{"description":"OK","content":{"text/csv":{"schema":{"type":"string"}}}}}}},"/communes/{code}.json":{"get":{"summary":"One commune","tags":["Communes"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/commune"}}}},"404":{"description":"No such code"}},"parameters":[{"name":"code","in":"path","required":true,"description":"The commune code","schema":{"$ref":"#/components/schemas/commune_code"},"example":"3101"}]}},"/changes.json":{"get":{"summary":"The 2026 changes: wilayas created and communes moved","tags":["Changes"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/changes"}}}}}}},"/changes.csv":{"get":{"summary":"The 2026 changes: wilayas created and communes moved, as CSV","tags":["Changes"],"responses":{"200":{"description":"OK","content":{"text/csv":{"schema":{"type":"string"}}}}}}},"/texts.json":{"get":{"summary":"The official texts and lists cited","tags":["Sources"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/texts"}}}}}}},"/divisions/2019/wilayas.json":{"get":{"summary":"The 58 wilayas of the 2019 division","tags":["Divisions"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/division_wilayas"}}}}}}},"/divisions/2019/communes.json":{"get":{"summary":"The communes in their wilayas of the 2019 division","tags":["Divisions"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/division_communes"}}}}}}}},"components":{"schemas":{"index":{"title":"index","type":"object","additionalProperties":false,"required":["name","description","version","data_version","base_url","counts","licences","repository","files"],"properties":{"name":{"const":"wilayas"},"description":{"type":"string"},"version":{"type":"string","pattern":"^1\\.[0-9]+\\.[0-9]+$","description":"The API's version: the major one is in the path"},"data_version":{"$ref":"#/components/schemas/date"},"base_url":{"type":"string"},"counts":{"type":"object","additionalProperties":{"type":"integer"}},"licences":{"type":"object","additionalProperties":false,"required":["data","code"],"properties":{"data":{"const":"CC0-1.0"},"code":{"const":"MIT"}}},"repository":{"type":"string"},"files":{"type":"object","additionalProperties":{"type":"string"}}}},"wilayas":{"title":"wilayas","type":"object","additionalProperties":false,"required":["data_version","wilayas"],"properties":{"data_version":{"$ref":"#/components/schemas/date"},"wilayas":{"type":"array","items":{"$ref":"#/components/schemas/wilaya"}}}},"wilaya":{"type":"object","additionalProperties":false,"required":["code","iso_3166_2","name","slug","seat","named_by","defined_by","created","parent","administered_by","counts","aliases"],"properties":{"code":{"$ref":"#/components/schemas/wilaya_code"},"iso_3166_2":{"type":["string","null"],"pattern":"^DZ-[0-9]{2}$","description":"Null for 59 to 69 until ISO 3166-2 lists them"},"name":{"$ref":"#/components/schemas/name"},"slug":{"$ref":"#/components/schemas/slug"},"seat":{"anyOf":[{"$ref":"#/components/schemas/commune_code"},{"type":"null"}],"description":"The chef-lieu's commune; null for Algiers, whose chef-lieu is the city"},"named_by":{"$ref":"#/components/schemas/citation"},"defined_by":{"type":"object","additionalProperties":false,"required":["text","article","amended_by"],"description":"The article of Law 84-09 that lists its communes, and the latest text that wrote it","properties":{"text":{"const":"law-84-09"},"article":{"type":"string"},"amended_by":{"type":["string","null"]}}},"created":{"anyOf":[{"type":"null"},{"type":"object","additionalProperties":false,"required":["date","by"],"properties":{"date":{"$ref":"#/components/schemas/date"},"by":{"$ref":"#/components/schemas/citation"}}}],"description":"For 49 to 69: the date of the Journal officiel issue of the law that created it"},"parent":{"anyOf":[{"$ref":"#/components/schemas/wilaya_code"},{"type":"null"}],"description":"For 49 to 69: the wilaya it was made from"},"administered_by":{"anyOf":[{"type":"null"},{"type":"object","additionalProperties":false,"required":["wilaya","until","by"],"properties":{"wilaya":{"$ref":"#/components/schemas/wilaya_code"},"until":{"$ref":"#/components/schemas/date"},"by":{"$ref":"#/components/schemas/citation"}}}],"description":"For 59 to 69: the parent wilaya runs its services until the handover, at the latest"},"counts":{"type":"object","additionalProperties":false,"required":["dairas","communes"],"properties":{"dairas":{"type":"integer","minimum":0},"communes":{"type":"integer","minimum":1}}},"aliases":{"type":"array","items":{"$ref":"#/components/schemas/alias"}}}},"dairas":{"title":"dairas","type":"object","additionalProperties":false,"required":["data_version","dairas"],"properties":{"data_version":{"$ref":"#/components/schemas/date"},"dairas":{"type":"array","items":{"$ref":"#/components/schemas/daira"}}}},"daira":{"type":"object","additionalProperties":false,"required":["code","name","slug","wilaya","listed_by","counts","aliases"],"description":"A daïra, identified and named by its seat's commune","properties":{"code":{"$ref":"#/components/schemas/commune_code"},"name":{"$ref":"#/components/schemas/name"},"slug":{"$ref":"#/components/schemas/slug"},"wilaya":{"$ref":"#/components/schemas/wilaya_code"},"listed_by":{"$ref":"#/components/schemas/citation"},"counts":{"type":"object","additionalProperties":false,"required":["communes"],"properties":{"communes":{"type":"integer","minimum":1}}},"aliases":{"type":"array","items":{"$ref":"#/components/schemas/alias"}}}},"communes":{"title":"communes","type":"object","additionalProperties":false,"required":["data_version","communes"],"properties":{"data_version":{"$ref":"#/components/schemas/date"},"communes":{"type":"array","items":{"$ref":"#/components/schemas/commune"}}}},"commune":{"type":"object","additionalProperties":false,"required":["code","name","slug","wilaya","daira","wilaya_before","listed_by","names_from","previous_codes","aliases"],"properties":{"code":{"$ref":"#/components/schemas/commune_code"},"name":{"$ref":"#/components/schemas/name"},"slug":{"$ref":"#/components/schemas/slug"},"wilaya":{"$ref":"#/components/schemas/wilaya_code"},"daira":{"anyOf":[{"$ref":"#/components/schemas/commune_code"},{"type":"null"}]},"wilaya_before":{"anyOf":[{"type":"null"},{"type":"object","additionalProperties":false,"required":["wilaya","until","by"],"properties":{"wilaya":{"$ref":"#/components/schemas/wilaya_code"},"until":{"$ref":"#/components/schemas/date"},"by":{"$ref":"#/components/schemas/citation"}}}],"description":"For the 108 communes Law 26-06 moved: the wilaya they were in"},"listed_by":{"$ref":"#/components/schemas/citation"},"names_from":{"type":"object","additionalProperties":false,"required":["ar","fr"],"description":"The text each name comes from: the one cited, or ONS's list","properties":{"ar":{"type":"string"},"fr":{"type":"string"}}},"previous_codes":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","until"],"properties":{"code":{"$ref":"#/components/schemas/commune_code"},"until":{"$ref":"#/components/schemas/date"}}}},"aliases":{"type":"array","items":{"$ref":"#/components/schemas/alias"}}}},"changes":{"title":"changes","type":"object","additionalProperties":false,"required":["data_version","changes"],"properties":{"data_version":{"$ref":"#/components/schemas/date"},"changes":{"type":"array","items":{"$ref":"#/components/schemas/change"}}}},"texts":{"title":"texts","type":"object","additionalProperties":false,"required":["data_version","texts","lists"],"properties":{"data_version":{"$ref":"#/components/schemas/date"},"texts":{"type":"array","items":{"$ref":"#/components/schemas/text"}},"lists":{"type":"array","items":{"$ref":"#/components/schemas/list"}}}},"division_wilayas":{"title":"division-wilayas","type":"object","additionalProperties":false,"required":["data_version","wilayas"],"properties":{"data_version":{"$ref":"#/components/schemas/date"},"wilayas":{"type":"array","items":{"$ref":"#/components/schemas/division_wilaya"}}}},"division_communes":{"title":"division-communes","type":"object","additionalProperties":false,"required":["data_version","communes"],"properties":{"data_version":{"$ref":"#/components/schemas/date"},"communes":{"type":"array","items":{"$ref":"#/components/schemas/division_commune"}}}},"name":{"type":"object","additionalProperties":false,"required":["ar","fr"],"description":"As printed in the Arabic and the French editions of the text cited","properties":{"ar":{"type":"string","minLength":1},"fr":{"type":"string","minLength":1}}},"citation":{"type":"object","additionalProperties":false,"required":["text","article"],"description":"A place in a text of texts.json. In the daïra decrees, which list communes in tables, article is the wilaya whose table it is, and item the daïra and the commune (\"10/2\").","properties":{"text":{"type":"string","pattern":"^[a-z0-9-]+$"},"article":{"type":"string","minLength":1},"item":{"type":"string","minLength":1}}},"wilaya_code":{"type":"string","pattern":"^(0[1-9]|[1-5][0-9]|6[0-9])$"},"commune_code":{"type":"string","pattern":"^[0-9]{4}$"},"date":{"type":"string","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}$"},"slug":{"type":"string","pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"},"alias":{"type":"object","additionalProperties":false,"required":["lang","name","texts"],"properties":{"lang":{"enum":["ar","fr","en"]},"name":{"type":"string","minLength":1},"texts":{"type":"array","items":{"type":"string"},"description":"The texts that print it, oldest first"}}},"commune_summary":{"type":"object","additionalProperties":false,"required":["code","name","slug","daira"],"properties":{"code":{"$ref":"#/components/schemas/commune_code"},"name":{"$ref":"#/components/schemas/name"},"slug":{"$ref":"#/components/schemas/slug"},"daira":{"anyOf":[{"$ref":"#/components/schemas/commune_code"},{"type":"null"}]}}},"daira_summary":{"type":"object","additionalProperties":false,"required":["code","name","slug","communes"],"properties":{"code":{"$ref":"#/components/schemas/commune_code"},"name":{"$ref":"#/components/schemas/name"},"slug":{"$ref":"#/components/schemas/slug"},"communes":{"type":"integer","minimum":1}}},"change":{"type":"object","additionalProperties":false,"required":["date","type","subject","from","to","by"],"properties":{"date":{"$ref":"#/components/schemas/date","description":"The date of the Journal officiel issue"},"type":{"enum":["wilaya_created","commune_moved"]},"subject":{"type":"string","description":"The wilaya's or the commune's code"},"from":{"$ref":"#/components/schemas/wilaya_code"},"to":{"$ref":"#/components/schemas/wilaya_code"},"by":{"$ref":"#/components/schemas/citation"}}},"text":{"type":"object","additionalProperties":false,"required":["id","kind","number","signed","jo_number","jo_date","url_ar","url_fr","sha256_ar","sha256_fr"],"properties":{"id":{"type":"string"},"kind":{"enum":["law","ordinance","decree","presidential decree","executive decree"]},"number":{"type":"string"},"signed":{"$ref":"#/components/schemas/date"},"jo_number":{"type":"integer"},"jo_date":{"$ref":"#/components/schemas/date"},"url_ar":{"type":"string"},"url_fr":{"type":"string"},"sha256_ar":{"type":"string","pattern":"^[0-9a-f]{64}$"},"sha256_fr":{"type":"string","pattern":"^[0-9a-f]{64}$"}}},"list":{"type":"object","additionalProperties":false,"required":["id","title","published","url","sha256"],"description":"ONS's code géographique national","properties":{"id":{"type":"string"},"title":{"type":"string"},"published":{"type":"string"},"url":{"type":"string"},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"}}},"division_wilaya":{"type":"object","additionalProperties":false,"required":["code","name","slug","communes"],"properties":{"code":{"$ref":"#/components/schemas/wilaya_code"},"name":{"$ref":"#/components/schemas/name"},"slug":{"$ref":"#/components/schemas/slug"},"communes":{"type":"integer","minimum":1}}},"division_commune":{"type":"object","additionalProperties":false,"required":["code","name","slug","wilaya"],"properties":{"code":{"$ref":"#/components/schemas/commune_code"},"name":{"$ref":"#/components/schemas/name"},"slug":{"$ref":"#/components/schemas/slug"},"wilaya":{"$ref":"#/components/schemas/wilaya_code"}}}}}}
