Documentation

TypeScript API

Analyze pages and render reports from a Node.js application.

Jeff Patterson / Agency Enterprise. Updated August 30, 2026.

Install

Use the API when code needs the audit result. One call takes a URL and gives back one object. The app saves that object, shows a report, or compares it with an old run. Keep the query set and tool version with each saved result.

Start with one URL and one short query set. Load the file, run the check, and keep the returned object. Save it when the run needs a base. Pass it to one report format at a time. On an error, log the code and URL before a retry.

npm install aiseo-audit

Analyze and render a page

Pass the URL and optional signalsBase, timeout, or userAgent values to the analyzer. Put query, domain, engine, and scoring settings in the configuration object.

import { analyzeUrl, loadConfig, renderReport } from "aiseo-audit";

const config = await loadConfig();
const result = await analyzeUrl({ url: "https://example.com" }, config);
const html = renderReport(result, { format: "html" });

console.log(result.overallScore, result.grade);
console.log(result.stages?.technicalEligibility.status);

Core runtime exports

  • analyzeUrl and analyzeSitemap
  • renderReport and renderSitemapReport
  • loadConfig and loadConfigWithPath
  • computeDiff, orchestrateDiff, and renderDiffReport
  • renderHistoryTimeline and loadBaselineResult
  • computeStages and makeDiagnostic

Error handling

Use FetchError and FetchErrorCode to identify network failures. Configuration and schema failures use regular errors. Handle changing responses because deterministic scores require identical fetched HTML.