Access the Google Search Console API with managed OAuth authentication using cURL. Query search analytics, manage sitemaps, and monitor site performance.
bash
curl -s \
-H "Authorization: Bearer $MATON_API_KEY" \
https://gateway.maton.ai/google-search-console/webmasters/v3/sites | jq
text
https://gateway.maton.ai/google-search-console/{native-api-path}
Replace {native-api-path} with the actual Google Search Console API endpoint path.
The gateway proxies requests to www.googleapis.com and automatically injects your OAuth token.
All requests require the Maton API key:
bash
-H "Authorization: Bearer $MATON_API_KEY"
bash
export MATON_API_KEY="YOUR_API_KEY"
Manage connections at:
text
https://ctrl.maton.ai
bash
curl -s \
-H "Authorization: Bearer $MATON_API_KEY" \
"https://ctrl.maton.ai/connections?app=google-search-console&status=ACTIVE" | jq
bash
curl -s -X POST \
-H "Authorization: Bearer $MATON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"app":"google-search-console"}' \
https://ctrl.maton.ai/connections | jq
bash
curl -s \
-H "Authorization: Bearer $MATON_API_KEY" \
https://ctrl.maton.ai/connections/{connection_id} | jq
json
{
"connection": {
"connection_id": "21fd90f9-5935-43cd-b6c8-bde9d915ca80",
"status": "ACTIVE",
"creation_time": "2025-12-08T07:20:53.488460Z",
"last_updated_time": "2026-01-31T20:03:32.593153Z",
"url": "https://connect.maton.ai/?session_token=...",
"app": "google-search-console",
"metadata": {}
}
}
Open the url in a browser to complete OAuth authorization.
bash
curl -s -X DELETE \
-H "Authorization: Bearer $MATON_API_KEY" \
https://ctrl.maton.ai/connections/{connection_id} | jq
If multiple connections exist:
bash
curl -s \
-H "Authorization: Bearer $MATON_API_KEY" \
-H "Maton-Connection: 21fd90f9-5935-43cd-b6c8-bde9d915ca80" \
https://gateway.maton.ai/google-search-console/webmasters/v3/sites | jq
If omitted, the default (oldest active) connection is used.
bash
# List sites
GET /google-search-console/webmasters/v3/sites
# Get a specific site
GET /google-search-console/webmasters/v3/sites/{siteUrl}
⚠️ Site URL must be URL-encoded Example:
https%3A%2F%2Fexample.com%2F
bash
curl -s -X POST \
-H "Authorization: Bearer $MATON_API_KEY" \
-H "Content-Type: application/json" \
https://gateway.maton.ai/google-search-console/webmasters/v3/sites/{siteUrl}/searchAnalytics/query \
-d '{
"startDate": "2024-01-01",
"endDate": "2024-01-31",
"dimensions": ["query"],
"rowLimit": 100
}' | jq
bash
# List sitemaps
curl -s \
-H "Authorization: Bearer $MATON_API_KEY" \
https://gateway.maton.ai/google-search-console/webmasters/v3/sites/{siteUrl}/sitemaps | jq
# Submit sitemap
curl -s -X PUT \
-H "Authorization: Bearer $MATON_API_KEY" \
https://gateway.maton.ai/google-search-console/webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}
# Delete sitemap
curl -s -X DELETE \
-H "Authorization: Bearer $MATON_API_KEY" \
https://gateway.maton.ai/google-search-console/webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}
json
{
"startDate": "2024-01-01",
"endDate": "2024-01-31",
"dimensions": ["query"],
"rowLimit": 25
}
json
{
"dimensions": ["page"]
}
json
{
"dimensions": ["device"]
}
json
{
"dimensions": ["date"]
}
json
{
"dimensionFilterGroups": [{
"filters": [{
"dimension": "query",
"operator": "contains",
"expression": "keyword"
}]
}]
}
query – Search querypage – Page URLcountry – Country codedevice – DESKTOP, MOBILE, TABLETdate – DateclicksimpressionsctrpositionstartRow for pagination-g if URL contains brackets:bash
curl -g "https://example.com?fields[]=..."
jq, environment variables may not expand correctly in some shells.StatusMeaning400Missing Search Console connection401Invalid/missing API key429Rate limited (10 req/sec)4xx/5xxUpstream API error
bash
echo $MATON_API_KEY
bash
curl -s \
-H "Authorization: Bearer $MATON_API_KEY" \
https://ctrl.maton.ai/connections | jq
bash
SITE_URL=$(python3 -c "import urllib.parse; print(urllib.parse.quote('https://example.com', safe=''))")
curl -s -X POST \
-H "Authorization: Bearer $MATON_API_KEY" \
-H "Content-Type: application/json" \
"https://gateway.maton.ai/google-search-console/webmasters/v3/sites/$SITE_URL/searchAnalytics/query" \
-d '{
"startDate": "2024-01-01",
"endDate": "2024-01-31",
"dimensions": ["query"],
"rowLimit": 25
}' | jq