/kenya-api

RESTFul API documenting all the information about country Kenya

Primary LanguageJavaScript

Kenya API

RESTFul API documenting all the information about country Kenya

Blogsite website

Features

  • Get general infomation about kenya,its people, government, institutions, health, culture, energy, finance, infrastructure, geographical sites e.t.c
  • Get information about the 47 counties from population, industries, area, tribes, postal_codes e.t.c

Built with

- Expressjs

Getting Started

General country information

To get general information from this API, you need to perform a GET request to https://kenyaapi.herokuapp.com endpoint.

Using Axios

import axios from 'axios';

const res = await axios.get(`https://kenyaapi.herokuapp.com`);
 // log the data to the console
console.log(res)

Using Fetch API

fetch('https://kenyaapi.herokuapp.com')

    .then(response => response.json())

    .then(data =>
    // log the data to the console
    console.log(data)
    );

General Data about the 47 counties

To get information about the 47 counties of kenya, you need to perform a GET request to https://kenyaapi.herokuapp.com/counties endpoint.

Using Axios

import axios from 'axios';

const res = await axios.get(`https://kenyaapi.herokuapp.com/counties`);
 // log the data to the console
console.log(res)

Using Fetch API

fetch('https://kenyaapi.herokuapp.com/counties')

    .then(response => response.json())

    .then(data =>
    // log the data to the console
    console.log(data)
    );

General Data about Wards/Contituencies

To get information about all the Wards/Contituencies, you need to perform a GET request to https://kenyaapi.herokuapp.com/wards endpoint.

Using Axios

import axios from 'axios';

const res = await axios.get(`https://kenyaapi.herokuapp.com/wards`);
 // log the data to the console
console.log(res)

Using Fetch API

fetch('https://kenyaapi.herokuapp.com/wards')

    .then(response => response.json())

    .then(data =>
    // log the data to the console
    console.log(data)
    );

General Data about postalcodes

To get information about all the postalcodes, you need to perform a GET request to https://kenyaapi.herokuapp.com/postalcodes endpoint.

Using Axios

import axios from 'axios';

const res = await axios.get(`https://kenyaapi.herokuapp.com/postalcodes`);
 // log the data to the console
console.log(res)

Using Fetch API

fetch('https://kenyaapi.herokuapp.com/postalcodes')

    .then(response => response.json())

    .then(data =>
    // log the data to the console
    console.log(data)
    );

Authors

Contributing

Contributions are always welcome!

See contributing.md for ways to get started.

Please adhere to this project's code of conduct.

License

MIT

# install dependencies

$ npm install


# serve with hot reload at localhost:3000

$ node src/index.js

For detailed explanation on how things work, check out Expresssjs.