Ahrefs API Guide: Process, Pricing, Alternatives and More
I’m a big fan of Ahrefs. It’s one of the most useful tools I’ve ever used in marketing, and I’ve used it extensively for everything from my own marketing efforts, to my clients’ research, to even personal use. I also mention it frequently in posts like using Ahrefs to find competitor guest posts and the top alternatives to Semrush.
There’s one thing I often leave out of the discussion, and that’s the Ahrefs API. There’s a good reason for that, though, which I’ll get into later. First, though, what is their API, what can you do with it, and how can you use it? Let’s dig in.
What is the Ahrefs API?
Ahrefs, as you know, is one of the best marketing tools on the market today. They have one of the largest search indexes this side of Google, have some incredibly deep analytics and metrics that rival Google Analytics (and surpass it in many ways), and their tools for things like rank tracking, site auditing, backlink tracking, and SEO performance are top-tier.
In case you don’t know, an API, or Application Programming Interface, is a way to get direct access to data from a system like Ahrefs without having to go through the dashboard. It’s faster, and it allows you to customize the data on your own end, without needing to rely on things like scraping. They’re extremely useful, but since they’re pure data streams, they require a program layer to interpret the data.
The Ahrefs API gives you access to some (but not necessarily all) of Ahrefs data, which you can then use in your own applications, assuming you handle the data appropriately.
Currently, the Ahrefs API is up to Version 3. Version 3 has existed since 2022, but it was only recently – just a couple of months ago as of this writing – that Version 2 was fully discontinued. So, everything I write from here on out is referring to the V3 API.
What Can the Ahrefs API Do?
Like every API, the Ahrefs API will only give you the data it’s allowed to access. Fortunately, Ahrefs allows a lot of their data to be pulled via API endpoints from their various tools.
Here’s what they allow:
- Overview Stats from Site Explorer
- Historical Charts from Site Explorer
- Backlink Data from Site Explorer
- Organic Traffic Reports from Site Explorer
- Paid Traffic Reports from Site Explorer
- Single Keyword Metrics from Keywords Explorer
- Keyword List Metrics from Keywords Explorer
- Search Volume History from Keywords Explorer
- Volume History by Country from Keywords Explorer
- Keywords Ideas Reports from Keywords Explorer
- Project Health Scores from Site Auditor
- Top 100 SERPS Results from SERP Overview
- Project Overview Data from Rank Tracker
- Ahrefs Crawler IP Address Ranges
Additionally, the API can give you data about your own API account, such as your usage limits and quotas.
While this looks like a pretty big list of data – and it is – it’s not everything Ahrefs can do. It’s also not everything they know. Some of their data requires processing and their own algorithms, and they don’t want to hand that over even for a fee. Other data is simply derived from the data they give you, so you can figure it out on your own if you need it.
How Much Does the Ahrefs API Cost?
Above, I mentioned one main reason why I don’t talk about the Ahrefs API, and it’s this right here.
Ahrefs offers all plans access to a handful of free test queries. You need to create an API key to use these, but they do not consume API units. You can click the link there and see which queries Ahrefs will let you run for free, but they aren’t really that many or that useful, and they’re capped at 100 results no matter how many you would like to get. That’s reasonable! APIs can be very heavy on servers, especially if you’re trying to harvest the data for thousands of keywords or hundreds of domains.
For full access to the API, though, you need to be on the Enterprise plan of Ahrefs. There’s no API-only plan and, in fact, even the enterprise plan is limited and you have to pay extra for more API units. More on those in a bit.
As you likely know, enterprise-grade plans for most marketing services are quite costly. Ahrefs starts their enterprise plan at a whopping $1,249 per month. That price allows you 2,000,000 API units per month. That might sound like a lot, but I’ll get into that a bit later.
You can also buy an extra 1,000,000 API units for $500 per year. Presumably you can buy this add-on multiple times if you need an even larger number of units for your needs, but at that point the cost doesn’t really matter to you as much as it does to me.
What Are the Problems with the Ahrefs API?
Other than the sheer cost, there are two issues with the Ahrefs API.
The first is API units. Like I said, two million API units per month seems like a lot, and in a way it is. But, it’s also less than it seems.
Every query you run on the Ahrefs API, by default, automatically costs a minimum of 50 API units. On top of that, you add on an additional cost of units that is:
- Per-row cost times the number of rows.
A row can have a scaling cost based on the number of pieces of data you want in that row. A row with only one piece of data has a row cost of 1. A row with three pieces of data has a row cost of 3. A row with four pieces of data, but two of those data pieces are the same, will cost 3.
Some pieces of data are either derived data or expensive data that Ahrefs doesn’t want to hand over for the same low cost, so these fields cost 5 or 10 units instead of 1. Traffic data is one example, which costs 10 units.
So, say you get 100 rows of data, and each row costs 5 units; that’s a cost of 500.
The one allowance is that the base cost is just the minimum; if an API call would cost anywhere from 1 to 49 units, it costs 50. You don’t then keep adding the 50, though; that 100×5 calculation costs 500, not 550.
Basically, it just means that a good query that harvests a bunch of data about a list of domains can easily cost thousands or tens of thousands of API units, so having millions at your disposal isn’t quite as much as you might think.
There’s one other problem with the Ahrefs API, which is that it’s essentially just limited to “personal” use. I put personal in quotes because it’s obviously quite usable for businesses – that’s why it’s available in the Enterprise plans, after all – but more that it’s not available for external or commercial use, in general.
What do I mean? Well, the goal is that your use of the API will center around using your own spreadsheets or internal systems. If I wanted to integrate Ahrefs data directly into Topicfinder, I would need to submit my app for their approval as an official integration. They’re pretty picky with who they allow to resell their data.
This cuts out two of the three main uses of an API.
- It’s much too expensive to be worthwhile for a smaller project.
- It’s restricted from spinning up an app that uses the data; you still can, but it requires approval and takes time, which you might not have.
- This leaves it primarily available for internal use by large businesses.
There’s nothing wrong with Ahrefs’ decision to limit their API in this way. It just means a business like mine, which could make good use of the data but isn’t raking in millions a year, is kind of frozen out of it.
How Can You Use the Ahrefs API?
Let’s assume you’ve made it past the price barrier and you’re willing to use the Ahrefs API. How do you do it?
Step 1: Figure out what data you want. Since the Ahrefs API is so costly, you don’t want to waste queries on data you won’t use. I recommend aiming for an MVP-style query: the Minimum Viable Product of API calls. You can read through all of the specific endpoints you can call in their API documentation.
So, start by deciding what data you want, and more importantly, why you want the raw data in a spreadsheet rather than getting the output through the Ahrefs dashboards. If you have internal tools or other apps you want to funnel that data into, or you want to do some Big Data Processing on it, that’s fine, just avoid the pitfall of harvesting the same report you can just generate from their dashboard without messing around with the API.
Step 2: Configure your queries. API language is strict, so you need to make sure you’re configuring your query properly; otherwise, you risk wasting time and money. While you might think a malformed API query bouncing is the worst case, it’s actually worse if you get a successful but wrong query and waste a bunch of your API units.
Ahrefs recommends that you test your query by running it against one of their free targets rather than just running it raw. You can poll x-api-units-cost-total to estimate the cost. This helps you not accidentally waste a bunch.
Step 3: Run the queries and use the data. Getting API results is very useful, but you do need to both save and use the information you receive. I’ve sporadically encountered people who have APIs they pay for and even have scripts that routinely run queries and pull data, but then they never really make use of that data.
Hopefully, having a good idea of why you need the data in the first place will help you avoid this issue. But it’s still a pitfall.
If it feels like I’m glossing over a lot here, I kind of am. Configuring and using API data really requires a coder who knows what they’re doing with APIs, data sources, and display dashboards to whip you up a useful internal dashboard to harvest, process, and display the data. That might mean hiring a coder to make something for you, and it definitely isn’t something I can give you a complete rundown on in one sub-section of a blog post. Just remember, if the cost didn’t already warn you, that investing in APIs tends to be a significant hurdle.
Are There Viable Alternatives to the Ahrefs API?
If you’ve balked at the price and the limitations, are there alternatives you can use? Or is the Ahrefs API the only worthwhile marketing API out there?
The answer is both, really. Ahrefs is by far the biggest of the big data marketing firms, so until Google releases their data via API, they’re the best you’re going to get. However, if you want acceptable, mostly-good-enough data from a cheaper or more accessible source, there are other ways to get it.
Semrush offers an API with very good marketing data, and while it’s still quite expensive, $500 per month is still a lot cheaper than Ahrefs.
Moz’s API is one of the most flexible and accessible out there; they even allow you a limited amount of access (3k rows per month) for just $20 per month. For small projects and individual research, it’s pretty great.
Screaming Frog (or Greenflare) aren’t APIs, but they do allow you to scrape data, so you can get similar results depending on what data you want from Ahrefs. You don’t need massive Big Data to gather page titles, after all.
You can also give Topicfinder a look. Depending on the data you wanted, I’ve found ways to harvest and present a lot of it, and I can help you with topic ideation, competitive research, and more. Check out the features list and, if it seems like it’s useful, give it a try with the free trial!
Leave a Comment
Fine-tuned for competitive creators
Topicfinder is designed by a content marketing agency that writes hundreds of longform articles every month and competes at the highest level. It’s tailor-built for competitive content teams, marketers, and businesses.
Get Started