Find your Sites in Google Search Console
The direct gscdump client calls Google with your OAuth access token. List Sites first so you can copy an exact Site identifier.
Before you start
Get a Google access token with Search Console access. Keep it on your server. A Site can use sc-domain:example.com or a URL prefix such as https://example.com/.
Create the direct client
Install gscdump with pnpm add gscdump. Set GOOGLE_ACCESS_TOKEN, then run:
import { googleSearchConsole } from 'gscdump'
const accessToken = process.env.GOOGLE_ACCESS_TOKEN
if (!accessToken)
throw new Error('Set GOOGLE_ACCESS_TOKEN')
const google = googleSearchConsole({ accessToken })
const sites = await google.sites()
console.log(sites)sites() returns Google's Site list for that grant. Copy an identifier from the result. The direct client reference lists other imports.
If the list is empty
Check that the token belongs to a user with Search Console access. A valid grant can still have no accessible Sites.
Query one Site next
Use the identifier in Direct Search Analytics. For synced history and hosted Reports, choose hosted access.