Two Minute Reports Logo
Connectors

Ahrefs

Connect Ahrefs to Google Sheets or Google Data Studio

The Ahrefs connector gets your Ahrefs data into Google Sheets and Google Data Studio. Use it to track the SEO metrics of your Ahrefs projects in a spreadsheet or a Google Data Studio report.

What you can report on

  • Domain Rating and URL Rating, as a value or as a history by day, week, month, or year
  • Ahrefs rank, as a value on the end date
  • Backlinks and referring domains: live, all time, new, and lost
  • Lists of backlinks, broken backlinks, referring domains, anchors, linked domains, and outgoing anchors
  • Organic search: traffic, traffic value, keywords by position, organic keywords, top pages, organic competitors, and data by country
  • AI responses of your top pages: how often each page appears in ChatGPT, Copilot, Gemini, Google AI Mode, AI Overviews, Grok, and Perplexity answers (needs the Ahrefs Brand Radar add-on)
  • Paid search: paid keywords, paid traffic, cost, and paid pages
  • Rank Tracker: positions, traffic, and SERP features of your tracked keywords, and your competitors
  • Site Audit: health score, crawled pages, and issues
  • Backlink gap: the domains that link to your competitors but not to you (an Ahrefs Enterprise plan only)

Each Ahrefs project is one account in Two Minute Reports.

Prerequisites

  • An Ahrefs plan with API access: Lite, Standard, Advanced, or Enterprise. See Ahrefs plans.
  • The owner or an admin of your Ahrefs workspace, to create the API key
  • One or more projects in your Ahrefs workspace

How to get your credentials

The connector uses an Ahrefs API key. One API key gives access to all the projects of its workspace.

  1. Sign in to Ahrefs as the owner or an admin of the workspace.
  2. Go to Account settings › API keys.
  3. Create a new API key. Enter a name that you can find again, for example Two Minute Reports.
  4. Select an expiry date. The key stops working on that date.
  5. Optional: set a monthly limit of API units for the key. See API units.
  6. Copy the API key and keep it in a safe place.
An API key has no scopes. Your Ahrefs plan sets the data that the key can get. The key also stops working when the person who created it leaves the workspace. Then create a new key and edit the connection.

For more about API keys, see the Ahrefs API key documentation.

How to create a connection

  1. In the Hub, open Connections & accounts.
  2. Select Create connection.
  3. Select Ahrefs (BETA) in the connector list.
  4. Select Next.

  1. In Name the connection, enter a name.
  2. In API key, paste your API key. If you do not have an API key, see How to get your credentials.
  3. Select Test connection.

  1. Enable the projects you want to report on.
  2. Select Done.

Only enabled accounts fetch data, and only enabled accounts count toward your plan. You can enable or disable accounts at any time on the Connections & accounts page.

How to get Ahrefs data into Google Sheets or Google Data Studio

To get Ahrefs data into Google Sheets:

  1. In the Two Minute Reports sidebar, open Data Queries.
  2. Select Add.
  3. Select the projects you want to report on. You can select more than one.
  4. Select your metrics and dimensions.
  5. Select the date range.
  6. To change the country, the target, or the competitors, open Report Config, then AHREFS. Each option shows only after you select a field that uses it. See Report configuration. To change the number of rows in a list, open Data Options. See Number of rows in a list.
  7. Set sorting and filters if you need them.
  8. Select Run query. Two Minute Reports adds the data to your sheet.

Good to know

Ahrefs plans

Your Ahrefs plan sets the data that you can get and the number of rows in a list:

LiteStandardAdvancedEnterprise
API units each month200,000800,0002,000,000Custom
Rows in a list, at most100250500No limit from Ahrefs; 10,000 in Two Minute Reports
Backlink gapNoNoNoYes
  • AI responses: the AI responses fields of Top pages, for example ChatGPT responses, need the Ahrefs Brand Radar add-on, on any plan. Without it, the query stops with the message "The AI responses fields need the Ahrefs Brand Radar add-on". Remove these fields from the query, or add Brand Radar to your Ahrefs workspace.
  • Backlink gap: Ahrefs gives the backlink gap fields to an Enterprise plan only. On a different plan, the query stops with the message "The fields in this query need an Ahrefs Enterprise plan". Remove these fields from the query, or use an API key from an Enterprise workspace.

Plans and their limits come from Ahrefs' About API v3 article and Ahrefs pricing, and can change.

API units

Each query uses API units from the monthly units of your Ahrefs workspace:

  • A request uses a minimum of 50 units. A list uses more for each row, and some fields use 5 or 10 units for each row. The description of each field shows these fields.
  • Limit rows controls most of the cost of a list. See Number of rows in a list.
  • Rank Tracker, Site Audit projects, and the project list use no units. Each Site Audit issues request uses 50 units.
  • The same query in 1 hour uses no new units. Two Minute Reports keeps the result for 1 hour.
  • Each scheduled refresh runs the query again, so it uses units again. A report that refreshes every day uses the units of its queries every day.

To see the units that you used, go to Account settings › Limits & usage in Ahrefs.

Report configuration

To change these options, open the Ahrefs report options of the query. In Google Sheets, open Report Config, then AHREFS. In the Hub and in Google Data Studio, open Ahrefs Report Configuration. In Google Sheets and in Hub dashboards, each option shows only after you select a field that uses it. A Google Data Studio query config has no field list, so it shows all of the options. In every product, Target scope shows only after you enter a Target.

  • Country: the country of the organic search fields. Select one country, or leave it empty to get all countries together. For example, with no country, Organic traffic is the traffic from every country; with United States, it is the traffic from the United States only. Organic keywords without a country shows one row for each keyword and country; its Country field tells them apart. Organic competitors need a country.
  • Target: a domain or a URL to report on instead of the target of the project, for example a competitor. Site Explorer fields use it. Rank Tracker and Site Audit fields always use the project.
  • Target scope: the part of the Target to report on: the domain with its subdomains (the default), the domain only, a path, or one URL. Target scope applies only to a target that you enter. Without a target, the query uses the scope of the project.
  • Competitors: the competitor domains for the backlink gap fields, from 1 to 20.

Fields that you cannot use together

  • A query uses fields from one Ahrefs report. The domain overview (Authority, Backlink profile, Organic search, Paid search, Pages by traffic, and Outgoing links) is one report. Each list, for example Backlinks or Organic keywords, is a different report. Rank Tracker and Site Audit are different reports too. You can add Project fields to all reports.
  • A filter can only use fields from the same report as the selected fields.
  • Time dimensions work with the domain overview fields that have a history, with Rank Tracker, with Site Audit (not Site Audit issues), and with Backlinks and Referring domains. See When you do not select a time dimension for the other lists.

Rank Tracker device

Rank Tracker fields show desktop rankings. To get desktop and mobile, add the Device dimension, in Rank Tracker device: you get one row for each device, Desktop and Mobile. Device works with the four Rank Tracker reports only.

With Device, Two Minute Reports gets each Rank Tracker date twice, once for each device. Rank Tracker uses no API units, but the query takes about twice as long. A filter on Device also gets both devices.

Time dimensions

  • Domain overview fields show a history by day, week, month, or year. A year shows the value of the last month of that year in your date range, not a total or an average. For example, Domain rating by Year shows the DR of December for each past year, and of the last month in your date range for the current year.
  • Rank Tracker and Site Audit fields (not Site Audit issues) show one value for each day, week, month, or year, on the last day of that period. A query can have a maximum of 110 periods.
  • A Rank Tracker or Site Audit query by day can be slow. Two Minute Reports gets each day with a separate request, and sends a maximum of 55 requests each minute. For example, 110 days by day for one project takes about 2 minutes, and each more project adds the same time. To get the data faster, use a week or month time dimension, for example Year month.
  • Backlinks and Referring domains use the date that Ahrefs first saw the link or the domain. For example, Referring domains by month shows the new referring domains of each month.

Number of rows in a list

Limit rows sets the number of rows in a list, for example 100 backlinks or 100 keywords. It is in the data options of the query:

  • Google Sheets: open Data Options, then select Limit number of rows.
  • Hub dashboards and Google Data Studio: open Data Options, then enter Limit rows.

How Two Minute Reports uses it:

  • If you set Limit rows, you get up to that number of rows, and a maximum of 10,000. Two Minute Reports gets a minimum of 100 rows from Ahrefs: if Limit rows is less than 100, it gets 100 rows, then shows only the first rows up to your limit.
  • If you do not set Limit rows, you get the maximum number of rows that your Ahrefs plan permits, or 1,000 rows on an Enterprise plan.

Totals, groups, filters, and sorting use only the rows that Two Minute Reports gets from Ahrefs, not all of the rows that Ahrefs has. For example, a site has 5,000 backlinks and Limit rows is 100: the total of a metric is the total of the 100 backlinks that Ahrefs sent. This is the same in Google Sheets, Hub dashboards, and Google Data Studio.

Limit rows changes the Ahrefs request only for fields that give one row for each item, for example one row for each backlink or each keyword:

  • Backlinks, Broken backlinks, Referring domains, Anchors, and Linked domains
  • Outgoing external anchors and Outgoing internal anchors
  • Organic keywords, Organic competitors, Top pages, and Paid pages
  • Best by backlinks, Best by internal links, Countries, and Crawled pages
  • Rank Tracker keywords, Rank Tracker domains, and Rank Tracker pages
  • Backlink gap

For the other fields, you always get all of their data:

  • Authority, Backlink profile, Organic search, Paid search, Pages by traffic, and Outgoing links
  • Rank Tracker competitors, Site Audit, Site Audit issues, and Project

Your Ahrefs plan can give you fewer rows. Ahrefs never gives more rows than your plan permits: 100 on Lite, 250 on Standard, and 500 on Advanced. For example, on a Standard plan, Limit rows 1,000 gives you 250 rows. Ahrefs shows no error, and the query does not stop. See Ahrefs plans.

More rows use more API units. For example, 500 rows use about five times the units of 100 rows. If you do not set Limit rows, a list uses the maximum rows of your plan, and thus the most units. See API units.

When you do not select a time dimension

If your query has no time dimension, for example Date or Year month, a list shows the data of one day. That day is:

  • The last day of your date range for Organic keywords, Organic competitors, Top pages, Paid pages, Countries, Site Audit issues, and Rank Tracker.
  • Today for all of the other lists. Your date range does not change their data. One exception: Backlinks, Referring domains, Anchors, and Best by backlinks also show the links that were lost after the first day of your date range.

For example, your date range is 1 October to 31 October:

  • Organic keywords shows your keywords on 31 October.
  • Backlinks shows your backlinks today, and the backlinks that were lost after 1 October.
  • Broken backlinks shows your broken backlinks today.

To show only the backlinks that are live today, add the filter Lost link equals false.

Ahrefs describes these dates in its API reference: the date option of Organic keywords and the history option of Backlinks.

To get one row for each day, week, or month, add a time dimension. Only Backlinks, Referring domains, and Rank Tracker lists can have one. See Time dimensions.

Metrics that end in "listed"

A metric that ends in "listed", for example Referring domains listed, counts the rows in your list. It does not count all of the rows that Ahrefs has.

For example, a site has 12,000 referring domains, and Limit rows is 100:

  • Referring domains listed shows 100.
  • Referring domains shows 12,000.

To get the total, use the metric that counts all in a separate query. One query cannot have both.

Counts your rowsCounts allAhrefs sends first the rows with the highest
Referring domains listed, in Referring domainsReferring domains, in Backlink profileDR
Organic keywords listed, in Organic keywordsOrganic keywords, in Organic searchTraffic
Crawled pages listed, in Crawled pagesCrawled URLs, in Site AuditUR
Tracked keywords listed, in Rank Tracker keywordsNoneVolume
Referring domains listed, in Backlink gapNoneReferring domain DR

Know these limitations before you use a "listed" metric:

  1. The count stops at your row limit. It cannot be more than the rows that Two Minute Reports gets from Ahrefs: Limit rows (a minimum of 100), or the maximum rows of your plan if you do not set Limit rows. Limit rows also cuts the rows that you see, but only after the count: with Limit rows 10 and only Referring domains listed in the query, Two Minute Reports gets 100 rows, counts them, and shows 100. Two Minute Reports does not show a warning when this occurs. If the count is the same as the rows that Two Minute Reports gets, the real number is probably higher. To count more rows, increase Limit rows.
  2. The count has only the top rows. Ahrefs sends the rows in the order of the last column of the table, and stops at your row limit. The sort of your query does not change which rows Ahrefs sends.
  3. A filter counts only the rows that you got. Two Minute Reports applies your filters after Ahrefs sends the rows. For example, a site has 12,000 referring domains, and Limit rows is 100. You add the filter DR less than 30. Ahrefs sends the 100 domains with the highest DR, so Referring domains listed can show 0.
  4. Referring domains listed also counts lost domains. The list also has the domains that the site lost after the first day of your date range. Referring domains counts only the domains that link to the site now. Thus, Referring domains listed can be more than Referring domains, even if all of the rows are in your list.
  5. With a time dimension, the row limit is for the full date range. Referring domains listed by month counts the new referring domains of each month. Limit rows applies to all of the months together, not to each month. For example, if Limit rows is 100, all of the months together show a maximum of 100 domains. Tracked keywords listed is different: by week, it can show up to Limit rows for each week.

Currency, time zone, and data freshness

  • Ahrefs shows all money values in US dollars. Currency conversion is not available for Ahrefs.
  • Ahrefs uses UTC days. A date range that ends after today in UTC stops at today in UTC.
  • Ahrefs updates most of its data one time each day. A history for today can be empty until Ahrefs has the data.

Troubleshooting

  • "Ahrefs didn't accept this API key": the key is not correct, or it expired. Create a new API key in Ahrefs, then paste it.
  • "This Ahrefs connection does not have an API key": edit the connection and paste an API key. See How to get your credentials.
  • "No projects were found in the Ahrefs workspace of this API key": create a project in Ahrefs, or use an API key from the workspace that has your projects. Then try again.
  • "Ahrefs didn't accept this connection's API key": the key expired, someone deleted it, or the person who created it left the workspace. Create a new API key. Then edit the connection and paste the new key.
  • "The fields in this query need an Ahrefs Enterprise plan": remove the backlink gap fields, or use an API key from an Enterprise workspace. See Ahrefs plans.
  • "The AI responses fields need the Ahrefs Brand Radar add-on": remove the AI responses fields, for example ChatGPT responses, or add Brand Radar to your Ahrefs workspace. See Ahrefs plans.
  • "The Ahrefs workspace has used all of its API units for this month": wait until your units reset on the date in the message, or ask a workspace admin to upgrade the Ahrefs plan. Set a lower Limit rows to use fewer units. To see your units, go to Account settings › Limits & usage in Ahrefs.
  • "This Ahrefs API key has used all of the API units set for it this month": the API key has a monthly unit limit, and it used all of it. Ask a workspace admin to increase the limit of the key in Account settings › API keys.
  • "This account is either removed or does not have required permissions to perform query operations": Ahrefs refused the request for the project. Make sure that the project is still in the workspace of the API key.
  • "Organic competitors are reported for one country at a time": select a Country in the Ahrefs report options. See Report configuration.
  • "Backlink gap fields compare the report target with its competitors": add one or more Competitors in the Ahrefs report options.
  • "Ahrefs compares up to 20 competitors at a time": remove competitors in the Ahrefs report options until you have 20 or fewer.
  • "Enter the target in the Ahrefs report configuration as a domain or URL": enter the Target as a domain or a URL, for example example.com or example.com/blog.
  • "A competitor in the Ahrefs report configuration isn't a valid domain or URL": enter each competitor as a domain or a URL, for example example.com.
  • "A filter can only use fields from the same Ahrefs report as the selected fields": remove the filter on a field from a different report, or use that field in a different query. See Fields that you cannot use together.
  • "Device splits Rank Tracker fields by desktop and mobile": add a Rank Tracker field to the query, or remove Device. See Rank Tracker device.
  • "Rank Tracker and Site Audit fields take one snapshot per day, week, month or year, up to 110 per query": use a weekly or monthly time dimension, or a shorter date range.
  • "This Ahrefs project is no longer available to the connection's API key": someone deleted the project, or its access changed. Edit the query and select a different project.

If you need help, contact [email protected].

Copyright © 2026