Odometer and fuel for selected period

This API retrieves information about vehicle mileage (odometer readings) and fuel consumption over a selected time interval.

How to get data

Request address

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

Request method

GET

Request parameters

  • cmd=odo_and_fuel — command to fetch odometer and fuel data
  • imei — device identifier (object ID)
  • ts — start time of the period (Unix timestamp)
  • te — end time of the period (Unix timestamp)
  • node — node number on which the command is executed
 
Example request
https://<server_address>/api/api.php?cmd=odo_and_fuel&ts=1624568400&te=1624586400&imei=866795036141404&node=1]
Response
{
    "code": 0,
    "msg": "ok",
    "data": {
        "fuel": 7.6,
        "start_odo": 407121.6,
        "stop_odo": 407229.4
    }
}
In response to the API request, the following is returned:
  • code — result code (0 = success)
  • msg — server message
  • fuel — amount of fuel consumed during the period
  • start_odo — odometer reading at the beginning of the period
  • stop_odo — odometer reading at the end of the period