User Manual
Version 7.6
×

API ECO Driving

This API allows you to obtain detailed information about the eco-friendliness of vehicle driving over a specified period.

Example

API request

https://<url>/api/api.php?cmd=mileco_drive&start=1738113401&stop=1738631801&time_diff_type=1&vehid=32,53     

API Response

{
    "32": {
        "29.01.2025_01:16|04.02.2025_01:16": {
            "date": "Wednesday, 29.01.2025 01:16 - Tuesday, 04.02.2025 01:16",
            "veh_id": 32,
            "distance": 842.75354055,
            "agent_id": 545,
            "account_id": 10025,
            "account_name": "IP Ivanov",
            "veh_name": "О 511 ГР 123",
            "veh_type": "Car",
            "eco_data": {
                "speed": {
                    "msg": "Speed",
                    "cnt": 0,
                    "val": 1290,
                    "fee": 12
                }
            }
        }
    }
    "53": {
        "29.01.2025_01:16|04.02.2025_01:16": {
            "date": "Wednesday, 29.01.2025 01:16 - Tuesday, 04.02.2025 01:16",
            "veh_id": 53,
            "distance": 8.24949075,
            "agent_id": 545,
            "account_id": 10025,
            "account_name": "IP Ivanov",
            "veh_name": "О 619АК 67",
            "veh_type": "Bus",
            "eco_data": []
        }
    }   

How to Obtain Data

Request Address

To obtain data, use the address: https://<url>/api/api.php?
  • <url>— the address of the site

Request Parameters

To get the required data, add parameters to the request address. Parameters are specified after the question mark ? and are separated by the ampersand &.
  • cmd = mileco_drive — command to obtain trip data
  • start — date and time of the start of the period for which you want to obtain data
  • stop — date and time of the end of the period
    Time is specified in Unix timestamp format — the number of seconds that have elapsed since January 1, 1970.
  • vehid — the identifier of the vehicle. If you need data for one vehicle — enter its ID, if for several vehicles — list their IDs separated by commas.
    If you do not specify the vehid parameter, the system will automatically provide information for all vehicles assigned to your account.
     
  • imei — a unique number of the vehicle's GPS tracker. Use this parameter to obtain data for a specific tracker.
    When specifying imei, it is not necessary to indicate the vehid parameter.
     
Example API request with imei: https://<url>/api/api.php?cmd=milecodrive&start=1738113401&stop=1738631801&timediff_type=1&imei=8664566839031889725
 
  • time_diff_type — grouping data by time. By default, data is collected for each day.
  • time_diff_type=1 — data will be collected for every 7 days
  • time_diff_type=2 — data will be collected for each month

Response to the Request

In response to the API request, data about vehicle is returned:
  • veh_id — vehicle identifier
  • imei — a unique number of the tracker
  • distance — distance traveled during the specified period
  • agent_id — contract identifier
  • account_id — account number in the system
  • account_name — account name
  • veh_name — name of the vehicle
  • veh_type — type of vehicle
  • eco_data — driving data