Skip to content

Latest commit

 

History

History
179 lines (145 loc) · 4.69 KB

README.md

File metadata and controls

179 lines (145 loc) · 4.69 KB

Nigeris States, Towns and Local Government Area

Node.js CI

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:

Get All States and their details

  1. Method: GET
  2. Endpoint: https://nigeria-states-towns-lgas.onrender.com/api/all
  3. Description: Retrieve a list of all states in Nigeria.
  4. Response: An array of state objects, each containing information about the state.

Response Example

[
  {
    "name": "Abia State",
    "capital": "Umuahia",
    "state_code": "ABIA",
    "creation_date": "1991",
    "location": {
      "latitude": "5.4527",
      "longitude": "7.5248"
    },
    "total_area": "6320",
    "population": 4112230,
    "towns": [
      {
        ...

Get only states information

  1. Method: GET
  2. Endpoint: https://nigeria-states-towns-lgas.onrender.com/api/states
  3. Description: Retrieve a list of all states in Nigeria.
  4. Response: Returns a list of states in nigeria only

Response Example

[
  {
    "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",
    ...

Get Towns in a State

  1. Method: GET
  2. Endpoint: https://nigeria-states-towns-lgas.onrender.com/api/{state_code}/towns
  3. Description: Retrieve a list of towns within a specific state by providing the state_code.
  4. Response: An array of towns objects within the specified state.

Example

https://nigeria-states-towns-lgas.onrender.com/api/FCT/towns

Response

[
  {
    "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
    },

Get LGA in a State

  1. Method: GET
  2. Endpoint: https://nigeria-states-towns-lgas.onrender.com/api/{state_code}/lgas
  3. Description: Retrieve a list of LGA within a specific state by providing the state_code.
  4. Response: An array of lga objects within the specified state.

Example

https://nigeria-states-towns-lgas.onrender.com/api/ABIA/lgas

Response

[
  {
    "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
    },
    ..

Others

You can also get items for any of the states. Examples: like the National Resources, Languages spoken, Ethnic Groups, Religions etc.

Example

  1. Method: GET
  2. Endpoint: https://nigeria-states-towns-lgas.onrender.com/api/{state_code}/{type}
  3. Description: Retrieve a list of items within a specific state by providing the state_code and type.
  4. Response: An array of items objects within the specified state.
https://nigeria-states-towns-lgas.onrender.com/api/FCT/airports

Response

[
  "Nnamdi Azikiwe International Airport"
]

Read more: here

Contributing

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

Support Me