One api to rule them all, query all states, Local government areas, Wards, Polling Units and Towns in Nigeria.
# Toneflix Places API
One api to rule them all, query all states, Local government areas, Wards, Polling Units and Towns in Nigeria.
# Usage
### Apply API Key
You can get an API key by creating an account on Toneflix Places API Portal](
naija-places.toneflix.com.ng).
Once you have generated your API keys you can add it to every request to the API via the `X-Api-Key` header
#### Example
```js [states]
const headers = new Headers();
const options = {
method: "GET",
headers: headers,
redirect: "follow",
};
headers.append("X-Api-Key", "API_KEY");
fetch("
naija-places.toneflix.com.ng", options)
.then((response) => response.json())
.then((result) => console.log(result))
.catch((error) => console.log("error", error));
```
## States
**`
naija-places.toneflix.com.ng`**
### Example Response
```json
{
"data": [
{
"id": 1,
"slug": "abia",
"name": "Abia",
"code": "AB"
},
{
"id": 2,
"slug": "adamawa",
"name": "Adamawa",
"code": "AD"
},
...
],
"status": "success",
"message": "Data Fetched.",
"statusCode": 200
}
```
## Local Government Areas
**`
naija-places.toneflix.com.ng`**
### Example Response
_`
naija-places.toneflix.com.ng`_
```json
{
"data": [
{
"id": 251,
"slug": "aninri",
"name": "Aninri",
"code": "DBR",
"state": "Enugu",
"stateId": 14
},
{
"id": 252,
"slug": "awgu",
"name": "Awgu",
"code": "AWG",
"state": "Enugu",
"stateId": 14
},
{
"id": 253,
"slug": "enugu-east",
"name": "Enugu East",
"code": "NKW",
"state": "Enugu",
"stateId": 14
},
...
],
"status": "success",
"message": "Data Fetched.",
"statusCode": 200
}
```
## Wards
**`
naija-places.toneflix.com.ng`**
### Example Response
_`
naija-places.toneflix.com.ng`_
```json
{
"data": [
{
"id": 2902,
"slug": "asata-township",
"name": "Asata Township",
"lga": "Enugu North",
"lgaId": 254,
"state": " …