Skip to main content

Kilometers Report

Distance traveled, fuel consumption, and cost metrics for your fleet over a given period.

GET/apidev/v1/reports/avl/kilometers
PermissionAPICLI_RPTAVL_KILOMETROS
Rate Limit10 req/min (sliding window)
Cache300s (5 min)
Max Range31 days

Overview

Provides distance and consumption data for every vehicle in your fleet. Use it to audit mileage, estimate fuel costs, and track CO₂ emissions.

  • Daily breakdownperday=true returns one row per vehicle per day
  • Driver groupingperperson=true segments results by the assigned driver
  • Geographic subdivisiongroupbygeo splits totals by state, city, or neighbourhood
  • Subtotalssubtotals=true includes summary rows

Query Parameters

ParameterTypeRequiredDefaultDescription
startdatestringYesISO 8601 start date-time (e.g. 2026-03-01T00:00:00)
enddatestringYesISO 8601 end date-time. Max range 31 days from startdate
devicesstringNoAll visibleComma-separated device IDs. Max 500
limitintegerNo25Records per page (1100)
offsetintegerNo0Records to skip
perdaybooleanNofalseGroup results by day
perpersonbooleanNofalseGroup results by assigned driver
subtotalsbooleanNofalseInclude subtotal rows
groupbygeoenumNoSubdivide by area: state, city, or neighbourhood
Device visibility

When devices is omitted, the report includes all devices visible to the authenticated user based on their permission scope.


Code Examples

curl -s "https://$TENANT/apidev/v1/reports/avl/kilometers?startdate=2026-03-01T00:00:00&enddate=2026-03-15T23:59:59&limit=50&perday=true" \
-H "Authorization: Bearer $TOKEN" \
-H "X-API-Key: $APIKEY" \
-H "tenant: $TENANT"

Response Fields

FieldTypeDescription
device_namestringDisplay name of the vehicle/device
device_groupstringGroup the device belongs to
person_namestring | nullAssigned driver name (when perperson is enabled)
datetimestring | nullDate of the record (when perday is enabled)
kmsnumberTotal kilometers traveled
gasnumberEstimated fuel consumed (liters)
costnumberEstimated fuel cost (currency per vehicle config)
co2numberEstimated CO₂ emissions (kg)
temperaturenumberAverage temperature sensor reading
statestring | nullState name (when groupbygeo is used)
citystring | nullCity name (when groupbygeo is used)
neighbourhoodstring | nullNeighbourhood name (when groupbygeo is used)
Fuel and cost values

gas, cost, and co2 are calculated using the fuel consumption rate and fuel price configured in each vehicle's settings. If not configured, these fields return 0.

Example Response

{
"success": true,
"data": [
{
"device_name": "Truck A-101",
"device_group": "Logistics North",
"person_name": null,
"datetime": "2026-03-01",
"kms": 267.7,
"gas": 32.12,
"cost": 48.18,
"co2": 83.54,
"temperature": 22.3,
"state": null,
"city": null,
"neighbourhood": null
},
{
"device_name": "Van B-205",
"device_group": "Urban Delivery",
"person_name": null,
"datetime": "2026-03-01",
"kms": 142.3,
"gas": 11.38,
"cost": 17.07,
"co2": 29.57,
"temperature": 4.1,
"state": null,
"city": null,
"neighbourhood": null
}
],
"meta": {
"total": 84,
"limit": 50,
"offset": 0
}
}

With perperson=true

When driver grouping is enabled, person_name is populated and multiple rows may appear for the same device if drivers changed during the period:

{
"device_name": "Truck A-101",
"device_group": "Logistics North",
"person_name": "Carlos Martinez",
"datetime": "2026-03-01",
"kms": 180.5,
"gas": 21.66,
"cost": 32.49,
"co2": 56.32,
"temperature": 22.3,
"state": null,
"city": null,
"neighbourhood": null
}

With groupbygeo=state

Geographic subdivision populates the corresponding geo field:

{
"device_name": "Truck A-101",
"device_group": "Logistics North",
"person_name": null,
"datetime": null,
"kms": 180.5,
"gas": 21.66,
"cost": 32.49,
"co2": 56.32,
"temperature": 0,
"state": "Montevideo",
"city": null,
"neighbourhood": null
}

Errors

CodeHTTPDescription
BAD_REQUEST400Missing required headers
VALIDATION_ERROR400Invalid params: missing dates, range > 31 days, malformed ISO date, limit > 100, > 500 devices
UNAUTHORIZED401Invalid or expired JWT / API Key
FORBIDDEN403User lacks APICLI_RPTAVL_KILOMETROS permission
RATE_LIMITED429Exceeded 10 req/min
INTERNAL_ERROR500Unexpected server error