Three credential types serve different APIs:
| Type | Used By | Cost |
|---|---|---|
| API Key | PageSpeed Insights, CrUX, CrUX History, Knowledge Graph | Free |
| Service Account | Search Console, Indexing API, GA4 | Free |
| Both | Full seo-google skill | Free |
Navigate to APIs & Services > Library and enable:
| API | Required For |
|---|---|
| Google Search Console API | GSC Search Analytics, URL Inspection, Sitemaps |
| PageSpeed Insights API | PSI Lighthouse lab data |
| Chrome UX Report API | CrUX field data + History |
| Web Search Indexing API | Indexing API v3 |
| Google Analytics Data API | GA4 organic traffic |
| Knowledge Graph Search API | Entity verification (optional) |
claude-seo (or similar)~/.config/claude-seo/service_account.json)The JSON file looks like:
{
"type": "service_account",
"project_id": "your-project-id",
"private_key_id": "...",
"private_key": "<service-account-private-key>",
"client_email": "<service-account-identifier>",
"client_id": "...",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token"
}
The client_email field is what you add to GSC and GA4.
client_emailclient_email123456789)mkdir -p ~/.config/claude-seo
Save to ~/.config/claude-seo/google-api.json:
{
"service_account_path": "~/.config/claude-seo/service_account.json",
"api_key": "<GOOGLE_API_KEY>",
"default_property": "sc-domain:example.com",
"ga4_property_id": "properties/123456789"
}
| Format | Example | When to Use |
|---|---|---|
| Domain property | sc-domain:example.com |
Covers all URLs on the domain (recommended) |
| URL-prefix property | https://example.com/ |
Covers only that specific prefix |
claude-seo run google_auth.py --check
Expected output at Tier 2 (full):
Credential Tier: 2 -- Full (API key + Service Account + GA4)
[OK] PageSpeed Insights v5
[OK] Chrome UX Report (CrUX) API
[OK] CrUX History API
[OK] Google Search Console API
Service account: configured
[OK] Google Indexing API v3
[OK] GA4 Data API v1beta
Instead of (or in addition to) the config file:
| Variable | Purpose |
|---|---|
GOOGLE_API_KEY |
API key for PSI/CrUX |
GOOGLE_APPLICATION_CREDENTIALS |
Path to service account JSON |
GA4_PROPERTY_ID |
GA4 property (e.g., properties/123456789) |
GSC_PROPERTY |
Default GSC property (e.g., sc-domain:example.com) |
| Scope | APIs |
|---|---|
https://www.googleapis.com/auth/webmasters.readonly |
GSC (read) |
https://www.googleapis.com/auth/webmasters |
GSC (read/write, needed for sitemap submission) |
https://www.googleapis.com/auth/indexing |
Indexing API |
https://www.googleapis.com/auth/analytics.readonly |
GA4 (read) |
| Error | Fix |
|---|---|
403 Forbidden on GSC |
Service account email not added to GSC property, or wrong permission level |
403 Forbidden on GA4 |
Service account email not added to GA4 property as Viewer |
404 Not Found on GSC |
Wrong property URL format. Use sc-domain: or include trailing slash for URL-prefix |
404 Not Found on CrUX |
Site has insufficient Chrome traffic. Not a credentials issue. |
429 Rate Limit |
Wait and retry. See rate-limits-quotas.md for per-API limits |
API not enabled |
Enable the specific API in GCP Console > APIs & Services > Library |