# Ahrefs Keyword Difficulty Scraper (`piotrv1001/ahrefs-keyword-difficulty-scraper`) Actor

Check Ahrefs Keyword Difficulty (KD) for a list of keywords: KD score, referring domains needed to rank in the top 10, monthly search volume, SERP features and the top organic results with their DR, UR, backlinks and traffic. No Ahrefs account needed.

- **URL**: https://apify.com/piotrv1001/ahrefs-keyword-difficulty-scraper.md
- **Developed by:** [FalconScrape](https://apify.com/piotrv1001) (community)
- **Categories:** SEO tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $8.00 / 1,000 keyword checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### 🚀 Ahrefs Keyword Difficulty Scraper

Check **Ahrefs Keyword Difficulty (KD)** for a whole list of keywords at once. For each keyword the **Ahrefs Keyword Difficulty Scraper** returns the KD score and how many referring domains you would need to reach the top 10. It also returns the monthly search volume, the SERP features (AI Overview, People Also Ask, videos…) and the top organic results with their Domain Rating, URL Rating, backlinks and traffic. Use it to prioritise content plans, size up competitors on a SERP and find keywords you can actually rank for. No Ahrefs account needed.

### ✨ Features

- 🎯 **Keyword Difficulty (0–100)**: Ahrefs' estimate of how hard it is to rank in the top 10.
- 🔗 **Links Needed**: The number of referring domains you would likely need to rank in the top 10.
- 📊 **Search Volume**: Monthly searches in the chosen country, when Ahrefs reports it on the results page.
- 🧩 **SERP Features**: AI Overview, People Also Ask, videos and other blocks on the results page.
- 🏁 **Top Organic Results with Metrics**: Position, title, URL, DR, UR, backlinks, referring domains, organic traffic, ranking keywords and the page's own top keyword with its volume.
- 🌍 **Any Country**: Pick the search market with a two-letter country code.

### 🛠️ How It Works

1. **Add your keywords** – one per line.
2. **Pick a country** – `us` by default.
3. **Run the Scraper** – one row per keyword, downloadable as JSON, CSV or Excel, or through the API.

### ⚙️ Input

| Field           | What it does                                                         |
| --------------- | -------------------------------------------------------------------- |
| **Keywords**    | Keywords to check, one per line.                                      |
| **Country**     | Two-letter country code of the search market (`us`, `gb`, `de`…).     |
| **Max results** | Stop after this many keywords. Default 50.                           |

With an empty input the scraper checks `web scraping`, `seo tools` and `keyword research` in the US.

```json
{
    "keywords": ["best running shoes", "running shoes for flat feet", "trail running shoes"],
    "country": "gb",
    "maxItems": 200
}
```

### 💰 Pricing

Pay only for the keywords you get — no monthly rental.

| Event               | Price                             | What you get                                                                                                        |
| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| **Keyword checked** | $0.008 per keyword ($8 per 1,000) | Keyword Difficulty, referring domains needed, search volume, SERP features and top organic results with full metrics |
| **Actor start**     | $0.00005 per run                  | Charged once when the run starts.                                                                                   |

Keywords Ahrefs has no data for in that country are skipped and not charged. Examples: 50 keywords = $0.40 · a 500-keyword content plan = $4.00.

### 📊 Sample Output Data

```json
{
    "keyword": "web scraping",
    "country": "us",
    "keywordDifficulty": 53,
    "referringDomainsToRankTop10": 95,
    "searchVolume": 8400,
    "serpFeatures": ["ai_overview", "questions", "videos"],
    "serpUpdatedAt": "2026-10-09T02:10:55Z",
    "organicResults": [
        {
            "position": 2,
            "title": "Web scraping",
            "url": "https://en.wikipedia.org/wiki/Web_scraping",
            "domainRating": 97,
            "urlRating": 19,
            "backlinks": 9667,
            "referringDomains": 2118,
            "organicTraffic": 5370,
            "rankingKeywords": 282,
            "topKeyword": "web scraping",
            "topKeywordVolume": 8400
        },
        {
            "position": 5,
            "title": "Web Scraper Cloud | Enterprise Web Scraping Platform",
            "url": "https://webscraper.io/",
            "domainRating": 65,
            "urlRating": 15,
            "backlinks": 5071,
            "referringDomains": 1956,
            "organicTraffic": 5252,
            "rankingKeywords": 502,
            "topKeyword": "web scraper",
            "topKeywordVolume": 3400
        }
    ],
    "scrapedAt": "2026-10-14T08:09:46.601Z"
}
```

### ❓ FAQ

**Why is `searchVolume` sometimes empty?** It is filled when one of the ranking pages has this exact keyword as its top keyword, which is usually the case for established keywords. Very niche keywords may have no volume.

**Why do positions skip numbers?** SERP features (AI Overview, People Also Ask, videos) take positions too; they are listed in `serpFeatures` and the organic results keep their real positions.

**Do I need an Ahrefs account?** No. The scraper uses the data Ahrefs shows publicly in its free tools.

### 🔗 More SEO Actors

- [Ahrefs Domain Rating Scraper](https://apify.com/piotrv1001/ahrefs-domain-rating-scraper): Domain Rating, backlink and referring-domain counts for a list of domains.
- [Ahrefs Backlinks Scraper](https://apify.com/piotrv1001/ahrefs-backlinks-scraper): the top backlinks pointing at any domain, with anchor text and source DR.
- [Ahrefs Traffic Scraper](https://apify.com/piotrv1001/ahrefs-traffic-scraper): monthly organic traffic, traffic value, top pages, countries and keywords.
- [Google Keyword Volume Scraper](https://apify.com/piotrv1001/google-keyword-volume-scraper): monthly Google search volume, CPC and competition for your keyword list.
- [Google Keyword Suggestions Scraper](https://apify.com/piotrv1001/google-keyword-suggestions-scraper): related keyword ideas around a seed, with volume and difficulty.
- [Google Ranked Keywords Scraper](https://apify.com/piotrv1001/google-ranked-keywords-scraper): every keyword a domain ranks for on Google, with position and URL.

This actor is not affiliated with or endorsed by Ahrefs. Keyword Difficulty is a metric by Ahrefs.

# Actor input Schema

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

Keywords to check, one per line.

## `country` (type: `string`):

Two-letter country code of the search market (us, gb, de…).

## `maxItems` (type: `integer`):

Stop after this many keywords.

## Actor input object example

```json
{
  "keywords": [
    "web scraping",
    "seo tools"
  ],
  "country": "us",
  "maxItems": 50
}
```

# 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 = {
    "keywords": [
        "web scraping",
        "seo tools",
        "keyword research"
    ],
    "country": "us",
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("piotrv1001/ahrefs-keyword-difficulty-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 = {
    "keywords": [
        "web scraping",
        "seo tools",
        "keyword research",
    ],
    "country": "us",
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("piotrv1001/ahrefs-keyword-difficulty-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 '{
  "keywords": [
    "web scraping",
    "seo tools",
    "keyword research"
  ],
  "country": "us",
  "maxItems": 50
}' |
apify call piotrv1001/ahrefs-keyword-difficulty-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,piotrv1001/ahrefs-keyword-difficulty-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/Tc9ow7DkNu4hzLUun/builds/nVQPlsE3P1XcP36xY/openapi.json
