> 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

# ListSites

# Package: googleSearchConsole

# Namespace: GscService

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

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

## Introduction

Lists the Google Search Console properties of the connected Google
account, with the account's permission level on each.

Includes properties that aren't Wix sites and domain properties
(`sc-domain:`). Domain properties can't be used as `siteUrl` in the other
methods.

---

## REST API

### Schema

```
 Method: listSites
 Description: Lists the Google Search Console properties of the connected Google account, with the account's permission level on each.  Includes properties that aren't Wix sites and domain properties (`sc-domain:`). Domain properties can't be used as `siteUrl` in the other methods.
 URL: https://www.wixapis.com/gsc/connection/v1/sites
 Method: GET
 Return type: ListSitesResponse
  - name: sites | type: array<SearchConsoleSite> | description: The connected Google account's Search Console properties.  | validation: maxItems 1000
     - name: siteUrl | type: string | description: URL of the property. A URL-prefix property is a full URL, for example `https://example.com/`. A domain property starts with `sc-domain:`.  | read-only: true | validation: maxLength 2000
     - name: permissionLevel | type: string | description: The connected Google account's permission level on the property, in Google's vocabulary: `siteOwner`, `siteFullUser`, `siteRestrictedUser`, or `siteUnverifiedUser`.  | read-only: true | validation: maxLength 50

 Possible Errors:
   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

### List Sites
```curl
curl -X GET \
'https://www.wixapis.com/gsc/v1/sites' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.gsc.siteReadiness.listSites()
 Description: Lists the Google Search Console properties of the connected Google account, with the account's permission level on each.  Includes properties that aren't Wix sites and domain properties (`sc-domain:`). Domain properties can't be used as `siteUrl` in the other methods.
 Return type: PROMISE<ListSitesResponse>
  - name: sites | type: array<SearchConsoleSite> | description: The connected Google account's Search Console properties.  | validation: maxItems 1000
     - name: siteUrl | type: string | description: URL of the property. A URL-prefix property is a full URL, for example `https://example.com/`. A domain property starts with `sc-domain:`.  | read-only: true | validation: maxLength 2000
     - name: permissionLevel | type: string | description: The connected Google account's permission level on the property, in Google's vocabulary: `siteOwner`, `siteFullUser`, `siteRestrictedUser`, or `siteUnverifiedUser`.  | read-only: true | validation: maxLength 50

 Possible Errors:
   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

### List the connected Google account's Search Console properties
```javascript
import { siteReadiness } from "@wix/gsc";

async function listSites() {
  const response = await siteReadiness.listSites();
}

/* Promise resolves to:
 * {
 *   "sites": [
 *     {
 *       "siteUrl": "https://www.my-fashion-store.com/",
 *       "permissionLevel": "siteOwner"
 *     },
 *     {
 *       "siteUrl": "sc-domain:my-fashion-store.com",
 *       "permissionLevel": "siteFullUser"
 *     }
 *   ]
 * }
 */

```

### listSites (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 listSites() {
  const response = await myWixClient.siteReadiness.listSites();
};
```

---