> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetSearchAnalytics

# Package: googleSearchConsole

# Namespace: GscService

# Method link: https://dev.wix.com/docs/api-reference/business-management/seo/google-search-console/site-readiness-v1/get-search-analytics.md

## Permission Scopes:
View SEO Settings: SCOPE.PROMOTE.VIEW-SEO

## Introduction

Retrieves the site's search performance data from Google Search Console.

Returns clicks, impressions, click-through rate, and average position,
grouped by the requested dimensions. For example, group by `date` for a
daily chart, or by `query` for top search terms.

The data is Google Search Console's search performance report for the
site, so its freshness and history range follow Google Search Console.

---

## REST API

### Schema

```
 Method: getSearchAnalytics
 Description: Retrieves the site's search performance data from Google Search Console.  Returns clicks, impressions, click-through rate, and average position, grouped by the requested dimensions. For example, group by `date` for a daily chart, or by `query` for top search terms.  The data is Google Search Console's search performance report for the site, so its freshness and history range follow Google Search Console.
 URL: https://www.wixapis.com/gsc/connection/v1/search-analytics
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  startDate, endDate
 Method parameters: 
   query param name: dimensions | type: array<dimensions> | description: Dimensions to group the results by, in the order they should appear in each result's `keys`. Supported values are Google Search Console's search analytics dimensions: `date`, `query`, `page`, `country`, `device`, `searchAppearance`.  Default: no grouping, a single aggregate row for the whole period.  | validation: maxItems 10, maxLength 50
   query param name: endDate | type: endDate | description: Last day of the requested period, in `YYYY-MM-DD` format. Inclusive. | required: true | validation: maxLength 10
   query param name: rowLimit | type: rowLimit | description: Maximum number of rows to return.  | validation: format int32
   query param name: startDate | type: startDate | description: First day of the requested period, in `YYYY-MM-DD` format. | required: true | validation: maxLength 10
   query param name: startRow | type: startRow | description: Zero-based index of the first row to return. Use with `rowLimit` to page through large result sets.  | validation: format int32
   query param name: type | type: type | description: Search type to report on. Supported values: `web`, `image`, `video`, `news`.  Default: `web`.  | validation: maxLength 20
 Return type: GetSearchAnalyticsResponse
  - name: results | type: array<SearchAnalyticsResult> | description: Search performance rows, one per combination of the requested dimensions.  | validation: maxItems 10000
     - name: keys | type: array<string> | description: Values of the requested dimensions, in the order the dimensions were requested. For example, for `dimensions: ["date"]`, the row's date.  | read-only: true | validation: maxItems 10, maxLength 5000
     - name: clicks | type: number | description: Number of clicks from Google Search results.  | read-only: true 
     - name: impressions | type: number | description: Number of times the site appeared in Google Search results.  | read-only: true 
     - name: ctr | type: number | description: Click-through rate: `clicks / impressions`, between 0 and 1.  | read-only: true 
     - name: position | type: number | description: Average position of the site's topmost result, where 1 is the first position.  | read-only: true 

 Possible Errors:
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: MISSING_URL | Description: The site's public URL couldn't be resolved. For example, the site isn't published yet.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: MISSING_TOKEN | Description: No Google account is connected for this site. Connect first with the GSC Connection API.
   HTTP Code: 429 | Status Code: RESOURCE_EXHAUSTED | Application Code: GOOGLE_QUOTA_EXCEEDED | Description: Google's API quota for the property is used up. Retry after the quota window resets.
   HTTP Code: 503 | Status Code: UNAVAILABLE | Application Code: GOOGLE_UNAVAILABLE | Description: Google answered with a temporary server error. Retry with backoff.


```

### Examples

### Get Search Analytics
```curl
curl -X GET \
'https://www.wixapis.com/gsc/v1/search-analytics?startDate=2026-08-01&endDate=2026-08-31&dimensions=query&rowLimit=3' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.gsc.siteReadiness.getSearchAnalytics(startDate, options)
 Description: Retrieves the site's search performance data from Google Search Console.  Returns clicks, impressions, click-through rate, and average position, grouped by the requested dimensions. For example, group by `date` for a daily chart, or by `query` for top search terms.  The data is Google Search Console's search performance report for the site, so its freshness and history range follow Google Search Console.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  startDate, options.endDate, options
 Method parameters: 
   param name: options | type: GetSearchAnalyticsOptions  none | required: true 
        - name: endDate | type: string | description: Last day of the requested period, in `YYYY-MM-DD` format. Inclusive. | required: true | validation: maxLength 10
        - name: dimensions | type: array<string> | description: Dimensions to group the results by, in the order they should appear in each result's `keys`. Supported values are Google Search Console's search analytics dimensions: `date`, `query`, `page`, `country`, `device`, `searchAppearance`.  Default: no grouping, a single aggregate row for the whole period.  | validation: maxItems 10, maxLength 50
        - name: type | type: string | description: Search type to report on. Supported values: `web`, `image`, `video`, `news`.  Default: `web`.  | validation: maxLength 20
        - name: rowLimit | type: integer | description: Maximum number of rows to return.  | validation: format int32
        - name: startRow | type: integer | description: Zero-based index of the first row to return. Use with `rowLimit` to page through large result sets.  | validation: format int32
   param name: startDate | type: string | description: First day of the requested period, in `YYYY-MM-DD` format. | required: true | validation: maxLength 10
 Return type: PROMISE<GetSearchAnalyticsResponse>
  - name: results | type: array<SearchAnalyticsResult> | description: Search performance rows, one per combination of the requested dimensions.  | validation: maxItems 10000
     - name: keys | type: array<string> | description: Values of the requested dimensions, in the order the dimensions were requested. For example, for `dimensions: ["date"]`, the row's date.  | read-only: true | validation: maxItems 10, maxLength 5000
     - name: clicks | type: number | description: Number of clicks from Google Search results.  | read-only: true 
     - name: impressions | type: number | description: Number of times the site appeared in Google Search results.  | read-only: true 
     - name: ctr | type: number | description: Click-through rate: `clicks / impressions`, between 0 and 1.  | read-only: true 
     - name: position | type: number | description: Average position of the site's topmost result, where 1 is the first position.  | read-only: true 

 Possible Errors:
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: MISSING_URL | Description: The site's public URL couldn't be resolved. For example, the site isn't published yet.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: MISSING_TOKEN | Description: No Google account is connected for this site. Connect first with the GSC Connection API.
   HTTP Code: 429 | Status Code: RESOURCE_EXHAUSTED | Application Code: GOOGLE_QUOTA_EXCEEDED | Description: Google's API quota for the property is used up. Retry after the quota window resets.
   HTTP Code: 503 | Status Code: UNAVAILABLE | Application Code: GOOGLE_UNAVAILABLE | Description: Google answered with a temporary server error. Retry with backoff.


```

### Examples

### Get the site's top search queries for a period
```javascript
import { siteReadiness } from "@wix/gsc";

async function getSearchAnalytics() {
  const response = await siteReadiness.getSearchAnalytics("2026-08-01", {
    endDate: "2026-08-31",
    dimensions: ["query"],
    rowLimit: 3,
  });
}

/* Promise resolves to:
 * {
 *   "results": [
 *     {
 *       "keys": ["linen summer dress"],
 *       "clicks": 128,
 *       "impressions": 2140,
 *       "ctr": 0.0598,
 *       "position": 6.4
 *     },
 *     {
 *       "keys": ["fashion store amsterdam"],
 *       "clicks": 74,
 *       "impressions": 990,
 *       "ctr": 0.0747,
 *       "position": 4.1
 *     },
 *     {
 *       "keys": ["organic cotton shirt"],
 *       "clicks": 31,
 *       "impressions": 1205,
 *       "ctr": 0.0257,
 *       "position": 11.8
 *     }
 *   ]
 * }
 */

```

### getSearchAnalytics (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { siteReadiness } from '@wix/gsc';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { siteReadiness },
  // Include the auth strategy and host as relevant
});


async function getSearchAnalytics(startDate,options) {
  const response = await myWixClient.siteReadiness.getSearchAnalytics(startDate,options);
};
```

---