Fares
What a taxi, okada, keke, bus or boat ride should cost.
Note:
Send your key as key=YOUR_API_KEY on the address, or in the X-NWays-Api-Key header. API keys
Base address: https://nways.ng/maps/v1
What a ride costs
GET https://nways.ng/maps/v1/fares/estimate
Taxi, shared taxi, okada, keke, danfo/bus, ride-hail and boat fares in NGN, GHS or XOF, from riders' reports (basis: crowd) or published sources (basis: guide), with night, rush hour, rain and charter. Modes the law keeps off the trip are in notAllowed, with the rule's source. Pass the route's distanceM and durationS when you have them. Reasons: FROM_TO_REQUIRED, MODE_INVALID, AT_INVALID, DISTANCEM_INVALID, DURATIONS_INVALID, LANG_INVALID.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
from | query | string | Required. |
to | query | string | Required. |
mode | query | string | Comma list of taxi, shared_taxi, okada, keke, danfo, ridehail, boat (default all). |
at | query | string (date-time) | |
distanceM | query | number | |
durationS | query | number | |
charter | query | boolean | |
rain | query | boolean | |
lang | query | string | One of: en, fr, pt. Default: en. |
fields | query | string | Comma list of the fields to keep in each result (a.b reaches into objects; id is always kept; * = all). |
cURL
curl "https://nways.ng/maps/v1/fares/estimate?from=6.4474%2C3.4720&to=6.5244%2C3.3792" \
-H "X-NWays-Api-Key: YOUR_API_KEY"JavaScript
const res = await fetch('https://nways.ng/maps/v1/fares/estimate?from=6.4474%2C3.4720&to=6.5244%2C3.3792', {
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()Python
import os
import requests
res = requests.get(
"https://nways.ng/maps/v1/fares/estimate?from=6.4474%2C3.4720&to=6.5244%2C3.3792",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Response
Estimates
| Field | Type | Description |
|---|---|---|
country | string | Required. |
region | string | |
currency | string | |
distanceM | number | Required. |
durationS | number | Required. |
night | boolean | Required. |
estimates | FareEstimate[] | Required. |
estimates[].mode | string | Required. One of: taxi, shared_taxi, okada, keke, bus, ridehail, boat. |
estimates[].service | string | |
estimates[].currency | string | Required. One of: NGN, GHS, XOF. |
estimates[].low | integer | Required. |
estimates[].typical | integer | Required. |
estimates[].high | integer | Required. |
estimates[].text | string | Required. |
estimates[].perPerson | boolean | Required. |
estimates[].charter | boolean | Required. |
estimates[].night | boolean | |
estimates[].rush | boolean | |
estimates[].rain | boolean | |
estimates[].basis | string | Required. One of: crowd, guide. |
estimates[].reports | integer | Required. |
estimates[].durationS | number | Required. |
estimates[].openingOffer | integer | Where prices are haggled: a good first offer. |
estimates[].sources | string (uri)[] | |
notAllowed | object[] | Required. |
notAllowed[].mode | string | Required. |
notAllowed[].ban | Ban | Required. |
notAllowed[].ban.id | string | Required. |
notAllowed[].ban.zone | string | Required. |
notAllowed[].ban.scope | string | Required. |
notAllowed[].ban.hours | string | |
notAllowed[].ban.since | string | |
notAllowed[].ban.source | string (uri) | |
notAllowed[].ban.where | string | One of: origin, destination, stop, route. |
notAllowed[].ban.walkM | number | |
notAllowed[].text | string | Required. |
attribution | string | Required. |
200 OK
{
"country": "string",
"region": "string",
"currency": "string",
"distanceM": 0,
"durationS": 0,
"night": true,
"estimates": [
{
"mode": "taxi",
"service": "Bolt",
"currency": "NGN",
"low": 0,
"typical": 0,
"high": 0,
"text": "₦3,000–4,500",
"perPerson": true,
"charter": true,
"night": true,
"rush": true,
"rain": true,
"basis": "crowd",
"reports": 0,
"durationS": 0,
"openingOffer": 0,
"sources": [
"string"
]
}
],
"notAllowed": [
{
"mode": "string",
"ban": {
"id": "string",
"zone": "Third Mainland Bridge",
"scope": "string",
"hours": "string",
"since": "string",
"source": "string",
"where": "origin",
"walkM": 0
},
"text": "string"
}
],
"attribution": "string"
}Errors
defaultError