# Method: stats.getSession

- [HTTP request](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/stats/getSession#body.HTTP_TEMPLATE)
- [Query parameters](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/stats/getSession#body.QUERY_PARAMETERS)
- [Request body](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/stats/getSession#body.request_body)
- [Response body](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/stats/getSession#body.response_body)
  - [JSON representation](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/stats/getSession#body.GetCustomerSessionStatsResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/stats/getSession#body.aspect)
- [CustomerSessionStats](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/stats/getSession#CustomerSessionStats)
  - [JSON representation](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/stats/getSession#CustomerSessionStats.SCHEMA_REPRESENTATION)
- [Try it!](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/stats/getSession#try-it)

Get the # of search sessions, % of successful sessions with a click query statistics for customer.

**Note:** This API requires a standard end user account to execute.

### HTTP request

`GET https://cloudsearch.googleapis.com/v1/stats/session`

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

### Query parameters

| Parameters ||
|---|---|
| `fromDate` | ``object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/Date`)`` All available stats from fromDate to toDate are returned. fromDate should be within the year and toDate \>= fromDate. |
| `toDate` | ``object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/Date`)`` |

### Request body

The request body must be empty.

### Response body

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "stats": [ { object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/stats/getSession#CustomerSessionStats`) } ] } ``` |

| Fields ||
|---|---|
| `stats[]` | ``object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/stats/getSession#CustomerSessionStats`)`` |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud_search.stats.indexing`
- `https://www.googleapis.com/auth/cloud_search.stats`
- `https://www.googleapis.com/auth/cloud_search`

For more information, see the [Authorization guide](https://developers.google.com/workspace/guides/configure-oauth-consent).

## CustomerSessionStats

| JSON representation |
|---|
| ``` { "date": { object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/Date`) }, "searchSessionsCount": string } ``` |

| Fields ||
|---|---|
| `date` | ``object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/Date`)`` The date for which session stats were calculated. Stats are calculated on the following day, close to midnight PST, and then returned. |
| `searchSessionsCount` | `string (https://developers.google.com/discovery/v1/type-format format)` The count of search sessions on the day |