API Endpoint
https://nigeria-states-towns-lgas.onrender.com/api
API Overview:
Your API provides information about Nigeria State, Towns, Local Government Areas, languages spoken, hospitals, airports, universities, polytechnics, and more. Here's how to interact with it with some examples:
- Method:
GET
- Endpoint:
https://nigeria-states-towns-lgas.onrender.com/api/all
- Description: Retrieve a list of all states in Nigeria.
- Response: An array of state objects, each containing information about the state.
[
{
"name": "Abia State",
"capital": "Umuahia",
"state_code": "ABIA",
"creation_date": "1991",
"location": {
"latitude": "5.4527",
"longitude": "7.5248"
},
"total_area": "6320",
"population": 4112230,
"towns": [
{
...
- Method:
GET
- Endpoint:
https://nigeria-states-towns-lgas.onrender.com/api/states
- Description: Retrieve a list of all states in Nigeria.
- Response: Returns a list of states in nigeria only
[
{
"name": "Abia State",
"capital": "Umuahia",
"state_code": "ABIA",
"creation_date": "1991",
"location": {
"latitude": "5.4527",
"longitude": "7.5248"
},
"total_area": "6320",
"population": 4112230,
"postal_code": null,
"religions": []
},
{
"name": "Adamawa",
"capital": "Yola",
...
- Method:
GET
- Endpoint:
https://nigeria-states-towns-lgas.onrender.com/api/{state_code}/towns
- Description: Retrieve a list of towns within a specific state by providing the state_code.
- Response: An array of towns objects within the specified state.
https://nigeria-states-towns-lgas.onrender.com/api/FCT/towns
[
{
"name": "Lokogoma",
"location": {
"latitude": null,
"longitude": null
},
"population": null,
"postal_code": null,
"total_area": null,
"creation_date": null
},
{
"name": "Galadimawa",
"location": {
"latitude": null,
"longitude": null
},
- Method:
GET
- Endpoint:
https://nigeria-states-towns-lgas.onrender.com/api/{state_code}/lgas
- Description: Retrieve a list of LGA within a specific state by providing the state_code.
- Response: An array of lga objects within the specified state.
https://nigeria-states-towns-lgas.onrender.com/api/ABIA/lgas
[
{
"name": "Aba North",
"location": {
"latitude": null,
"longitude": null
},
"total_area": null,
"postal_code": null,
"population": null,
"creation_date": null
},
{
"name": "Aba South",
"location": {
"latitude": null,
"longitude": null
},
..
You can also get items for any of the states. Examples: like the National Resources, Languages spoken, Ethnic Groups, Religions etc.
- Method:
GET
- Endpoint:
https://nigeria-states-towns-lgas.onrender.com/api/{state_code}/{type}
- Description: Retrieve a list of items within a specific state by providing the state_code and type.
- Response: An array of items objects within the specified state.
https://nigeria-states-towns-lgas.onrender.com/api/FCT/airports
[
"Nnamdi Azikiwe International Airport"
]
Read more: here
Contributions are done in two ways
Firstly, contributing to this repository
In case of any problems look at existing issues, if you cannot find anything related to your problem then open an issue. Create an issue before opening a pull request for non trivial fixes. In case of trivial fixes open a pull request directly.
Secondary, contributing to the live update app https://nigeria-locality.vercel.app/
and it's repository here