- 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
- Expressjs
To get general information from this API, you need to perform a GET request to https://kenyaapi.herokuapp.com
endpoint.
import axios from 'axios';
const res = await axios.get(`https://kenyaapi.herokuapp.com`);
// log the data to the console
console.log(res)
fetch('https://kenyaapi.herokuapp.com')
.then(response => response.json())
.then(data =>
// log the data to the console
console.log(data)
);
To get information about the 47 counties of kenya, you need to perform a GET request to https://kenyaapi.herokuapp.com/counties
endpoint.
import axios from 'axios';
const res = await axios.get(`https://kenyaapi.herokuapp.com/counties`);
// log the data to the console
console.log(res)
fetch('https://kenyaapi.herokuapp.com/counties')
.then(response => response.json())
.then(data =>
// log the data to the console
console.log(data)
);
To get information about all the Wards/Contituencies, you need to perform a GET request to https://kenyaapi.herokuapp.com/wards
endpoint.
import axios from 'axios';
const res = await axios.get(`https://kenyaapi.herokuapp.com/wards`);
// log the data to the console
console.log(res)
fetch('https://kenyaapi.herokuapp.com/wards')
.then(response => response.json())
.then(data =>
// log the data to the console
console.log(data)
);
To get information about all the postalcodes, you need to perform a GET request to https://kenyaapi.herokuapp.com/postalcodes
endpoint.
import axios from 'axios';
const res = await axios.get(`https://kenyaapi.herokuapp.com/postalcodes`);
// log the data to the console
console.log(res)
fetch('https://kenyaapi.herokuapp.com/postalcodes')
.then(response => response.json())
.then(data =>
// log the data to the console
console.log(data)
);
Contributions are always welcome!
See contributing.md
for ways to get started.
Please adhere to this project's code of conduct
.
# 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.