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

Request

Request Headers

Every request to a protected endpoint requires these headers:

HeaderRequiredDescription
AuthorizationYesBearer token obtained from the Login endpoint. Format: Bearer <token>
X-API-KeyYesCompany integration key provided during onboarding. Format: gtk_xxx...
tenantYesYour assigned tenant domain (default: geotareas.com) — always send your assigned tenant
Content-TypeConditionalapplication/json — required for POST and PUT requests

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
person_namestringAssigned driver name. Only populated when perperson=true
statestringState name. Only populated when groupbygeo is used
citystringCity name. Only populated when groupbygeo=city or neighbourhood
neighbourhoodstringNeighbourhood name. Only populated when groupbygeo=neighbourhood
datetimestring | nullDate of the record (YYYY-MM-DD). Only populated when perday=true
kmsnumberTotal kilometers traveled
temperaturenumberAverage temperature sensor 1 reading (°C). 0 if the vehicle has no sensor
fuelnumberEstimated fuel consumed (liters)
costnumberEstimated fuel cost (currency per vehicle config)
co2numberEstimated CO₂ emissions (kg)
Fuel and cost values

fuel, 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",
"person_name": "",
"state": "",
"city": "",
"neighbourhood": "",
"datetime": "2026-03-01",
"kms": 267.7,
"temperature": 22.3,
"fuel": 32.12,
"cost": 48.18,
"co2": 83.54
},
{
"device_name": "Van B-205",
"person_name": "",
"state": "",
"city": "",
"neighbourhood": "",
"datetime": "2026-03-01",
"kms": 142.3,
"temperature": 4.1,
"fuel": 11.38,
"cost": 17.07,
"co2": 29.57
}
],
"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",
"person_name": "Carlos Martinez",
"state": "",
"city": "",
"neighbourhood": "",
"datetime": "2026-03-01",
"kms": 180.5,
"temperature": 22.3,
"fuel": 21.66,
"cost": 32.49,
"co2": 56.32
}

With groupbygeo=state

Geographic subdivision populates the corresponding geo field:

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

Errors

CodeHTTPDescription
INVALID_DATE_RANGE400Date range exceeds the 31-day maximum, end before start, or non-ISO dates
VALIDATION_ERROR400Invalid params: missing dates, limit > 100, > 500 devices
UNAUTHORIZED401Missing, invalid, or expired tenant / Authorization / X-API-Key
FORBIDDEN403User lacks APICLI_RPTAVL_KILOMETROS permission
RATE_LIMITED429Exceeded 10 req/min
INTERNAL_ERROR500Unexpected server error