# Ahrefs Free Tools Scraper — Backlinks, DR, Keyword Ideas (`themineworks/ahrefs-scraper`) Actor

Read Ahrefs' free Backlink Checker & Keyword Generator: Domain Rating, referring domains, top backlinks sample, keyword ideas with difficulty/volume. No login. Use as an MCP server in Claude, ChatGPT & AI agents.

- **URL**: https://apify.com/themineworks/ahrefs-scraper.md
- **Developed by:** [The Mine Works](https://apify.com/themineworks) (community)
- **Categories:** SEO tools, Developer tools, MCP servers
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.00 / 1,000 check completeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 🔗 Ahrefs Free Tools Scraper: Backlinks, Domain Rating & Keyword Ideas

### Overview

This actor reads Ahrefs' own **public, free SEO tools** — the [free Backlink Checker](https://ahrefs.com/backlink-checker) and the [free Keyword Generator](https://ahrefs.com/keyword-generator) — and turns their preview data into clean, structured JSON. For a domain, you get Domain Rating (DR), total backlinks, total referring domains, dofollow counts, and a small sample of the actual top backlinks. For a seed keyword, you get keyword ideas with bucketed difficulty and volume labels.

No Ahrefs account, no login, no API key, and no access to the paid Ahrefs dashboard, Site Explorer, Keywords Explorer, or official API — this reads exactly what Ahrefs already shows for free to any visitor, nothing more.

✅ No login required | ✅ No API key | ⚠️ Turnstile pass rate currently unreliable (see below) | ✅ MCP-ready for AI agents

### Current status — read this before you buy

**As of the most recent live test, this actor does not reliably clear Ahrefs' Cloudflare Turnstile challenge.** This is disclosed here deliberately rather than glossed over.

What we verified directly from Ahrefs' own production code (not guessed): both free tools are backed by internal JSON endpoints (`stGetFreeBacklinksOverview`, `stGetFreeBacklinksList`, `stGetFreeKeywordIdeas`) whose request schemas require a Cloudflare Turnstile token. This actor drives a real, stealth-hardened Chromium session (residential proxy, realistic fingerprint) to the actual free-tool page and interacts with it exactly like a human would — types the real input, clicks the real submit button — and lets Ahrefs' own JS run its own Turnstile challenge.

Across repeated live test runs (different domains, different proxy configurations), the Turnstile widget does load and does run its full challenge flow — but Cloudflare's own server-side verification step (`/cdn-cgi/challenge-platform/.../pat/...`) consistently returned **HTTP 401**, meaning the session was actively rejected, not merely rate-limited or slow. No test run has yet produced a passing token from this infrastructure. We do not know whether this is specific to Apify's shared proxy IP ranges (plausible, given how many scrapers already hit Ahrefs' free tools through them) or a broader signal on this exact automation profile.

We are not going to paper over this with a third-party CAPTCHA-solving service — that changes the cost, reliability, and legitimacy profile of the actor in ways that need an explicit decision, not a silent workaround. Until Turnstile clears reliably, **treat this actor as unverified for production use**: the code correctly implements the real API contract and will return the fields documented below the moment a request clears Turnstile, but a clean run today may return zero results and zero charges. Runs are never charged when Turnstile doesn't clear (see Pricing/FAQ), so this fails safe rather than failing expensive.

### Coverage — read this before you buy

**This is the FREE PREVIEW tier only.** Ahrefs deliberately limits what its free tools show, to drive signups for the paid product. Concretely, this actor returns:

- **Backlink Checker:** Domain Rating, total backlinks count, total referring domains count, dofollow backlink/referring-domain counts, and a **small sample of top backlinks** (in practice well under 10 rows — this is the same cap Ahrefs' own free tool shows in a browser, not a limit we impose).
- **Keyword Generator:** keyword ideas with a **difficulty LABEL and a volume LABEL** (e.g. "Low"/"Medium"/"High"-style buckets) — **not** exact search volume numbers or an exact Keyword Difficulty score. Exact numbers are a paid Keywords Explorer feature and are out of scope here.

It does **not** return: the full backlinks report, historical backlink/referring-domain growth charts, anchor-text breakdowns, organic traffic estimates, exact keyword search volumes, SERP overviews, or anything else that sits behind an Ahrefs login. If you need that, you need an Ahrefs subscription — this actor is not a substitute for one, and does not try to be.

**Why this matters for pricing:** this is a thin data surface by Ahrefs' own design, and it's priced accordingly — well below the category's leading actor (see below).

### How it works (and why it needs a real browser)

We read Ahrefs' own production JavaScript before writing a line of code. Both free tools call internal JSON endpoints (`stGetFreeBacklinksOverview`, `stGetFreeBacklinksList`, `stGetFreeKeywordIdeas`) whose request schemas **require a `captcha` field**, and the page loads Cloudflare Turnstile. A plain HTTP request can't produce a valid Turnstile token — only a real browser completing the actual challenge can. So this actor drives a real, stealth-hardened Chromium session (residential proxy, realistic fingerprint) to the actual free-tool page, types into the real input box, clicks the real submit button, and lets Ahrefs' own code solve its own challenge — exactly like a human visitor. We then read the JSON response the site already sends to its own frontend. We never forge, replay, or crack a captcha token.

**Anti-bot honesty:** if Turnstile doesn't clear for a given domain or keyword — which does happen, especially in a large batch run in a short window, since that's exactly the pattern Ahrefs' abuse protection is built to catch — that item is skipped, logged clearly, and **never charged**. The run never fails outright and never fabricates a result.

### 🧾 Input configuration

Check a domain's backlinks:

```json
{
  "tool": "backlink_checker",
  "domain": "ahrefs.com",
  "backlinkMode": "subdomains",
  "maxBacklinks": 10
}
```

Get keyword ideas:

```json
{
  "tool": "keyword_generator",
  "keyword": "lab grown diamonds",
  "searchEngine": "Google",
  "withQuestionIdeas": true,
  "maxIdeas": 25
}
```

Check several domains in one run (each is a separate free-tool query):

```json
{
  "tool": "backlink_checker",
  "domains": ["ahrefs.com", "nivara.diamonds", "semrush.com"]
}
```

| Field | Description |
| --- | --- |
| `tool` | `backlink_checker` or `keyword_generator` |
| `domain` / `domains` | Single domain, or an array for bulk (backlink\_checker) |
| `backlinkMode` | `subdomains` (tool default) or `domain` (exact match only) |
| `maxBacklinks` | Cap on sampled backlink rows per domain (max 10 — the free tool's own ceiling) |
| `keyword` / `keywords` | Single seed keyword, or an array for bulk (keyword\_generator) |
| `searchEngine` | `Google`, `YouTube`, `Bing`, or `Amazon` |
| `withQuestionIdeas` | Also return question-style keyword ideas when Ahrefs returns them |
| `maxIdeas` | Cap on keyword idea rows per seed (max 100) |
| `proxyConfiguration` | RESIDENTIAL proxy recommended (prefilled) — helps Turnstile clear reliably |

### 📤 Output format

Backlink checker row:

```json
{
  "tool": "backlink_checker",
  "target": "ahrefs.com",
  "mode": "subdomains",
  "domainRating": 91,
  "backlinks": 2847213,
  "refdomains": 124892,
  "dofollowBacklinks": 1902341,
  "dofollowRefdomains": 98211,
  "topBacklinks": [
    { "urlFrom": "https://example.com/seo-guide", "urlTo": "https://ahrefs.com/", "anchor": "Ahrefs", "title": "The Complete SEO Guide", "domainRating": 72 }
  ],
  "captcha_cleared": true,
  "scraped_at": "2026-08-02T10:00:00.000Z"
}
```

Keyword generator row:

```json
{
  "tool": "keyword_generator",
  "keyword": "lab grown diamonds",
  "searchEngine": "Google",
  "total": 4213,
  "ideas": [
    { "keyword": "lab grown diamonds vs natural", "difficultyLabel": "Medium", "volumeLabel": "High" }
  ],
  "questionIdeas": [
    { "keyword": "are lab grown diamonds real", "difficultyLabel": "Low", "volumeLabel": "Medium" }
  ],
  "captcha_cleared": true,
  "scraped_at": "2026-08-02T10:00:00.000Z"
}
```

### 💼 Common use cases

**Quick competitor DR check** — before a link-building push, get a fast Domain Rating and backlink-count read on a competitor without opening Ahrefs.

**Content/keyword brainstorming** — feed a topic into the Keyword Generator to get a broad set of related and question-style keyword ideas with a rough sense of difficulty/volume, before doing deeper paid research on the shortlist.

**Lightweight prospect/vendor screening** — a fast DR + referring-domains sanity check on a domain (e.g. a guest-post or backlink vendor) before spending time or money on it.

**AI agent tooling** — plug into an MCP-connected agent so it can pull a domain's DR or brainstorm keywords mid-conversation without a human opening a browser.

### FAQ

**Do I need an Ahrefs account or API key?**
No. This reads Ahrefs' free, public tools exactly as any visitor sees them.

**Why does it need a real browser and residential proxy, not just an HTTP request?**
Ahrefs' free tools require solving a Cloudflare Turnstile challenge before they'll return data — that's confirmed directly in Ahrefs' own production code, not assumed. A plain HTTP client cannot produce a valid Turnstile token; only a real browser session can. Residential proxies make that browser session's fingerprint more likely to be treated as trustworthy.

**Why is the backlinks list so short?**
That's Ahrefs' own free-tier limit, not ours — the free Backlink Checker only ever shows a small sample of the full backlink profile to encourage a paid signup. This actor returns exactly what the free page shows.

**Why don't I get exact keyword search volume or difficulty numbers?**
The free Keyword Generator itself only shows bucketed labels ("Low"/"Medium"/"High"-style), not exact numbers — exact Volume and Keyword Difficulty scores are a paid Keywords Explorer feature.

**What happens if Ahrefs' Turnstile challenge doesn't clear?**
That item is skipped and logged, and you are never charged for it. Large batches run back-to-back are more likely to trip Ahrefs' own abuse protection — smaller batches with default settings are more reliable.

**How is pricing calculated?**
Pay per event. You're charged once per domain or keyword that actually returns real data. Blocked, failed, or empty checks are never charged. There is no free tier.

### Use in Claude, ChatGPT & any MCP agent

```
https://mcp.apify.com/?tools=themineworks/ahrefs-scraper
```

Or call it from code with the Apify client:

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('themineworks/ahrefs-scraper').call({
  tool: 'backlink_checker',
  domain: 'ahrefs.com',
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### 🛠️ Complete your SEO research stack

Pair this with the rest of the themineworks SEO/competitive-intelligence suite:

- **[Crunchbase Scraper](https://apify.com/themineworks/crunchbase-companies)**: company funding, investors, and firmographics.
- **[Website Contact Finder](https://apify.com/themineworks/website-contact-finder)**: pull contact details for the domains you just checked.

Found a bug or have a feature request? Open an issue on the actor's Apify Console page or reach out through the Apify profile.

# Actor input Schema

## `tool` (type: `string`):

Which of Ahrefs' free tools to read. "backlink\_checker" returns Domain Rating, backlinks/referring-domains counts, and a sample of top backlinks for a domain. "keyword\_generator" returns keyword ideas with bucketed difficulty/volume labels for a seed keyword.

## `domain` (type: `string`):

A single domain or URL to check, e.g. "ahrefs.com" or "nivara.diamonds". Ignored when "domains" is set or tool=keyword\_generator.

## `domains` (type: `array`):

Multiple domains/URLs to check in one run. Each one is a separate free-tool query against Ahrefs — large batches are more likely to trip Ahrefs' own Cloudflare Turnstile abuse protection (see README). Overrides "domain" when set.

## `backlinkMode` (type: `string`):

Match the exact domain only, or include its subdomains (Ahrefs' own tool default).

## `maxBacklinks` (type: `integer`):

Cap on how many individual backlink rows to include per domain from Ahrefs' free "Top backlinks" sample. The free tool itself only ever exposes a small sample (well under 10 in practice) — this cannot exceed what Ahrefs' free tier returns.

## `keyword` (type: `string`):

A single seed keyword or phrase, e.g. "lab grown diamonds". Ignored when "keywords" is set or tool=backlink\_checker.

## `keywords` (type: `array`):

Multiple seed keywords to run in one job. Each one is a separate free-tool query — same Turnstile caveat as bulk domains. Overrides "keyword" when set.

## `searchEngine` (type: `string`):

Which engine's keyword ideas to pull from Ahrefs' free Keyword Generator.

## `withQuestionIdeas` (type: `boolean`):

Also return the free tool's "question" keyword ideas list (e.g. "are lab grown diamonds real"), when Ahrefs returns one, in addition to the main ideas list.

## `maxIdeas` (type: `integer`):

Cap on how many keyword idea rows to include per seed keyword (applies to both the main and question ideas lists).

## `proxyConfiguration` (type: `object`):

Ahrefs' free tools sit behind Cloudflare Turnstile. RESIDENTIAL proxies improve the odds the challenge auto-clears for a real, stealth-hardened browser session.

## Actor input object example

```json
{
  "tool": "backlink_checker",
  "domain": "ahrefs.com",
  "backlinkMode": "subdomains",
  "maxBacklinks": 10,
  "keyword": "lab grown diamonds",
  "searchEngine": "Google",
  "withQuestionIdeas": true,
  "maxIdeas": 25,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "tool": "backlink_checker",
    "domain": "ahrefs.com",
    "backlinkMode": "subdomains",
    "maxBacklinks": 10,
    "keyword": "lab grown diamonds",
    "searchEngine": "Google",
    "withQuestionIdeas": true,
    "maxIdeas": 25,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("themineworks/ahrefs-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "tool": "backlink_checker",
    "domain": "ahrefs.com",
    "backlinkMode": "subdomains",
    "maxBacklinks": 10,
    "keyword": "lab grown diamonds",
    "searchEngine": "Google",
    "withQuestionIdeas": True,
    "maxIdeas": 25,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("themineworks/ahrefs-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "tool": "backlink_checker",
  "domain": "ahrefs.com",
  "backlinkMode": "subdomains",
  "maxBacklinks": 10,
  "keyword": "lab grown diamonds",
  "searchEngine": "Google",
  "withQuestionIdeas": true,
  "maxIdeas": 25,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call themineworks/ahrefs-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,themineworks/ahrefs-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/aOG9C4dOrnHNF4ESI/builds/xaRidSFdNAb76uMh4/openapi.json
