N-Ways
Developer docsTraffic

Traffic

Live congestion on the roads, as GeoJSON.

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

Live traffic in an area

GET https://nways.ng/maps/v1/traffic

Roads with live readings from N-Ways' phones (anonymised), as GeoJSON lines with a congestion level. Reasons: BBOX_INVALID.

Parameters

NameInTypeDescription
bboxquerystringRequired. minLng,minLat,maxLng,maxLat, under 3° across.
cURL
curl "https://nways.ng/maps/v1/traffic?bbox=3.30%2C6.40%2C3.50%2C6.60" \
  -H "X-NWays-Api-Key: YOUR_API_KEY"
JavaScript
const res = await fetch('https://nways.ng/maps/v1/traffic?bbox=3.30%2C6.40%2C3.50%2C6.60', {
  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/traffic?bbox=3.30%2C6.40%2C3.50%2C6.60",
    headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
    timeout=10,
)
data = res.json()

Response

Traffic

FieldTypeDescription
typestringRequired.
featuresobject[]Required.
features[].typestringRequired.
features[].geometryLineStringRequired.
features[].geometry.typestringRequired.
features[].geometry.coordinatesnumber[][]Required.
features[].propertiesobjectRequired.
features[].properties.levelintegerRequired. ≥ 0, ≤ 3.
features[].properties.levelNamestringRequired. One of: free, slow, heavy, standstill.
features[].properties.speedKmhnumberRequired.
features[].properties.normalKmhnumberRequired.
features[].properties.confidencestringRequired. One of: low, medium, high.
attributionstringRequired.
200 OK
{
  "type": "string",
  "features": [
    {
      "type": "string",
      "geometry": {
        "type": "string",
        "coordinates": [
          []
        ]
      },
      "properties": {
        "level": 0,
        "levelName": "free",
        "speedKmh": 0,
        "normalKmh": 0,
        "confidence": "low"
      }
    }
  ],
  "attribution": "string"
}

Errors

  • default Error