# Method: accounts.locations.reportInsights

- [HTTP request](https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#body.request_body)
  - [JSON representation](https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#body.response_body)
  - [JSON representation](https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#body.ReportLocationInsightsResponse.SCHEMA_REPRESENTATION)
- [Authorization Scopes](https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#body.aspect)
- [DrivingDirectionMetricsRequest](https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#DrivingDirectionMetricsRequest)
  - [JSON representation](https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#DrivingDirectionMetricsRequest.SCHEMA_REPRESENTATION)
- [NumDays](https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#NumDays)
- [LocationMetrics](https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#LocationMetrics)
  - [JSON representation](https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#LocationMetrics.SCHEMA_REPRESENTATION)
- [LocationDrivingDirectionMetrics](https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#LocationDrivingDirectionMetrics)
  - [JSON representation](https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#LocationDrivingDirectionMetrics.SCHEMA_REPRESENTATION)
- [TopDirectionSources](https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#TopDirectionSources)
  - [JSON representation](https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#TopDirectionSources.SCHEMA_REPRESENTATION)
- [RegionCount](https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#RegionCount)
  - [JSON representation](https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#RegionCount.SCHEMA_REPRESENTATION)

Returns a report containing insights on one or more metrics by location.

<br />

> [!NOTE]
> **Note:** Insight reports are limited to a batch size of 10 `locationNames` per call.

<br />

### HTTP request

`POST https://mybusiness.googleapis.com/v4/{name=accounts/*}/locations:reportInsights`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` The account resource name. |

### Request body

The request body contains data with the following structure:

| JSON representation ||
|---|---|
| ``` { "locationNames": [ string ], "basicRequest": { object (`https://developers.google.com/my-business/reference/rest/v4/BasicMetricsRequest`) }, "drivingDirectionsRequest": { object (`https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#DrivingDirectionMetricsRequest`) } } ``` |

| Fields ||
|---|---|
| `locationNames[]` | `string` A collection of locations to fetch insights for, specified by their names. |
| `basicRequest` | ``object (`https://developers.google.com/my-business/reference/rest/v4/BasicMetricsRequest`)`` A request to include basic metric insights in the report. |
| `drivingDirectionsRequest` | ``object (`https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#DrivingDirectionMetricsRequest`)`` A request to include insights about driving-direction requests in the report. |

### Response body

If successful, the response body contains data with the following structure:
Response message for `Insights.ReportLocationInsights`.

| JSON representation ||
|---|---|
| ``` { "locationMetrics": [ { object (`https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#LocationMetrics`) } ], "locationDrivingDirectionMetrics": [ { object (`https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#LocationDrivingDirectionMetrics`) } ] } ``` |

| Fields ||
|---|---|
| `locationMetrics[]` | ``object (`https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#LocationMetrics`)`` A collection of metric values by location. |
| `locationDrivingDirectionMetrics[]` | ``object (`https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#LocationDrivingDirectionMetrics`)`` A collection of values for driving direction-related metrics. |

### Authorization Scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/plus.business.manage`
- `https://www.googleapis.com/auth/business.manage`

For more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2).

## DrivingDirectionMetricsRequest

A request for driving direction insights.

| JSON representation ||
|---|---|
| ``` { "numDays": enum (`https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#NumDays`), "languageCode": string } ``` |

| Fields ||
|---|---|
| `numDays` | ``enum (`https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#NumDays`)`` The number of days to aggregate data for. Results returned will be available data over the last number of requested days. Valid values are 7, 30, and 90. |
| `languageCode` | `string` The BCP 47 code for the language. If a language code is not provided, it defaults to English. |

## NumDays

Number of days that this request can support.

| Enums ||
|---|---|
| `SEVEN` | 7 days. This is the default value. |
| `THIRTY` | 30 days. |
| `NINETY` | 90 days. |

## LocationMetrics

A series of Metrics and BreakdownMetrics associated with a Location over some time range.

| JSON representation ||
|---|---|
| ``` { "locationName": string, "timeZone": string, "metricValues": [ { object (`https://developers.google.com/my-business/reference/rest/v4/MetricValue`) } ] } ``` |

| Fields ||
|---|---|
| `locationName` | `string` The location resource name these values belong to. |
| `timeZone` | `string` IANA timezone for the location. |
| `metricValues[]` | ``object (`https://developers.google.com/my-business/reference/rest/v4/MetricValue`)`` A list of values for the requested metrics. |

## LocationDrivingDirectionMetrics

A location indexed with the regions that people usually come from. This is captured by counting how many driving-direction requests to this location are from each region.

| JSON representation ||
|---|---|
| ``` { "locationName": string, "topDirectionSources": [ { object (`https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#TopDirectionSources`) } ], "timeZone": string } ``` |

| Fields ||
|---|---|
| `locationName` | `string` The location resource name this metric value belongs to. |
| `topDirectionSources[]` | ``object (`https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#TopDirectionSources`)`` Driving-direction requests by source region. By convention, these are sorted by count with at most 10 results. |
| `timeZone` | `string` Time zone (IANA timezone IDs, for example, 'Europe/London') of the location. |

## TopDirectionSources

Top regions where driving-direction requests originated from.

| JSON representation ||
|---|---|
| ``` { "dayCount": integer, "regionCounts": [ { object (`https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#RegionCount`) } ] } ``` |

| Fields ||
|---|---|
| `dayCount` | `integer` The number of days data is aggregated over. |
| `regionCounts[]` | ``object (`https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights#RegionCount`)`` Regions sorted in descending order by count. |

## RegionCount

A region with its associated request count.

| JSON representation ||
|---|---|
| ``` { "latlng": { object (`https://developers.google.com/my-business/reference/rest/v4/accounts.locations#Location.LatLng`) }, "label": string, "count": string } ``` |

| Fields ||
|---|---|
| `latlng` | ``object (`https://developers.google.com/my-business/reference/rest/v4/accounts.locations#Location.LatLng`)`` Center of region. |
| `label` | `string` Human-readable label for the region. |
| `count` | `string (https://developers.google.com/discovery/v1/type-format format)` Number of driving-direction requests from this region. |