How to import Ahrefs data into Google Sheets

Ahrefs is a comprehensive SEO tool that you can use for keyword research, backlink analysis, competitor analysis, keyword rank tracking, and as an SEO audit tool. 

In this tutorial, I’ll teach you how to connect the Ahrefs API to Google Sheets in 5 steps:

  1. Install the Apipheny Add-on
  2. Generate an Ahrefs Token
  3. Choose your Endpoint URL
  4. Enter Ahrefs API Request into Apipheny
  5. Run the Ahrefs API request

Step 1.) Install and open the Apipheny Add-on in Google Sheets

To pull data from the Ahrefs API to Google Sheets easily and without writing any code, first install and open the Apipheny Google Sheets add-on.

Apipheny is a no-code API integrator for Google Sheets that you can use to make unlimited API requests, connect to unlimited APIs (including the Ahrefs API), save API requests, schedule API requests, and more. Click here if you want to learn more about Apipheny.

1. Install Apipheny by clicking the Install button on this page.

Install Apipheny
Install Apipheny

2. After you’ve installed Apipheny, open a Google Sheet and then click on the Add-Ons option in the top menu. In the add-ons menu, you should see Apipheny.

Click Apipheny > Import API to open the Apipheny sidebar in your Google Sheets.

Open Apipheny
Open Apipheny

Step 2.) Generate an Ahrefs API Token

To generate your API token, go to and click the Generate access token button:

Generate Ahrefs API Access Token
Generate Ahrefs API Access Token

Your token is now generated:

Ahrefs API Token
Ahrefs API Token

Copy your token to a safe location, because you’ll need it in the next steps.

Step 3.) Choose your Ahrefs API Endpoint

In this section, we’ll show you how to browse the Ahrefs API documentation to find an API endpoint URL that retrieves the information you need from your Ahrefs account.

If you already know your URL/endpoint and parameters, or you want to use the same example URL as us, just skip to Step 4.

To choose an endpoint, first open the Ahrefs API documentation page:

On that page, you’ll see that the menu on the left contains a list of endpoints for the Ahrefs API:

Ahrefs API endpoints
Ahrefs API endpoints

An example endpoint is the refdomains endpoint, that returns the referring domains that contain backlinks to the target:

The documentation for this endpoint contains a short description of the endpoint’s purpose, a table describing the accepted parameters, and a number of request examples:

refdomains Ahrefs API endpoint documentation
refdomains Ahrefs API endpoint documentation

All API calls to Ahrefs should be made to the base domain.

Ahrefs API root/base URL:

Step 4.) Enter your Ahrefs API Request into Apipheny

Now go back to your Google Sheet and make sure that the Apipheny add-on is open, with the “Import” tab open.

In the Import Tab, enter these details into the add-on:

Method: At the top of the Apipheny sidebar, select the HTTP method (GET or POST) required by your API endpoint. For this example, we are using the GET method.

API URL: In Step 3, we explained how you can find the Ahrefs API endpoint that you need. Now copy the complete URL into the Apipheny add-on, where it says API URL Path (JSON / CSV), followed by any GET parameters required for your query.

For this example, we are using the ahrefs_rank endpoint that returns the URLs and their rankings. The URL for this API endpoint is:<your_access_token>

If you use this same endpoint URL, just keep in mind that <your_access_token> should be replaced with the value you generated in Step 2. Do not include the brackets “<>” around your token.

Ahrefs API request entered into Google Sheets

Step 5.) Run the Ahrefs API Endpoint Request

Finally, click the Run button at the bottom of the Apipheny add-on and then wait for the Ahrefs API data to be imported into your Google Sheet:

Ahrefs API data in Google Sheets

After making a successful request to the Ahrefs API, try querying a different endpoint, or try using one of the more advanced features in the Apipheny add-on, such as:

  • Save and schedule your API request
  • Make a POST request (if available)
  • Use the custom =APIPHENY() function to call the API request inside your spreadsheet
  • Create an API request by referencing the value of a cell in the API URL with three curly braces eg. {{{Sheet1!A1}}}
Google Sheets API: Import API into Google Sheets

Related articles:

Related Posts