> For the complete documentation index, see [llms.txt](https://docs.sentiance.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sentiance.com/sdk/api-reference/android/driving-insights/drivinginsightsapi.md).

# DrivingInsightsApi

Use this API to receive driving insights about vehicular transports.

## DrivingInsightsApi API

### `getAverageOverallSafetyScore()`

> ```java
> @Nullable Float getAverageOverallSafetyScore(SafetyScoreRequestParameters params);
> ```
>
> Returns the average overall safety score for a given set of parameters, or `null` if the score is not available.
>
> Note: calling this method on an uninitialized SDK will throw an [SdkException](/sdk/api-reference/android/sdkexception.md).

<table><thead><tr><th width="240">Parameters</th><th></th></tr></thead><tbody><tr><td>params</td><td>The parameters for which to calculate the average overall safety score. See <a href="/pages/bOxkFySadnNDSSlFmlbT">SafetyScoreRequestParameters</a>.</td></tr></tbody></table>

### `getCallEvents()`

> ```java
> List<CallEvent> getCallEvents(String transportId);
> ```
>
> Returns the [call events](/sdk/api-reference/android/driving-insights/callevent.md) for a completed, non-provisional transport. See [isProvisional](/sdk/api-reference/android/eventtimeline/event.md) to learn more about what a provisional transport is.
>
> Note: calling this method on an uninitialized SDK will throw an [SdkException](/sdk/api-reference/android/sdkexception.md).

### `getCallWhileMovingEvents()`

{% hint style="warning" %}
This method was deprecated in v6.20.0 in favor of [getCallEvents()](#getcallevents).
{% endhint %}

> ```java
> List<CallWhileMovingEvent> getCallWhileMovingEvents(String transportId);
> ```
>
> Returns the [call while moving events](/sdk/api-reference/android/driving-insights/callwhilemovingevent.md) for a completed, non-provisional transport. See [isProvisional](/sdk/api-reference/android/eventtimeline/event.md) to learn more about what a provisional transport is.
>
> Note: calling this method on an uninitialized SDK will throw an [SdkException](/sdk/api-reference/android/sdkexception.md).

<table><thead><tr><th width="240">Parameters</th><th></th></tr></thead><tbody><tr><td>transportId</td><td>The ID of the desired transport.</td></tr></tbody></table>

### `getDrivingInsights()`

> ```java
> @Nullable DrivingInsights getDrivingInsights(String transportId)
> ```
>
> Returns the [driving insights](/sdk/api-reference/android/driving-insights/drivinginsight.md) for a given non-provisional transport, or `null` if there are no driving insights, the transport ID is invalid, or the transport is a provisional one. See [isProvisional](/sdk/api-reference/android/eventtimeline/event.md) to learn more about what a provisional transport is.
>
> Note: calling this method on an uninitialized SDK will throw an [SdkException](/sdk/api-reference/android/sdkexception.md).

<table><thead><tr><th width="243">Parameters</th><th></th></tr></thead><tbody><tr><td>transportId</td><td>The ID of the desired transport.</td></tr></tbody></table>

### `getHarshDrivingEvents()`

> ```java
> List<HarshDrivingEvent> getHarshDrivingEvents(String transportId)
> ```
>
> Returns the [harsh driving events](/sdk/api-reference/android/driving-insights/harshdrivingevent.md) for a completed, non-provisional transport. See [isProvisional](/sdk/api-reference/android/eventtimeline/event.md) to learn more about what a provisional transport is.
>
> Note: calling this method on an uninitialized SDK will throw an [SdkException](/sdk/api-reference/android/sdkexception.md).

<table><thead><tr><th width="244">Parameters</th><th></th></tr></thead><tbody><tr><td>transportId</td><td>The ID of the desired transport.</td></tr></tbody></table>

### `getPhoneUsageEvents()`

> ```java
> List<PhoneUsageEvent> getPhoneUsageEvents(String transportId)
> ```
>
> Returns the [phone usage events](/sdk/api-reference/android/driving-insights/phoneusageevent.md) for a completed, non-provisional transport. See [isProvisional](/sdk/api-reference/android/eventtimeline/event.md) to learn more about what a provisional transport is.
>
> Note: calling this method on an uninitialized SDK will throw an [SdkException](/sdk/api-reference/android/sdkexception.md).

<table><thead><tr><th width="244">Parameters</th><th></th></tr></thead><tbody><tr><td>transportId</td><td>The ID of the desired transport.</td></tr></tbody></table>

### `getSpeedingEvents()`

> ```java
> List<SpeedingEvent> getSpeedingEvents(@NonNull String transportId);
> ```
>
> Returns the [speeding events](/sdk/api-reference/android/driving-insights/speedingevent.md) for a completed, non-provisional transport. See [isProvisional](/sdk/api-reference/android/eventtimeline/event.md) to learn more about what a provisional transport is.
>
> Note: calling this method on an uninitialized SDK will throw an [SdkException](/sdk/api-reference/android/sdkexception.md).

<table><thead><tr><th width="240">Parameters</th><th></th></tr></thead><tbody><tr><td>transportId</td><td>The ID of the desired transport.</td></tr></tbody></table>

### `getWrongWayDrivingEvents()`

> ```java
> List<WrongWayDrivingEvent> getWrongWayDrivingEvents(String transportId);
> ```
>
> Returns the [wrong way driving events](/sdk/api-reference/android/driving-insights/wrong-way-driving-event.md) for a completed, non-provisional transport. See [isProvisional](/sdk/api-reference/android/eventtimeline/event.md) to learn more about what a provisional transport is.
>
> Note: calling this method on an uninitialized SDK will throw an [SdkException](/sdk/api-reference/android/sdkexception.md).

<table><thead><tr><th width="240">Parameters</th><th></th></tr></thead><tbody><tr><td>transportId</td><td>The ID of the desired transport.</td></tr></tbody></table>

### `setDrivingInsightsReadyListener()`

> ```java
> void setDrivingInsightsReadyListener(@Nullable DrivingInsightsReadyListener listener)
> ```
>
> Sets a listener that will be invoked when the driving insights for a completed, non-provisional transport becomes ready. See [isProvisional](/sdk/api-reference/android/eventtimeline/event.md) to learn more about what a provisional transport is.
>
> Note: calling this method on an uninitialized SDK will throw an [SdkException](/sdk/api-reference/android/sdkexception.md).

<table><thead><tr><th width="248">Parameters</th><th></th></tr></thead><tbody><tr><td>listener</td><td>A <a href="/pages/PHoqqDhlOniKinw7UVuH"><code>DrivingInsightsReadyListener</code></a> to receive the driving insights. Set <code>null</code> to remove a previously set listener.</td></tr></tbody></table>
