Skip to content

Audit & Citability

The auditSite function checks your site for AEO best practices and returns a detailed report:

import { auditSite, formatAuditReport, getGrade, resolveConfig } from 'aeo.js';
const config = resolveConfig({
title: 'My Site',
url: 'https://mysite.com',
pages: [{ pathname: '/', title: 'Home', content: 'Welcome to my site.' }],
});
const result = auditSite(config);
console.log(formatAuditReport(result));
console.log('Grade:', getGrade(result.score));

The audit checks for:

  • Presence of robots.txt, llms.txt, llms-full.txt
  • Sitemap accessibility
  • Structured data (JSON-LD)
  • Open Graph meta tags
  • AI crawler accessibility

You can also run it from the CLI:

Terminal window
npx aeo.js check

Measure how likely AI engines are to cite your content:

import { formatPageCitability, resolveConfig, scorePageCitability, scoreSiteCitability } from 'aeo.js';
// Score a single page
const pageScore = scorePageCitability({
pathname: '/',
title: 'Home',
content: '# Home\n\nMy site publishes practical guides for AI-ready content.',
});
console.log(formatPageCitability(pageScore));
// Score the whole site
const config = resolveConfig({
title: 'My Site',
url: 'https://mysite.com',
pages: [{ pathname: '/', title: 'Home', content: 'Welcome to my site.' }],
});
const siteScore = scoreSiteCitability(config);

The citability score evaluates:

  • Content structure and headings
  • Factual density and specificity
  • Source attribution
  • Unique data and statistics
  • Clear definitions and explanations

Generate a comprehensive AEO report:

import { formatReportJson, formatReportMarkdown, generateReport, resolveConfig } from 'aeo.js';
const config = resolveConfig({
title: 'My Site',
url: 'https://mysite.com',
pages: [{ pathname: '/', title: 'Home', content: 'Welcome to my site.' }],
});
const report = generateReport(config);
// Get as markdown
console.log(formatReportMarkdown(report));
// Get as JSON
console.log(formatReportJson(report));

Get platform-specific optimization suggestions:

import { auditSite, generatePlatformHints, resolveConfig, scoreSiteCitability } from 'aeo.js';
const config = resolveConfig({
title: 'My Site',
url: 'https://mysite.com',
pages: [{ pathname: '/', title: 'Home', content: 'Welcome to my site.' }],
});
const audit = auditSite(config);
const citability = scoreSiteCitability(config);
const hints = generatePlatformHints(audit, citability);
// Returns platform-specific optimization hints for ChatGPT, Perplexity, Google AI, and Bing Copilot