An open-source, robust, and strongly-typed RESTful API providing comprehensive, verified data on Nigerian geography, governance, education, culture, history, and tourism.
- 🌟 What is OpenNG?
- 🎯 Why OpenNG?
- ✨ Key Highlights
- 🗂️ Knowledge Domains
- 🔌 Consuming the REST API
- 💡 Endpoint Examples & Usage
- 🚀 Target Use Cases
- 🛡️ Security & Reliability
- 🛠️ Contributing & Local Development
- 📜 Code of Conduct
- 📄 License
OpenNG REST API is a standardized, public RESTful API for Nigerian socio-economic, political, cultural, educational, and geographic data.
It structures verified data across Nigeria’s 36 states and the Federal Capital Territory (FCT), 774 Local Government Areas (LGAs), wards, political offices, historical timelines, higher institutions, ethnic groups, languages, and tourism destinations into a predictable and developer-friendly REST interface.
- Scattered Data: Nigerian public data is fragmented across government websites, PDFs, and unofficial repositories.
- Inconsistent Naming & Formats: LGA names, state boundaries, and historical dates frequently suffer from spelling inconsistencies and lack standardized schemas.
- Integration Friction: Developers building fintech KYC, civic apps, or travel platforms must manually compile and maintain separate datasets.
- Unified REST Endpoints: Intuitive, predictable REST resource paths (
/api/v1/states,/api/v1/universities,/api/v1/governors). - Standardized Envelopes: Consistent JSON payload responses with built-in pagination metadata (
total,page,limit,totalPages). - Interactive Documentation: Self-documenting OpenAPI / Swagger UI accessible out of the box.
- Open & Free: 100% open-source under the MIT License.
- ⚡ High Performance: Fast response times with built-in in-memory caching and response compression.
- 📐 Strict Validation: Request validation via NestJS
ValidationPipeandclass-validator. - 📖 Interactive Swagger UI: Explore and test all endpoints directly in your browser.
- 🛡️ Enterprise Security: Helmet security headers, CORS protection, request rate limiting, and structured JSON logging.
┌───────────────┐
│ OpenNG REST │
└───────┬───────┘
┌─────────────┬──────────────┼──────────────┬─────────────┐
▼ ▼ ▼ ▼ ▼
┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐
│ Geography │ │Governance │ │ Education │ │ Culture │ │ History │
└───────────┘ └───────────┘ └───────────┘ └───────────┘ └───────────┘
| Domain | Description | Base Endpoints |
|---|---|---|
| 🌍 Geography | Administrative divisions & geopolitical boundaries | /api/v1/states, /api/v1/lgas, /api/v1/regions, /api/v1/wards |
| 🏛️ Politics & Governance | Executive offices, electoral history, and parties | /api/v1/governors, /api/v1/presidents, /api/v1/political-parties, /api/v1/offices |
| 🎓 Education | Accredited tertiary learning institutions | /api/v1/universities, /api/v1/polytechnics, /api/v1/colleges |
| 🎭 Culture & Heritage | Indigenous identities, languages & monarchs | /api/v1/ethnic-groups, /api/v1/languages, /api/v1/festivals, /api/v1/traditional-institutions |
| 📜 History | Timeline of Nigerian milestones & regimes | /api/v1/historical-events, /api/v1/people |
| 🏖️ Tourism | Heritage landmarks, waterfalls, nature parks | /api/v1/tourism-sites |
All API requests are prefixed with the /api/v1 namespace:
https://api.openng.org/api/v1 (Production)
http://localhost:3000/api/v1 (Local)
Access the full interactive OpenAPI documentation in your browser:
👉 http://localhost:3000/api/v1/docs
Every endpoint returns a standardized JSON envelope:
{
"success": true,
"statusCode": 200,
"message": "Data retrieved successfully",
"data": { ... },
"meta": {
"total": 37,
"page": 1,
"limit": 10,
"totalPages": 4
}
}GET /api/v1/states/lagos HTTP/1.1
Host: localhost:3000{
"success": true,
"statusCode": 200,
"message": "State retrieved successfully",
"data": {
"name": "Lagos",
"slug": "lagos",
"capital": "Ikeja",
"areaKm2": 3577,
"population": 12550598,
"regionName": "South West",
"governor": "Babajide Sanwo-Olu",
"governorParty": "APC",
"lgasCount": 20,
"universitiesCount": 8
}
}GET /api/v1/states/lagos/lgas?page=1&limit=5 HTTP/1.1GET /api/v1/governors?page=1&limit=10 HTTP/1.1{
"success": true,
"statusCode": 200,
"data": [
{
"stateName": "Lagos",
"governorName": "Babajide Sanwo-Olu",
"governorPartyName": "All Progressives Congress",
"deputyName": "Obafemi Hamzat",
"deputyPartyName": "All Progressives Congress"
}
]
}GET /api/v1/universities?page=1&limit=5 HTTP/1.1{
"success": true,
"statusCode": 200,
"meta": {
"total": 260,
"page": 1,
"limit": 5,
"totalPages": 52
},
"data": [
{
"name": "University of Lagos",
"slug": "unilag",
"type": "Federal",
"foundedYear": 1962,
"stateName": "Lagos"
}
]
}GET /api/v1/ethnic-groups/yoruba HTTP/1.1{
"success": true,
"statusCode": 200,
"data": {
"name": "Yoruba",
"slug": "yoruba",
"populationEstimate": 45000000,
"primaryStates": "Lagos, Ogun, Oyo, Osun, Ondo, Ekiti, Kwara, Kogi",
"festivalsCount": 14
}
}GET /api/v1/historical-events?page=1&limit=5 HTTP/1.1{
"success": true,
"statusCode": 200,
"data": [
{
"title": "Independence of Nigeria",
"slug": "nigerian-independence-1960",
"eventYear": 1960,
"eventDate": "1960-10-01",
"category": "Political",
"regimeType": "Civilian",
"summary": "Nigeria gained independence from the United Kingdom."
}
]
}GET /api/v1/tourism-sites?page=1&limit=5 HTTP/1.1- 💳 Fintech & KYC Verification: Standardize state of origin, LGA mappings, and residential verification without spelling mismatches.
- 🗳️ Civic Tech & Governance Dashboards: Track political representation, executive administrations, and electoral history.
- 📚 EduTech Platforms: Validate accredited universities, polytechnics, and colleges with verified ownership types.
- 🗺️ Travel & Tourism Applications: Power tourism discovery platforms showcasing cultural festivals, heritage monuments, and attractions.
- 📰 Journalism & Fact-Checking: Instantly access historical milestones, political timelines, and demographic data.
- Security Headers: Powered by Helmet to secure HTTP headers.
- CORS Protection: Configurable Cross-Origin Resource Sharing for API security.
- Rate Limiting & Throttling: Automated request limiting via
@nestjs/throttler. - Structured JSON Observability: Zero-overhead logging with Pino and Prometheus telemetry (
/metrics).
Interested in adding datasets, writing controllers, running the project locally, or submitting a pull request?
👉 Please see our CONTRIBUTING.md for complete instructions on:
- Local setup (Node.js, PostgreSQL, Prisma)
- Environment variable configuration
- Running local development and debug servers
- Database migrations and Prisma Studio
- Running tests, ESLint, and Prettier
- Conventional Commits and PR submission guidelines
We are committed to fostering an inclusive, welcoming community. All participants must adhere to our Code of Conduct.
This project is licensed under the MIT License.
Copyright (c) 2026 OpenNG Contributors.