Get report

This API generates a report for vehicles, drivers, zones, clients, or tags over a selected time period, with detailed options for customizing the report content.

How to get data

Request address

To get the data, use the address:  https://<server_address>/api/api.php?

Request method

GET or POST

Request parameters

Required:
  • cmd=get_report — API command to retrieve a report
  • report_type — report type (numeric identifier)
  • start — start of the period (Unix timestamp)
  • stop — end of the period (Unix timestamp)
  • veh_id — vehicle IDs (comma-separated)
  • explode — data separation: 1 — by days, 2 — by weeks, 3 — no separation
  • group — data grouping: 1 — by days, 2 — by objects, 3 — by zones, 4 — by drivers, 5 — by clients, 6 — by groups, 7 — by tags
  • format— report format: json, pdf, xls
  • tz — time zone of the report (e.g., Africa/Johannesburg)
Optional:
  • drivers_id — list of driver IDs
  • zones_id — list of geofence IDs
  • fillings — include refueling data
  • stales — include idle periods
  • speed — include speed data
  • rashod — include fuel consumption
  • stops — include stops
  • run — include engine run data
  • contr_time/ type — control time
  • tags — list of tag IDs
  • template — report template ID
  • outside_zones — include external zones
  • work_hours — include only working hours
  • fuel — include fuel data
  • vehicle_not_moving_time — include idle time for the report
  • vehicles_has_covered_km — include vehicle mileage
  • notifications — list of notification IDs
 

Example GET request

https://<server_address>/api/api.php?cmd=get_report&report_type=1&start=1724623200&stop=1724709600&veh_id=1234,5678&explode=1&group=2&format=json
&tz=Africa/Johannesburg&node=1

Example POST request

{
    "cmd": "get_report",
    "report_type": 1,
    "start": 1724623200,
    "stop": 1724709600,
    "veh_id": "1234,5678",
    "explode": 1,
    "group": 2,
    "format": "json",
    "tz": "Africa/Johannesburg"
}
Response
{
  "code": 0,
  "msg": "OK",
  "data": [
    {
      "veh_id": "1234",
      "date": "2025-09-22",
      "distance": 125.5,
      "fuel_consumption": 15.2,
      "stops": 5,
      "speed_avg": 60
    },
    {
      "veh_id": "5678",
      "date": "2025-09-22",
      "distance": 98.3,
      "fuel_consumption": 12.7,
      "stops": 4,
      "speed_avg": 55
    }
  ]
}
In response to the API request, the following is returned:
  • code — result code (0 = successful operation)
  • msg — server message
  • data — array of report data
  • veh_id — vehicle ID
  • date — report date
  • distance — distance traveled (km)
  • fuel_consumption — fuel consumed
  • stops — number of stops
  • speed_avg — average speed