Google Search Console Data Sync in PHP
Sync your Google Search Console data to correlate traditional search performance (clicks, impressions, CTR, position) with AI-readiness metrics. After syncing, you can identify pages where low ACRI scores correlate with declining traffic.
Endpoint
POST /api/v1/gsc/sync
PHP Code
$ch = curl_init("https://seodiff.io/api/v1/gsc/sync");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("SEODIFF_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => '{"site_url":"https://example.com","date_range":"last_90_days"}',
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
echo "Status: " . ($response["status"] ?? "unknown") . "\n";Example Response
{"status":"synced","pages_imported":1247,"date_range":{"start":"2025-01-01","end":"2025-03-31"}}All requests require an API key in the Authorization: Bearer header. Get your API key →
Same Endpoint, Other Languages
More PHP Examples
Evaluate pSEO Pages
Test programmatic pages against assertion rules. The core agentic evaluation endpoint.
Scan a Website
Enqueue a surface scan for diff detection and SEO regression identification.
Validate in CI/CD Pipeline
CI-friendly endpoint that blocks deployments when SEO regressions are detected.
Trigger Deep Audit
Start a comprehensive multi-page crawl with PageRank, link analysis, and pSEO diagnostics.
Validate llms.txt File
Test your llms.txt file against the specification and get actionable fixes.