Build on Nairobi's
Transit Data Layer
API reference, integration guides, and code examples for developers building on real-time matatu telemetry and the Matatu Pulse platform.
Getting Started in 5 Minutes
The Matatu Pulse API provides real-time vehicle telemetry, route data, ETA predictions, and historical trip records for Nairobi's matatu network. Here's how to make your first request.
Authenticate and pull live positions for all vehicles on a route in under 2 minutes.
Stream real-time GPS position updates as they happen — ideal for live map applications.
Query real-time arrival estimates for any stage on any tracked route with congestion-aware modelling.
Access aggregated, anonymised trip history for research, planning, and analytics use cases.
Authentication
All API requests require a Bearer token passed in the Authorization header. Obtain your API key from the developer dashboard.
# Get live vehicle positions for Route 46 curl -X GET "https://api.matatupulse.co.ke/v1/routes/46/vehicles" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Accept: application/json"
Example Response
Vehicle positions are returned as GeoJSON-compatible objects with heading, speed, and sacco metadata.
{
"route_id": "46",
"route_name": "CBD → Kangemi",
"updated_at": "2025-02-21T08:14:32Z",
"vehicles": [
{
"id": "KBZ-441A",
"lat": -1.2687,
"lng": 36.8031,
"heading": 274,
"speed_kmh": 32,
"sacco": "Supermetro",
"occupancy": "medium",
"timestamp": "2025-02-21T08:14:29Z"
}
]
}
Core Endpoints
All endpoints are versioned under https://api.matatupulse.co.ke/v1. The WebSocket feed is available at wss://stream.matatupulse.co.ke/v1.
| Method | Endpoint | Description |
|---|---|---|
| GET | /routes | List all tracked routes with metadata |
| GET | /routes/{id}/vehicles | Live vehicle positions for a route |
| GET | /routes/{id}/eta | ETA predictions for all stops on a route |
| GET | /vehicles/{id} | Single vehicle live status and metadata |
| GET | /stops/{id}/arrivals | Upcoming arrivals at a specific stage |
| GET | /fares | Current fare estimates by route |
| WS | /stream/routes/{id} | Real-time position stream for a route |
| WS | /stream/vehicles/{id} | Real-time stream for a single vehicle |
Recent Changelog
Subscribe to the full changelog for detailed release notes.
The /fares endpoint is now generally available after 3 months in beta. Returns current and peak-hour estimates by route.
Vehicle responses now include an `occupancy` field (low / medium / high) derived from sacco-reported load data.
Added 30s ping/pong heartbeat to WebSocket connections to prevent silent disconnections on mobile data.
Opened historical trip data endpoints covering all routes back to January 2024 in 15-minute aggregated intervals.