Repository navigation
feat(domain): optional Ahrefs free Domain Rating in domain overview - #421
Open
pm-rahulsengupta wants to merge 1 commit into
Open
pm-rahulsengupta wants to merge 1 commit into
pm-rahulsengupta wants to merge 1 commit into
Conversation
alkomy
pushed a commit
to alkomy/open-seo
that referenced
this pull request
Oct 10, 2026
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an optional
AHREFS_API_KEYenv that enriches domain overview resultswith the free Ahrefs public Domain Rating (
/v3/public/domain-rating-free).src/server/lib/ahrefs/client.ts— small key-gated client for the freeendpoint; parses the endpoint's nested
{"domain_rating": {"domain_rating": <0-100>}}payload (flat form alsoaccepted) with Zod range validation, retries once with a
dateparam ifthe API demands one, and never throws into the overview flow
DomainService— fetches the rating in parallel with the paid DataForSEOcall (
Promise.allSettled), stores it on the 12h-cached overview objectget_domain_overviewMCP tool — returnsahrefsDomainRatingwhen presentWhy
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 --noEmitclean, and type-aware lint clean on the changed files.