N-Ways
Developer docsLive

Live

Live

On this page
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/fleet

Every vehicle now, with its rider, state, current delivery and zones

GET https://nways.ng/maps/v1/fleet/live

state: moving, stopped (stayed within 50 m for 2 minutes or more; stoppedSince says since when), offline (silent longer than offlineAfterS) or never (no position yet). task is the open delivery assigned last; openTasks counts them all. counts sums the fleet and its open deliveries (unassigned = created, no vehicle; late = open and past dueAt, or expected after it).

cURL
curl "https://nways.ng/maps/v1/fleet/live" \
  -H "X-NWays-Api-Key: YOUR_API_KEY"
JavaScript
const res = await fetch('https://nways.ng/maps/v1/fleet/live', {
  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/fleet/live",
    headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
    timeout=10,
)
data = res.json()

Response

The fleet now

FieldTypeDescription
vehiclesLiveVehicle[]Required.
vehicles[].idstringRequired.
vehicles[].namestringRequired.
vehicles[].modestringRequired. How ETAs are routed. motorcycle = a dispatch bike (motorcycle roads and timing; the commercial okada bans, which are for passenger okadas, don't apply); okada = a passenger okada fleet (kept out of okada ban areas); motorbike = a private motorbike; keke = a tricycle (two-wheeler roads, no okada bans); car, van, truck = car routing; bicycle; walk = a courier on foot; boat = on the water (ETA in a straight line at its speed); asset = anything else you track (a trailer, a generator): never routed. One of: motorcycle, okada, motorbike, keke, car, van, truck, bicycle, walk, boat, asset. Default: motorcycle.
vehicles[].platestringRequired.
vehicles[].groupstring
vehicles[].colourstringThe vehicle's colour on the console's and N-Ways Business's maps. A new vehicle takes the one its project uses least. One of: blue, orange, teal, purple, pink, green, brown, navy, magenta, olive, cyan, maroon, sky, lime, plum, sand.
vehicles[].batteryPctnumberThe battery at its last report, when it sends one.
vehicles[].driverobject | nullRequired.
vehicles[].statestringRequired. One of: moving, stopped, offline, never.
vehicles[].lastLocationPosition | nullRequired.
vehicles[].stoppedSincestring (date-time) | nullRequired.
vehicles[].taskobject | nullRequired.
vehicles[].openTasksintegerRequired.
vehicles[].zonesobject[]Required.
vehicles[].zones[].idstring
vehicles[].zones[].namestring
countsobjectRequired.
counts.totalintegerRequired.
counts.movingintegerRequired.
counts.stoppedintegerRequired.
counts.offlineintegerRequired.
counts.neverintegerRequired.
counts.activeTasksintegerRequired.
counts.unassignedintegerRequired.
counts.lateintegerRequired.
settingsSettingsRequired.
settings.shareTrafficbooleanRequired. Let your vehicles' positions also feed N-Ways' public live traffic (anonymously). Off unless you turn it on. Default: false.
settings.retentionDaysintegerRequired. How long trip history and ended tasks are kept. Default: 30. ≥ 1, ≤ 90.
settings.brandNamestringRequired. The name tracking pages show ("Your delivery from …"). Up to 60 characters.
settings.offlineAfterSintegerRequired. Silence after which a vehicle is offline (vehicle.offline). Default: 600. ≥ 60, ≤ 86400.
settings.stopAlertSintegerRequired. A vehicle on a delivery stopped this long is a stopped alert. Default: 600. ≥ 60, ≤ 7200.
atstring (date-time)Required.
200 OK
{
  "vehicles": [
    {
      "id": "string",
      "name": "string",
      "mode": "motorcycle",
      "plate": "string",
      "group": "string",
      "colour": "blue",
      "batteryPct": 0,
      "driver": {
        "id": "string",
        "name": "string",
        "phone": "string"
      },
      "state": "moving",
      "lastLocation": {
        "lat": 0,
        "lng": 0,
        "heading": 0,
        "speedMps": 0,
        "accuracyM": 0,
        "at": "2026-10-15T09:00:00+01:00"
      },
      "stoppedSince": "2026-10-15T09:00:00+01:00",
      "task": {
        "id": "string",
        "ref": "string",
        "status": "created",
        "pickup": {
          "lat": 0,
          "lng": 0,
          "name": "string",
          "address": "string"
        },
        "dropoff": {
          "lat": 0,
          "lng": 0,
          "name": "string",
          "address": "string"
        },
        "recipientName": "string",
        "eta": {
          "at": "2026-10-15T09:00:00+01:00",
          "durationS": 0,
          "distanceM": 0,
          "trafficDelayS": 0,
          "pickupAt": "2026-10-15T09:00:00+01:00",
          "updatedAt": "2026-10-15T09:00:00+01:00"
        },
        "dueAt": "2026-10-15T09:00:00+01:00",
        "late": true,
        "trackingUrl": "string"
      },
      "openTasks": 0,
      "zones": [
        {
          "id": "string",
          "name": "string"
        }
      ]
    }
  ],
  "counts": {
    "total": 0,
    "moving": 0,
    "stopped": 0,
    "offline": 0,
    "never": 0,
    "activeTasks": 0,
    "unassigned": 0,
    "late": 0
  },
  "settings": {
    "shareTraffic": false,
    "retentionDays": 30,
    "brandName": "string",
    "offlineAfterS": 600,
    "stopAlertS": 600
  },
  "at": "2026-10-15T09:00:00+01:00"
}

Errors

  • default Error

What needs a look now, most urgent first

GET https://nways.ng/maps/v1/fleet/alerts

offline: a vehicle with an open delivery silent longer than offlineAfterS; late: an open delivery past dueAt or expected after it; stopped: a vehicle with an open delivery stopped longer than stopAlertS.

cURL
curl "https://nways.ng/maps/v1/fleet/alerts" \
  -H "X-NWays-Api-Key: YOUR_API_KEY"
JavaScript
const res = await fetch('https://nways.ng/maps/v1/fleet/alerts', {
  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/fleet/alerts",
    headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
    timeout=10,
)
data = res.json()

Response

Alerts

FieldTypeDescription
alertsAlert[]Required.
alerts[].kindstringRequired. crash first (open until resolved; detail as the crash alert's, with alertId). One of: crash, offline, late, stopped.
alerts[].vehicleIdstring | nullRequired.
alerts[].vehicleNamestringRequired.
alerts[].taskIdstring | nullRequired.
alerts[].taskRefstringThe delivery's number (#1042), for the alert's words.
alerts[].taskLabelstringWho or where the delivery is for.
alerts[].vehicleColourstringThe vehicle's colour on the console's and N-Ways Business's maps. A new vehicle takes the one its project uses least. One of: blue, orange, teal, purple, pink, green, brown, navy, magenta, olive, cyan, maroon, sky, lime, plum, sand.
alerts[].sincestring (date-time)Required.
alerts[].detailobjectRequired. offline {lastSeenAt, offlineAfterS}; late {dueAt, status, etaAt?}; stopped {stoppedS, stopAlertS, position}.
atstring (date-time)Required.
200 OK
{
  "alerts": [
    {
      "kind": "crash",
      "vehicleId": "string",
      "vehicleName": "string",
      "taskId": "string",
      "taskRef": "string",
      "taskLabel": "string",
      "vehicleColour": "blue",
      "since": "2026-10-15T09:00:00+01:00",
      "detail": {}
    }
  ],
  "at": "2026-10-15T09:00:00+01:00"
}

Errors

  • default Error

Where each vehicle on a delivery is going

GET https://nways.ng/maps/v1/fleet/routes

For every vehicle with an open delivery: the road it has travelled since its first open (or today's finished) delivery began (done, at most 6 hours, a point every 15 s at most), the road ahead from its last position through every stop it hasn't reached (ahead, from the routing engine; straight lines while routed is false), and its stops in order: today's finished ones first, then each open delivery's pickup and drop-off. Lines are [lng, lat] (GeoJSON order) and simplified. The road ahead is worked out again when the stops change and every few minutes, not on every position: trim it to the vehicle's live position on your map.

Parameters

NameInTypeDescription
vehicleIdquerystringOne vehicle only.
cURL
curl "https://nways.ng/maps/v1/fleet/routes" \
  -H "X-NWays-Api-Key: YOUR_API_KEY"
JavaScript
const res = await fetch('https://nways.ng/maps/v1/fleet/routes', {
  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/fleet/routes",
    headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
    timeout=10,
)
data = res.json()

Response

Routes

FieldTypeDescription
routesVehicleRoute[]Required.
routes[].vehicleIdstringRequired.
routes[].colourstringRequired. The vehicle's colour on the console's and N-Ways Business's maps. A new vehicle takes the one its project uses least. One of: blue, orange, teal, purple, pink, green, brown, navy, magenta, olive, cyan, maroon, sky, lime, plum, sand.
routes[].donenumber[][]Required.
routes[].aheadnumber[][]Required.
routes[].routedbooleanRequired. ahead follows the roads (false: straight lines between the stops for now).
routes[].stopsobject[]Required.
routes[].stops[].nintegerRequired. The stop's number, from 1.
routes[].stops[].kindstringRequired. One of: pickup, dropoff.
routes[].stops[].taskIdstringRequired.
routes[].stops[].taskRefstringRequired. The delivery's number (#1042).
routes[].stops[].labelstringRequired. Who or where it is for: the recipient, else the drop-off's name.
routes[].stops[].namestringThe stop's name or address.
routes[].stops[].latnumberRequired.
routes[].stops[].lngnumberRequired.
routes[].stops[].statusstringRequired. One of: created, assigned, picked_up, arriving, completed, failed, cancelled.
routes[].stops[].etaAtstring (date-time) | nullRequired.
routes[].stops[].dueAtstring (date-time) | nullRequired.
routes[].stops[].donebooleanRequired. Reached (picked up, or delivered).
routes[].stops[].finalbooleanRequired. The last stop not yet reached.
routes[].updatedAtstring (date-time)Required.
atstring (date-time)Required.
200 OK
{
  "routes": [
    {
      "vehicleId": "string",
      "colour": "blue",
      "done": [
        [
          0
        ]
      ],
      "ahead": [
        [
          0
        ]
      ],
      "routed": true,
      "stops": [
        {
          "n": 0,
          "kind": "pickup",
          "taskId": "string",
          "taskRef": "string",
          "label": "string",
          "name": "string",
          "lat": 0,
          "lng": 0,
          "status": "created",
          "etaAt": "2026-10-15T09:00:00+01:00",
          "dueAt": "2026-10-15T09:00:00+01:00",
          "done": true,
          "final": true
        }
      ],
      "updatedAt": "2026-10-15T09:00:00+01:00"
    }
  ],
  "at": "2026-10-15T09:00:00+01:00"
}

Errors

  • default Error