Loading...
Loading...
Google Search Console API integration for search analytics, URL inspection, sitemap management, and site verification. Use when working with search performance data, checking indexing status, managing sitemaps, or analyzing SEO metrics.
npx skill4agent add jakenuts/agent-skills google-search-consolejelly-dotenvskills/jelly-dotenv/SKILL.md# Service account JSON key file path
GOOGLE_SERVICE_ACCOUNT_KEY_FILE=/path/to/service-account.json
# Or inline JSON (for CI/CD environments)
GOOGLE_SERVICE_ACCOUNT_KEY_JSON='{"type":"service_account","project_id":"...","private_key":"..."}'GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-client-secret
GOOGLE_REFRESH_TOKEN=your-refresh-token# Default site URL (optional, can be specified per request)
GOOGLE_SEARCH_CONSOLE_SITE_URL=https://your-site.com
# Alternative naming patterns (auto-detected)
GSC_SITE_URL=https://your-site.com
SEARCH_CONSOLE_SITE=sc-domain:your-site.comskills/jelly-dotenv/.env/.envhttps://www.googleapis.com/auth/webmasters.readonly## Search Performance (Last 7 Days)
| Metric | Value | Change |
|--------|-------|--------|
| Clicks | 1,234 | +12% |
| Impressions | 45,678 | +8% |
| CTR | 2.7% | +0.3% |
| Avg Position | 15.2 | -2.1 |
### Top Queries
| Query | Clicks | Impressions | CTR | Position |
|-------|--------|-------------|-----|----------|
| keyword 1 | 234 | 5,678 | 4.1% | 8.5 |
| keyword 2 | 189 | 4,321 | 4.4% | 12.3 |## URL Inspection: https://example.com/page
| Property | Status |
|----------|--------|
| Index Status | ✅ Indexed |
| Crawled | 2024-01-15 |
| Canonical | https://example.com/page |
| Mobile Usability | ✅ Mobile friendly |
| Rich Results | ⚠️ 2 warnings |interface SearchAnalyticsRequest {
startDate: string; // YYYY-MM-DD
endDate: string; // YYYY-MM-DD
dimensions?: ('query' | 'page' | 'country' | 'device' | 'date')[];
searchType?: 'web' | 'image' | 'video' | 'news';
dimensionFilterGroups?: FilterGroup[];
aggregationType?: 'auto' | 'byPage' | 'byProperty';
rowLimit?: number; // Max 25000
startRow?: number;
}interface UrlInspectionRequest {
inspectionUrl: string;
siteUrl: string;
languageCode?: string;
}| Operation | Method | Endpoint |
|---|---|---|
| List | GET | |
| Get | GET | |
| Submit | PUT | |
| Delete | DELETE | |
| Error | Cause | Solution |
|---|---|---|
| 401 Unauthorized | Invalid credentials | Check service account key or OAuth tokens |
| 403 Forbidden | No access to site | Add service account to Search Console |
| Invalid scope | Wrong OAuth scope | Use |
| Error | Cause | Solution |
|---|---|---|
| 404 Not Found | Site not in Search Console | Add site to Search Console first |
| 400 Bad Request | Invalid parameters | Check date format (YYYY-MM-DD) |
| 429 Rate Limit | Too many requests | Wait and retry with backoff |
# Solution: Add credentials to .env
GOOGLE_SERVICE_ACCOUNT_KEY_FILE=/path/to/key.json# Solution: Add service account email to Search Console
# Go to: Search Console → Settings → Users and permissions# Solution: Use YYYY-MM-DD format, max 16 months historical datawebmasters.readonly