Beta
Directions
Today: live (Beta) since 11 November 2026. Routing covers Lagos today; all of Nigeria comes with the Nigeria release.
What it does
Gives a route from an origin to a destination, with optional stops on the way, as a line, a distance and a time.
- Modes:
car,okada(motorcycle taxi),keke(tricycle taxi),bicycleandwalk. - Gates and closed roads: estate gates and roads closed to a mode are left out of the route, from our contributors' reports. They are never baked into the road network, so a gate that opens again is used again.
- Public transport (
transit) answers with no routes for now. Our transport data covers too little yet. - No live traffic. Times are from typical speeds, not today's traffic.
Request
POST https://maps-api.ranamaps.com/v1/directions/route
curl https://maps-api.ranamaps.com/v1/directions/route \
-H "X-Rana-Key: $RANA_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"origin": {"lat": 6.4541, "lng": 3.3947},
"destination": {"lat": 6.5965, "lng": 3.3421},
"mode": "okada",
"alternatives": true
}'
| Field | Required | Notes |
|---|---|---|
origin, destination |
yes | {"lat", "lng"}, or {"place_id": "…"} with one of our place ids. A destination place routes to its open gate |
waypoints |
no | Up to 8 points to pass through, in order |
mode |
no | car (default), okada, keke, bicycle, walk, transit |
alternatives |
no | true for up to two more routes. Ignored with waypoints |
avoid |
no | Any of tolls, highways, ferries |
departure_time |
no | ISO time, for example 2026-11-11T08:30:00+01:00. Used for gate opening hours, not traffic |
Answer (example values)
{
"routes": [
{
"distance_m": 18412,
"duration_s": 2140,
"geometry": "o~{zKq}xiE...",
"legs": [{
"distance_m": 18412,
"duration_s": 2140,
"start": { "lat": 6.4541, "lng": 3.3947 },
"end": { "lat": 6.5965, "lng": 3.3421 },
"steps": [{
"instruction": "Turn right onto Ikorodu Road.",
"maneuver": "turn-right",
"distance_m": 2300,
"duration_s": 260,
"street_names": ["Ikorodu Road"],
"location": { "lat": 6.5012, "lng": 3.3778 },
"geometry": "…"
}]
}]
}
],
"attribution": "© Rana Maps © OpenStreetMap"
}
geometryis an encoded polyline at precision 6. Add?geometry=geojsonfor a GeoJSON line.- Distances are whole metres; times are whole seconds.
- No route found answers
200with"routes": []. - A
place_idthat does not resolve answers404 not_found. maneuveris one ofdepart,arrive,straight,turn-left,turn-right,turn-slight-left,turn-slight-right,turn-sharp-left,turn-sharp-right,uturn-left,uturn-right,keep-left,keep-right,fork-left,fork-right,ramp-left,ramp-right,merge,merge-left,merge-right,roundabout,ferry, ornull.
Coverage
All of Nigeria once the Nigeria release is deployed (built and tested, not live yet). Gates and closed roads are known mostly in Lagos, so routes elsewhere may pass a gate we have not heard of.
Limits
Trial: 60 requests a minute, 2,000 a day. See limits and usage.