Tarifs
Ce que devrait coûter une course en taxi, okada, keke, bus ou bateau.
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
| Nom | Où | Type | Description |
|---|---|---|---|
from | requête | string | Obligatoire. |
to | requête | string | Obligatoire. |
mode | requête | string | Liste séparée par des virgules parmi taxi, shared_taxi, okada, keke, danfo, ridehail, boat (par défaut, tous). |
at | requête | string (date-time) | |
distanceM | requête | number | |
durationS | requête | number | |
charter | requête | boolean | |
rain | requête | boolean | |
lang | requête | string | Au choix: en, fr, pt. Par défaut: en. |
fields | requête | string | Liste 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 "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"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()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
| Champ | Type | Description |
|---|---|---|
country | string | Obligatoire. |
region | string | |
currency | string | |
distanceM | number | Obligatoire. |
durationS | number | Obligatoire. |
night | boolean | Obligatoire. |
estimates | FareEstimate[] | Obligatoire. |
estimates[].mode | string | Obligatoire. Au choix: taxi, shared_taxi, okada, keke, bus, ridehail, boat. |
estimates[].service | string | |
estimates[].currency | string | Obligatoire. Au choix: NGN, GHS, XOF. |
estimates[].low | integer | Obligatoire. |
estimates[].typical | integer | Obligatoire. |
estimates[].high | integer | Obligatoire. |
estimates[].text | string | Obligatoire. |
estimates[].perPerson | boolean | Obligatoire. |
estimates[].charter | boolean | Obligatoire. |
estimates[].night | boolean | |
estimates[].rush | boolean | |
estimates[].rain | boolean | |
estimates[].basis | string | Obligatoire. Au choix: crowd, guide. |
estimates[].reports | integer | Obligatoire. |
estimates[].durationS | number | Obligatoire. |
estimates[].openingOffer | integer | Là où les prix se marchandent : une bonne première offre. |
estimates[].sources | string (uri)[] | |
notAllowed | object[] | Obligatoire. |
notAllowed[].mode | string | Obligatoire. |
notAllowed[].ban | Ban | Obligatoire. |
notAllowed[].ban.id | string | Obligatoire. |
notAllowed[].ban.zone | string | Obligatoire. |
notAllowed[].ban.scope | string | Obligatoire. |
notAllowed[].ban.hours | string | |
notAllowed[].ban.since | string | |
notAllowed[].ban.source | string (uri) | |
notAllowed[].ban.where | string | Au choix: origin, destination, stop, route. |
notAllowed[].ban.walkM | number | |
notAllowed[].text | string | Obligatoire. |
attribution | string | Obligatoire. |
{
"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
defaultErreur