# 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](/important-topics/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/TAQtKB0wSAxMIFckU8ny">SafetyScoreRequestParameters</a>.</td></tr></tbody></table>

### `getCallEvents()`

> ```java
> List<CallEvent> getCallEvents(String transportId);
> ```
>
> Returns the [call events](/important-topics/sdk/api-reference/android/driving-insights/callevent.md) for a completed, non-provisional transport. See [isProvisional](/important-topics/sdk/api-reference/android/eventtimeline/event.md#isprovisional) to learn more about what a provisional transport is.
>
> Note: calling this method on an uninitialized SDK will throw an [SdkException](/important-topics/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](/important-topics/sdk/api-reference/android/driving-insights/callwhilemovingevent.md) for a completed, non-provisional transport. See [isProvisional](/important-topics/sdk/api-reference/android/eventtimeline/event.md#isprovisional) to learn more about what a provisional transport is.
>
> Note: calling this method on an uninitialized SDK will throw an [SdkException](/important-topics/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](/important-topics/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](/important-topics/sdk/api-reference/android/eventtimeline/event.md#isprovisional) to learn more about what a provisional transport is.
>
> Note: calling this method on an uninitialized SDK will throw an [SdkException](/important-topics/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](/important-topics/sdk/api-reference/android/driving-insights/harshdrivingevent.md) for a completed, non-provisional transport. See [isProvisional](/important-topics/sdk/api-reference/android/eventtimeline/event.md#isprovisional) to learn more about what a provisional transport is.
>
> Note: calling this method on an uninitialized SDK will throw an [SdkException](/important-topics/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](/important-topics/sdk/api-reference/android/driving-insights/phoneusageevent.md) for a completed, non-provisional transport. See [isProvisional](/important-topics/sdk/api-reference/android/eventtimeline/event.md#isprovisional) to learn more about what a provisional transport is.
>
> Note: calling this method on an uninitialized SDK will throw an [SdkException](/important-topics/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](/important-topics/sdk/api-reference/android/driving-insights/speedingevent.md) for a completed, non-provisional transport. See [isProvisional](/important-topics/sdk/api-reference/android/eventtimeline/event.md#isprovisional) to learn more about what a provisional transport is.
>
> Note: calling this method on an uninitialized SDK will throw an [SdkException](/important-topics/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](/important-topics/sdk/api-reference/android/driving-insights/speedingevent-1.md) for a completed, non-provisional transport. See [isProvisional](/important-topics/sdk/api-reference/android/eventtimeline/event.md#isprovisional) to learn more about what a provisional transport is.
>
> Note: calling this method on an uninitialized SDK will throw an [SdkException](/important-topics/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](/important-topics/sdk/api-reference/android/eventtimeline/event.md#isprovisional) to learn more about what a provisional transport is.
>
> Note: calling this method on an uninitialized SDK will throw an [SdkException](/important-topics/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="https://github.com/sentiance/v4-docs/blob/main/important-topics/sdk/api-reference/android/driving-insights/broken-reference/README.md"><code>DrivingInsightsReadyListener</code></a> to receive the driving insights. Set <code>null</code> to remove a previously set listener.</td></tr></tbody></table>


---

# 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.sentiance.com/important-topics/sdk/api-reference/android/driving-insights/drivinginsightsapi.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.
