DEV Community

Cover image for How to audit a website's SEO and AI visibility with a single API call
Alba LM
Alba LM

Posted on Edited on

How to audit a website's SEO and AI visibility with a single API call

 Checking a page's SEO usually means opening five different tools: one for the title and meta description, another for Open Graph tags, another for canonicals and indexability, another for the sitemap, and yet another to validate JSON-LD.

And now there's a new question: can AI assistants and AI search engines actually read your page? A site can look perfect in a browser and still be blocked in robots.txt, or be almost empty for crawlers that don't run JavaScript.

I got tired of checking all of this by hand, so I built PageSignal: an API that audits any public URL in a single request and returns two explainable scores, one for SEO and one for AI visibility, so you know not just what failed but why.

What it checks

SEO

  • Title and meta description: length, and duplicate tags on the same page
  • Open Graph and Twitter Card tags: and which recommended ones are missing
  • Indexability: meta robots, googlebot and the X-Robots-Tag header combined into one verdict
  • Canonical URL: missing, empty, duplicated, self-referencing or pointing elsewhere
  • robots.txt and XML sitemap discovery
  • JSON-LD: every block parsed and validated, with its schema types
  • Headings, image ALT coverage, internal and external links
  • A 0–100 SEO score where every rule shows its points, severity and the reason

AI visibility

  • robots.txt rules for 12 AI crawlers: GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-SearchBot, Claude-User, PerplexityBot, Perplexity-User, Google-Extended, Applebot-Extended, CCBot and meta-externalagent
  • Search bots vs training bots: blocking search and assistant bots can hide you from AI answers, while blocking training bots is a policy choice, so they are reported separately
  • Content visible without JavaScript: pages built in the browser can look almost empty to crawlers that don't run JS
  • JSON-LD presence and llms.txt detection
  • A 0–100 AI visibility score with findings and plain-English fixes

Try it without signing up

There's a live demo where you paste a URL and get both scores and the top issues to fix:

👉 https://pagesignal.alorenzom.com/demo

Or straight from your terminal, no key needed (3 checks per day):

curl -s https://pagesignal.alorenzom.com/demo/api/audit \
  -H 'Content-Type: application/json' \
  -d '{"url":"https://example.com/"}'
Enter fullscreen mode Exit fullscreen mode

The demo returns a summary. The full API returns the complete report — here's a real, unedited one for python.org.

Call the full API

With a free RapidAPI key:

curl --get 'https://pagesignal-seo-audit-metadata-json-ld-validator.p.rapidapi.com/v1/audit' \
  --data-urlencode 'url=https://www.python.org/' \
  -H 'X-RapidAPI-Host: pagesignal-seo-audit-metadata-json-ld-validator.p.rapidapi.com' \
  -H "X-RapidAPI-Key: $RAPIDAPI_KEY"
Enter fullscreen mode Exit fullscreen mode

Only want the AI visibility report? Use the dedicated endpoint:

curl --get 'https://pagesignal-seo-audit-metadata-json-ld-validator.p.rapidapi.com/v1/ai-visibility' \
  --data-urlencode 'url=https://www.python.org/' \
  -H 'X-RapidAPI-Host: pagesignal-seo-audit-metadata-json-ld-validator.p.rapidapi.com' \
  -H "X-RapidAPI-Key: $RAPIDAPI_KEY"
Enter fullscreen mode Exit fullscreen mode

Example output

This is a trimmed, real response for https://www.python.org/:

{
  "success": true,
  "network": {
    "final_url": "https://www.python.org/",
    "status_code": 200,
    "response_time_ms": 113,
    "redirect_count": 0
  },
  "quality_score": {
    "score": 68,
    "grade": "C",
    "errors_count": 1,
    "warnings_count": 4,
    "breakdown": [
      {
        "rule_id": "title_check",
        "severity": "warning",
        "max_points": 15,
        "points_impact": -6,
        "message": "Your title is shorter than recommended (30–60 characters). Consider adding primary keywords or brand context."
      },
      {
        "rule_id": "xml_sitemap_check",
        "severity": "error",
        "max_points": 10,
        "points_impact": -10,
        "message": "No XML sitemap was detected at common locations."
      }
    ]
  },
  "diagnostics": { "http_ok": true, "likely_client_rendered": false, "notes": [] },
  "title": { "status": "warning", "value": "Welcome to Python.org", "length": 21 },
  "indexability": { "status": "healthy", "is_indexable": true, "raw_directives": "index, follow" },
  "canonical": { "status": "warning", "is_present": false, "badge": "Missing" },
  "structured_data": {
    "status": "healthy",
    "blocks_detected": 1,
    "valid_blocks": 1,
    "invalid_blocks": 0,
    "blocks": [{ "schema_types": ["WebSite"], "errors": [] }]
  },
  "ai_visibility": {
    "status": "healthy",
    "score": 95,
    "grade": "A",
    "badge": "Readable by AI",
    "content_visible_without_js": true,
    "robots_txt_checked": true,
    "crawlers": [
      { "name": "GPTBot", "operator": "OpenAI", "purpose": "training", "allowed": true },
      { "name": "OAI-SearchBot", "operator": "OpenAI", "purpose": "search", "allowed": true }
    ],
    "blocked_search_crawlers": [],
    "blocked_training_crawlers": [],
    "llms_txt": { "checked": true, "found": false, "status_code": 404 }
  }
}
Enter fullscreen mode Exit fullscreen mode

Every point lost comes with a message, so you can show your users exactly what to fix instead of a bare number.

Fail your CI build when SEO or AI visibility breaks

Here's a small script that audits a list of URLs and exits with code 1 if any page breaks a rule you care about. Save it as seo-check.mjs (Node 18+, no dependencies):

// seo-check.mjs: audits a list of URLs and exits with code 1 if any of them
// breaks a rule you care about, so it can stop a CI pipeline.
const HOST = 'pagesignal-seo-audit-metadata-json-ld-validator.p.rapidapi.com';
const KEY = process.env.RAPIDAPI_KEY;
const MIN_SCORE = 60;

const urls = process.argv.slice(2);
if (!KEY || urls.length === 0) {
  console.error('Usage: RAPIDAPI_KEY=your_key node seo-check.mjs <url> [more urls...]');
  process.exit(2);
}

let failed = false;

for (const url of urls) {
  const res = await fetch(`https://${HOST}/v1/audit?url=${encodeURIComponent(url)}`, {
    headers: { 'X-RapidAPI-Host': HOST, 'X-RapidAPI-Key': KEY },
  });
  const report = await res.json();

  if (!res.ok) {
    console.log(`✖ ${url}: ${report.error?.code ?? `HTTP ${res.status}`}`);
    failed = true;
    continue;
  }

  const { quality_score, indexability, canonical, structured_data, ai_visibility } = report;
  const problems = [];
  if (quality_score.score < MIN_SCORE) problems.push(`score ${quality_score.score} is below ${MIN_SCORE}`);
  if (!indexability.is_indexable) problems.push('page is not indexable');
  if (!canonical.is_present) problems.push('canonical tag is missing');
  if (structured_data.invalid_blocks > 0) problems.push('invalid JSON-LD found');
  if (ai_visibility.blocked_search_crawlers.length > 0) {
    problems.push(`AI search crawlers blocked: ${ai_visibility.blocked_search_crawlers.join(', ')}`);
  }
  if (!ai_visibility.content_visible_without_js) problems.push('content is not visible without JavaScript');

  if (problems.length > 0) {
    console.log(`✖ ${url}: ${problems.join('; ')}`);
    failed = true;
  } else {
    console.log(`✔ ${url}: SEO ${quality_score.score}, AI visibility ${ai_visibility.score}`);
  }
}

process.exit(failed ? 1 : 0);
Enter fullscreen mode Exit fullscreen mode

Run it like this:

RAPIDAPI_KEY=your_key node seo-check.mjs https://example.com/ https://example.com/pricing
Enter fullscreen mode Exit fullscreen mode

Limitations

  • JavaScript is not executed, so single-page apps can return partial data. The response flags this in diagnostics.likely_client_rendered.
  • Sites behind anti-bot walls can't be analyzed.
  • Only public http/https URLs are supported.
  • The AI checks show whether a page can be read. They can't guarantee that any AI product will cite it.

Try it

What would you add to a check like this? I'd love to hear what you'd want it to catch.

Top comments (1)

Collapse
 
alorenzom profile image
Alba LM •

Thanks for reading! A quick question for those of you who run SEO checks in CI: which rule has bitten you the most in production? A stray noindex, a canonical pointing to staging, broken JSON-LD after a CMS update? I'm deciding which checks to add next, so I'd love to hear your real cases.