Rana Maps developers

Beta

API reference

Rana's own web services for maps, routing, roads, geocoding and places in Nigeria.

Version 1.0.0-beta. Server: https://maps-api.ranamaps.com (Customer API).

Operations

GET /v1/key Beta

Describes the key that calls, its organisation's plan and limits. Free; counts no usage.

POST /v1/directions/route Beta

A route from an origin to a destination, with optional waypoints and alternatives.

POST /v1/directions/matrix Beta

Distance and time from each origin to each destination. Up to 100 cells; usage counts one unit per cell.

POST /v1/roads/snap Beta

Snaps a GPS trace (up to 100 points) to the roads most likely travelled, with the distance along them.

GET /v1/geocode/reverse Beta

Street, area, ward, city, LGA and state for a point.

GET /v1/geocode Alpha

Points for a written place, street or area name. Alpha; thin outside Lagos.

GET /v1/places/autocomplete Alpha

Place, street, stop and area suggestions as a person types. Alpha; thin outside Lagos.

GET /v1/places/nearby Alpha

Verified places within a radius, nearest first. Alpha.

GET /v1/places/{place_id} Alpha

One verified place with its street, gates (status and hours) and approved photos. Alpha.

GET /v1/static Beta

A PNG or WebP picture of the map, with optional markers and one path. Cached at Cloudflare for a day.

POST /v1/telemetry Beta

SDK health events (the SDKs send these). Kept as daily counts; never location, viewport or user ids. Counts no usage.

Keys

SchemeSent asNotes
RanaKeyHeaderX-Rana-Key: …Preferred. A public key (pk_live_…) in web pages and apps, a secret key (sk_live_…) on servers.
RanaKeyQuery?key=…Allowed, but the header keeps keys out of URLs and logs. If both are sent and differ, the request is refused with conflicting_keys.

Response headers

HeaderMeaning
Rana-Request-IdA random id for this request. Quote it to support.
Rana-StabilityThe label of the endpoint that answered.
X-RateLimit-LimitRequests (or matrix cells) allowed per minute for this organisation and product group.
X-RateLimit-RemainingRequests (or matrix cells) left in the current minute.
Retry-AfterSeconds to wait before trying again. Sent with 429 and 503.

Error responses

ResponseWhen
BadRequestThe request is not valid (invalid_request, invalid_body, conflicting_keys, too_many_cells, too_many_points).
UnauthorizedNo usable key (missing_key, malformed_key, unknown_key).
ForbiddenThe key may not be used here (revoked, organisation_suspended, client_not_allowed, no_client_identity, secret_key_in_browser, scope_not_allowed).
NotFoundNo such resource (not_found).
TooManyRequestsOver a limit (rate_limited, daily_limit_reached, spending_cap_reached).
InternalErrorOur fault (internal_error).
UnavailableRouting or search is busy or down (upstream_unavailable).
TimeoutThe answer took too long (timeout).

Every error code is explained on the errors page.

Schemas

Point

A point in WGS 84.

FieldTypeRequiredNotes
latnumberyes
lngnumberyes

Metres

A distance in whole metres.

Type: integer

Seconds

A duration in whole seconds.

Type: integer

Polyline6

An encoded polyline at precision 6.

Type: string

GeoJsonLineString

FieldTypeRequiredNotes
type"LineString"yes
coordinatesarrayyes

Attribution

Type: string

Always © Rana Maps © OpenStreetMap

Plan

trial is free with daily limits; payg bills every unit; starter and business are subscriptions with overage.

Type: string

Values: trial, payg, starter, business, custom

KeyInfo

FieldTypeRequiredNotes
organisation_idstringyes
keyobjectyes
planPlanyes
limitsobjectyes
attributionAttributionyes

Location

A point, or one of our place ids. A destination place routes to its open gate.

Avoid

Type: array

Line

polyline6 by default; a GeoJSON LineString with ?geometry=geojson.

RouteRequest

FieldTypeRequiredNotes
originLocationyes
destinationLocationyes
waypointsarray
modeMode
alternativesbooleanUp to two more routes. Ignored with waypoints.
avoidAvoid
departure_timestringUsed for gate opening hours. No live traffic.

Step

FieldTypeRequiredNotes
instructionstringyes
maneuverstring,nullyesFor example turn-left, keep-right, roundabout, depart, arrive.
distance_mMetresyes
duration_sSecondsyes
street_namesarrayyes
locationPointyes
geometryLineyes

Leg

FieldTypeRequiredNotes
distance_mMetresyes
duration_sSecondsyes
startPointyes
endPointyes
stepsarrayyes

Route

FieldTypeRequiredNotes
distance_mMetresyes
duration_sSecondsyes
geometryLineyes
legsarrayyes

RouteResponse

FieldTypeRequiredNotes
routesarrayyes
attributionAttributionyes

MatrixRequest

FieldTypeRequiredNotes
originsarrayyes
destinationsarrayyes
modeMode
avoidAvoid

MatrixCell

FieldTypeRequiredNotes
distance_minteger,nullyes
duration_sinteger,nullyes

MatrixResponse

FieldTypeRequiredNotes
rowsarrayyes
attributionAttributionyes

SnapRequest

FieldTypeRequiredNotes
pointsarrayyes
modestring
interpolatebooleanAlso return the points along the road between the snapped ones.

SnapResponse

FieldTypeRequiredNotes
pointsarrayyes
distance_mMetresyes
geometryLineyes
attributionAttributionyes

ReverseGeocodeResponse

FieldTypeRequiredNotes
streetstring,nullyes
street_sourcestring,nullyes
areastring,nullyesSuburb or neighbourhood.
wardstring,nullyes
citystring,nullyes
lgastring,nullyesLocal government area.
statestring,nullyes
countrystring,nullyes
formattedstring,nullyes
attributionAttributionyes

GeocodeResponse

FieldTypeRequiredNotes
resultsarrayyes
attributionAttributionyes

PlaceKind

Type: string

Values: unknown, fuel, bank, worship, education, health, lodging, market, food, shop, service, government, office, leisure, other

AutocompleteResponse

FieldTypeRequiredNotes
suggestionsarrayyes
attributionAttributionyes

NearbyResponse

FieldTypeRequiredNotes
resultsarrayyes
attributionAttributionyes

Gate

FieldTypeRequiredNotes
namestringyes
rolestringyesmain or side
pointPointyes
statusstringyesNow, in Lagos time, from the gate's hours.
hoursstring,nullyesHH:MM-HH:MM, Lagos time.

PlaceDetails

FieldTypeRequiredNotes
place_idstringyes
namestringyes
aliasesarrayyes
kindstringyes
pointPointyes
streetstring,nullyes
house_numberstring,nullyes
how_to_findstring,nullyes
gatesarrayyes
photosarrayyes
updated_atstring,nullyes
attributionAttributionyes

Mode

transit answers with no routes for now.

Type: string

Values: car, okada, keke, bicycle, walk, transit

ErrorCode

A stable code. Clients branch on it. New codes may be added; existing ones never change within v1.

Type: string

Values: invalid_request, invalid_body, conflicting_keys, too_many_cells, too_many_points, missing_key, malformed_key, unknown_key, revoked, organisation_suspended, client_not_allowed, no_client_identity, secret_key_in_browser, scope_not_allowed, not_found, rate_limited, daily_limit_reached, spending_cap_reached, internal_error, upstream_unavailable, timeout

Error

FieldTypeRequiredNotes
errorErrorCodeyes
messagestringyesPlain English for the developer. Wording can change; do not parse it.
docsstringyesLink to the code's entry on the errors page.
detailsExtra detail for some codes, for example the failing fields of invalid_body.

Map data answers carry "attribution": "© Rana Maps © OpenStreetMap".