nigeria-lga-data
v1.0.0
Published
A TypeScript-first npm package for all 774 Nigerian LGAs — with geopolitical zones, coordinates, and geospatial lookups. The only Nigerian LGA dataset with built-in proximity search.
Maintainers
Readme
nigeria-lga-data
The only TypeScript-first npm package for all 774 Nigerian LGAs — with geopolitical zones, coordinates, and proximity search.
Why this package?
If you're building health tech, civic tech, NGO tools, or any location-aware app for Nigeria, you need reliable LGA data — not just names.
Existing packages give you a flat list of LGA names. This package gives you:
| Feature | Other packages | nigeria-lga-data |
|---|---|---|
| LGA names | ✅ | ✅ |
| State capitals | ✅ | ✅ |
| Geopolitical zones | ❌ | ✅ |
| Centroid coordinates | ❌ | ✅ |
| Proximity search (nearest LGA by lat/lng) | ❌ | ✅ |
| TypeScript-first (full type safety) | ❌ | ✅ |
| ESM + CJS support | ❌ | ✅ |
| Unique slug IDs | ❌ | ✅ |
Built and maintained by someone who shipped a production disease surveillance dashboard for a Nigerian LGA — and needed this data to do it.
Installation
npm install nigeria-lga-data
# or
yarn add nigeria-lga-dataQuick Start
import {
getAll,
getByState,
getByName,
getById,
getByZone,
getByCoordinates,
getNearby,
getStates,
} from "nigeria-lga-data";
// Get all 774 LGAs
const all = getAll();
// Filter by state
const plateauLGAs = getByState("Plateau");
// → [{ id: "plateau-barkin-ladi", name: "Barkin Ladi", state: "Plateau", ... }]
// Look up by name
const langtang = getByName("Langtang North");
// → [{ id: "plateau-langtang-north", geopoliticalZone: "North Central", ... }]
// Stable slug-based lookup
const lga = getById("plateau-langtang-north");
// Filter by geopolitical zone
const northCentral = getByZone("North Central");
// 🌍 Find nearest LGA to a GPS coordinate
const nearest = getByCoordinates(9.8, 9.4);
// → { lga: { name: "Langtang North", ... }, distanceKm: 12.3 }
// Get 5 closest LGAs to a point
const nearby = getNearby(6.45, 3.39, 5); // Near LagosAPI Reference
getAll(): LGA[]
Returns all LGAs in the dataset.
getByState(state: string): LGA[]
Returns all LGAs in a state. Case-insensitive.
getByName(name: string): LGA[]
Finds LGAs by name. Returns all matches (useful for duplicate LGA names across states).
getById(id: string): LGA | undefined
Finds a single LGA by its unique slug ID (e.g. "plateau-langtang-north").
getByZone(zone: GeopoliticalZone): LGA[]
Filters LGAs by geopolitical zone. Valid values:
"North Central" | "North East" | "North West" | "South East" | "South South" | "South West"
getByCoordinates(lat: number, lng: number): NearestLGAResult
Returns the LGA with the nearest centroid to the given coordinates, plus the distance in km.
getNearby(lat: number, lng: number, limit?: number): NearestLGAResult[]
Returns the N closest LGAs sorted by distance. Default limit: 5.
getStates(): string[]
Returns all 37 state names (36 states + FCT), sorted alphabetically.
getZones(): GeopoliticalZone[]
Returns all six geopolitical zone names.
getLGACountByState(): Record<string, number>
Returns a map of state → LGA count.
Data Shape
interface LGA {
id: string; // "plateau-langtang-north"
name: string; // "Langtang North"
state: string; // "Plateau"
geopoliticalZone: GeopoliticalZone; // "North Central"
coordinates: {
lat: number; // 10.0486
lng: number; // 8.2019
};
}Use Cases
- Health tech dashboards — map disease data to LGA boundaries
- NGO & humanitarian tools — aggregate survey responses by zone
- Civic tech apps — constituency lookups, population mapping
- Logistics platforms — route planning across administrative areas
- Government reporting — standardize LGA names across datasets
Roadmap
- [ ] v1.1 — Add GeoJSON boundary loader (opt-in, lazy-loaded)
- [ ] v1.2 — Population estimates per LGA
- [ ] v1.3 — Health facility counts per LGA (GRID3 data)
- [ ] v2.0 — Ward-level data
Contributions welcome — see CONTRIBUTING.md.
Built in the context of public health
This package was extracted from real-world work on Langtang HealthLink, an open-source disease surveillance and community health dashboard built for Langtang North LGA, Plateau State. It is maintained as a standalone tool so that other developers building health and civic applications for Nigeria can depend on it.
License
MIT — free to use in any project, commercial or otherwise.
If this package saves you time, please ⭐️ the repo and share it with other Nigerian developers.
