Linking Ahrefs as a source
Let AI connect your sources for you
Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog.

The Ahrefs connector syncs SEO data — Site Audit health scores, backlink profiles, organic keyword rankings, Domain Rating history, daily site metrics, and more — into the PostHog data warehouse, so you can analyze them alongside your product data.
Prerequisites
- An Ahrefs Lite plan or higher.
- An API key created in Account settings > API keys.
- A Site Audit project ID. Find the numeric ID in the project URL:
https://app.ahrefs.com/site-audit/123456.
Note: Page data (the
site_audit_pagestable) requires verified project ownership in Ahrefs.
Adding a data source
- In PostHog, go to the Sources tab of the data pipeline section.
- Click + New source and click Link next to this source.
- Enter your credentials (see Configuration below) and click Next.
- Select the tables you want to sync, choose a sync method and frequency, then click Import.
Once the syncs are complete, you can start querying this data in PostHog.
Import Site Audit crawl results, backlink data, organic keyword rankings, referring domains, Domain Rating history, daily site metrics, Rank Tracker rankings, and more from Ahrefs.
You'll be asked for:
- API key — create one in Account settings > API keys.
- Site Audit project ID — the numeric ID from your project URL (e.g.
123456fromhttps://app.ahrefs.com/site-audit/123456).
Sync modes
Each table can be synced in one of several modes, depending on what the source supports:
- Webhook (when available) – the source pushes changes to PostHog in real time. Fastest freshness, lowest ongoing cost, and the only mode that reliably captures updates and deletes.
- Incremental – only new or updated rows are synced on each run, using a cursor field (such as an
updated_attimestamp). Cheaper than a full refresh, but deletes aren't captured. - Append only – new rows are appended using a cursor field; existing rows are never updated. Ideal for immutable, append-only tables like event logs.
- Full refresh – the whole table is reloaded on every sync. Use it when a table has no reliable cursor or when you need deletions reflected.
See sync methods for a full explanation of how each mode works and how to choose between them.
Most Ahrefs tables are full refresh. The domain_rating_history, metrics_history, site_metrics_daily, and brand_radar_mentions_history tables sync incrementally on date.
API unit costs
Syncs use your Ahrefs account's API units. Plan for these costs per sync:
| Table | Cost |
|---|---|
| Health scores, projects, Rank Tracker overview | Free |
| Top domains (1M rows) | Free |
| Issues, pages | 50 units per request |
| Metrics history | 10 units per metric per month |
| Daily site metrics | ~150 units per day |
| Brand Radar mentions history | 50+ units per platform/report |
| Backlinks, keywords, referring domains | Varies by plan |
The first sync of site_metrics_daily reads the last 7 days. Later syncs add each new day, up to 31 days back. History tables (domain_rating_history, metrics_history, brand_radar_mentions_history) start 180 days back on first sync.
The brand_radar_mentions_history table reads each AI search platform in your Ahrefs plan, for each Brand Radar report linked to the project. Each incremental sync reads the last 30 days again, to get days that one platform publishes after the others. If you link a report or add a platform after the first sync, run a full resync to get its earlier days.
Data limits
Some tables return a capped number of rows per sync:
| Table | Limit |
|---|---|
site_audit_pages | 100 pages |
backlinks | 1,000 live links |
organic_keywords | 1,000 keywords |
top_pages | 1,000 pages |
referring_domains | 1,000 domains |
domain_rating_top_domains | 1,000,000 domains |
Configuration
| Option | Description |
|---|---|
API keyType: password Required: True | |
Site Audit project IDType: text Required: True | Use the ID from https://app.ahrefs.com/site-audit/123456. |
Supported tables
| Table | Description | Sync method | Incremental field | Primary key |
|---|---|---|---|---|
site_audit_health_scores | Health score and crawl totals for the selected Site Audit project. | Full refresh | — | — |
site_audit_issues | Issue summaries from the latest crawl of the selected Site Audit project. | Full refresh | — | — |
site_audit_pages | The first 100 crawled URLs, ordered by URL. Requires verified project ownership. | Full refresh | — | — |
projects | Every project in the Ahrefs workspace, with its target URL, scope, and protocol. | Full refresh | — | — |
domain_rating_history | Monthly Domain Rating of the selected project's target. | Incremental, Full refresh | date | — |
metrics_history | Monthly organic and paid search traffic and traffic value of the selected project's target. | Incremental, Full refresh | date | — |
site_metrics_daily | Daily Domain Rating, Ahrefs Rank, live backlink and referring domain totals, and organic keyword and traffic totals of the selected project's target. | Incremental, Full refresh | date | — |
backlinks | Up to 1000 live backlinks to the selected project's target, strongest referring domains first. | Full refresh | — | — |
link_intersect_refdomains | Up to 1000 referring domains that link to the selected project's target or its competitors in Ahrefs, most shared first. | Full refresh | — | — |
link_intersect_refpages | Up to 1000 referring pages that link to the selected project's target or its competitors in Ahrefs, most shared first. | Full refresh | — | — |
brand_radar_web_pages | Up to 1000 web pages with the most traffic that mention the brands in each Brand Radar report linked to the selected project. | Full refresh | — | — |
brand_radar_mentions_history | Estimated mentions over time of the brands in each Brand Radar report linked to the selected project, for each AI search platform. | Incremental, Full refresh | date | — |
domain_rating_top_domains | The top 1 million domains ranked by Ahrefs Domain Rating. Free to sync. | Full refresh | — | — |
organic_keywords | Up to 1000 keywords the selected project's target ranks for in organic search, highest traffic first. | Full refresh | — | — |
referring_domains | Up to 1000 domains with live links to the selected project's target, highest Domain Rating first. | Full refresh | — | — |
top_pages | Up to 1000 pages of the selected project's target that get the most organic search traffic, highest traffic first. | Full refresh | — | — |
rank_tracker_overview | Current desktop and mobile rankings of the keywords tracked in the project's Rank Tracker. | Full refresh | — | — |
Troubleshooting
- If the connection fails with an authentication error, the API key is wrong, expired, or has been revoked. Create a new one in Account settings > API keys, then reconnect the source.
- If a sync fails with a quota error, your API units are exhausted. The sync retries automatically once units renew or you raise your limit.
- If page data returns no rows, check that the Site Audit project has verified ownership.
- If the sync fails with "no target for the Site Audit project", check that the project ID is correct and the project has a target URL configured.
If your sync is failing or data looks wrong, see the Data warehouse troubleshooting guide. If that doesn't help, contact support – we're happy to help.





