Rank tracking: pluggable SERP provider, so self-hosters can cut the per-check cost
The gap
Every SERP call goes through DataForSEO. src/server/lib/dataforseo/serp.ts is reached directly from the rank-check path, so there's no seam where a self-hoster could substitute something else.
That's the right default — DataForSEO is reliable, handles locations properly, and needs no scraping infrastructure. But it makes daily tracking of a large keyword set expensive, and cost is the main thing that stops self-hosters from tracking as often as they'd like. A 200-keyword tracker on both devices, checked daily, adds up quickly.
For comparison, SerpBear's one genuine architectural advantage over OpenSEO is that its scraper is pluggable — ScrapingRobot / ScrapingAnt / SerpApi / a custom endpoint / your own proxy — so the per-check cost can approach zero if you bring your own infrastructure.
Proposed shape
A narrow provider interface for one operation only — "given a keyword, location, language and device, return ranked URLs" — with DataForSEO as the default implementation and no behaviour change unless a self-hoster opts in.
SERP_PROVIDER=dataforseo # default, current behaviour
SERP_PROVIDER=custom
SERP_PROVIDER_URL=https://... # returns a normalized resultDeliberately limited to rank checking. Keyword metrics, backlinks, domain overview and local SERP stay DataForSEO-only — they're not commodity data and abstracting them would be a large interface for little gain.
Why the interface has to stay small
The temptation is a general "SERP source" abstraction. I'd argue against it:
- Rank checking needs position + URL, nothing else. That's a tiny contract that anything can satisfy.
- Everything else DataForSEO returns (volume, difficulty, CPC, backlink graph) has no equivalent from a scraper, so an abstraction covering it would be mostly holes.
Keeping it to one method means the default path is unchanged and the risk is contained to opt-in configurations.
Things worth deciding
- Credit accounting.
estimateRankCheckCreditsand the billing gate assume DataForSEO pricing. With a custom provider there is no OpenSEO credit cost — the estimate should presumably report zero and the paid-plan gate shouldn't apply. Worth confirming that's acceptable in hosted mode, or whether this should be self-host-only outright (which I'd understand). - Trust boundary.
SERP_PROVIDER_URLis operator-configured rather than user-supplied, which is a much safer position than a user-entered webhook — but it's still an outbound call to an arbitrary host, and the response needs strict schema validation before it reaches the rank pipeline. - Honesty about the source. A run backed by a custom provider should record that, so a user comparing history across a provider switch can see why numbers moved.
Happy to build this behind the default, with the DataForSEO path untouched and tests covering both. Question 1 is the one I'd want settled first, since it decides whether this is a hosted feature at all.
Source: every-app/open-seo