# nigeria-geo
> Complete Nigerian States and LGAs Data API for JavaScript & TypeScript
The most comprehensive **Nigeria geographic data library** for JavaScript and TypeScript. Get all **36 Nigerian states + FCT**, **774 Local Government Areas (LGAs)**, postal codes, coordinates, and shipping zone calculations.
## Why nigeria-geo?
Nigerian developers waste hours scraping unreliable data sources. **nigeria-geo** provides:
- ✅ **All 37 States** (36 states + FCT Abuja) with capitals and coordinates
- ✅ **All 774 LGAs** with verified spellings from official sources
- ✅ **Fuzzy Search** - find locations even with typos
- ✅ **Postal Codes** - NIPOST postal codes for all LGAs
- ✅ **Shipping Zones** - calculate delivery zones for e-commerce
- ✅ **LGA Classifications** - urban, semi-urban, rural, riverine
- ✅ **React Map Components** - interactive Nigeria maps with choropleth support
- ✅ **TypeScript** - full type definitions
- ✅ **Tree-shakeable** - import only what you need
## Packages
| Package | Description | Size |
|---------|-------------|------|
| `@some19ice/nigeria-geo-core` | States, LGAs, coordinates, search | ~193 KB |
| `@some19ice/nigeria-geo-logistics` | Shipping zones, postal codes, classifications | ~9 KB |
| `@some19ice/nigeria-geo-viz` | React map components, TopoJSON | ~430 KB |
## Installation
```bash
# npm
npm install @some19ice/nigeria-geo-core
# pnpm
pnpm add @some19ice/nigeria-geo-core
# yarn
yarn add @some19ice/nigeria-geo-core
```
## Quick Start
### Get Nigerian States and LGAs
```typescript
import {
getStates,
getStateById,
getLGAsByState,
searchLocations
} from '@some19ice/nigeria-geo-core';
// Get all 37 Nigerian states
const states = getStates();
console.log(states.length); // 37
// Get Lagos State
const lagos = getStateById('lagos');
console.log(lagos?.capital); // "Ikeja"
console.log(lagos?.zone); // "South West"
// Get all LGAs in Lagos
const lagosLGAs = getLGAsByState('lagos');
console.log(lagosLGAs.length); // 20 …