SEO Data Enrichment — Channel Overview
Platforms: Semrush, Ahrefs, Moz
Researched: May 2026
Why This Channel
Leadmetrics’ SEO intelligence today is built entirely on first-party data: Google Search Console (clicks, impressions, positions), Google Analytics (sessions, sources), and AI agents that run web searches. This is good but limited — it only shows what you already rank for.
Semrush and Ahrefs are third-party SEO databases that contain the organic keyword universe for any domain: keywords you don’t rank for yet, competitor keyword gaps, backlink profiles, domain authority, toxic link detection, and estimated organic traffic for any URL. Connecting a client’s Semrush or Ahrefs account imports this external intelligence into the platform so agents have a dramatically richer view of the competitive SEO landscape.
This is a data enrichment channel — it has no publishing capability. Its value is entirely in the quality of insights and content briefs it enables.
Auth Mechanism
Semrush
API Key — no OAuth required.
- Client generates an API key from
semrush.com/api/→ pastes it into the channel form - All API calls:
GET https://api.semrush.com/?key={apiKey}&... - Free tier: 10 API units/day (very limited); paid plans from ~$130/month include API access
Ahrefs
API Key (Ahrefs API v3).
- Client generates an API key from Ahrefs account settings → pastes it into the channel form
- All API calls:
GET https://api.ahrefs.com/v3/...withAuthorization: Bearer {apiKey} - API access requires an active Ahrefs subscription (Lite+)
Moz
API Key + Secret (basic auth pattern, similar to WordPress).
- Client provides
MOZSCAPE_ACCESS_ID+MOZSCAPE_SECRET_KEY - API calls:
https://lsapi.seomoz.com/v2/url_metricswithAuthorization: Basic {base64}
For v1, Semrush is the recommended target — largest keyword database, most widely used, and the most comprehensive competitor intelligence API.
What It Enables
| Capability | Detail |
|---|---|
| Competitor keyword gaps | Keywords where competitors rank but the client doesn’t — primary input for Content Brief Writer |
| Domain authority / DR | Client’s Domain Rating vs competitors — context for strategy and backlink targets |
| Organic traffic estimate | Estimated monthly visits for any URL — informs which competitor pages to target |
| Backlink profile | Referring domains, anchor text, new/lost links — feeds Backlink Researcher agent |
| Toxic link detection | Identify spammy backlinks that may be hurting rankings |
| Keyword difficulty | Semrush KD score for any keyword — helps Content Brief Writer prioritise low-competition targets |
| SERP features | Which keywords trigger featured snippets, People Also Ask, local packs |
Workers Needed
| Worker | Queue | Trigger |
|---|---|---|
seo-enrichment-sync.worker.ts (new) | agent__seo-enrichment-sync | On channel connect + weekly cron |
Feeds into: keyword-researcher.worker.ts | — | Uses enriched data as additional keyword source |
Feeds into: backlink-researcher.worker.ts | — | Uses Semrush backlink data as primary source |
Feeds into: content-brief-writer.worker.ts | — | Uses competitor gap data to prioritise brief topics |
Insight Worker Output (ChannelInsight)
- Domain Authority / Domain Rating score and trend
- Estimated organic traffic vs 3 months ago
- New backlinks gained / lost this week
- Top 10 competitor keyword gaps (keywords they rank for, you don’t)
- Top ranking opportunity: keyword with high volume + low difficulty + client not yet ranking
- Suggested: 3 content briefs targeting the highest-opportunity gaps
Data Model
model SEOEnrichmentSnapshot {
id String @id @default(cuid())
tenantId String
channelId String
domainAuthority Int? // Semrush Authority Score or Ahrefs DR
organicTraffic Int? // Estimated monthly visits
backlinkCount Int?
referringDomains Int?
topGapKeywords Json // Array of { keyword, volume, difficulty, competitorRank }
snapshotDate DateTime
source String // "semrush" | "ahrefs" | "moz"
tenant Tenant @relation(fields: [tenantId], references: [id])
channel ConnectedChannel @relation(fields: [channelId], references: [id])
@@index([tenantId, snapshotDate])
}Channel Detail Page — SeoDataEnrichmentChannelDetail.tsx
Tabs:
- Authority — Domain Rating / Authority Score; trend chart; comparison vs top 3 competitors
- Keyword Gaps — table of competitor keywords the client isn’t ranking for; sort by volume or difficulty; “Create Brief” button per row
- Backlinks — new links gained / lost; top referring domains; anchor text distribution
- Insights — AI-generated competitive SEO summary
- Suggestions — top 5 content actions from gap analysis
Implementation Plan
Phase 1 — Semrush API Key + Domain Overview
-
Create
packages/providers/semrush/src/index.ts:getDomainOverview(apiKey, domain)— authority score, organic traffic, backlinksgetDomainKeywords(apiKey, domain, country)— keywords the domain ranks forgetKeywordGap(apiKey, domain1, domain2, country)— competitor gap analysisgetBacklinks(apiKey, domain)— referring domains, new/lostverify(apiKey)— test API key validity
-
Connection flow (API Key auth):
- Channel form: collect
API Key(single field) - On connect: call
verify()andgetDomainOverview()for the tenant’s main website domain - Store API key in
tokenInfo.accessToken; website domain insubChannelInfo
- Channel form: collect
-
Create
seo-enrichment-sync.worker.ts:- Run on connect + weekly
- Call Semrush APIs; upsert
SEOEnrichmentSnapshot - Emit gap keywords to RAG pipeline so agents can use them
-
Update
keyword-researcher.worker.tsto merge Semrush gap keywords with its own research when the channel is connected -
Update
backlink-researcher.worker.tsto use Semrush backlink data as primary source instead of web searches -
Add seed entry to
packages/db/prisma/seed.ts -
Create
SeoDataEnrichmentChannelDetail.tsx
Phase 2 — Ahrefs Support
-
Create
packages/providers/ahrefs/src/index.tswith equivalent methods using Ahrefs v3 API -
Allow tenants to connect either Semrush or Ahrefs (or both — data merged in
seo-enrichment-sync.worker.ts)
Phase 3 — Moz Support
- Create
packages/providers/moz/src/index.tsfor clients who have only Moz subscriptions
Seed Entry
// packages/db/prisma/seed.ts — CHANNEL_CATALOGUE
{
type: "Semrush",
name: "Semrush",
iconKey: "semrush", // use Globe icon if brand icon unavailable
description: "Import competitor keyword gaps, domain authority, and backlink data to power SEO content briefs.",
authenticationType: "ApiKey",
requiresUrl: false,
isActive: true,
categories: ["seo"],
},
{
type: "Ahrefs",
name: "Ahrefs",
iconKey: "ahrefs",
description: "Import backlink profiles and keyword intelligence from Ahrefs to enrich SEO strategy.",
authenticationType: "ApiKey",
requiresUrl: false,
isActive: false, // enable after Semrush is live
categories: ["seo"],
},