Audit & Citability
Site Audit
Section titled “Site Audit”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:
npx aeo.js checkCitability Score
Section titled “Citability Score”Measure how likely AI engines are to cite your content:
import { formatPageCitability, resolveConfig, scorePageCitability, scoreSiteCitability } from 'aeo.js';
// Score a single pageconst pageScore = scorePageCitability({ pathname: '/', title: 'Home', content: '# Home\n\nMy site publishes practical guides for AI-ready content.',});console.log(formatPageCitability(pageScore));
// Score the whole siteconst 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
Reports
Section titled “Reports”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 markdownconsole.log(formatReportMarkdown(report));
// Get as JSONconsole.log(formatReportJson(report));Platform Hints
Section titled “Platform Hints”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