Skip to content

feat(domain): optional Ahrefs free Domain Rating in domain overview - #421

Open
pm-rahulsengupta wants to merge 1 commit into
every-app:mainfrom
pm-rahulsengupta:feat/ahrefs-free-dr
Open

pm-rahulsengupta wants to merge 1 commit into
every-app:mainfrom
pm-rahulsengupta:feat/ahrefs-free-dr

Conversation

@pm-rahulsengupta

Copy link
Copy Markdown

What

Adds an optional AHREFS_API_KEY env that enriches domain overview results
with the free Ahrefs public Domain Rating (/v3/public/domain-rating-free).

  • src/server/lib/ahrefs/client.ts — small key-gated client for the free
    endpoint; parses the endpoint's nested
    {"domain_rating": {"domain_rating": <0-100>}} payload (flat form also
    accepted) with Zod range validation, retries once with a date param if
    the API demands one, and never throws into the overview flow
  • DomainService — fetches the rating in parallel with the paid DataForSEO
    call (Promise.allSettled), stores it on the 12h-cached overview object
  • get_domain_overview MCP tool — returns ahrefsDomainRating when present
  • Domain overview UI — an "Ahrefs DR" stat when the value is present
  • compose/env-example/preflight plumbing, same pattern as other optional keys

Why

Domain overview is the app's most-used research entry point, and its metrics
all charge DataForSEO credits. Ahrefs' public Domain Rating endpoint is free
with a free-tier API key, so self-hosters get a domain-strength signal at
zero marginal cost. Without the key the feature is off and nothing changes.

The Ahrefs call bypasses billing entirely: no credits, no metering, and a
failure degrades to a null field without affecting the DataForSEO result.

Testing

Unit tests for the client (key-gated skip, the endpoint's real nested payload
shape, flat shape, date retry, 403, unparseable and out-of-range payloads),
tsc --noEmit clean, and type-aware lint clean on the changed files.

alkomy pushed a commit to alkomy/open-seo that referenced this pull request Oct 10, 2026
@pm-rahulsengupta

Copy link
Copy Markdown
Author

Running on our self-hosted instance — the optional Ahrefs free Domain Rating shows up in domain overview as designed. Available for any review feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant