Counties API
Access county and sub-county information across Kenya
List Counties
GET
/api/v1/countiesPublic KeyGet a list of all Kenyan counties
Example Request
Request
curl -X GET "https://api.shambarecords.com/api/v1/counties" \
-H "X-API-Key: sr_pub_your_public_key"Response
{
"data": [
{
"id": 1,
"code": "001",
"name": "Mombasa",
"capital": "Mombasa City",
"population": 1208333,
"area_sq_km": 229.7,
"sub_counties": [
{ "id": 1, "name": "Changamwe" },
{ "id": 2, "name": "Jomvu" },
{ "id": 3, "name": "Kisauni" },
{ "id": 4, "name": "Likoni" },
{ "id": 5, "name": "Mvita" },
{ "id": 6, "name": "Nyali" }
]
},
{
"id": 47,
"code": "047",
"name": "Nairobi",
"capital": "Nairobi City",
"population": 4397073,
"area_sq_km": 696.0,
"sub_counties": [
{ "id": 285, "name": "Dagoretti North" },
{ "id": 286, "name": "Dagoretti South" },
{ "id": 287, "name": "Embakasi Central" },
{ "id": 288, "name": "Embakasi East" }
]
}
]
}Get County by ID
GET
/api/v1/counties/:idPublic KeyRetrieve detailed information about a specific county
Path Parameters
Parameters
idintegerrequiredCounty ID (1-47)
Example Request
Request
curl -X GET "https://api.shambarecords.com/api/v1/counties/47" \
-H "X-API-Key: sr_pub_your_public_key"Response
{
"data": {
"id": 47,
"code": "047",
"name": "Nairobi",
"capital": "Nairobi City",
"population": 4397073,
"area_sq_km": 696.0,
"coordinates": {
"latitude": -1.286389,
"longitude": 36.817223
},
"sub_counties": [
{
"id": 285,
"name": "Dagoretti North",
"wards": ["Kilimani", "Kawangware", "Gatina", "Kileleshwa", "Kabiro"]
},
{
"id": 286,
"name": "Dagoretti South",
"wards": ["Mutu-ini", "Ngand'o", "Riruta", "Uthiru/Ruthimitu", "Waithaka"]
},
{
"id": 287,
"name": "Embakasi Central",
"wards": ["Kayole North", "Kayole Central", "Kayole South", "Komarock", "Matopeni/Spring Valley"]
}
],
"economy": {
"main_activities": ["Services", "Manufacturing", "Trade"],
"agricultural_products": ["Vegetables", "Dairy", "Poultry"]
},
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
}Get Sub-Counties
GET
/api/v1/counties/:id/sub-countiesPublic KeyGet all sub-counties for a specific county
Example Request
Request
curl -X GET "https://api.shambarecords.com/api/v1/counties/22/sub-counties" \
-H "X-API-Key: sr_pub_your_public_key"Response
{
"data": {
"county": {
"id": 22,
"name": "Kiambu"
},
"sub_counties": [
{
"id": 181,
"name": "Gatundu North",
"wards": ["Gituamba", "Githobokoni", "Chania", "Mang'u"]
},
{
"id": 182,
"name": "Gatundu South",
"wards": ["Kiamwangi", "Kiganjo", "Ndarugu", "Ngenda"]
},
{
"id": 183,
"name": "Githunguri",
"wards": ["Githunguri", "Githiga", "Ikinu", "Ngewa", "Komothai"]
},
{
"id": 184,
"name": "Kiambaa",
"wards": ["Cianda", "Karuri", "Ndenderu", "Muchatha", "Kihara"]
}
]
}
}County Object Schema
Response Schema
idintegerCounty ID (1-47)
codestringThree-digit county code (e.g., '001', '047')
namestringCounty name
capitalstringCounty capital/headquarters
populationintegernullablePopulation count (latest census)
area_sq_kmnumbernullableArea in square kilometers
coordinatesobjectnullableGeographic coordinates (latitude, longitude)
sub_countiesarray of objectsList of sub-counties with IDs, names, and wards
economyobjectnullableEconomic information (main activities, agricultural products)