N-Ways
Documentation développeursTarifs

Tarifs

Ce que devrait coûter une course en taxi, okada, keke, bus ou bateau.

Remarque :

Envoyez votre clé avec key=VOTRE_CLE_API dans l’adresse, ou dans l’en-tête X-NWays-Api-Key. Clés d’API

Adresse de base : https://nways.ng/maps/v1

Ce que coûte une course

GET https://nways.ng/maps/v1/fares/estimate

Tarifs de taxi, taxi partagé, okada, keke, danfo/bus, VTC et bateau en NGN, GHS ou XOF, d’après les signalements des passagers (basis: crowd) ou des sources publiées (basis: guide), avec nuit, heure de pointe, pluie et course privée. Les modes que la loi exclut du trajet figurent dans notAllowed, avec la source de la règle. Transmettez les distanceM et durationS de l’itinéraire quand vous les avez. Raisons : FROM_TO_REQUIRED, MODE_INVALID, AT_INVALID, DISTANCEM_INVALID, DURATIONS_INVALID, LANG_INVALID.

Paramètres

NomOùTypeDescription
fromrequêtestringObligatoire.
torequêtestringObligatoire.
moderequêtestringListe séparée par des virgules parmi taxi, shared_taxi, okada, keke, danfo, ridehail, boat (par défaut, tous).
atrequêtestring (date-time)
distanceMrequêtenumber
durationSrequêtenumber
charterrequêteboolean
rainrequêteboolean
langrequêtestringAu choix: en, fr, pt. Par défaut: en.
fieldsrequêtestringListe séparée par des virgules des champs à garder dans chaque résultat (a.b descend dans les objets ; id est toujours gardé ; * = tous).
cURL
curl "https://nways.ng/maps/v1/fares/estimate?from=6.4474%2C3.4720&to=6.5244%2C3.3792" \
  -H "X-NWays-Api-Key: VOTRE_CLE_API"
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()

Réponse

Estimations

ChampTypeDescription
countrystringObligatoire.
regionstring
currencystring
distanceMnumberObligatoire.
durationSnumberObligatoire.
nightbooleanObligatoire.
estimatesFareEstimate[]Obligatoire.
estimates[].modestringObligatoire. Au choix: taxi, shared_taxi, okada, keke, bus, ridehail, boat.
estimates[].servicestring
estimates[].currencystringObligatoire. Au choix: NGN, GHS, XOF.
estimates[].lowintegerObligatoire.
estimates[].typicalintegerObligatoire.
estimates[].highintegerObligatoire.
estimates[].textstringObligatoire.
estimates[].perPersonbooleanObligatoire.
estimates[].charterbooleanObligatoire.
estimates[].nightboolean
estimates[].rushboolean
estimates[].rainboolean
estimates[].basisstringObligatoire. Au choix: crowd, guide.
estimates[].reportsintegerObligatoire.
estimates[].durationSnumberObligatoire.
estimates[].openingOfferintegerLà où les prix se marchandent : une bonne première offre.
estimates[].sourcesstring (uri)[]
notAllowedobject[]Obligatoire.
notAllowed[].modestringObligatoire.
notAllowed[].banBanObligatoire.
notAllowed[].ban.idstringObligatoire.
notAllowed[].ban.zonestringObligatoire.
notAllowed[].ban.scopestringObligatoire.
notAllowed[].ban.hoursstring
notAllowed[].ban.sincestring
notAllowed[].ban.sourcestring (uri)
notAllowed[].ban.wherestringAu choix: origin, destination, stop, route.
notAllowed[].ban.walkMnumber
notAllowed[].textstringObligatoire.
attributionstringObligatoire.
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"
}

Erreurs

  • default Erreur