Skip to main content

Get Counties

Retrieve all counties in Kenya (47 counties).

Response

counties
array
Array of county objects

Example

cURL
curl http://localhost:3000/counties
Response
[
  {
    "county_code": 1,
    "county_name": "Mombasa"
  },
  {
    "county_code": 2,
    "county_name": "Kwale"
  },
  {
    "county_code": 47,
    "county_name": "Nairobi"
  }
]

Get Constituencies by County

Retrieve all constituencies within a specific county.

Path Parameters

county
integer
required
County code (1-47)

Response

constituencies
array
Array of constituency objects

Example

cURL
curl http://localhost:3000/counties/47/constituencies
Response
[
  {
    "constituency_code": 290,
    "county_code": 47,
    "constituency_name": "Westlands"
  },
  {
    "constituency_code": 291,
    "county_code": 47,
    "constituency_name": "Dagoretti North"
  },
  {
    "constituency_code": 292,
    "county_code": 47,
    "constituency_name": "Dagoretti South"
  }
]

Get Wards by Constituency

Retrieve all wards within a specific constituency.

Path Parameters

constituency
integer
required
Constituency code

Response

wards
array
Array of ward objects

Example

cURL
curl http://localhost:3000/constituencies/290/wards
Response
[
  {
    "ward_code": 1001,
    "constituency_code": 290,
    "ward_name": "Kitisuru"
  },
  {
    "ward_code": 1002,
    "constituency_code": 290,
    "ward_name": "Parklands/Highridge"
  },
  {
    "ward_code": 1003,
    "constituency_code": 290,
    "ward_name": "Karura"
  }
]

Get Polling Stations by Ward

Retrieve all polling stations within a specific ward.

Path Parameters

ward
integer
required
Ward code

Response

stations
array
Array of polling station objects

Example

cURL
curl http://localhost:3000/wards/1001/stations
Response
[
  {
    "id": 10001,
    "ward_code": 1001,
    "reg_center_code": 5001,
    "station_name": "Kitisuru Primary School",
    "registered_voters": 850
  },
  {
    "id": 10002,
    "ward_code": 1001,
    "reg_center_code": 5002,
    "station_name": "Kitisuru Secondary School",
    "registered_voters": 920
  }
]

Kenya’s Administrative Structure

Kenya’s electoral geography is organized hierarchically:

County

  • 47 counties - Primary administrative divisions
  • Each county has a Governor and Senator

Constituency

  • 290 constituencies - Parliamentary electoral areas
  • Each constituency has an MP and Women’s Representative
  • Multiple constituencies per county

Ward

  • 1,450 wards - County assembly electoral areas
  • Each ward has an MCA (Member of County Assembly)
  • Multiple wards per constituency

Polling Station

  • Thousands of polling stations across the country
  • Physical locations where voters cast ballots
  • Multiple stations per ward
  • Each station has registered voters assigned to it

Data Hierarchy

Use these endpoints in sequence to drill down from national to station level:
  1. GET /counties - Get all counties
  2. GET /counties//constituencies - Get constituencies in a county
  3. GET /constituencies//wards - Get wards in a constituency
  4. GET /wards//stations - Get polling stations in a ward
This hierarchical structure matches how election results are aggregated from station → ward → constituency → county → national levels.

Build docs developers (and LLMs) love