Rana Maps developers

Beta

Distance matrix

Today: live (Beta) since 11 November 2026.

What it does

Gives the distance and time from each origin to each destination, for example from 10 drivers to 10 pickups. The same modes as directions, with the same gates and closed roads left out.

Limits

On our test machine a 10 × 10 matrix in Lagos took about a quarter of a second.

Request

POST https://maps-api.ranamaps.com/v1/directions/matrix

curl https://maps-api.ranamaps.com/v1/directions/matrix \
  -H "X-Rana-Key: $RANA_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "origins": [{"lat": 6.4541, "lng": 3.3947}, {"lat": 6.4281, "lng": 3.4219}],
    "destinations": [{"lat": 6.5965, "lng": 3.3421}],
    "mode": "car"
  }'

Answer (example values)

{
  "rows": [
    { "cells": [{ "distance_m": 18412, "duration_s": 1710 }] },
    { "cells": [{ "distance_m": 21950, "duration_s": 2033 }] }
  ],
  "attribution": "© Rana Maps © OpenStreetMap"
}

Coverage

All of Nigeria once the Nigeria release is deployed. Gates and closed roads are known mostly in Lagos.