An open-source, strongly-typed GraphQL knowledge graph and 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 API
- 💡 Query Examples & Use Cases
- 🚀 Target Use Cases
- 🛡️ Security & Reliability
- 🛠️ Contributing & Local Development
- 📜 Code of Conduct
- 📄 License
OpenNG GraphQL is a unified, open-access knowledge platform for Nigeria. It models the intricate connections across Nigeria’s 36 states and the Federal Capital Territory (FCT), 774 Local Government Areas (LGAs), wards, political offices, historical timelines, higher institutions, ethnic heritage, languages, and tourism destinations into an intuitive, queryable GraphQL API.
Rather than dealing with static CSVs, outdated government PDFs, or multiple disjointed databases, OpenNG delivers structured, relational data in real time with type safety.
- Data Fragmentation: Nigerian public data is scattered across legacy websites, fragmented government portals, and unstructured documents.
- Inconsistent Standards: Varied naming conventions, spelling discrepancies, and missing metadata make automated data consumption difficult.
- Over-fetching / Under-fetching: Traditional REST endpoints often force clients to make dozens of cascading requests to assemble complete data profiles.
- Single Unified Graph: Request exactly what you need in a single roundtrip.
- Strongly Typed: Backed by a verified code-first GraphQL schema with comprehensive DTO validation.
- Relational Integrity: Seamlessly traverse relationships (e.g.
State➔LGAs➔Wards,State➔Governor➔Political Party,Ethnic Group➔Festivals). - Community-Driven & Open: Publicly auditable and extensible under the MIT License.
- ⚡ Precision Fetching: Query precise fields for mobile, web, and backend applications without payload bloat.
- 🔗 Deep Relational Links: Interconnect geographic boundaries, tertiary schools, political office holders, and cultural history.
- 🔎 Built-in Filtering & Pagination: Paginate through large datasets with structured metadata (
total,page,limit,totalPages). - 🛡️ Enterprise-Grade Security: Query depth limiting, Helmet CSP nonces, and automated rate limiting.
┌───────────────┐
│ OpenNG Engine │
└───────┬───────┘
┌─────────────┬──────────────┼──────────────┬─────────────┐
▼ ▼ ▼ ▼ ▼
┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐
│ Geography │ │Governance │ │ Education │ │ Culture │ │ History │
└───────────┘ └───────────┘ └───────────┘ └───────────┘ └───────────┘
| Domain | Description | Available Entities |
|---|---|---|
| 🌍 Geography | Nigeria's administrative and geopolitical landscape | States, LGAs, Wards, Senatorial Districts, Geopolitical Regions, Federal Constituencies |
| 🏛️ Politics & Governance | Public offices, electoral history, and administrations | State Governors, Presidents, Ministries, Public Offices, Office Holders, Political Parties |
| 🎓 Education | Accredited tertiary learning institutions | Federal, State, and Private Universities, Polytechnics, and Colleges of Education |
| 🎭 Culture & Heritage | Rich cultural tapestry and indigenous identities | Ethnic Groups, Indigenous Languages, Traditional Monarchs/Institutions, Cultural Festivals |
| 📜 History | Comprehensive historical timeline & key figures | Historical Events, Historic Regimes (Civilian/Military), Prominent Figures & Roles |
| 🏖️ Tourism | Heritage landmarks, waterfalls, nature parks | Tourist Sites, Cultural Monuments, Natural Landmarks categorized by State & Region |
All queries and introspection requests are served via HTTP POST requests to:
POST /graphql
When running or accessing OpenNG, an interactive GraphQL Playground/Sandbox is available in your browser at:
👉 /graphql (e.g., http://localhost:3000/graphql)
Retrieve detailed information for a specific state including capital, region, population, and counts of sub-entities:
query GetStateDetails {
State_getBySlug(params: { slug: "lagos" }) {
success
statusCode
data {
name
slug
capital
areaKm2
population
regionName
governor
governorParty
lgasCount
universitiesCount
tourismSitesCount
}
}
}List current governors alongside their deputy governors and affiliated political parties:
query ListStateGovernors {
Governor_list(query: { limit: 10, page: 1 }) {
success
meta {
total
page
limit
totalPages
}
data {
stateName
governorName
governorPartyName
deputyName
deputyPartyName
assumedDate
}
}
}Query federal, state, and private universities located within a specific state or across Nigeria:
query ListUniversities {
University_list(query: { limit: 5, page: 1 }) {
data {
name
slug
type
foundedYear
stateName
stateSlug
}
}
}Explore ethnic demographics, associated languages, and annual cultural celebrations:
query GetEthnicGroupAndFestivals {
EthnicGroup_getBySlug(params: { slug: "yoruba" }) {
data {
name
slug
populationEstimate
primaryStates
festivalsCount
}
}
}Retrieve chronological events filtered by regime type or era:
query ListHistoricalEvents {
HistoricalEvent_list(query: { limit: 5, page: 1 }) {
data {
title
slug
eventYear
eventDate
category
regimeType
summary
}
}
}Discover tourist attractions and cultural landmarks categorized by state:
query ListTourismSites {
TourismSite_list(query: { limit: 10, page: 1 }) {
data {
name
slug
category
stateName
}
}
}- 💳 Fintech & KYC / Identity Verification: Validate state of origin, LGA mappings, and residential jurisdictions with standardized spellings.
- 🗳️ Civic Tech & Public Policy: Build dashboards tracking public offices, political representation, and historical administrations.
- 📚 EduTech & Career Platforms: Integrate authoritative lists of universities, polytechnics, and colleges with verified accreditation types.
- 🗺️ Travel & Tourism Apps: Power travel discovery platforms highlighting cultural festivals, heritage sites, and attractions.
- 📰 Journalism & Fact-Checking: Instantly query historical events, political party histories, and demographic data.
- Query Depth Limiting: Protects the API against recursive and denial-of-service (DoS) queries.
- Content Security Policy (CSP): Nonce-secured CSP headers via Helmet.
- Rate Limiting: Automated request throttling powered by
@nestjs/throttler. - Structured Observability: High-performance JSON logging using Pino and Prometheus telemetry.
Interested in contributing datasets, building new resolvers, running the project locally, or submitting a pull request?
👉 Please see our CONTRIBUTING.md for full instructions on:
- Local environment setup (Node.js, PostgreSQL, Prisma)
- Running local development and debug servers
- Database migrations and Prisma Studio
- Running tests, linter, and formatting
- Conventional Commits and PR submission guidelines
We are committed to providing a friendly, safe, and welcoming environment for everyone. Please review our Code of Conduct before interacting with the repository.
This project is licensed under the MIT License.
Copyright (c) 2026 OpenNG Contributors.