---
title: "GET /v1/stats/index/datasources/{datasourcesId}"
method: GET
path: "/v1/stats/index/datasources/{datasourcesId}"
tags: ["stats"]
---

# GET /v1/stats/index/datasources/{datasourcesId}

`GET /v1/stats/index/datasources/{datasourcesId}`

## Request

- Base URL: `https://cloudsearch.googleapis.com`
- URL: `https://cloudsearch.googleapis.com/v1/stats/index/datasources/{datasourcesId}`
- Auth: one of:
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud_search`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud_search`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud_search.stats`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud_search.stats`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud_search.stats.indexing`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud_search.stats.indexing`

Gets indexed item statistics for a single data source. **Note:** This API requires a standard end user account to execute.

## Path parameters

- `datasourcesId` string, required

## Query parameters

- `$.xgafv` '1' | '2'
- `access_token` string
- `alt` 'json' | 'media' | 'proto'
- `callback` string
- `fields` string
- `key` string
- `oauth_token` string
- `prettyPrint` boolean
- `quotaUser` string
- `uploadType` string
- `upload_protocol` string
- `fromDate.day` integer
- `fromDate.month` integer
- `fromDate.year` integer
- `toDate.day` integer
- `toDate.month` integer
- `toDate.year` integer

## Response `200`

Successful response

- GetDataSourceIndexStatsResponse
  - `averageIndexedItemCount` string, int64: Average item count for the given date range for which billing is done.
  - `stats` DataSourceIndexStats[]: Summary of indexed item counts, one for each day in the requested range.
    - `date` Date: Represents a whole calendar date, for example a date of birth. The time of day and time zone are either specified elsewhere or are not significant. The date is relative to the [Proleptic Gregorian Calendar](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar). The date must be a valid calendar date between the year 1 and 9999.
      - `day` integer: Day of month. Must be from 1 to 31 and valid for the year and month.
      - `month` integer: Month of date. Must be from 1 to 12.
      - `year` integer: Year of date. Must be from 1 to 9999.
    - `itemCountByStatus` ItemCountByStatus[]: Number of items aggregrated by status code.
      - `count` string, int64: Number of items matching the status code.
      - `indexedItemsCount` string, int64: Number of items matching the status code for which billing is done. This excludes virtual container items from the total count. This count would not be applicable for items with ERROR or NEW_ITEM status code.
      - `statusCode` 'CODE_UNSPECIFIED' | 'ERROR' | 'MODIFIED' | 'NEW_ITEM' | 'ACCEPTED': Status of the items.

## Changes

- **2026-12-04** `e6b5623d031d`: 4 info
  - the security scope `https://www.googleapis.com/auth/cloud_search` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud_search` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/cloud_search.stats.indexing` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud_search.stats.indexing` was removed from the endpoint's security scheme `Oauth2c`
- **2026-11-09** `b2f1256e48fb`: 4 info
  - the security scope `https://www.googleapis.com/auth/cloud_search` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud_search` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/cloud_search.stats.indexing` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud_search.stats.indexing` was removed from the endpoint's security scheme `Oauth2c`

[Operation history](https://skmtc.dev/google/apis/cloudsearch/changes/v1/stats/index/datasources/:datasourcesId/get.md)

---

[API](https://skmtc.dev/google/apis/cloudsearch.md) - [All operations](https://skmtc.dev/google/apis/cloudsearch/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/cloudsearch/revisions/e6b5623d031d?raw)
