Nigerian Government Fees API: AI-Powered Public Service Data
Source: Dev.to
What I Built
I built the Nigerian Government and Public Utility Fees API, a production‑ready REST API that provides verified, structured, and traceable information about Nigerian government fees and public utility costs. It centralizes data from multiple Nigerian agencies into one accessible endpoint.
In Nigeria, citizens often struggle to find accurate information about the official cost of services such as:
- National Identification Number (NIN) services
- WAEC / NECO / JAMB examination fees
- Passport and identity‑related processes
- Electricity tariffs across different DisCos
- Other government‑regulated public fees
The problem
For most Nigerians, finding accurate government fee information is frustrating. Information is usually scattered across PDFs, outdated websites, or unofficial sources. This API centralizes that data into a clean, developer‑friendly backend that can be reliably consumed by applications, chatbots, dashboards, and AI agents.
The solution
A single API that provides:
- 90+ verified government fees across 6 categories (Identity, Immigration, Education, Electricity, Transport, Business)
- 6 official agencies: NIMC, NIS, NECO, JAMB, NERC, UNILAG
- Complete documentation with code examples in JavaScript, Python, and cURL
- Rich relationship data: every fee includes category, agency, and official source information
- Search & filtering: find exactly what you need instantly
The API is built with a strong focus on:
- official data sources
- traceability
- maintainability
- real‑world production usage
Live API URL: https://xmlb-8xh6-ww1h.n7e.xano.io/api:public
API Documentation
The API follows a simple and predictable REST structure.
Core Resources
- Categories (e.g., Identity & Management, Education, Electricity)
- Subcategories (e.g., NIN, NECO, JAMB, Passport, DisCos)
- Fees (individual payable items)
- Agencies (government bodies)
- Sources (official documents and websites)
Base URL
https://xmlb-8xh6-ww1h.n7e.xano.io/api:public
Authentication
API key via query parameter: ?api_key=YOUR_KEY
Test API Key: nga_b6cf98a60bda43ba8cf54af9dbd87260
Available Endpoints
1. POST /api_key/generate
Generates an API key for accessing secured endpoints.
curl -X POST 'https://xmlb-8xh6-ww1h.n7e.xano.io/api:public/api_key/generate' \
-H 'Content-Type: application/json' \
--data '{"user_email":"your-email@example.com"}'
2. GET /fees
Retrieve a paginated list of fees with optional filtering.
Parameters
category(optional) – filter by category name/slugstate(optional) – filter by statesearch(optional) – search in name and descriptionpage(optional, default: 1) – page numberper_page(optional, default: 20, max: 100) – results per page
Example
curl 'https://xmlb-8xh6-ww1h.n7e.xano.io/api:public/fees?category=identity&per_page=5'
3. GET /fees/{id}
Get a single fee by ID with all relationships.
Example
curl 'https://xmlb-8xh6-ww1h.n7e.xano.io/api:public/fees/1?api_key=nga_b6cf98a60bda43ba8cf54af9dbd87260'
4. GET /fees/search
Search fees by name and description (minimum 2 characters).
Example
curl 'https://xmlb-8xh6-ww1h.n7e.xano.io/api:public/fees/search?q=passport&api_key=nga_b6cf98a60bda43ba8cf54af9dbd87260'
5. GET /categories
Get all categories with fee counts.
Example
curl 'https://xmlb-8xh6-ww1h.n7e.xano.io/api:public/categories?api_key=nga_b6cf98a60bda43ba8cf54af9dbd87260'
6. GET /metadata
Get API statistics and version information.
Example
curl 'https://xmlb-8xh6-ww1h.n7e.xano.io/api:public/metadata?api_key=nga_b6cf98a60bda43ba8cf54af9dbd87260'
Rate Limits
Currently no rate limits are enforced. Request tracking is implemented for future rate limiting.
Response Format
All responses are JSON. Errors follow a standardized format:
{
"code": "ERROR_CODE_TYPE",
"message": "Human-readable error message"
}
Full documentation is available in my GitHub repository with complete request/response examples, error handling, and integration guides.
Demo
Example 1 – Generate API Key
Request
curl -X POST 'https://xmlb-8xh6-ww1h.n7e.xano.io/api:public/api_key/generate' \
-H 'Content-Type: application/json' \
--data '{"user_email":"your-email@example.com"}'
Response
{
"success": true,
"api_key": "nga_********************************",
"message": "API key generated successfully. Please save this key as it provides access to the API."
}
Example 2 – Get All Categories
Request
curl -X GET \
'https://xmlb-8xh6-ww1h.n7e.xano.io/api:public/categories?api_key=nga_b6cf98a60bda43ba8cf54af9dbd87260' \
-H 'accept: application/json'
Response
[
{
"id": 1,
"display_name": "Identity & Management",
"description": "Fees related to national identity systems such as NIN",
"fee_count": 19
},
{
"id": 2,
"display_name": "Immigration",
"description": "Passport and visa related fees",
"fee_count": 10
},
{
"id": 3,
"display_name": "Education",
"description": "NECO, JAMB and related examination fees",
"fee_count": 45
}
]
Example 3 – Search for NIN Fees
Request
curl -X GET \
'https://xmlb-8xh6-ww1h.n7e.xano.io/api:public/fees/search?q=NIN&api_key=nga_b6cf98a60bda43ba8cf54af9dbd87260' \
-H 'accept: application/json'
Response
[
{
"id": 1,
"name": "NIN Enrolment (First Time)",
"amount": 0,
"currency": "NGN",
"service_type": "Standard",
"description": "Initial NIN enrollment is free",
"category_name": "Identity & Management",
"agency_name": "National Identity Management Commission",
"subcategory_name": "NIN",
"source_name": "NIMC"
}
]
Example 4 – Get Fee Details
Request
curl -X GET \
'https://xmlb-8xh6-ww1h.n7e.xano.io/api:public/fees/20?api_key=nga_b6cf98a60bda43ba8cf54af9dbd87260' \
-H 'accept: application/json'
Response
{
"id": 20,
"name": "Standard Passport 32 Pages (5-Year Validity)",
"amount": 100000,
"currency": "NGN",
"service_type": "Standard",
"description": "New or Renewal",
"subcategory": {
"id": 3,
"name": "Passport",
"category": {
"id": 2,
"name": "Immigration",
"description": "Passport and visa related fees"
}
},
"source": {
"id": 2,
"name": "Nigerian Immigration Service (NIS)",
"agency": {
"id": 2,
"name": "Nigeria Immigration Service",
"website": "https://immigration.gov.ng"
}
}
}
Code Integration Examples
JavaScript
const BASE_URL = 'https://xmlb-8xh6-ww1h.n7e.xano.io/api:public';
const API_KEY = 'YOUR_API_KEY';
// Example: fetch all categories
fetch(`${BASE_URL}/categories?api_key=${API_KEY}`)
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));
Python
import requests
BASE_URL = 'https://xmlb-8xh6-ww1h.n7e.xano.io/api:public'
API_KEY = 'YOUR_API_KEY'
# Example: search for passport fees
params = {'q': 'passport', 'api_key': API_KEY}
response = requests.get(f'{BASE_URL}/fees/search', params=params)
print(response.json())
cURL
curl "https://xmlb-8xh6-ww1h.n7e.xano.io/api:public/fees?category=education&api_key=YOUR_API_KEY"