Skip to content

Repository files navigation

seo-auditor

A ProAgentStore agent that audits website SEO daily and tracks score trends over time.

What it does

  • Fetches each configured URL at 05:00 UTC daily
  • Extracts: title, meta description, H1-H6 structure, image alt tags, internal/external links, word count, JSON-LD schema markup
  • Calls Workers AI (llama-3.3-70b) to score each page 0-100 and generate actionable recommendations
  • Falls back to deterministic rule-based scoring if AI response is malformed
  • Persists each audit to D1 and a rolling 90-entry score history to a Durable Object per site
  • Detects regressions (score dropped vs previous audit) and logs a warning

API

MethodPathDescription
POST/sitesRegister a URL for daily auditing
GET/sitesList all registered sites
GET/auditsPaginated audit list (latest first)
GET/audits/latestLatest audit per site
GET/audits/:idSingle audit by id
POST/cron/triggerManually run a full audit cycle
GET/healthLiveness probe

POST /sites

{
"url": "https://example.com",
"label": "Example homepage"
}

GET /audits

Query params: limit (max 100, default 20), offset (default 0), site_id (filter to one site).

Audit object

{
"id": "abc123def456",
"site_id": "xyz789",
"audited_at": "2026-06-06T05:00:00.000Z",
"score": 74,
"title": "Example Domain",
"meta_desc": "This domain is for use in illustrative examples.",
"word_count": 312,
"h1_count": 1,
"images_total": 4,
"images_no_alt": 1,
"links_internal": 8,
"links_external": 2,
"has_schema": true,
"recommendations": [
"Expand meta description to 120-160 characters (currently 48).",
"Add alt text to 1 image that is currently missing it.",
"Expand content beyond 600 words for stronger SEO signals."
],
"regression": false
}

Scoring

The AI scores pages on these criteria (rule-based fallback uses the same weights):

SignalPoints
Title present10
Title 50-60 chars10
Meta description present10
Meta description 120-160 chars10
Exactly one H115
300+ words10
600+ words5 bonus
All images have alt text10 (−2 per missing, max −10)
JSON-LD schema present10
Internal + external links10

Development

pnpm install
pnpm dev

Create the D1 database locally:

wrangler d1 create seo-auditor-db
# copy database_id into wrangler.toml
wrangler d1 migrations apply seo-auditor-db --local

Deploy

Push to main — GitHub Actions runs migrations then deploys the worker.

Or manually:

pnpm run db:migrate
pnpm deploy

Secrets

Set via wrangler secret put and mirror in Doppler project pags:

SecretPurpose
ADMIN_TOKENBearer token for write API endpoints (optional; if unset all routes are open)

About

Audits website SEO daily. Fetches configured URLs, scores each page 0-100 with actionable recommendations via Workers AI, and tracks scores over time.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages