Logo Lanfrica

Web-learning/south-africa-district-api

Domaine:

geospatial

Type de record:

dataset
Créateur:
Web
Hôte:
REST API and GeoJSON dataset for all South African District and Metropolitan Municipalities. # South Africa District API A lightweight REST API and GeoJSON dataset for South Africa's **52 Metropolitan and District Municipalities**. The project combines official municipality information with OpenStreetMap, Wikidata and Statistics South Africa into a single developer-friendly API. --- ## Features - 🇿🇦 52 District & Metropolitan Municipalities - 📍 Administrative headquarters - 🗺 GeoJSON boundaries - 🌍 OSM Relation IDs - 🧭 Wikidata IDs - 📖 Wikipedia links - 👥 Population - 📐 Area (km²) - 🔍 Search API - ⚡ Ready for Leaflet, OpenLayers and MapLibre - 🔄 Automatic update scripts --- ## Project Structure ``` south-africa-district-api/ api/ data/ docs/ examples/ scripts/ package.json README.md ``` --- ## Installation ```bash git clone github.com cd south-africa-district-api npm install ``` --- ## Running Development ```bash npm run dev ``` Production ```bash npm start ``` --- ## Building the dataset Download OpenStreetMap boundaries ```bash npm run osm ``` Download Wikidata metadata ```bash npm run wikidata ``` Download Statistics South Africa data ```bash npm run statssa ``` Build GeoJSON ```bash npm run build ``` Run everything ```bash npm run update ``` --- # API Endpoints ## Provinces ``` GET /api/provinces ``` Returns the nine South African provinces. --- ## Municipalities ``` GET /api/municipalities ``` Returns every district and metropolitan municipality. --- ## Municipality ``` GET /api/municipalities/DC22 ``` Returns one municipality. --- ## Search ``` GET /api/search?q=umgungundlovu ``` Search by - Municipality code - Municipality name - Seat - Province - Wikidata ID - OSM Relation ID --- ## Boundaries Entire province ``` GET /api/boundaries/KZN ``` Single municipality ``` GET /api/boundaries/DC22 ``` --- ## Municipality Object ```json { "code": "DC22", "name": "uMgungundlovu District Municipality", "province": "KwaZulu-Natal", "type": "District Municip …