Skip to Content
ChannelsSeo Data EnrichmentSEO Data Enrichment — Channel Overview

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/... with Authorization: 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_metrics with Authorization: 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

CapabilityDetail
Competitor keyword gapsKeywords where competitors rank but the client doesn’t — primary input for Content Brief Writer
Domain authority / DRClient’s Domain Rating vs competitors — context for strategy and backlink targets
Organic traffic estimateEstimated monthly visits for any URL — informs which competitor pages to target
Backlink profileReferring domains, anchor text, new/lost links — feeds Backlink Researcher agent
Toxic link detectionIdentify spammy backlinks that may be hurting rankings
Keyword difficultySemrush KD score for any keyword — helps Content Brief Writer prioritise low-competition targets
SERP featuresWhich keywords trigger featured snippets, People Also Ask, local packs

Workers Needed

WorkerQueueTrigger
seo-enrichment-sync.worker.ts (new)agent__seo-enrichment-syncOn channel connect + weekly cron
Feeds into: keyword-researcher.worker.tsUses enriched data as additional keyword source
Feeds into: backlink-researcher.worker.tsUses Semrush backlink data as primary source
Feeds into: content-brief-writer.worker.tsUses 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:

  1. Authority — Domain Rating / Authority Score; trend chart; comparison vs top 3 competitors
  2. Keyword Gaps — table of competitor keywords the client isn’t ranking for; sort by volume or difficulty; “Create Brief” button per row
  3. Backlinks — new links gained / lost; top referring domains; anchor text distribution
  4. Insights — AI-generated competitive SEO summary
  5. Suggestions — top 5 content actions from gap analysis

Implementation Plan

Phase 1 — Semrush API Key + Domain Overview

  1. Create packages/providers/semrush/src/index.ts:

    • getDomainOverview(apiKey, domain) — authority score, organic traffic, backlinks
    • getDomainKeywords(apiKey, domain, country) — keywords the domain ranks for
    • getKeywordGap(apiKey, domain1, domain2, country) — competitor gap analysis
    • getBacklinks(apiKey, domain) — referring domains, new/lost
    • verify(apiKey) — test API key validity
  2. Connection flow (API Key auth):

    • Channel form: collect API Key (single field)
    • On connect: call verify() and getDomainOverview() for the tenant’s main website domain
    • Store API key in tokenInfo.accessToken; website domain in subChannelInfo
  3. 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
  4. Update keyword-researcher.worker.ts to merge Semrush gap keywords with its own research when the channel is connected

  5. Update backlink-researcher.worker.ts to use Semrush backlink data as primary source instead of web searches

  6. Add seed entry to packages/db/prisma/seed.ts

  7. Create SeoDataEnrichmentChannelDetail.tsx

Phase 2 — Ahrefs Support

  1. Create packages/providers/ahrefs/src/index.ts with equivalent methods using Ahrefs v3 API

  2. Allow tenants to connect either Semrush or Ahrefs (or both — data merged in seo-enrichment-sync.worker.ts)

Phase 3 — Moz Support

  1. Create packages/providers/moz/src/index.ts for 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"], },

© 2026 Leadmetrics — Internal use only