Validate llms.txt File in Node.js
The llms.txt specification tells AI systems which pages to prioritize and how to cite your content. This endpoint validates your llms.txt file against the spec, checks for common mistakes, and suggests improvements.
Endpoint
POST /api/v1/llmstxt/validate
Node.js Code
const response = await fetch("https://seodiff.io/api/v1/llmstxt/validate", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SEODIFF_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({"url":"https://example.com/llms.txt"}),
});
const data = await response.json();
console.log("Status:", data.status);Example Response
{"valid":true,"warnings":["Consider adding a 'preferred-citation' field"],"sections_found":3,"urls_listed":12}All requests require an API key in the Authorization: Bearer header. Get your API key →
Same Endpoint, Other Languages
More Node.js 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.
Google Search Console Data Sync
Pull GSC performance data into SEODiff for correlation with AI-readiness metrics.