# Google Search Console

> Access Google Search Console for SEO data such as queries, clicks, impressions, rankings, and indexing status across sites. Use when diagnosing search performance or indexing issues.

- Skill: `thedaviddias/google-search-console` (Agent Skill)
- Install (CLI): `npx skillmds@latest add thedaviddias/google-search-console`
- Raw SKILL.md: https://api.skillmd.com/api/skills/thedaviddias/google-search-console/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Marketing & Growth
- Author: thedaviddias (https://skillmd.com/u/thedaviddias)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/thedaviddias/google-search-console

---


# Google Search Console Skill

Access SEO performance data from Google Search Console.

## Credentials

- 1Password: `op://Jarvis/Google Search Console`
- Token file: `~/.config/gsc/token.json`

## Token Refresh

Access tokens expire after 1 hour. Refresh with:

```bash
curl -s -X POST "https://oauth2.googleapis.com/token" \
  -d "client_id=CLIENT_ID" \
  -d "client_secret=CLIENT_SECRET" \
  -d "refresh_token=REFRESH_TOKEN" \
  -d "grant_type=refresh_token" | jq -r '.access_token'
```

## API Usage

### List Sites
```bash
curl -s "https://www.googleapis.com/webmasters/v3/sites" \
  -H "Authorization: Bearer ACCESS_TOKEN"
```

### Search Analytics (Top Queries)
```bash
curl -s -X POST "https://www.googleapis.com/webmasters/v3/sites/ENCODED_SITE_URL/searchAnalytics/query" \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "startDate": "2026-01-01",
    "endDate": "2026-01-31",
    "dimensions": ["query"],
    "rowLimit": 10
  }'
```

### Top Pages
```bash
curl -s -X POST "https://www.googleapis.com/webmasters/v3/sites/ENCODED_SITE_URL/searchAnalytics/query" \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "startDate": "2026-01-01",
    "endDate": "2026-01-31",
    "dimensions": ["page"],
    "rowLimit": 10
  }'
```

### By Country
```bash
-d '{"dimensions": ["country"], ...}'
```

### By Device
```bash
-d '{"dimensions": ["device"], ...}'
```

## URL Encoding

Site URLs must be URL-encoded:
- `https://frontendchecklist.io/` → `https%3A%2F%2Ffrontendchecklist.io%2F`
- `sc-domain:goshuinatlas.com` → `sc-domain%3Agoshuinatlas.com`

## Metrics

- `clicks` - Total clicks from search
- `impressions` - Times shown in search results
- `ctr` - Click-through rate
- `position` - Average ranking position

## Date Range

- Max range: 16 months of data
- Format: `YYYY-MM-DD`

