# Trip analysis from custom data source

## Principle

The trip analysis service combines GPS measurements with physical models of vehicle dynamics to produce driving behaviour insights:

* Trip statistics
* Eco-driving indicators and fuel consumption estimates
* Tire and brake wear measurements
* Driving safety indicators
* Speed limit score

The trip analysis service processes GPS data sampled at 1 Hz (once per second), which is typically the maximum frequency of consumer-grade GPS sensors.

If you are using the DriveKit SDK, trip analysis runs automatically and the results are synchronized at the SDK level and transferred to your platform through our push trip service.

If you operate your own data collection infrastructure (black box, OBD device, or in-vehicle data system), you can leverage the same analysis capabilities by using the Trip Analysis API.

This section explains how to send your trip data to the Trip Analysis API and how to interpret the response.

## Request

The trip analysis service has the following signature:

<mark style="color:green;">`POST`</mark> `https://service.drivequant.com/v1/drivekit/analysis/trip`

### Request body

The data required for the request are as follows: a unique user identifier, the trip end date, the vehicle characteristics, and the trip data — typically GPS data recorded at a sampling frequency of 1 Hz.

<table><thead><tr><th width="159">Name</th><th width="100" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td>userId</td><td align="center"><code>string</code></td><td>User unique identifier</td></tr><tr><td>tripEndDate</td><td align="center"><code>date</code></td><td>Trip end date</td></tr><tr><td>vehicle</td><td align="center"><code>object</code></td><td>see <a href="#vehicle-characteristics">Vehicle characteristics</a></td></tr><tr><td>route</td><td align="center"><code>object</code></td><td>see <a href="#gps-route-data">GPS route data</a></td></tr></tbody></table>

<details open>

<summary>Sample request</summary>

```json
{
	"userId": "f49ac10a-57cc-4872-a567-0e92b2d3d479",
	"tripEndDate": "2026-04-02T10:05:10.662+0000",	
	"vehicle": {
		"typeIndex": 1,
		"engineIndex": 1,
		"power": 150,
		"mass": 1400,
		"gearboxIndex": 2,
		"consumption": 4.5,
		"autoGearboxNumber": 6,
		"engineDisplacement": 1200,
		"frontTireSize": "205/55/16",
		"rearTireSize": "205/55/16",
		"length": 4.5,
		"width": 1.8,
		"height": 1.45,
		"engineCylinderNb": 4,
		"driveWheels": 0
	},
	"route": {
		"gpsDate": [double],
		"latitude": [double],
		"longitude": [double],
		"gpsVelocity": [double],
		"gpsAccuracy": [double],
		"gpsElevation": [double],
		"gpsHeading": [double]
	}
}
```

</details>

#### User

Each request requires a unique user identifier, provided in the userId field.

This field is mandatory, as it is used to track the number of unique users of the service, and serves as the basis for monthly billing.

{% hint style="info" %}
User identification also enables data aggregation, allowing the generation of [synthesis](https://docs.drivequant.com/backend/driver/synthesis-of-scores) and[ timeline](https://docs.drivequant.com/backend/driver/timeline-of-scores) (weekly and monthly) for driving indicators (mileage, number of trips, average scores, etc.).
{% endhint %}

#### Trip end date

The trip end date can be provided via the tripEndDate field. If not specified, the service defaults to the current server time with no timezone offset (UTC).

#### Vehicle characteristics

For a more accurate analysis of driving behavior, we recommend configuring the vehicle that was actually used. Vehicle mass and engine type are key parameters for getting an accurate fuel consumption estimation, and for computing the ecodriving score.&#x20;

The vehicle characteristics can be provided in the vehicle field:

<table><thead><tr><th width="213">Name</th><th width="84" align="center">Type</th><th width="322">Description</th><th align="center">Default value</th></tr></thead><tbody><tr><td>carTypeIndex</td><td align="center"><code>int</code></td><td><a href="/pages/-LnIYWt8LUcTbp4cVirZ#vehicle-body-type">Vehicle body type</a></td><td align="center">1</td></tr><tr><td>carEngineIndex</td><td align="center"><code>int</code></td><td><a href="/pages/-LnIYWt8LUcTbp4cVirZ#engine-type">Engine type</a></td><td align="center">1</td></tr><tr><td>carPower</td><td align="center"><code>double</code></td><td>Vehicle power (in hp). This value must be entered in horsepower. In case you only have the engine power in kW, you can apply the following formula: <span class="math">P [hp] = P [kW] / 0.7355</span> (min: 40 hp, max 450 hp) </td><td align="center">150</td></tr><tr><td>carMass</td><td align="center"><code>double</code></td><td><p>Vehicle mass (in kg)</p><p>(min: 700 kg, max: 3500 kg)</p></td><td align="center">1400</td></tr><tr><td>carGearboxIndex</td><td align="center"><code>int</code></td><td><a href="/pages/-LnIYWt8LUcTbp4cVirZ#gearbox-type">Gearbox type</a></td><td align="center">2</td></tr><tr><td>carConsumption</td><td align="center"><code>double</code></td><td><p>Combined fuel consumption (in l/100km) measured during the New European Driving Cycle (NEDC). </p><p>(min: 3 l/100km, max: 20 l/100km)</p></td><td align="center">4.5</td></tr><tr><td>carAutoGearboxNumber</td><td align="center"><code>int</code></td><td>Number of gear ratios for the automatic gearbox. This parameter is taken into account only if <code>carGearboxIndex</code> is set to 1.</td><td align="center">6</td></tr><tr><td>engineDisplacement</td><td align="center"><code>double</code></td><td>Engine displacement (in l)</td><td align="center">1200</td></tr><tr><td>frontTireSize</td><td align="center"><code>string</code></td><td>Front tire size</td><td align="center">"205/55/16"</td></tr><tr><td>rearTireSize</td><td align="center"><code>string</code></td><td>Rear tire size</td><td align="center">"205/55/16"</td></tr><tr><td>length</td><td align="center"><code>double</code></td><td>Vehicle length (in m)</td><td align="center">4.5</td></tr><tr><td>width</td><td align="center"><code>double</code></td><td>Vehicle width (in m)</td><td align="center">1.8</td></tr><tr><td>height</td><td align="center"><code>double</code></td><td>Vehicle height (in m)</td><td align="center">1.45</td></tr><tr><td>engineCylinderNb</td><td align="center"><code>int</code></td><td>Number of cylinders</td><td align="center">4</td></tr><tr><td>driveWheels</td><td align="center"><code>int</code></td><td><a href="/pages/-LnIYWt8LUcTbp4cVirZ#drive-wheels-type">Drive wheels type</a></td><td align="center">0</td></tr></tbody></table>

{% hint style="info" %}
If the vehicle field is omitted from the request, the API will fall back to a default vehicle, whose characteristics are listed in the table.
{% endhint %}

#### GPS route data

The route field accepts standard GPS data points (location, speed, altitude, heading, and accuracy) as typically provided by a GPS device.

<table><thead><tr><th width="150.66666666666666">Name</th><th width="169" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td>gpsDate*</td><td align="center"><code>array[double]</code></td><td>GPS relative time vector (in s)</td></tr><tr><td>gpsVelocity*</td><td align="center"><code>array[double]</code></td><td>GPS speed vector (in km/h)</td></tr><tr><td>latitude</td><td align="center"><code>array[double]</code></td><td>Latitude vector (in deg)</td></tr><tr><td>longitude</td><td align="center"><code>array[double]</code></td><td>Longitude vector (in deg)</td></tr><tr><td>gpsAccuracy</td><td align="center"><code>array[double]</code></td><td>GPS accuracy vector (in m)</td></tr><tr><td>gpsElevation</td><td align="center"><code>array[double]</code></td><td>GPS elevation vector (in m)</td></tr><tr><td>gpsHeading</td><td align="center"><code>array[double]</code></td><td>GPS heading vector measured clockwise from true North (in deg)</td></tr></tbody></table>

{% hint style="info" %}

* Each request corresponds to a **single trip**. Therefore, splitting a trip across multiple requests is not supported, and no attempt will be made to merge the requests.
* Only the gpsDate and gpsVelocity fields are mandatory. However, providing the other fields enables the computation of more metrics.
* All the arrays in the route field must have the same length.
* All parameters must be sampled at 1 Hz (once per second), in line with standard GPS sensor specifications. This frequency is necessary to accurately capture acceleration and braking events for vehicle dynamics analysis.
  {% endhint %}

#### Rate limiting

The Trip Analysis API is limited to **20 requests per second**.&#x20;

Requests that exceed this threshold will receive an error response.&#x20;

We recommend implementing retry logic with exponential backoff to handle these errors gracefully.

## Response

The Trip Analysis API returns a rich, structured response organized by data category. The table below summarizes the available analysis modules.&#x20;

The comments and itinerary statistics modules are included by default; all others are optional and can be combined as needed.

<table><thead><tr><th width="236.66666666666663" valign="middle">Name</th><th width="142" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td valign="middle">itinId</td><td align="center"><code>string</code></td><td>Trip unique identifier</td></tr><tr><td valign="middle">userName</td><td align="center"><code>string</code></td><td>User unique identifier</td></tr><tr><td valign="middle">endDate</td><td align="center"><code>date</code></td><td>Trip end date</td></tr><tr><td valign="middle">processingDate</td><td align="center"><code>date</code></td><td>Trip processing date</td></tr><tr><td valign="middle">sampledRoute</td><td align="center"><code>object</code></td><td>see <a href="#sampled-route">Sampled route</a></td></tr><tr><td valign="middle">matchedRoute</td><td align="center"><code>object</code></td><td>see <a href="#matched-route">Matched route</a></td></tr><tr><td valign="middle">itineraryStatistics</td><td align="center"><code>object</code></td><td>see <a href="#itinerary-statistics">Itinerary statistics</a></td></tr><tr><td valign="middle">weather</td><td align="center"><code>object</code></td><td>see <a href="#weather">Weather</a></td></tr><tr><td valign="middle">itineraryData</td><td align="center"><code>object</code></td><td>see <a href="#itinerary-data">Itinerary data</a></td></tr><tr><td valign="middle">ecoDriving</td><td align="center"><code>object</code></td><td>see <a href="#eco-driving-score">Eco-driving score</a></td></tr><tr><td valign="middle">advancedEcoDriving</td><td align="center"><code>array[object]</code></td><td>see <a href="#advanced-eco-driving">Advanced eco-driving score</a></td></tr><tr><td valign="middle">fuelEstimation</td><td align="center"><code>object</code></td><td>see <a href="#fuel-estimation">Fuel estimation</a></td></tr><tr><td valign="middle">advancedFuelEstimation</td><td align="center"><code>array[object]</code></td><td>see <a href="#advanced-fuel-estimation">Advanced fuel estimation</a></td></tr><tr><td valign="middle">energyEstimation</td><td align="center"><code>object</code></td><td>see <a href="#energy-estimation">Energy estimation</a></td></tr><tr><td valign="middle">advancedEnergyEstimation</td><td align="center"><code>array[object]</code></td><td>see <a href="#advanced-eco-driving">Advanced energy estimation</a></td></tr><tr><td valign="middle">safety</td><td align="center"><code>object</code></td><td>see <a href="#safety-score">Safety score</a></td></tr><tr><td valign="middle">advancedSafety</td><td align="center"><code>array[object]</code></td><td>see <a href="#advanced-safety-score">Advanced safety score</a></td></tr><tr><td valign="middle">safetyEvents</td><td align="center"><code>array[object]</code></td><td>see <a href="#safety-events">Safety events</a></td></tr><tr><td valign="middle">tireWear</td><td align="center"><code>object</code></td><td>see <a href="#tire-and-brake-wear-estimates">Tire and brake wear estimates</a></td></tr><tr><td valign="middle">brakeWear</td><td align="center"><code>object</code></td><td>see <a href="#tire-and-brake-wear-estimates">Tire and brake wear estimates</a></td></tr><tr><td valign="middle">speedingStatistics</td><td align="center"><code>object</code></td><td>see <a href="#speeding-score">Speeding score</a></td></tr><tr><td valign="middle">speedingEvents</td><td align="center"><code>array[object]</code></td><td>see <a href="#speeding-events">Speeding events</a></td></tr></tbody></table>

### Sampled route

The sampledRoute field provides a cleaned and enriched representation of the trip. Raw GPS data is reinterpolated to a uniform 1 Hz sampling rate and filtered to remove noise. Additional motion variables (such as acceleration and yaw rate) are then derived from the processed signal.

<table><thead><tr><th width="187.66666666666666">Name</th><th width="171" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td>time</td><td align="center"><code>array[double]</code></td><td>Relative time (in s)</td></tr><tr><td>latitude</td><td align="center"><code>array[double]</code></td><td>Latitude (in deg)</td></tr><tr><td>longitude</td><td align="center"><code>array[double]</code></td><td>Longitude (in deg)</td></tr><tr><td>velocity</td><td align="center"><code>array[double]</code></td><td>Speed (in km/h)</td></tr><tr><td>velocityLimits</td><td align="center"><code>array[double]</code></td><td>Speed limit (in km/h)</td></tr><tr><td>heading</td><td align="center"><code>array[double]</code></td><td>Heading (in deg)</td></tr><tr><td>distance</td><td align="center"><code>array[double]</code></td><td>Cumulative distance (in m)</td></tr><tr><td>elevation</td><td align="center"><code>array[double]</code></td><td>GPS elevation (in m)</td></tr><tr><td>yawRate</td><td align="center"><code>array[double]</code></td><td>Yaw rate (in rad/s)</td></tr><tr><td>longitudinalAccel</td><td align="center"><code>array[double]</code></td><td>Longitudinal acceleration (in m/s²)</td></tr><tr><td>lateralAccel</td><td align="center"><code>array[double]</code></td><td>Lateral acceleration (in m/s²)</td></tr></tbody></table>

### Matched route

The matchedRoute field provides a map-matched version of the trip route. Raw GPS coordinates are snapped to the underlying road network to correct positioning errors and accurately reflect the roads travelled.

<table><thead><tr><th width="187.66666666666666">Name</th><th width="164" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td>latitude</td><td align="center"><code>array[double]</code></td><td>Snapped latitude shape (in deg)</td></tr><tr><td>longitude</td><td align="center"><code>array[double]</code></td><td>Snapped longitude shape (in deg)</td></tr></tbody></table>

{% hint style="info" %}
The service returns an optimised subset of coordinates sufficient enough to accurately display the vehicle's path on a map, rather than returning matched coordinates for every input point.
{% endhint %}

### Itinerary statistics

Itinerary statistics module provides several indicators that characterize the trip conditions: the trip distance, the vehicle movement duration and the idle duration. We also compute the number of sub-displacements. A trip can be characterized as a succession of events either dictated by the driver’s will or by external factors. These events, called breakpoints, are indicated with black dots in the figure below. Each section of a trip between two breakpoints is called sub-displacement. The figure illustrates these concepts for a short trip with one traffic light (vehicle stopped) and one intersection with priority (vehicle deceleration followed by acceleration).

![](https://lh4.googleusercontent.com/OTBTQqMP7kWCcv8AuyBp5bOdMVXA0PYuHjMWgZnwoKbW6cMptE13H8ck1QkvjJY71um4Mm77d7S9K1jGe6Rfql6ln7cUQe2gpHZusCf1vUhuOpw8PK10xE27XSByAn1X5W5fHJzI)

<table><thead><tr><th width="179">Name</th><th width="113.66666666666666" align="center" valign="middle">Type</th><th>Description</th></tr></thead><tbody><tr><td>distance</td><td align="center" valign="middle"><code>double</code></td><td>Total distance travelled (in m)</td></tr><tr><td>speedMean</td><td align="center" valign="middle"><code>double</code></td><td>Mean vehicle speed (in km/h)</td></tr><tr><td>tripDuration</td><td align="center" valign="middle"><code>double</code></td><td>Total trip duration (in s)</td></tr><tr><td>drivingDuration</td><td align="center" valign="middle"><code>double</code></td><td>Total duration of movement phases (in s)</td></tr><tr><td>idlingDuration</td><td align="center" valign="middle"><code>double</code></td><td>Total duration of idling phases (in s)</td></tr><tr><td>drivingPercentage</td><td align="center" valign="middle"><code>double</code></td><td>Percentage of vehicle movement</td></tr><tr><td>idlingPercentage</td><td align="center" valign="middle"><code>double</code></td><td>Percentage of idling phases</td></tr><tr><td>subdispNb</td><td align="center" valign="middle"><code>int</code></td><td>Number of sub-displacements detected during the trip</td></tr><tr><td>meteo</td><td align="center" valign="middle"><code>int</code></td><td>Weather condition code (see <a href="/pages/-LnIYWt8LUcTbp4cVirZ#weather-code">Weather code</a>)</td></tr><tr><td>day</td><td align="center" valign="middle"><code>boolean</code></td><td><code>true</code> if the trip occurred during the day, <code>false</code> if at night</td></tr><tr><td>weekDay</td><td align="center" valign="middle"><code>boolean</code></td><td><code>true</code> if the trip occurred on a weekday (Mon–Fri), <code>false</code> if on a weekend (Sat–Sun)</td></tr><tr><td>transportationMode</td><td align="center" valign="middle"><code>int</code></td><td>Detected transportation mode (see <a href="/pages/-LnIYWt8LUcTbp4cVirZ#transportation-mode">Transportation mode</a>)</td></tr></tbody></table>

### Weather

The weather field contains the weather data at the time and location of the end of the trip (based on the trip’s last GPS location). Results are returned using both the provider's own classification and DriveQuant's unified weather coding system, which ensures consistency across providers.

<table><thead><tr><th width="179">Name</th><th width="113.66666666666666" align="center" valign="middle">Type</th><th>Description</th></tr></thead><tbody><tr><td>provider</td><td align="center" valign="middle"><code>string</code></td><td>Name of the weather data provider</td></tr><tr><td>providerCode</td><td align="center" valign="middle"><code>double</code></td><td>Weather condition code as defined by the provider</td></tr><tr><td>providerCondition</td><td align="center" valign="middle"><code>double</code></td><td>Weather condition label as defined by the provider</td></tr><tr><td>code</td><td align="center" valign="middle"><code>double</code></td><td>Weather condition code (see <a href="/pages/-LnIYWt8LUcTbp4cVirZ#weather-code">Weather code</a>)</td></tr><tr><td>condition</td><td align="center" valign="middle"><code>double</code></td><td>Weather condition</td></tr><tr><td>temperature</td><td align="center" valign="middle"><code>double</code></td><td>Air temperature (in °C)</td></tr><tr><td>windSpeed</td><td align="center" valign="middle"><code>double</code></td><td>Wind speed (in km/h)</td></tr><tr><td>windDegree</td><td align="center" valign="middle"><code>int</code></td><td>Wind direction measured clockwise from North (in deg)</td></tr><tr><td>pressure</td><td align="center" valign="middle"><code>int</code></td><td>Atmospheric pressure (in hPa)</td></tr><tr><td>precipitation</td><td align="center" valign="middle"><code>boolean</code></td><td>Precipitation amount (in mm)</td></tr><tr><td>humidity</td><td align="center" valign="middle"><code>boolean</code></td><td>Relative humidity (in %)</td></tr><tr><td>cloud</td><td align="center" valign="middle"><code>int</code></td><td>Cloud coverage (in %)</td></tr><tr><td>visibility</td><td align="center" valign="middle"><code>int</code></td><td>Visibility distance (in m)</td></tr><tr><td>sunrise</td><td align="center" valign="middle"><code>date</code></td><td>Sunrise time at trip location</td></tr><tr><td>sunset</td><td align="center" valign="middle"><code>date</code></td><td>Sunset time at trip location</td></tr></tbody></table>

### Itinerary data

The itineraryData field provides temporal and geographical context for the trip. It includes start and end times, as well as the departure and arrival locations resolved to city, postal code, state, and country level.

<table><thead><tr><th width="195">Name</th><th width="127.66666666666666" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td>startDate</td><td align="center"><code>date</code></td><td>Trip start date</td></tr><tr><td>endDate</td><td align="center"><code>date</code></td><td>Trip end date</td></tr><tr><td>departureCity</td><td align="center"><code>string</code></td><td>Name of the departure city</td></tr><tr><td>arrivalCity</td><td align="center"><code>string</code></td><td>Name of the arrival city</td></tr><tr><td>departureAddress</td><td align="center"><code>string</code></td><td>Full address of the departure location</td></tr><tr><td>arrivalAddress</td><td align="center"><code>string</code></td><td>Full address of the arrival location</td></tr><tr><td>departurePostalCode</td><td align="center"><code>string</code></td><td>Postal code of the departure location</td></tr><tr><td>arrivalPostalCode</td><td align="center"><code>string</code></td><td>Postal code of the arrival location</td></tr><tr><td>departureState</td><td align="center"><code>string</code></td><td>Name of the departure state</td></tr><tr><td>arrivalState</td><td align="center"><code>string</code></td><td>Name of the arrival state</td></tr><tr><td>departureCountry</td><td align="center"><code>string</code></td><td>Name of the departure country</td></tr><tr><td>arrivalCountry</td><td align="center"><code>string</code></td><td>Name of the arrival country</td></tr></tbody></table>

### Eco-driving score

#### Description

Eco-driving module performs an analysis of the entire trip, characterized by a succession of events and road segments. The driving efficiency is computed by comparing the vehicle speed recorded with an optimal speed profile, for each segment. This calculation takes into account the actual driving conditions and a physical vehicle model that captures the inertial dynamics of the vehicle and the efficiency of the powertrain components. The eco-driving score ranges from 0 and 10, and is calculated by comparing the actual energy consumed during the trip with the energy that would have been consumed using the optimal speed profile. The best eco-driving score corresponds to the highest driving efficiency.

<table><thead><tr><th width="162.66666666666666">Name</th><th width="128" align="center" valign="middle">Type</th><th>Description</th></tr></thead><tbody><tr><td>score</td><td align="center" valign="middle"><code>double</code></td><td>Eco-driving score (min: 0, max: 10). If trip is too short to be scored, score is set to 11.</td></tr><tr><td>scoreAccel</td><td align="center" valign="middle"><code>double</code></td><td>Score of the acceleration phases. If trip is too short to be scored, score is set to 6.</td></tr><tr><td>scoreMain</td><td align="center" valign="middle"><code>double</code></td><td>Score of the stabilized speed phases. If trip is too short to be scored, score is set to 6.</td></tr><tr><td>scoreDecel</td><td align="center" valign="middle"><code>double</code></td><td>Score of the deceleration phases. If trip is too short to be scored, score is set to 6.</td></tr><tr><td>stdDevAccel</td><td align="center" valign="middle"><code>double</code></td><td>Standard deviation of acceleration score</td></tr><tr><td>stdDevMain</td><td align="center" valign="middle"><code>double</code></td><td>Standard deviation of stabilized speed score</td></tr><tr><td>stdDevDecel</td><td align="center" valign="middle"><code>double</code></td><td>Standard deviation of deceleration score</td></tr><tr><td>energyClass</td><td align="center" valign="middle"><code>int</code></td><td><p>See <a href="#energy-class">Energy Class</a>:</p><p>0: energy class A </p><p>1: energy class B</p><p>2: energy class C</p><p>3: energy class D</p><p>4: energy class E</p></td></tr></tbody></table>

#### Scores definitions

Acceleration, deceleration and speed maintain phases have a large impact on the vehicle’s fuel consumption. As a consequence, by comparing the real and the optimal speed profiles, eco-driving analysis module returns 3 key driving indicators.

The acceleration and deceleration scores range from -5 to +5. For a value of (-5), your acceleration or deceleration is too slow. For the highest value (+5) you are accelerating or decelerating too fast. A score of (0) indicates that your acceleration or deceleration perfectly matches with an eco-driving style.

The speed maintain score ranges from 0 to 5. The minimum value (0) indicates that the driver has an appropriate behavior and drives at a constant speed. On the other hand, if the driving analysis module detects an oscillating speed profile, this score increases. The highest value (+5) indicates that you can improve to keep a constant speed to reduce your fuel consumption.

These indicators will help you improve your driving efficiency and reduce your energy consumption. They can also illustrate the level of anticipation that the drivers should adopt to avoid harsh accelerations and brakings.

The numerical values of driving scores can be transformed into driving tips. The tables below give examples of content that can be returned to a driver based on the driving notes of a trip:

<table><thead><tr><th width="200" align="center">scoreAccel</th><th>Description</th></tr></thead><tbody><tr><td align="center">-5 to -4</td><td>Acceleration is too low</td></tr><tr><td align="center">-4 to -2</td><td>Weak acceleration</td></tr><tr><td align="center">-2 to 1</td><td>Good acceleration</td></tr><tr><td align="center">1 to 3</td><td>Strong acceleration</td></tr><tr><td align="center">3 to 5</td><td>Acceleration is too high</td></tr></tbody></table>

<table><thead><tr><th width="200" align="center">scoreMain</th><th>Description</th></tr></thead><tbody><tr><td align="center">0 to 1.5</td><td>Good speed maintain</td></tr><tr><td align="center">1.5 to 3.5</td><td>Irregular speed</td></tr><tr><td align="center">3.5 to 5</td><td>Very fluctuating speed</td></tr></tbody></table>

<table><thead><tr><th width="200" align="center">scoreDecel</th><th>Description</th></tr></thead><tbody><tr><td align="center">-5 to -4</td><td>Deceleration is too low</td></tr><tr><td align="center">-4 to -2</td><td>Weak deceleration</td></tr><tr><td align="center">-2 to 1</td><td>Good deceleration</td></tr><tr><td align="center">1 to 3</td><td>Strong deceleration</td></tr><tr><td align="center">3 to 5</td><td>Deceleration is too high</td></tr></tbody></table>

{% hint style="warning" %}
The eco-driving analysis is performed for vehicle displacement greater than 100 meters and speed higher than 10 km/h. This avoids providing inaccurate driving scores during vehicle maneuvers (slow driving in traffic jams or in parking lots...). In that case, eco-driving analysis module returns the following error codes:

* 11 for the eco-driving score
* 6 for acceleration phase, stabilized speed phase and deceleration phase
  {% endhint %}

#### Energy class

The energy class « energyClass » depends on the average fuel consumption of the vehicle. It positions the trip fuel consumption with respect to the average consumption of the vehicle.

* Class A corresponds to 0.5 x the NEDC consumption of the vehicle expressed in $$\mathrm{gCO\_2/km}$$.
* Class E corresponds to 1.5 x the NEDC consumption of the vehicle expressed in $$\mathrm{gCO\_2/km}$$

Then we defined the 5 classes with a uniform distribution between class A and class E. The energy class « energyClass » is calculated from the trip $$\mathrm{CO\_2}$$ emission « co2Emission » and the function below:

![Energy class definition](https://lh3.googleusercontent.com/o7zeQ4fozZs6TYCtPglmJlV-zaQ2cmq_qNLKyJsWbV-MkL-_s6lJj_l1J0evkI1qXekhyWly4xZX6TlofZw_-i8K9PY6aN801sW2v8xhJIH-csAkJJ4n6j9AOn_1V4G3guE-BdI2)

### Advanced eco-driving

<table><thead><tr><th width="193">Name</th><th width="168.66666666666666" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td>ecoDrivingContext</td><td align="center"><code>array[object]</code></td><td>Array of <a href="#ecodrivingcontext">EcoDrivingContext</a></td></tr></tbody></table>

In order to provide fair scoring and to facilitate drivers comparison, the trip scores can be accompanied by road class scores. These scores are included in the EcoDrivingContext class into the Advanced Modules. This service differentiates 5 types of road conditions (contextId) to contextualize the driving scores:

* 0 - Traffic jam: This corresponds to vehicle displacements of less than 100 meters and performed with speeds below 10 km/h. In traffic jams, it is obviously not possible to improve your driving, that is why scoring are not provided for this type of road.
* 1 - Heavy urban traffic
* 2 - City
* 3 - Suburban
* 4 - Expressways

{% hint style="warning" %}
In case a road type is not included in the trip, the distance and duration percentages are equal to zero, the efficiency score is set to 11 and the driving scores (Accel/Main/Decel) are set to 6.
{% endhint %}

#### EcoDrivingContext

<table><thead><tr><th width="174">Name</th><th width="121.66666666666666" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td>distance</td><td align="center"><code>double</code></td><td>Percentage of distance travelled in a road type</td></tr><tr><td>duration</td><td align="center"><code>double</code></td><td>Percentage of elapsed time in a road type</td></tr><tr><td>efficiencyScore</td><td align="center"><code>double</code></td><td>Eco-driving score</td></tr><tr><td>scoreAccel</td><td align="center"><code>double</code></td><td>Score of the acceleration phases</td></tr><tr><td>scoreMain</td><td align="center"><code>double</code></td><td>Score of the stabilized speed phases</td></tr><tr><td>scoreDecel</td><td align="center"><code>double</code></td><td>Score of the deceleration phases</td></tr><tr><td>contextId</td><td align="center"><code>int</code></td><td><a href="/pages/-LnIYWt8LUcTbp4cVirZ#road-conditions">Road conditions</a></td></tr></tbody></table>

### Fuel estimation

#### Description

The fuel consumption is obtained from a backward computation based on a mathematical modeling of the vehicle and powertrain. Fuel consumption estimation asseses the mechanical traction power from the vehicle speed and mass. A power transfer is performed between each component of the powertrain to compute the engine torque. Finally, the engine torque combined with the vehicle speed help to process the fuel mass from an engine consumption map developed by IFPEN. This fuel mapping is adapted according to the vehicle parameters and is valid for any type of vehicle or fleet of vehicles.

This approach is particularly adapted to estimate real-driving fuel consumption which can be more than 20% above the homologation data provided by car manufacturers. The main advantage lies in the accuracy of the estimate that can reach 5% when all input variables are available and the vehicle parameters set. The estimation method accounts for the physical fuel characteristics. These parameters are listed below:

<table><thead><tr><th width="135">Fuel type</th><th width="136" align="center">Density (kg/l)</th><th align="center">Lower heating value (GJ/t)</th><th align="center">CO2 emission factor (tCO2/TJ)</th><th align="center">CO2 emission factor (kgCO2/l)</th></tr></thead><tbody><tr><td>Gasoline</td><td align="center">0.755</td><td align="center">44</td><td align="center">70.26</td><td align="center">2.3340</td></tr><tr><td>Diesel</td><td align="center">0.845</td><td align="center">42</td><td align="center">75.70</td><td align="center">2.6866</td></tr></tbody></table>

Values calculated by fuel estimation module are described below:

<table><thead><tr><th width="184">Name</th><th width="93.66666666666666" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td>co2Mass</td><td align="center"><code>double</code></td><td>Total Mass of <span class="math">\mathrm{CO_2}</span> (in kg)</td></tr><tr><td>co2Emission</td><td align="center"><code>double</code></td><td>Average Mass of <span class="math">\mathrm{CO_2}</span> per unit of distance (in g/km)</td></tr><tr><td>fuelConsumption</td><td align="center"><code>double</code></td><td>Average fuel consumption (in l/100km)</td></tr><tr><td>fuelVolume</td><td align="center"><code>double</code></td><td>Total fuel consumption (in l)</td></tr><tr><td>idleFuelPercentage</td><td align="center"><code>double</code></td><td>Idle fuel consumption percentage</td></tr><tr><td>idleFuelConsumption</td><td align="center"><code>double</code></td><td>Idle fuel consumption per unit of time (in l/h)</td></tr><tr><td>idleCo2Emission</td><td align="center"><code>double</code></td><td>Idle <span class="math">\mathrm{CO_2}</span> emission (in g/km)</td></tr><tr><td>idleCo2Mass</td><td align="center"><code>double</code></td><td>Idle <span class="math">\mathrm{CO_2}</span> mass (in kg)</td></tr><tr><td>engineTempStatus</td><td align="center"><code>boolean</code></td><td>Engine cold start</td></tr><tr><td>coldFuelVolume</td><td align="center"><code>double</code></td><td>Cold engine fuel volume (in l)</td></tr></tbody></table>

### Advanced fuel estimation

<table><thead><tr><th width="216">Name</th><th width="182.66666666666666" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td>fuelEstimationContext</td><td align="center"><code>array[object]</code></td><td>Array of <a href="/pages/-LmyNRA_muNPJIeFBcbX#fuelestimationcontext">FuelEstimationContext</a></td></tr></tbody></table>

In order to provide detailed fuel consumption estimation across the vehicle trips, the advanced fuel estimation service may return the fuel consumption for each driving context of the vehicle. This service differentiates 5 types of road conditions (contextId):&#x20;

* 0 - Traffic jam
* 1 - Heavy urban traffic
* 2 - City
* 3 - Suburban
* 4 - Expressways

{% hint style="warning" %}
In case a road type is not included in the trip, the percentages of distance and duration are equals to zero as well as the co2Mass, co2Emission, fuelVolume and fuelConsumption.
{% endhint %}

#### FuelEstimationContext

<table><thead><tr><th width="172.66666666666666">Name</th><th width="117" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td>contextId</td><td align="center"><code>int</code></td><td>Road conditions</td></tr><tr><td>distance</td><td align="center"><code>double</code></td><td>Percentage of distance travelled in a road type</td></tr><tr><td>duration</td><td align="center"><code>double</code></td><td>Percentage of elapsed time in a road type</td></tr><tr><td>co2Mass</td><td align="center"><code>double</code></td><td>Total Mass of  <span class="math">\mathrm{CO_2}</span> (in kg)</td></tr><tr><td>co2Emission</td><td align="center"><code>double</code></td><td>Average <span class="math">\mathrm{CO_2}</span> emissions (in g/km)</td></tr><tr><td>fuelVolume</td><td align="center"><code>double</code></td><td>Total fuel consumption (in l)</td></tr><tr><td>fuelConsumption</td><td align="center"><code>double</code></td><td>Average fuel consumption (in l/100km)</td></tr></tbody></table>

### **Energy estimation**

For electric vehicles, DriveQuant provides energy information instead of fuel estimation.

<table><thead><tr><th width="228">Name</th><th width="99.66666666666666" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td>energy</td><td align="center"><code>double</code></td><td>Estimated energy (in kWh)</td></tr><tr><td>energyConsumption</td><td align="center"><code>double</code></td><td>Estimated energy consumption (in kWh/100km)</td></tr><tr><td>energyOpti</td><td align="center"><code>double</code></td><td>Optimal energy (in kWh)</td></tr><tr><td>energyOptiConsumption</td><td align="center"><code>double</code></td><td>Optimal energy consumption (in kWh/100km)</td></tr></tbody></table>

{% hint style="info" %}
The **EnergyEstimation** sub-document is only present in the response body for electric vehicles. If the configured vehicle is a conventional vehicle, the energy estimation is not added in the response body.
{% endhint %}

### **Advanced energy estimation**

To provide more details on the energy consumption, the service may return the energy data for each driving context of the vehicle.

<table><thead><tr><th width="215.16666666666666">Name</th><th width="110.5" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td>energy</td><td align="center"><code>double</code></td><td>Estimated energy (in kWh)</td></tr><tr><td>energyConsumption</td><td align="center"><code>double</code></td><td>Estimated energy consumption (in kWh/100km)</td></tr><tr><td>energyOpti</td><td align="center"><code>double</code></td><td>Optimal energy (in kWh)</td></tr><tr><td>energyOptiConsumption</td><td align="center"><code>double</code></td><td>Optimal energy (in kWh/100km)</td></tr><tr><td>contextId</td><td align="center"><code>int</code></td><td>Road conditions</td></tr><tr><td>distance</td><td align="center"><code>double</code></td><td>Percentage of distance travelled in a road type</td></tr><tr><td>duration</td><td align="center"><code>double</code></td><td>Percentage of elapsed time in a road type</td></tr></tbody></table>

{% hint style="info" %}
The **AdvancedEnergyEstimation** sub-document is only present in the response body for electric vehicles. If the configured vehicle is a conventional vehicle, the energy estimation is not added in the response body.
{% endhint %}

### Safety score

<table><thead><tr><th width="132">Name</th><th width="96.66666666666666" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td>safetyScore</td><td align="center"><code>double</code></td><td>Safety score (ranges from 3 to 10)</td></tr><tr><td>nbAdh</td><td align="center"><code>int</code></td><td>Number of times strong adherence threshold was exceeded</td></tr><tr><td>nbAccel</td><td align="center"><code>int</code></td><td>Number of strong accelerations</td></tr><tr><td>nbDecel</td><td align="center"><code>int</code></td><td>Number of strong decelerations</td></tr><tr><td>nbAdhCrit</td><td align="center"><code>int</code></td><td>Number of times critical adherence threshold was exceeded</td></tr><tr><td>nbAccelCrit</td><td align="center"><code>int</code></td><td>Number of critical accelerations</td></tr><tr><td>nbDecelCrit</td><td align="center"><code>int</code></td><td>Number of critical decelerations</td></tr></tbody></table>

{% hint style="warning" %}
&#x20;If trip is too short to be scored, `safetyScore` is set to 11.
{% endhint %}

### Advanced safety score

| Name          |       Type      | Description                                                                  |
| ------------- | :-------------: | ---------------------------------------------------------------------------- |
| safetyContext | `array[object]` | Array of [SafetyContext](/trip-analysis/rest-services/trip.md#safetycontext) |

#### SafetyContext

<table><thead><tr><th width="129.66666666666666">Name</th><th width="103" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td>distance</td><td align="center"><code>double</code></td><td>Percentage of distance travelled in a road type</td></tr><tr><td>duration</td><td align="center"><code>double</code></td><td>Percentage of travel time spent in a road type</td></tr><tr><td>safetyScore</td><td align="center"><code>double</code></td><td>Safety score (ranges from 3 to 10)</td></tr><tr><td>nbAdh</td><td align="center"><code>int</code></td><td>Number of times strong adherence threshold was exceeded</td></tr><tr><td>nbAccel</td><td align="center"><code>int</code></td><td>Number of strong accelerations</td></tr><tr><td>nbDecel</td><td align="center"><code>int</code></td><td>Number of strong decelerations</td></tr><tr><td>nbAdhCrit</td><td align="center"><code>int</code></td><td>Number of times critical adherence threshold was exceeded</td></tr><tr><td>nbAccelCrit</td><td align="center"><code>int</code></td><td>Number of critical accelerations</td></tr><tr><td>nbDecelCrit</td><td align="center"><code>int</code></td><td>Number of critical decelerations</td></tr><tr><td>contextId</td><td align="center"><code>int</code></td><td>Road conditions</td></tr></tbody></table>

{% hint style="warning" %}
In case a road type is no included in the trip, the distance and duration percentages are equal to zero and the safety score is set to 11.
{% endhint %}

### Safety events

The data provided in the following table helps to display safety events on your map system and deliver the locations of harsh braking or acceleration as well as the coordinates where a tire to road adherence threshold has been crossed.

<table><thead><tr><th width="136.66666666666666">Name</th><th width="116" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td>time</td><td align="center"><code>double</code></td><td>Time since the beginning of the trip (in s)</td></tr><tr><td>latitude</td><td align="center"><code>double</code></td><td>Latitude (in deg)</td></tr><tr><td>longitude</td><td align="center"><code>double</code></td><td>Longitude (in deg)</td></tr><tr><td>velocity</td><td align="center"><code>double</code></td><td>Vehicle speed (in km/h)</td></tr><tr><td>heading</td><td align="center"><code>double</code></td><td>Vehicle heading (in deg)</td></tr><tr><td>elevation</td><td align="center"><code>double</code></td><td>Altitude (in m)</td></tr><tr><td>distance</td><td align="center"><code>double</code></td><td>Distance travelled since the beginning of the trip (in m)</td></tr><tr><td>type</td><td align="center"><code>int</code></td><td>Type of event<br>    1. Adherence<br>    2. Acceleration<br>    3. Braking</td></tr><tr><td>level</td><td align="center"><code>int</code></td><td>Intensity related to the event<br>    1. Strong<br>    2. Harsh</td></tr><tr><td>value</td><td align="center"><code>int</code></td><td><p>Absolute value of the event:</p><ul><li>in m/s2 for acceleration and braking events</li><li>normalized between 0 and 1 for the adherence events</li></ul></td></tr></tbody></table>

The service provides the time, coordinate and severity level of each event. Two levels of severity are calculated using specific threshold values for each event.

| Type of event   | Unit | Strong | Harsh |
| --------------- | :--: | :----: | :---: |
| Acceleration    | m/s² |   2.0  |  2.5  |
| Braking         | m/s² |  -1.8  |  -2.4 |
| Adherence limit |   -  |   0.2  |  0.3  |

### Tire and brake wear estimates

#### Description

The wear analysis service has been designed to monitor the brake pads and tires wear levels. This service was designed to improve vehicle maintenance solutions and can be used to create maintenance alerts.

The wear estimation relates to the power dissipated in the tire - road or brake disc - brake contact. To compute this variable our service relies on the vehicle’s dynamic modelling that estimates the braking efforts and the efforts at the contact between the tire and the road.&#x20;

For each trip, the service gives for each components (front/rear brakes/tires):

* The worn mass fraction during the trip.
* The total worn percentage since the installation of new tires or brakes.

**Tire and brake wear indicators for a single trip**

The wear analysis service measures tire wear and brake pad wear. The service allows to distinguish the front and rear axles of the vehicle. The wear is assumed to be the same for the right tire and the left tire of the vehicle. A similar assumption is made for the brake pads.

The output value corresponds to a mass fraction of the worn component (tire or brake pad). This value is expressed in thousandth part of parts-per-million (ppm) which is a unit equivalent to a parts-per-billion (ppb).&#x20;

The worn mass fraction (tire or brake pad) is given for each individual trip. To obtain the total worn mass fraction, the sum of all the trip’s values must be done. The total worn mass fraction value is bounded between a minimum and a maximum value:&#x20;

* Minimum value = 0 ppb. If the total worn mass fraction is 0, the component (tire or brake pad) is assumed to have no wear.
* Maximum value = $$10^9$$ppb. If the total worn mass fraction reaches the maximum value, this means that the component (tire or brake pad) is fully worn and must be replaced.

For a tire, the maximum value for the mass fraction ($$10^9$$ppb) indicates that the tire has lost all its usable mass of rubber. This corresponds to a minimum tire tread height of 1.6 mm. *In France, a tire must legally have a minimum tread height of 1.6 mm over its entire circumference.*

The wear calculation service estimates for each trip:

* The worn fraction of front tires
* The worn fraction of the rear tire
* The worn fraction of the front brakes
* The worn fraction of the rear brakes.

Example of tire autonomy calculation:&#x20;

Assuming a vehicle that has performed $$N$$ trips, the tire autonomy ( $$d\_a$$ ) in km can be computed as follow:

$$d\_a=f(w)\times\sum\_{k=1}^Nd\_i$$ with $$f(w)=\frac{1}{10^9\times\sum\_{k=1}^Nw\_i}-1$$&#x20;

where ω is the tire worn mass fraction for the trip i (in ppb) and di is the distance (in km) of the trip i. The wear function f(ω) is a decreasing function that goes from infinity to zero. When f(ω) equals zero, the tire has no longer autonomy and must be replaced. This function is displayed below:

![](https://lh5.googleusercontent.com/zEF2xgPIxXRY9o34GjFjsHqdYeRMw47MlYGe-El9YmDiOnF-z8-TMgdU2q_OVwNKSA9hBlbodW5Mo3pI2TBQyUiU6ow5AlK98XR-NpGDPJcUjR6s43Nki0KR7QyrPbsFHUZ0X-R5)

**Total tire and brake wear indicators**

In order to facilitate the integration within a vehicle maintenance service, the DriveQuant API provides for all your requests the following set of data related to any component (tires or brakes):

* The total distance traveled with a given component (Distance)
* The level of wear of the considered component (TotalWear)
* The remaining autonomy before a complete wear (Autonomy)
* The average wear speed of the considered component (WearRate)
* The total autonomy of the considered component is assumed to be equal to the total travelled distance plus the remaining autonomy (Distance + Autonomy).

The diagram below illustrates the principle and the meaning of these quantities. The figure shows the evolution of the wear as a function of the distance traveled with the component. This is a generic representation that applies to a brake pad or a tire.

![](https://lh5.googleusercontent.com/KrfZ8VA8u4gGW4PKsWnW8qQ6PSv_VzpCGIXHMdKU8W-kcr_0-vRoSjG1R9IoYaDKm2oC9mptpFvRKASmGvId5GEjWqjiXyaJVPrkLdRFKvdthTIhbXreWgDL9qDSIPkz01kMJKaW)

The autonomy of a set of tires or brakes is calculated for each axle (front and rear). For example, the most worn tire between the left tire and the right tire on the same axle is used.

<table><thead><tr><th width="195.66666666666666">Name</th><th width="98" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td>frontTireWear</td><td align="center"><code>int</code></td><td><p>Worn mass fraction of the front tires (right/ left) for current trip</p><p>Unit : thousandths part of ppm = ppb</p><p>Min. value = 0 / Max. value = <span class="math">10^9</span> </p></td></tr><tr><td>rearTireWear</td><td align="center"><code>int</code></td><td><p>Worn mass fraction of the rear tires (right/left) for current trip</p><p>Unit : thousandths part of ppm = ppb</p><p>Min. value = 0 / Max. value = <span class="math">10^9</span></p></td></tr><tr><td>frontBrakePadWear</td><td align="center"><code>int</code></td><td><p>Worn mass fraction of the front brakes (right/left) for current trip</p><p>Unit : thousandths part of ppm = ppb</p><p>Min. value = 0 / Max. value = <span class="math">10^9</span> </p></td></tr><tr><td>rearBrakePadWear</td><td align="center"><code>int</code></td><td><p>Worn mass fraction of the rear brakes (right/left) for current trip</p><p>Unit : thousandths part of ppm = ppb</p><p>Min. value = 0 / Max. value = <span class="math">10^9</span> </p></td></tr><tr><td>frontTireDistance</td><td align="center"><code>int</code></td><td><p>Total distance analyzed for the front tires (in km)</p><p>Min. value = 0 / Max. value = 1 000 000</p></td></tr><tr><td>rearTireDistance</td><td align="center"><code>int</code></td><td><p>Total distance analyzed for the rear tires (in km)</p><p>Min. value = 0 / Max. value = 1 000 000</p></td></tr><tr><td>frontBrakeDistance</td><td align="center"><code>int</code></td><td><p>Total distance analyzed for the front brakes (in km)</p><p>Min. value = 0 / Max. value = 1 000 000</p></td></tr><tr><td>rearBrakeDistance</td><td align="center"><code>int</code></td><td><p>Total distance analyzed for the rear brakes (in km)</p><p>Min. value = 0 / Max. value = 1 000 000</p></td></tr><tr><td>frontTireAutonomy</td><td align="center"><code>int</code></td><td><p>Front tires remaining distance before change (in km)</p><p>Min. value = 0 / Max. value = 1 000 000</p></td></tr><tr><td>rearTireAutonomy</td><td align="center"><code>int</code></td><td><p>Rear tires remaining distance before change (in km)</p><p>Min. value = 0 / Max. value = 1 000 000</p></td></tr><tr><td>frontBrakeAutonomy</td><td align="center"><code>int</code></td><td><p>Front brakes remaining distance before change (in km)</p><p>Min. value = 0 / Max. value = 1 000 000</p></td></tr><tr><td>rearBrakeAutonomy</td><td align="center"><code>int</code></td><td><p>Rear brakes remaining distance before change (in km)</p><p>Min. value = 0 / Max. value = 1 000 000</p></td></tr><tr><td>frontTireTotalWear</td><td align="center"><code>double</code></td><td><p>Total worn mass percentage of the front tires (right/left) </p><p>Min. value = 0% / Max. value = 100%</p></td></tr><tr><td>rearTireTotalWear</td><td align="center"><code>double</code></td><td><p>Total worn mass percentage of the rear tires (right/left) </p><p>Min. value = 0% / Max. value = 100%</p></td></tr><tr><td>frontBrakeTotalWear</td><td align="center"><code>double</code></td><td><p>Total worn mass percentage of the front brakes (right/left) </p><p>Min. value = 0% / Max. value = 100%</p></td></tr><tr><td>rearBrakeTotalWear</td><td align="center"><code>double</code></td><td><p>Total worn mass percentage of the rear brakes (right/left) </p><p>Min. value = 0% / Max. value = 100%</p></td></tr><tr><td>frontTireWearRate</td><td align="center"><code>double</code></td><td>Average wear rate for the front tires (in %/1000km)</td></tr><tr><td>rearTireWearRate</td><td align="center"><code>double</code></td><td>Average wear rate for the rear tires (in %/1000km)</td></tr><tr><td>frontBrakeWearRate</td><td align="center"><code>double</code></td><td>Average wear rate for the rear brakes (in %/1000km)</td></tr><tr><td>rearBrakeWearRate</td><td align="center"><code>double</code></td><td>Average wear rate for the rear brakes (in %/1000km)</td></tr></tbody></table>

The wear rate measures the component wear (in %) as a function of distance. This variable allows to compare vehicles and to inform a vehicle fleet manager whose components are wearing out too quickly. The wear rate is related to the type of vehicle, the driving style, the type of road used and the driving condition. This is why its value can change if the typology of trips changes and if the vehicle is driven by several drivers who have different driving styles.

### Speeding score

This service measures distance and driving time when the vehicle speed exceeds the speed limit.

From this information, a speed limit score is calculated. The speed limit score is 10 if the overspeed distance is zero. The speed limit score decreases with the increase in the percentage of distance spent in overspeeding.

The sensitivity function linking the relative speeding distance (in %) with the speeding score is shown below.

<figure><img src="/files/ilziPs511TDY7H9WYfZd" alt="" width="563"><figcaption><p>Log scale sensitivity function for speeding score</p></figcaption></figure>

<figure><img src="/files/ObL7aKq1lVtbuzh6Zfak" alt="" width="563"><figcaption><p>Speed score sensitivity function in decimal scale</p></figcaption></figure>

This service returns a global (or trip) score for the entire trip as well as several sub-scores corresponding to each of the legal speed portions traveled during the trip.&#x20;

The global (or trip) score is the average of the sub-scores weighted by distance.

<table><thead><tr><th width="190.66666666666666">Name</th><th width="143" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td>distance</td><td align="center"><code>int</code></td><td>trip distance (in m)</td></tr><tr><td>duration</td><td align="center"><code>int</code></td><td>trip duration (in s)</td></tr><tr><td>speedingDistance</td><td align="center"><code>int</code></td><td>Distance travelled at a speed above the limit (in m)</td></tr><tr><td>speedingDuration</td><td align="center"><code>int</code></td><td>Duration spent at a speed above the limit (in s)</td></tr><tr><td>score</td><td align="center"><code>double</code></td><td>Speeding score</td></tr><tr><td>speedLimitContexts</td><td align="center"><code>array[object]</code></td><td>Array of <a href="#speedlimitcontexts">SpeedLimitContexts</a></td></tr></tbody></table>

#### SpeedLimitContexts

<table><thead><tr><th width="162">Name</th><th width="89" align="center">Type</th><th width="493">Description</th></tr></thead><tbody><tr><td>speedLimit</td><td align="center"><code>int</code></td><td>Speed limit for the portion of the trip (in km/h)</td></tr><tr><td>distance</td><td align="center"><code>int</code></td><td>Total distance for the portion of the trip limited at the speed limit value (in m)</td></tr><tr><td>duration</td><td align="center"><code>int</code></td><td>Total duration for the portion of the trip limited at the speed limit value (in s)</td></tr><tr><td>speedingDistance</td><td align="center"><code>int</code></td><td>Distance travelled at a speed above the limit within the speed limit portion (in m)</td></tr><tr><td>speedingDuration</td><td align="center"><code>int</code></td><td>Duration spent at a speed above the limit within the speed limit portion (in s)</td></tr><tr><td>score</td><td align="center"><code>double</code></td><td>Speeding score for a given speed limit portion</td></tr></tbody></table>

#### Response body example

```json
{
  "speedingStatistics": {
    "distance": 6835,
    "duration": 613,
    "speedingDistance": 280,
    "speedingDuration": 14,
    "score": 9.55,
    "speedLimitContexts": [
      {
        "speedLimit": 30,
        "distance": 21,
        "duration": 6,
        "speedingDistance": 0,
        "speedingDuration": 0,
        "score": 10.0
      },
      {
        "speedLimit": 50,
        "distance": 2378,
        "duration": 352,
        "speedingDistance": 169,
        "speedingDuration": 9,
        "score": 8.83
      },
      {
        "speedLimit": 70,
        "distance": 2153,
        "duration": 122,
        "speedingDistance": 111,
        "speedingDuration": 5,
        "score": 9.38
      },
      {
        "speedLimit": 90,
        "distance": 2283,
        "duration": 133,
        "speedingDistance": 0,
        "speedingDuration": 0,
        "score": 10.0
      }
    ]
  }
}
```

### **Speeding events**

The service that computes the speeding score also returns location-based information about overspeeding events.

This type of information is used to indicate on a map the places on the trip where the speed of the vehicle exceeds the speed limit.&#x20;

The start and end positions of overspeeding segments are included in the SpeedingEvents table.

<table><thead><tr><th width="107.66666666666666">Name</th><th width="113" align="center">Type</th><th width="498.33333333333337">Description</th></tr></thead><tbody><tr><td>time</td><td align="center"><code>double</code></td><td>Time since the beginning of the trip (in s)</td></tr><tr><td>latitude</td><td align="center"><code>double</code></td><td>Latitude (in deg)</td></tr><tr><td>longitude</td><td align="center"><code>double</code></td><td>Longitude (in deg)</td></tr><tr><td>type</td><td align="center"><code>int</code></td><td><p>1 = Overspeeding segment start point</p><p>0 = Overspeeding segment endpoint</p></td></tr><tr><td>index</td><td align="center"><code>int</code></td><td>Index of the speeding event in the matched route vector.</td></tr></tbody></table>

**Response body example**

```json
"speedingEvents": [
  {
    "longitude": 2.240690719770278,
    "latitude": 48.87119316290749,
    "time": 96,
    "type": 1,
    "index": 36
  },
  {
    "longitude": 2.2389993413999454,
    "latitude": 48.87022711541927,
    "time": 106,
    "type": 0,
    "index": 39
  }
]
```

## Error Response Format

In some cases, the service may be unable to analyze a trip.&#x20;

The most common reasons are listed below.

<table><thead><tr><th width="114.66666666666666" align="center">HTTP status</th><th width="130" align="center">Code</th><th width="498.33333333333337">Description</th></tr></thead><tbody><tr><td align="center">400</td><td align="center">1001</td><td>The mandatory field route is missing</td></tr><tr><td align="center">400</td><td align="center">1002</td><td>The mandatory field gpsDate is missing</td></tr><tr><td align="center">400</td><td align="center">1003</td><td>The mandatory field gpsVelocity is missing</td></tr><tr><td align="center">400</td><td align="center">1004</td><td>There are not enough GPS points to perform the analysis. Please make sure that your trip contains at least 10 GPS points</td></tr><tr><td align="center">400</td><td align="center">1005</td><td>The route data is inconsistent: each vector must have the same length</td></tr><tr><td align="center">400</td><td align="center">1006</td><td>The route data is not valid (velocity is too low)</td></tr><tr><td align="center">400</td><td align="center">1007</td><td>The route data sampling period is invalid (expected 1 Hz)</td></tr><tr><td align="center">400</td><td align="center">1008</td><td>The gpsDate field contains negative values</td></tr><tr><td align="center">401</td><td align="center">2000 - 2003</td><td>Unauthorized request (invalid or expired credentials)</td></tr><tr><td align="center">409</td><td align="center">3000</td><td>A similar trip has already been processed and stored with the same account</td></tr><tr><td align="center">429</td><td align="center">4000</td><td>You have reached your daily requests quota</td></tr><tr><td align="center">429</td><td align="center">4001</td><td>You have exceeded the rate limit for this endpoint. Please try again later</td></tr><tr><td align="center">500</td><td align="center">5000 - 5001</td><td>The service failed to process your data. Further analysis of your data is required</td></tr><tr><td align="center">500</td><td align="center">6000 - 6003</td><td>A configuration issue prevents the request from being analyzed</td></tr><tr><td align="center">500</td><td align="center">9999</td><td>An unexpected error has occurred</td></tr></tbody></table>

{% hint style="info" %}
If a request fails, please contact our support team (via <support@drivequant.com>) and include the HTTP status code and error code in your message. These details are essential for diagnosing the issue quickly.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.drivequant.com/analysis-services/trip-analysis-from-custom-data-source.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
