N-Ways
Developer docsFares

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

NameInTypeDescription
fromquerystringRequired.
toquerystringRequired.
modequerystringComma list of taxi, shared_taxi, okada, keke, danfo, ridehail, boat (default all).
atquerystring (date-time)
distanceMquerynumber
durationSquerynumber
charterqueryboolean
rainqueryboolean
langquerystringOne of: en, fr, pt. Default: en.
fieldsquerystringComma 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

FieldTypeDescription
countrystringRequired.
regionstring
currencystring
distanceMnumberRequired.
durationSnumberRequired.
nightbooleanRequired.
estimatesFareEstimate[]Required.
estimates[].modestringRequired. One of: taxi, shared_taxi, okada, keke, bus, ridehail, boat.
estimates[].servicestring
estimates[].currencystringRequired. One of: NGN, GHS, XOF.
estimates[].lowintegerRequired.
estimates[].typicalintegerRequired.
estimates[].highintegerRequired.
estimates[].textstringRequired.
estimates[].perPersonbooleanRequired.
estimates[].charterbooleanRequired.
estimates[].nightboolean
estimates[].rushboolean
estimates[].rainboolean
estimates[].basisstringRequired. One of: crowd, guide.
estimates[].reportsintegerRequired.
estimates[].durationSnumberRequired.
estimates[].openingOfferintegerWhere prices are haggled: a good first offer.
estimates[].sourcesstring (uri)[]
notAllowedobject[]Required.
notAllowed[].modestringRequired.
notAllowed[].banBanRequired.
notAllowed[].ban.idstringRequired.
notAllowed[].ban.zonestringRequired.
notAllowed[].ban.scopestringRequired.
notAllowed[].ban.hoursstring
notAllowed[].ban.sincestring
notAllowed[].ban.sourcestring (uri)
notAllowed[].ban.wherestringOne of: origin, destination, stop, route.
notAllowed[].ban.walkMnumber
notAllowed[].textstringRequired.
attributionstringRequired.
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

  • default Error