Voter Data Analytics API
Access electoral administrative data through a simple REST API. Retrieve states, Local Government Areas, wards and polling units using standard HTTP GET requests.
Base URL
All API endpoints are available under the following base URL:
https://api.binusman.com.ng/api/v1
https://api.binusman.com.ng
Authentication
This API is currently public and does not require an API key, username, password or login.
You can send a normal HTTP GET request directly to the API endpoint.
How the API works
The data is organised in a hierarchy. Start with a state, then use its ID to retrieve LGAs, then use the LGA ID to retrieve wards, and finally use the ward ID to retrieve polling units.
States
│
└── LGAs
│
└── Wards
│
└── Polling Units
States
Retrieve all states available in the database.
/states
Full URL:
https://api.binusman.com.ng/api/v1/states
Local Government Areas
Retrieve all LGAs belonging to a particular state.
/lgas?state_id=STATE_ID
https://api.binusman.com.ng/api/v1/lgas?state_id=1
| Name | Type | Required |
|---|---|---|
| state_id | Integer | Yes |
Wards
Retrieve wards belonging to an LGA.
/wards?lga_id=LGA_ID
https://api.binusman.com.ng/api/v1/wards?lga_id=1
Polling Units
Retrieve polling units belonging to a ward.
/units?ward_id=WARD_ID
https://api.binusman.com.ng/api/v1/units?ward_id=1
If a ward has ID 25, request:
/units?ward_id=25
API Response
All successful requests return JSON.
{
"status": "success",
"message": "States loaded successfully",
"data": [
{
"id": 1,
"api_id": 19,
"name": "Kaduna",
"slug": "kaduna",
"code": "KD"
}
]
}
Response fields
| Field | Description |
|---|---|
| id | Internal database ID. |
| api_id | Original external API ID. |
| name | Name of the location. |
| slug | URL-friendly name. |
| code | Location code when available. |
JavaScript Example
You can call the API directly from a JavaScript or React application.
fetch(
"https://api.binusman.com.ng/api/v1/states"
)
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(error => {
console.error(error);
});
PHP Example
The API can also be consumed using PHP.
<?php
$url = "https://api.binusman.com.ng/api/v1/states";
$response = file_get_contents($url);
$data = json_decode(
$response,
true
);
print_r($data);
cURL Example
You can also test the API from a terminal.
curl "https://api.binusman.com.ng/api/v1/states"
Complete Example
A developer can build a location selector by connecting the endpoints in this order:
GET /states
Retrieve available states.
GET /lgas?state_id=1
Retrieve LGAs for the selected state.
GET /wards?lga_id=1
Retrieve wards for the selected LGA.
GET /units?ward_id=1
Retrieve polling units for the selected ward.
Error Responses
If a request fails, the API returns a JSON error response.
{
"status": "error",
"message": "state_id is required",
"data": []
}
| HTTP Code | Meaning |
|---|---|
| 200 | Request successful. |
| 400 | Invalid or missing parameter. |
| 405 | HTTP method not allowed. |
| 500 | Server/database error. |
Usage Guidelines
Read-only API
The public API is designed for retrieving location data. It does not provide endpoints for inserting, editing or deleting records.
Use the IDs returned by the API
When requesting child resources, use the corresponding ID returned by the previous request.
Avoid unnecessary requests
Cache data where appropriate instead of repeatedly requesting the same information.
Important
The API provides administrative location information such as states, LGAs, wards and polling units. It does not automatically mean that individual voter records are available.