Validate in CI/CD Pipeline in PHP

The validate endpoint is designed for CI/CD integration. With wait=true, it blocks until the scan completes and returns pass/fail based on your configured rules. Returns HTTP 200 for pass and 409 for fail, making it easy to gate deployments.

Endpoint

POST /api/v1/validate

PHP Code

$ch = curl_init("https://seodiff.io/api/v1/validate");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => "POST",
    CURLOPT_HTTPHEADER     => [
        "Authorization: Bearer " . getenv("SEODIFF_API_KEY"),
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => '{"url":"https://staging.example.com","wait":true,"rules":{"max_issues":0,"required_score":80}}',
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
echo "Status: " . ($response["status"] ?? "unknown") . "\n";

Example Response

{"pass":true,"score":92,"issues":[],"scan_id":"s_abc123","duration_ms":3200}
Authentication

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.

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.

Google Search Console Data Sync

Pull GSC performance data into SEODiff for correlation with AI-readiness metrics.

Start testing in 30 seconds

Get an API key and run your first evaluation with a single cURL command.

Get API Key or Read full API docs