A free public REST API serving Kenya public data — counties, banks, M-Pesa paybills, and public holidays.
No authentication required. Free to use.
https://kenya-api-90wq.onrender.com
Get all counties
Get all counties Filter by region GET /api/counties?region=Nairobi GET /api/counties?region=Coast GET /api/counties?region=Rift Valley Get county by code Get county by code Example response:
{
"count": 47,
"data": [
{
"code": 1,
"name": "Mombasa",
"capital": "Mombasa",
"region": "Coast"
}
]
}Get all banksGET /api/banks Search by name GET /api/banks?search=equity GET /api/banks?search=kcb Get bank by code Get bank by code Example response:
{
"count": 1,
"data": [
{
"code": "49",
"name": "Equity Bank Kenya",
"shortname": "Equity",
"swift": "EQBLKENX"
}
]
}Get all paybills GET /api/mpesa/paybills
Filter by category GET /api/mpesa/paybills?category=Government GET /api/mpesa/paybills?category=Banking GET /api/mpesa/paybills?category=Utilities Get paybill by number GET /api/mpesa/paybills/400200 Get all categories GET /api/mpesa/categories
Example response:
{
"count": 4,
"data": [
{
"number": "990099",
"name": "KRA iTax",
"category": "Government"
}
]
}Get all holidays Filter by typeGET /api/holidays?type=National Holiday GET /api/holidays?type=Public HolidayExample response:
{
"count": 13,
"data": [
{
"date": "12-12",
"name": "Jamhuri Day",
"type": "National Holiday"
}
]
}Kenya has 8 regions:
- Nairobi
- Coast
- North Eastern
- Eastern
- Central
- Rift Valley
- Western
- Nyanza
// Get all Nairobi counties
const res = await fetch('https://kenya-api-90wq.onrender.com/api/counties?region=Nairobi');
const data = await res.json();
console.log(data);import requests
res = requests.get('https://kenya-api-90wq.onrender.com/api/counties?region=Coast')
print(res.json())- Constituencies data
- Ward data
- Universities and colleges
- Hospitals and health facilities
- Currency exchange rates
- Rate limiting and API keys
Carter - Full-stack developer GitHub: https://github.com/Carter254g
MIT