Tarifas
Quanto deve custar uma viagem de táxi, okada, keke, autocarro ou barco.
Envie a sua chave com key=A_SUA_CHAVE_API no endereço, ou no cabeçalho X-NWays-Api-Key. Chaves de API
Endereço base: https://nways.ng/maps/v1
Quanto custa uma viagem
GET https://nways.ng/maps/v1/fares/estimate
Tarifas de táxi, táxi partilhado, okada, keke, danfo/autocarro, transporte por aplicação e barco em NGN, GHS ou XOF, a partir de relatos de passageiros (basis: crowd) ou de fontes publicadas (basis: guide), com noite, hora de ponta, chuva e fretamento. Os modos que a lei exclui do percurso estão em notAllowed, com a fonte da regra. Passe o distanceM e o durationS do percurso quando os tiver. Motivos: FROM_TO_REQUIRED, MODE_INVALID, AT_INVALID, DISTANCEM_INVALID, DURATIONS_INVALID, LANG_INVALID.
Parâmetros
| Nome | Onde | Tipo | Descrição |
|---|---|---|---|
from | consulta | string | Obrigatório. |
to | consulta | string | Obrigatório. |
mode | consulta | string | Lista separada por vírgulas de taxi, shared_taxi, okada, keke, danfo, ridehail, boat (por omissão, todos). |
at | consulta | string (date-time) | |
distanceM | consulta | number | |
durationS | consulta | number | |
charter | consulta | boolean | |
rain | consulta | boolean | |
lang | consulta | string | Um de: en, fr, pt. Predefinição: en. |
fields | consulta | string | Lista separada por vírgulas dos campos a manter em cada resultado (a.b entra em objetos; id é sempre mantido; * = todos). |
curl "https://nways.ng/maps/v1/fares/estimate?from=6.4474%2C3.4720&to=6.5244%2C3.3792" \
-H "X-NWays-Api-Key: A_SUA_CHAVE_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()Resposta
Estimativas
| Campo | Tipo | Descrição |
|---|---|---|
country | string | Obrigatório. |
region | string | |
currency | string | |
distanceM | number | Obrigatório. |
durationS | number | Obrigatório. |
night | boolean | Obrigatório. |
estimates | FareEstimate[] | Obrigatório. |
estimates[].mode | string | Obrigatório. Um de: taxi, shared_taxi, okada, keke, bus, ridehail, boat. |
estimates[].service | string | |
estimates[].currency | string | Obrigatório. Um de: NGN, GHS, XOF. |
estimates[].low | integer | Obrigatório. |
estimates[].typical | integer | Obrigatório. |
estimates[].high | integer | Obrigatório. |
estimates[].text | string | Obrigatório. |
estimates[].perPerson | boolean | Obrigatório. |
estimates[].charter | boolean | Obrigatório. |
estimates[].night | boolean | |
estimates[].rush | boolean | |
estimates[].rain | boolean | |
estimates[].basis | string | Obrigatório. Um de: crowd, guide. |
estimates[].reports | integer | Obrigatório. |
estimates[].durationS | number | Obrigatório. |
estimates[].openingOffer | integer | Onde os preços se regateiam: uma boa primeira oferta. |
estimates[].sources | string (uri)[] | |
notAllowed | object[] | Obrigatório. |
notAllowed[].mode | string | Obrigatório. |
notAllowed[].ban | Ban | Obrigatório. |
notAllowed[].ban.id | string | Obrigatório. |
notAllowed[].ban.zone | string | Obrigatório. |
notAllowed[].ban.scope | string | Obrigatório. |
notAllowed[].ban.hours | string | |
notAllowed[].ban.since | string | |
notAllowed[].ban.source | string (uri) | |
notAllowed[].ban.where | string | Um de: origin, destination, stop, route. |
notAllowed[].ban.walkM | number | |
notAllowed[].text | string | Obrigatório. |
attribution | string | Obrigatório. |
{
"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"
}Erros
defaultErro