API — Libya (LY)

3 regions, 22 districts, 104 baladiyas, 1,165 muhallas.

Endpoints

GET /api/v1/countries/ly.json
Full dataset — all levels, all records
GET /api/v1/ly/region.json
All 3 regions (إقليم)
GET /api/v1/ly/district.json
All 22 districts (شعبية)
GET /api/v1/ly/baladiya.json
All 104 baladiyas (بلدية)
GET /api/v1/ly/muhalla.json
All 1,165 muhallas (محلة)
GET /api/v1/ly/region/{slug}.json
Single region with children
Example: /api/v1/ly/region/east-ly01.json

Quick Start

JavaScript

fetch('https://openadmindata.org/api/v1/countries/ly.json')
  .then(r => r.json())
  .then(data => {
    const levels = data.meta.levels.map(l => l.name_en);
    console.log('Libya:', levels.join(' → '));
    
    console.log(data.data.region.length, 'regions');
  });

Python

import requests
data = requests.get('https://openadmindata.org/api/v1/countries/ly.json').json()
regions = data['data']['region']
print(f"Libya: {len(regions)} regions")

cURL

curl -s https://openadmindata.org/api/v1/ly/region.json | jq '.count'

Schema

Each entity record contains:

FieldTypeDescription
idstringUnique identifier
name_localstringName in local script
name_enstringEnglish / romanized name
slugstringURL-safe slug
latnumberLatitude (WGS84)
lonnumberLongitude (WGS84)
parent_idstring?Parent entity ID (null for top level)
parent_name_localstring?Parent name in local script
parent_name_enstring?Parent English name
postal_codestring?Postal code (deepest level only, where available)