Search API Connector Documentation
Import Ahrefs Data to Google Sheets
In this guide, I'll get you started on pulling data from the awesome Ahrefs SEO tool suite into Google Sheets, using the API Connector add-on for Sheets. Targeted around backlinks, you can use the Site Explorer, Content Explorer, Keywords Explorer, Rank Tracker, and Site Audit to compare your website to competitors. All in all, it's a pretty sweet tool and we can integrate its native API with Google Sheets!
Note: You need an account with Ahrefs to use this integration, and Ahrefs is not a free tool. However, through this integration, you can access their API without paying their additional API fee ($500+ a month, as shown here).
- Before You Begin
- Part 1: Connect to the Ahrefs API
- Part 2: Pull Data from Ahrefs to Sheets
- Part 3: Create a Custom API Request
- Part 4: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Connect to the Ahrefs API
The easiest way to get started with the Ahrefs API is through API Connector’s built-in integration.
- Select Ahrefs from the drop-down list of applications
- Under Authorization, click Connect to Ahrefs
- You will see a modal asking you to approve the connection. Click Allow.
- You'll then be returned to your Google Sheet, and can verify that your Ahrefs connection is now active.
Part 2: Pull Data from Ahrefs to Sheets
Now that we're connected, let's pull some data into Sheets.
- There's only one endpoint for Ahrefs so skip straight to Request parameters. Choose the table from which you'd like to retrieve data. For this example, we'll choose
- Fill out the other required parameters (mode and target). For this example we'll set mode as
domainand target as
ahrefs.com, but you can use your own values.
- Set a destination sheet, name your request, and click Run to see response data in your sheet.
- Now select any other "from" table of interest and adjust parameters to get different data sets. You can pull in any of the data you see while logged into Ahrefs.
Part 3: Create a Custom API Request
Alternatively, you can run your own custom API requests instead of using API Connector’s pre-built integration, using any of the URLs shown in the API documentation. To create a custom request, add the complete URL into the request URL field and select Ahrefs from the OAuth menu.
To convert from a preset request to a custom API URL, tick the Add request URL box before running your preset request (under Output options). This will print out your complete API URL, which you can then copy/paste into the request URL field.
Part 4: API Documentation
Official API documentation: https://ahrefs.com/api/documentation
API request builder tool: https://ahrefs.com/api/api-request-builder