All docs
Connect

Ahrefs connection guide: connect, see your data, revoke

TL;DR

Agent Planners connects to Ahrefs through Ahrefs Connect (OAuth 2.0 with PKCE, one permission: apiv3-integration-apps). Each person connects their own Ahrefs account; every call uses that account's API units and says how many. Ahrefs is in a pilot: it is open to selected workspaces while Ahrefs reviews Agent Planners for Ahrefs Connect, and until Ahrefs activates the app only Ahrefs' free test queries run (ahrefs.com, yep.com and firehose.com as targets; ahrefs, yep and firehose as keywords).

1. Before connecting

  1. 1Sign in to Agent Planners and open Integrations → the Ahrefs card.
  2. 2The card says Not connected and offers Connect Ahrefs (workspace admins and editors). You need a paid Ahrefs plan — Lite, Standard, Advanced or Enterprise.

2. Press Connect Ahrefs and sign in to Ahrefs

  1. 1Press Connect Ahrefs. Agent Planners sends you to Ahrefs (app.ahrefs.com) — your Ahrefs password is never typed into Agent Planners.
  2. 2Sign in to Ahrefs if you are not signed in already.
Ahrefs asking which workspace to connect, opened by Connect as you
Signed in to Ahrefs, you pick the workspace whose plan and API units the app may use.
  1. 1Ahrefs shows its consent screen for Agent Planners. Press the button to authorize.
  2. 2Ahrefs returns you to Agent Planners. Our server exchanges the one-time code for the access token (PKCE + the app's secret, server-side) and reads your plan and units (subscription-info/limits-and-usage, a free call).
Ahrefs' consent screen asking to authorize Agent Planners
Ahrefs' consent screen.

4. Your account after connecting

  • The card now says Connected · Ahrefs plan: <plan> · sign-in valid until <date> and shows this month's API units (used of the limit, the reset date, and this app's cap if your Ahrefs admin set one).
  • The connection is yours: teammates connect their own Ahrefs accounts. Connecting again updates your connection in place.
  • An Ahrefs sign-in lasts one year and cannot be renewed by an app; the card asks you to Re-authorize when it ends.
The Ahrefs card after connecting: Connected, the Ahrefs plan, the sign-in's expiry and this month's API units
The Ahrefs card after connecting, with the plan, expiry and units.

5. How the agent shows Ahrefs data

  1. 1Ask in the Workspace, for example: “Get the Domain Rating, backlink counts and top 10 organic keywords of ahrefs.com, and the keyword overview and SERP for “ahrefs” in the US.”
  2. 2The agent plans its Ahrefs reads, runs them on your connection and writes a report with tables. Every Ahrefs step shows the API units it spent (0 when Ahrefs served it from its cache) next to the data.
  3. 3Ahrefs numbers are labelled as Ahrefs' estimates; money fields (CPC, traffic value) arrive from Ahrefs in US cents, and every answer tells the agent so before it reports dollars.
The Workspace composer with an Ahrefs research goal
Asking the agent for Ahrefs research.

Ahrefs data in a finished task

  • The report summarizes the findings; each table (backlinks, organic keywords, SERP) can be downloaded as CSV.
  • Opening a step shows its exact answer, including ahrefsUnits (rows, units charged, cache) and agentPlannersCredits — the two meters side by side.
A finished task showing Ahrefs data as a report and tables, with the API units each step spent
A finished Ahrefs research task.

Units shown per call

  • ahrefsUnits.costActual is what Ahrefs charged your plan for that call; cache: "hit" means it cost nothing.
  • agentPlannersCredits is Agent Planners' own charge for the call — a different meter (see below).
The report's table of Ahrefs API units per step: quoted units and actual units used
One step's units and credits.

6. Revoke access

  1. 1In Agent Planners: on the Ahrefs card press the bin icon on your connection and confirm. Our copy of the sign-in is deleted at once; tasks, schedules and dashboards that used it stop.
  2. 2In Ahrefs: open Account settings → Applications and revoke Agent Planners. Ahrefs offers apps no revocation endpoint, so this is where the sign-in itself is ended. Your Ahrefs admin can also cap the app's monthly units there.
  3. 3Do both to fully disconnect. The card returns to Not connected.
The confirmation shown before removing the Ahrefs connection
Removing the connection in Agent Planners.

Revoking in Ahrefs

Ahrefs' Account settings → Applications page listing Agent Planners
Ahrefs' Applications page.

After revoking

  • The Ahrefs card shows Not connected again. Nothing of your Ahrefs sign-in remains in Agent Planners.

What Agent Planners stores — and the access token

  • The authorization code is exchanged on our server (PKCE S256 + the client secret, which never leaves the server).
  • The access token is stored encrypted (AES-256-GCM) on the connection record and decrypted only on the server for the request to api.ahrefs.com.
  • No page, API answer, MCP / REST answer, log line, URL or e-mail contains the token: the accounts API strips credentials, tool answers carry only data and units, and errors are rewritten without the Authorization header.
  • Disconnect / Remove deletes the stored token at once; revoking in Ahrefs (Account settings → Applications) ends it on Ahrefs' side.
  • Stored with the connection: the encrypted token, its expiry, which Ahrefs Connect app issued it, and your plan / unit figures from limits-and-usage. Ahrefs data from tasks is kept with the task like any other task result (deleted under the workspace's retention settings).

Endpoints used, data retrieved and unit cost

EndpointToolData retrievedUsed forAhrefs units (default call)
GET subscription-info/limits-and-usageahrefs.limits_and_usagePlan name, monthly unit limit and usage, this app's unit cap and usage, reset date, the sign-in's expiryShows the connected account's status on the Integrations card and before costly researchFree
GET site-explorer/domain-ratingahrefs.domain_ratingDomain Rating and Ahrefs Rank of a site on a dateQuick authority check of a site or competitor2 units a row × 1 row → 50 (min 50)
GET site-explorer/metricsahrefs.site_metricsOrganic / paid keywords, traffic and traffic valueSize up a site's search visibility44 units a row × 1 row → 50 (min 50)
GET site-explorer/backlinks-statsahrefs.backlinks_statsLive and all-time backlink and referring-domain countsLink-profile summary before deeper backlink reads12 units a row × 1 row → 50 (min 50)
GET site-explorer/all-backlinksahrefs.backlinksIndividual backlinks (source, target, anchor, source DR, traffic, dofollow, first / last seen)Link audits and outreach research17 units a row × 50 rows → 850 (min 50)
GET site-explorer/refdomainsahrefs.refdomainsReferring domains with their DR and link countsWhich sites link to a domain6 units a row × 50 rows → 300 (min 50)
GET site-explorer/anchorsahrefs.anchorsAnchor texts and how many domains use themAnchor-text distribution checks10 units a row × 50 rows → 500 (min 50)
GET site-explorer/organic-keywordsahrefs.organic_keywordsKeywords a site ranks for, with position, volume, traffic, difficulty, CPCContent and keyword-gap research34 units a row × 50 rows → 1,700 (min 50)
GET site-explorer/top-pagesahrefs.top_pagesA site's pages by organic traffic and their top keywordFind a site's best-performing content24 units a row × 50 rows → 1,200 (min 50)
GET site-explorer/organic-competitorsahrefs.organic_competitorsSites competing for the same keywordsIdentify search competitors15 units a row × 50 rows → 750 (min 50)
GET site-explorer/metrics-historyahrefs.metrics_historyOrganic / paid traffic and value over timeTrend reportsmax(50, field costs × rows) — depends on the fields asked
GET site-explorer/domain-rating-historyahrefs.domain_rating_historyDomain Rating over timeAuthority trend reports2 units a row × 12 rows → 50 (min 50)
GET keywords-explorer/overviewahrefs.keywords_overviewVolume, difficulty, CPC, traffic potential, intent of given keywordsKeyword evaluation for content and ads53 units a row × 1 row → 53 (min 50)
GET keywords-explorer/matching-termsahrefs.matching_termsKeyword ideas containing the seed termsKeyword ideation33 units a row × 50 rows → 1,650 (min 50)
GET keywords-explorer/related-termsahrefs.related_termsRelated keyword ideasKeyword ideation33 units a row × 50 rows → 1,650 (min 50)
GET keywords-explorer/search-suggestionsahrefs.search_suggestionsSearch-box suggestions for the seedsKeyword ideation32 units a row × 50 rows → 1,600 (min 50)
GET keywords-explorer/volume-historyahrefs.keyword_volume_historyMonthly search volume of one keywordSeasonality checks2 units a row × 12 rows → 50 (min 50)
GET serp-overview/serp-overviewahrefs.serp_overviewThe Google results page for one keyword with each result's metricsWho ranks for a keyword and how strong they are23 units a row × 10 rows → 230 (min 50)
GET management/projectsahrefs.list_projectsThe account's Rank Tracker projectsPick a project to report onFree
GET management/project-keywordsahrefs.list_project_keywordsKeywords tracked in one projectRank Tracker reportingFree
GET management/project-competitorsahrefs.list_project_competitorsCompetitors of one projectRank Tracker reportingFree
GET rank-tracker/overviewahrefs.rank_tracker_overviewTracked positions and their changeWeekly rank reportsFree
GET rank-tracker/competitors-overviewahrefs.rank_tracker_competitorsCompetitors' positions on tracked keywordsCompetitive rank reportsFree
GET site-audit/projectsahrefs.site_audit_projectsSite Audit projects with health score and issue countsTechnical SEO statusFree
GET site-audit/issuesahrefs.site_audit_issuesIssues a crawl found and pages affectedTechnical SEO fix lists50 units a request
GET site-audit/page-explorerahrefs.site_audit_pagesCrawled pages (optionally with one issue)Technical SEO fix lists50 units a request
POST batch-analysis/batch-analysisahrefs.batch_analysisDR, backlinks, referring domains and organic metrics for up to 100 targets in one requestCompare many sites at once (cheaper than one call each)29 units a row × 1 row → 50 (min 50)
PUT management/project-keywordsahrefs.add_project_keywords(write) adds keywords to a Rank Tracker projectStart tracking keywords a task found — follows the approval settingFree
PUT management/project-keywords-deleteahrefs.remove_project_keywords(write) removes tracked keywords and their historyStop tracking keywords — always a person's decisionFree
Unit costs come from each endpoint's own price in Ahrefs' API reference (field costs, minimum 50 a paid request); the agent asks only the default fields unless a step needs others, and every answer reports the units Ahrefs actually charged. The Traffic Analytics add-on is never called.

How API units are conserved

  • Only the fields a step needs: every list endpoint has a short default select (listed per endpoint) — Ahrefs prices a row by the fields asked for.
  • Few rows by default: list reads return ≤ 50 rows unless the step asks for more (cap 1,000); an answer that hits its limit says so and tells the agent to narrow the filter rather than raise the limit.
  • One request for many sites: batch analysis covers up to 100 targets in a single call instead of one call each.
  • Free endpoints first: the account's plan and usage (limits-and-usage), Rank Tracker and project lists cost no units; the agent reads usage before large research.
  • No repeated calls: a step's answer is reused by later steps of the same task (it is passed on, not fetched again); a change is never sent twice; a read is retried only when Ahrefs answered 429 / 5xx (nothing was returned).
  • Every answer reports the units it spent (Ahrefs' x-api-units-cost-total-actual and x-api-cache headers) — the agent and the person see the cost of each step; an Ahrefs cache hit costs nothing and is shown as such.
  • Bad arguments never reach Ahrefs: dates, targets, project ids, paths and required fields are checked before any request is sent.
  • The Ahrefs workspace admin can cap this app's monthly units (Ahrefs → API keys → the "Integration app" key); the Integrations card shows the cap and the month's usage.

Ahrefs API units vs Agent Planners credits

OperationAgent Planners creditsHow
An Ahrefs step inside a task (web app, schedule, project, loop)0 credits for the Ahrefs call itselfThe task's model usage is billed as for any task. Ahrefs bills Agent Planners nothing for your call.
An Ahrefs read over MCP / REST (Claude, Codex, your own system)7 credits per callThe flat MCP / REST read charge, billed once after the call has run (one ledger row per call).
An Ahrefs change over MCP / REST (Rank Tracker keywords)34 credits per callThe flat MCP / REST write charge, billed once when the change runs (a change waiting for approval costs nothing until it runs).
A call that is refused, held for a person, or fails0 creditsNothing is charged for a call that did not run successfully.
Ahrefs API unitsFrom your Ahrefs planEvery answer reports the units Ahrefs charged your account (0 for a cache hit or a free endpoint). Agent Planners never converts or resells units.
Two separate meters. Ahrefs API units come from the connected person's own Ahrefs plan — Ahrefs charges them for every paid request, shows them in Ahrefs → Account settings → Limits and usage, and each Agent Planners answer reports how many a call used. Agent Planners credits come from your Agent Planners workspace: no per-call charge for an Ahrefs step inside a task (only the task's model usage), and the flat per-call MCP / REST charge when an external agent or system calls an Ahrefs tool. Test and staging connections follow exactly the same rules; nothing is free or charged twice because it is a test.

Frequently asked questions

Does Agent Planners ever show my Ahrefs token?
No. The token is exchanged and stored encrypted on the server; no page, API answer, log or e-mail contains it.
Who pays for Ahrefs API units?
The connected Ahrefs account's own plan. Agent Planners credits are a separate meter for Agent Planners itself.
How do I revoke access?
Remove the connection on the Ahrefs card (deletes our copy at once) and revoke Agent Planners under Ahrefs → Account settings → Applications.
Which redirect URI does the app use?
https://www.agentplanners.com/api/oauth/ahref/callback

Related