# Method: stats.index.datasources.get

- [HTTP request](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/stats.index.datasources/get#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/stats.index.datasources/get#body.PATH_PARAMETERS)
- [Query parameters](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/stats.index.datasources/get#body.QUERY_PARAMETERS)
- [Request body](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/stats.index.datasources/get#body.request_body)
- [Response body](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/stats.index.datasources/get#body.response_body)
- [Authorization scopes](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/stats.index.datasources/get#body.aspect)
- [Try it!](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/stats.index.datasources/get#try-it)

Gets indexed item statistics for a single data source.

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

### HTTP request

`GET https://cloudsearch.googleapis.com/v1/stats/index/{name=datasources/*}`

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

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` The resource id of the data source to retrieve statistics for, in the following format: "datasources/{sourceId}" |

### Query parameters

| Parameters ||
|---|---|
| `fromDate` | ``object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/Date`)`` Start of the date range to retrieve statistics for, in PST. This value must be within 1 year of the current date. The fromDate and toDate can be the same to provide statistics for a single day. If both fromDate and toDate are set to the current day, real-time statistics are returned for the current day. Note: Requests for real-time stats from large data sources are expensive and have high latency. |
| `toDate` | ``object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/Date`)`` End of the date range to receive statistics for, in PST. This value must be within 1 year of the current date. If set to the current date, real-time statistics are returned. Note: Requests for real-time stats from large data sources are expensive and have high latency. The fromDate and toDate can be the same to provide statistics for a single day. If both fromDate and toDate are set to the current day, real-time statistics are returned for the current day. |

### Request body

The request body must be empty.

### Response body

If successful, the response body contains an instance of `https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/stats.index.datasources#GetDataSourceIndexStatsResponse`.

### 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).