# Ahrefs Scraper DR, Backlinks, Keywords, Traffic & AI Visibility (`memo23/ahrefs-scraper`) Actor

Paste domains, keywords or brands and pick the Ahrefs datasets you need. Each data point comes back as its own row: DR and backlinks, broken links, 12-month traffic, keyword ideas with difficulty, SERP results, rank checks, AI-search citations and top websites. No Ahrefs login, pay per row.

- **URL**: https://apify.com/memo23/ahrefs-scraper.md
- **Developed by:** [Muhamed Didovic](https://apify.com/memo23) (community)
- **Categories:** SEO tools, AI, Agents
- **Features:** Limited permissions
- **Stats:** 296 total users, 61 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $8.50 / 1,000 results

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/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 Scraper

Extract Ahrefs' free SEO data at scale — **Domain Rating, backlinks, referring domains, broken links, organic traffic, keyword ideas, keyword difficulty, SERP overviews, AI-visibility citations, and the top-websites ranking** — for any domain, keyword, or brand. No Ahrefs subscription, login, or cookies required. Bulk input, 188 countries, JSON/CSV/Excel out.

![How Ahrefs Scraper works](https://raw.githubusercontent.com/muhamed-didovic/muhamed-didovic.github.io/main/assets/how-it-works-ahrefs.png)

### Why use the Ahrefs Scraper?

- **No Ahrefs account or subscription.** Pulls straight from Ahrefs' public free tools — no seats, no API key, no login.
- **The whole free-tool suite in one actor.** Domain Rating, backlinks (overview + individual list), broken links, traffic, keyword ideas, keyword difficulty, SERP, keyword rank, and AI visibility — mix any of them in a single run.
- **Bulk by design.** Feed lists of domains, keywords, and brands together; every input fans out across parallel workers.
- **188 countries.** Localise keyword and traffic data to any market.
- **Clean, flat output.** One row per data point with a `rowType` discriminator — pipe straight into a sheet, database, or dashboard.
- **Nothing to set up.** Paste your inputs and run. Failed lookups are retried automatically, so a temporary error rarely costs you a row.

### What does the Ahrefs Scraper do?

The Ahrefs Scraper turns Ahrefs' free SEO tools into a structured data feed. Give it three kinds of input — **domains/URLs**, **keywords**, and **brands** — and toggle which datasets you want for each:

| Input | Datasets you can pull |
|---|---|
| **Domain / URL** | Domain Rating & backlink counts, backlinks overview, individual backlinks list, broken inbound links, organic-traffic overview (12-month history, top pages/countries/keywords), XML sitemap URLs, top competitors and similarly ranked sites |
| **Keyword** | Keyword ideas (+ question ideas), numeric keyword difficulty (0–100) with the live SERP, SERP overview, keyword rank (for a domain you choose) |
| **Brand** | AI-visibility citations across ChatGPT, Gemini, Perplexity, Copilot, Grok, and Google AI, plus Google AI Overviews and AI Mode mention counts with cited pages and a 6-month timeline |

It also scrapes the **Top Websites** ranking (Ahrefs' most-visited sites, filterable by 26 categories and by country) — a global dataset that runs once per run, whatever else you put in.

Everything runs account-free and returns one flat row per data point.

### Supported inputs

- **Domains / URLs** — e.g. `apify.com`, `https://example.com/blog`. Scope each with the `mode` setting (exact URL, domain + subdomains, path prefix, or whole domain).
- **Keywords** — any seed phrase, localised by `country`.
- **Brands** — any brand or entity name for AI-visibility.

All three accept bulk lists and can be combined in one run.

### Use cases

- **Backlink research & outreach** — pull a competitor's referring domains and top backlinks to build a prospect list.
- **Broken-link building** — find broken inbound links pointing at any site and pitch your replacement.
- **Keyword research** — expand a seed keyword into hundreds of ideas with difficulty and volume bands, plus question keywords for content.
- **Rank tracking** — check where your domain ranks for a basket of keywords across markets.
- **Competitor traffic intelligence** — estimate a rival's organic traffic, value, trend, and top pages/countries.
- **AI-search visibility (GEO)** — measure how often a brand is cited by ChatGPT, Gemini, Perplexity, and Google AI Overviews.
- **Domain Rating enrichment** — score a list of domains by authority for lead-qualification or link-vetting.
- **Market mapping** — pull the top-visited websites in any category or country to size a niche or find leaders to benchmark.
- **Competitor discovery** — list the sites Ahrefs sees as a domain's top competitors, with their traffic and page counts.
- **Google AI Overviews & AI Mode tracking** — count how many AI Overviews and AI Mode answers mention a brand, which pages get cited, and how that moved over six months.
- **Site audits** — pull a domain's sitemap URLs with last-modified dates to check coverage and freshness.

### How it works

1. **Input** — provide domains/URLs, keywords, and/or brands, then pick the datasets and locale.
2. **Processing** — parallel workers look up each input in the matching Ahrefs free tool and retry failed lookups automatically.
3. **Output** — every data point is flattened to one row (tagged with `rowType`) and pushed to the dataset, ready to export.

### Input configuration

| Field | Type | Description |
|---|---|---|
| `urls` | array | Domains / URLs for the website datasets. |
| `keywords` | array | Seed keywords for the keyword datasets. |
| `brands` | array | Brand names for AI-visibility. |
| `country` | string | Two-letter country code for keyword & traffic data (default `us`). |
| `mode` | select | URL scope: `exact`, `subdomains`, `prefix`, `domain` (default `subdomains`). |
| `protocol` | select | Protocol for the traffic dataset: `both`, `https`, `http`. |
| `searchEngine` | select | Engine for keyword ideas (Google, Bing, YouTube, Amazon, ChatGPT, Gemini, Perplexity, …). |
| `rankDomain` | string | Optional — when set, each keyword also returns where this domain ranks. |
| `includeBacklinks` | boolean | Backlinks overview (DR, backlinks, referring domains, dofollow split). On by default. |
| `includeBacklinksList` | boolean | Individual top backlinks, fetched together with the backlinks overview. |
| `includeWebsiteAuthority` | boolean | Standalone Domain Rating row (redundant with the backlinks overview). |
| `includeBrokenLinks` | boolean | Broken inbound links pointing at the target. |
| `includeTraffic` | boolean | Organic-traffic overview with 12-month history and top pages/countries/keywords. |
| `includeSitemap` | boolean | XML sitemap: a summary row plus one row per sitemap URL (with last-modified date). |
| `maxSitemapEntries` | integer | Cap on sitemap URL rows per site (default 100, max 1000; Ahrefs stops near 1000). |
| `includeCompetitors` | boolean | Top competing websites and similarly ranked sites from ahrefstop.com. Only returns rows when Ahrefs lists the domain there. |
| `includeAiOverviews` | boolean | Per brand: Google AI Overviews mention count, monthly change, top topics, cited pages and domains, 6-month timeline. Adds run time per brand. |
| `includeAiMode` | boolean | The same for Google AI Mode answers. Adds run time per brand. |
| `includeKeywordIdeas` | boolean | Related keyword ideas. On by default. |
| `includeQuestionIdeas` | boolean | Also pull question-style keyword ideas. |
| `includeKeywordDifficulty` | boolean | Numeric keyword difficulty (0–100) plus the live SERP with per-result metrics. |
| `includeSerpOverview` | boolean | Full organic SERP with per-result metrics. |
| `includeTopWebsites` | boolean | Ahrefs top-websites ranking (global). Runs once per run. |
| `topWebsitesCategory` | string | Optional category slug filter, e.g. `finance`, `shopping`, `news`. |
| `topWebsitesCountry` | string | Optional country slug filter, e.g. `united-kingdom`, `india`. Combines with category. |
| `topWebsitesLimit` | integer | Cap on top-website rows (default 100). |
| `maxBacklinks` / `maxKeywordIdeas` / `maxSerpResults` | integer | Per-target row caps (default 100). |
| `maxItems` | integer | Hard cap on total output rows. |
| `maxConcurrency` | integer | Parallel workers (default 3). |
| `proxy` | object | Proxy configuration (default Apify Residential, US). |

#### Example input

```json
{
  "urls": ["apify.com"],
  "keywords": ["seo tools"],
  "brands": ["Apify"],
  "country": "us",
  "mode": "subdomains",
  "includeBacklinks": true,
  "includeBacklinksList": true,
  "includeTraffic": true,
  "includeKeywordIdeas": true,
  "includeKeywordDifficulty": true
}
```

### Output overview

Each data point is a single flat row tagged with a `rowType`, so one dataset cleanly holds every tool's output:

`website_authority` · `backlinks_overview` · `backlink` · `broken_link` · `traffic_overview` · `sitemap` · `sitemap_url` · `competitor` · `similarly_ranked` · `keyword_idea` · `keyword_difficulty` · `serp_result` · `keyword_rank` · `ai_visibility` · `ai_overviews` · `ai_mode` · `top_website`

### Output samples

**Backlinks overview** (`rowType: "backlinks_overview"`)

```json
{
  "rowType": "backlinks_overview",
  "url": "apify.com",
  "mode": "subdomains",
  "domainRating": 81,
  "backlinks": 3281785,
  "refDomains": 12319,
  "dofollowBacklinks": 94,
  "dofollowRefDomains": 71
}
```

**Individual backlink** (`rowType: "backlink"`)

```json
{
  "rowType": "backlink",
  "targetDomain": "apify.com",
  "sourceUrl": "https://github.com/docling-project/docling",
  "targetUrl": "https://apify.com/vancura/docling",
  "sourceTitle": "GitHub - docling-project/docling",
  "anchor": "Docling Actor",
  "domainRating": 97
}
```

**Traffic overview** (`rowType: "traffic_overview"`)

```json
{
  "rowType": "traffic_overview",
  "url": "apify.com",
  "monthlyOrganicTraffic": 477073,
  "monthlyTrafficValue": 16976950,
  "trafficHistory": [{ "date": "2026-07-01", "organic": 466379 }],
  "topPages": [{ "url": "https://apify.com/", "traffic": 31978, "share": 36.56 }],
  "topCountries": [{ "country": "in", "share": 22.9 }]
}
```

**Keyword idea** (`rowType: "keyword_idea"`)

```json
{
  "rowType": "keyword_idea",
  "seedKeyword": "seo tools",
  "keyword": "free seo tools",
  "country": "us",
  "difficultyLabel": "Hard",
  "volumeLabel": "MoreThanOneThousand",
  "isQuestion": false
}
```

**Keyword difficulty** (`rowType: "keyword_difficulty"`)

```json
{ "rowType": "keyword_difficulty", "keyword": "seo tools", "country": "us", "difficulty": 82, "shortage": 399 }
```

**Sitemap** (`rowType: "sitemap"`, followed by one `sitemap_url` row per URL)

```json
{ "rowType": "sitemap", "url": "https://apify.com", "host": "apify.com", "urlCount": 1000, "crawledTotal": 1265216, "excluded": 325917, "capped": true, "cap": 1000 }
{ "rowType": "sitemap_url", "host": "apify.com", "url": "https://affiliate.apify.com/", "lastmod": "2026-06-23" }
```

**Competitors** (`rowType: "competitor"` or `"similarly_ranked"`)

```json
{ "rowType": "competitor", "targetDomain": "apify.com", "domain": "brightdata.com", "traffic": "88K", "trafficChange": "+11.1K", "pages": "940", "rank": null, "rankChange": null }
{ "rowType": "similarly_ranked", "targetDomain": "canva.com", "domain": "microsoft.com", "traffic": "303.7M", "trafficChange": "-17M", "pages": null, "rank": 15, "rankChange": null }
```

**Google AI Overviews mentions** (`rowType: "ai_overviews"`; `ai_mode` has the same shape)

```json
{
  "rowType": "ai_overviews",
  "brand": "Notion",
  "totalMentions": 539193,
  "newMentionsThisCycle": -3205,
  "totalTopics": 216415,
  "totalDomains": 163783,
  "topCitedPages": [{ "url": "zapier.com/blog/best-note-taking-apps/", "mentions": 6207 }],
  "aiOverviewsTimeline": [{ "date": "2026-08-01T00:00:00Z", "citations": 3535 }]
}
```

**Top website** (`rowType: "top_website"`)

```json
{
  "rowType": "top_website",
  "rank": 1,
  "domain": "moneysavingexpert.com",
  "category": "Finance",
  "monthlyVisits": "5.4M",
  "monthlyVisitsChange": "-905.2K",
  "scope": "finance/united-kingdom"
}
```

**AI visibility** (`rowType: "ai_visibility"`)

```json
{
  "rowType": "ai_visibility",
  "brand": "Apify",
  "totalAiCitations": 16716,
  "citationsByModel": [
    { "model": "Chatgpt", "count": 270 },
    { "model": "Perplexity", "count": 207 }
  ],
  "topCitedDomains": [{ "domain": "apify.com", "mentions": 454 }]
}
```

### Key output fields

| Field | Appears in | Meaning |
|---|---|---|
| `domainRating` | authority, backlinks, backlink, broken_link, serp_result | Ahrefs Domain Rating (0–100). |
| `backlinks` / `refDomains` | authority, backlinks_overview | Total backlinks and referring domains. |
| `sourceUrl` / `targetUrl` / `anchor` | backlink, broken_link | Linking page, linked page, and anchor text. |
| `httpCode` | broken_link | HTTP status of the broken target (e.g. 404). |
| `monthlyOrganicTraffic` / `monthlyTrafficValue` | traffic_overview | Estimated monthly organic visits and traffic value. |
| `trafficHistory` | traffic_overview | 12 months of organic-traffic points. |
| `difficultyLabel` / `volumeLabel` | keyword_idea | Difficulty and search-volume bands. |
| `position` / `urlRating` | serp_result | Organic position and URL Rating of the result. |
| `topPosition` | keyword_rank | Best organic position your domain holds for the keyword. |
| `totalAiCitations` / `citationsByModel` | ai_visibility | AI citations and their per-model breakdown. |
| `rank` / `monthlyVisits` / `monthlyVisitsChange` | top_website | Ranking position, estimated monthly visits, and month-over-month change. |
| `difficulty` | keyword_difficulty | Ahrefs keyword difficulty, 0–100. |
| `urlCount` / `crawledTotal` / `capped` | sitemap | URLs in the sitemap, pages Ahrefs crawled, and whether the 1000-URL cap was hit. |
| `pages` / `rank` / `rankChange` | competitor, similarly_ranked | Competitors carry their page count; similarly ranked sites carry their ahrefstop rank and its change. |
| `totalMentions` / `newMentionsThisCycle` | ai_overviews, ai_mode | Google AI Overviews / AI Mode answers mentioning the brand, and the change this cycle. |

### Free Apify plan

On the free Apify plan, the first 3 rows of each kind (backlinks, SERP results, keyword ideas, traffic overviews and so on) come back in full, so you can check the data. After that, rows keep what identifies them and the domain rating, with backlink, traffic and mention counts rounded to their order of magnitude, while the lists themselves (backlink source URLs and anchors, keyword ideas, SERP result URLs, traffic history, top pages and countries, AI citation breakdowns) are shortened or left empty, and the row carries a `freePlanNote`. Top-website lists, sitemaps, keyword difficulty and keyword rank are never masked. Any paid Apify plan returns every field.

### FAQ

**Do I need an Ahrefs account or subscription?** No. The actor uses Ahrefs' public free tools — no login, API key, or cookies.

**Are the numbers the same as paid Ahrefs?** They match Ahrefs' *free* tools, which show real Ahrefs metrics but at free-tier depth (e.g. keyword volume/difficulty as labelled bands, and top-N backlinks rather than the full index).

**Can I scrape many domains and keywords at once?** Yes. Provide bulk lists of `urls`, `keywords`, and `brands` together; they fan out across parallel workers.

**Which countries are supported?** Any two-letter country code (188 markets) for keyword and traffic data.

**Why do some fields come back `null`?** A dataset is only populated when its toggle is on and Ahrefs returns that field for the target. Non-organic SERP entries (AI overview, questions) have fewer metrics than organic ones.

**How is it billed?** Pay-per-result — you're charged per output row. See the Pricing tab on the actor's page.

### Support

Found a bug or need a field added? Open an issue on the actor's **Issues** tab in Apify Console and we'll take a look.

### Additional services

Need a tailored SEO or data-extraction pipeline — scheduled runs, enrichment, or delivery straight to your warehouse? Reach out through the developer profile on Apify.

### Explore more scrapers

- **Ubersuggest Scraper** — keyword volume, CPC, difficulty, domain backlinks & top pages.
- **SimilarWeb Scraper** — website traffic, engagement, and audience data.
- **[Keyword Metrics](https://apify.com/memo23/keyword-metrics)** — Google & Bing search volume, CPC, competition, difficulty & ~93 months of history, 1000 keywords per run.
- Browse the full store profile for more SEO and directory scrapers.

### 🤖 For AI Agents & LLM Apps

Compact reference for AI agents calling this actor via the [Apify MCP server](https://mcp.apify.com) or the Apify API (actor: `memo23/ahrefs-scraper`).

**Purpose:** scrape Ahrefs' free SEO tools with no Ahrefs account — domains/URLs return Domain Rating, backlinks, broken links and organic traffic; keywords return ideas, difficulty, SERP and rank; brands return AI-visibility citations.

**Minimal input:**

```json
{ "urls": ["apify.com"], "maxItems": 50 }
```

Keyword mode: `{ "keywords": ["seo tools"], "country": "us" }` · Brand AI-visibility: `{ "brands": ["Apify"] }` — `urls`, `keywords`, and `brands` can be combined in one run.

**Output:** one flat row per data point, tagged with `rowType` (`backlinks_overview`, `backlink`, `broken_link`, `website_authority`, `traffic_overview`, `sitemap`, `sitemap_url`, `competitor`, `similarly_ranked`, `keyword_idea`, `keyword_difficulty`, `serp_result`, `keyword_rank`, `ai_visibility`, `ai_overviews`, `ai_mode`, `top_website`). Common fields: `domainRating, backlinks, refDomains, sourceUrl, targetUrl, anchor, httpCode, monthlyOrganicTraffic, monthlyTrafficValue, trafficHistory[], topPages[], topCountries[], urlCount, lastmod, pages, seedKeyword, keyword, difficultyLabel, volumeLabel, difficulty, position, urlRating, topPosition, totalAiCitations, citationsByModel[], topCitedDomains[], totalMentions, topCitedPages[], rank, monthlyVisits`.

**Behaviors an agent should know:**

- Website datasets are toggles: `includeBacklinks` and `includeKeywordIdeas` default on; enable `includeBrokenLinks`, `includeTraffic`, `includeSerpOverview`, `includeKeywordDifficulty`, etc. as needed. Each enabled dataset adds run time per URL/keyword (the backlinks list comes with the overview), so enable only what you need.
- Cap output with `maxItems` (total rows, default 10000) plus per-target `maxBacklinks`/`maxKeywordIdeas`/`maxSerpResults` (default 100 each) — set low to bound cost.
- `mode` scopes URL datasets (`exact`, `subdomains`, `prefix`, `domain`); `rankDomain` adds a rank check to each keyword; `searchEngine` picks the keyword engine (Google default, includes AI engines).
- `includeTopWebsites` is a global dataset that runs once per run, independent of `urls`/`keywords`; filter with `topWebsitesCategory`/`topWebsitesCountry`.
- No Ahrefs account, API key, or cookies required; the default proxy setting works out of the box.
- Pay-per-event billing — see the Pricing tab on the actor page.

### ⚠️ Disclaimer

This actor extracts data made publicly available by Ahrefs' free online tools (ahrefs.com) and the public Ahrefs top-websites ranking (ahrefstop.com). It does not access any account-gated or paid Ahrefs data, and it is not affiliated with, endorsed by, or sponsored by Ahrefs. "Ahrefs" is a trademark of its respective owner and is used here only to describe the data source. Use the collected data in compliance with Ahrefs' terms, applicable laws (including copyright and data-protection rules such as GDPR/CCPA), and only for legitimate purposes. You are responsible for how you use the output.

### SEO keywords

Ahrefs scraper, Ahrefs API, Ahrefs free tools scraper, Domain Rating checker, backlink checker, backlinks scraper, referring domains, broken link checker, organic traffic checker, keyword research tool, keyword difficulty checker, keyword ideas, SERP checker, keyword rank checker, AI visibility checker, AI citations, SEO data extraction, bulk domain analysis, competitor backlink analysis, DR checker, SEO scraper, Apify SEO actor, top websites ranking, most visited websites, Ahrefs top websites, website ranking by category, top sites by country, sitemap generator, sitemap URL extractor, competitor finder, similar websites, Google AI Overviews tracker, AI Mode tracker, keyword difficulty score.

# Actor input Schema

## `urls` (type: `array`):

Domains or URLs (e.g. `apify.com`) — each returns Domain Rating, backlinks, broken links, and organic-traffic data (per the Website datasets toggles).

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

Seed keywords — each returns keyword ideas, difficulty, SERP overview, and (with a rank domain) a rank check.

## `brands` (type: `array`):

Brand names — each returns AI-visibility citations across ChatGPT, Gemini, Perplexity, Copilot, Grok, and Google AI. Turn on AI Overviews or AI Mode below for Google mention counts.

## `includeAiOverviews` (type: `boolean`):

For each brand: how many Google AI Overviews mention it, the monthly change, cited pages, and the citation timeline. Adds run time per brand.

## `includeAiMode` (type: `boolean`):

For each brand: how many Google AI Mode answers mention it, the monthly change, cited pages, and the citation timeline. Adds run time per brand.

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

Two-letter country code for keyword & traffic datasets, e.g. `us`, `gb`, `de`, `in`.

## `mode` (type: `string`):

How to scope backlinks / broken links / traffic for a URL. `subdomains` = the domain and its subdomains; `exact` = the single URL; `prefix` = all pages under the path; `domain` = the whole domain.

## `protocol` (type: `string`):

Protocol for the traffic dataset.

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

Search engine for keyword ideas. Includes AI engines.

## `rankDomain` (type: `string`):

When set, each keyword also returns where this domain ranks for it (best organic position). Leave empty to skip rank checks.

## `includeBacklinks` (type: `boolean`):

Domain Rating, total backlinks, referring domains, and dofollow split.

## `includeBacklinksList` (type: `boolean`):

The individual top backlinks — source page URL, target URL, anchor text, source Domain Rating, and HTTP status. Fetched together with the backlinks overview.

## `includeWebsiteAuthority` (type: `boolean`):

A standalone Domain Rating + backlink-count row. Redundant if the backlinks overview is on (which already includes DR).

## `includeBrokenLinks` (type: `boolean`):

Broken inbound links pointing at the target — source page, anchor, HTTP status, and source Domain Rating.

## `includeTraffic` (type: `boolean`):

Estimated monthly organic traffic & value, 12-month traffic history, and top pages / countries / keywords.

## `includeSitemap` (type: `boolean`):

Sitemap URLs for each domain (host, counts, and up to the cap below of URL + last-modified rows).

## `maxSitemapEntries` (type: `integer`):

Cap on individual sitemap URL rows per site. Ahrefs itself stops around 1000.

## `includeCompetitors` (type: `boolean`):

Top competing websites and similarly ranked sites from ahrefstop.com. Only present when Ahrefs lists the domain there.

## `includeKeywordIdeas` (type: `boolean`):

Related keyword ideas — each with a difficulty label and search-volume band.

## `includeQuestionIdeas` (type: `boolean`):

Also include question-style keyword ideas (what / how / why …) alongside the keyword ideas.

## `includeKeywordDifficulty` (type: `boolean`):

Numeric keyword difficulty (0–100) plus the live SERP — organic results with Domain Rating, URL Rating, traffic, and referring-domain metrics. Volume and CPC stay as labels on keyword ideas; the free checker does not return those as numbers.

## `includeSerpOverview` (type: `boolean`):

The full SERP for a keyword — every organic result with its position, Domain Rating, URL Rating, estimated traffic, and top keyword.

## `includeTopWebsites` (type: `boolean`):

Scrape the Ahrefs top-websites list (rank, domain, category, estimated monthly visits, and change).

## `topWebsitesCategory` (type: `string`):

Filter the ranking by category slug, e.g. `finance`, `shopping`, `news`, `health`, `arts-and-entertainment`. Leave empty for all categories.

## `topWebsitesCountry` (type: `string`):

Filter the ranking by country slug, e.g. `united-kingdom`, `india`, `canada`. Combines with the category filter. Leave empty for worldwide.

## `topWebsitesLimit` (type: `integer`):

Cap on top-website rows. The worldwide list paginates (100/page); category/country-filtered lists are roughly a single page.

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

Cap on individual backlink and broken-link rows collected per URL.

## `maxKeywordIdeas` (type: `integer`):

Cap on keyword-idea rows collected per seed keyword.

## `maxSerpResults` (type: `integer`):

Cap on SERP-result rows collected per keyword (difficulty + SERP overview).

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

Hard cap on the total number of rows across all inputs.

## `maxConcurrency` (type: `integer`):

How many workers run in parallel. Higher is faster; lower it if runs slow down or fail.

## `proxy` (type: `object`):

Residential proxies recommended. The default works out of the box; to use your own proxies, turn off Apify Proxy and paste their URLs.

## Actor input object example

```json
{
  "urls": [
    "apify.com"
  ],
  "keywords": [
    "seo tools"
  ],
  "includeAiOverviews": false,
  "includeAiMode": false,
  "country": "us",
  "mode": "subdomains",
  "protocol": "both",
  "searchEngine": "Google",
  "includeBacklinks": true,
  "includeBacklinksList": false,
  "includeWebsiteAuthority": false,
  "includeBrokenLinks": false,
  "includeTraffic": false,
  "includeSitemap": false,
  "maxSitemapEntries": 100,
  "includeCompetitors": false,
  "includeKeywordIdeas": true,
  "includeQuestionIdeas": false,
  "includeKeywordDifficulty": false,
  "includeSerpOverview": false,
  "includeTopWebsites": false,
  "topWebsitesLimit": 100,
  "maxBacklinks": 100,
  "maxKeywordIdeas": 100,
  "maxSerpResults": 100,
  "maxItems": 50,
  "maxConcurrency": 3,
  "proxy": {
    "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 = {
    "urls": [
        "apify.com"
    ],
    "keywords": [
        "seo tools"
    ],
    "maxItems": 50,
    "proxy": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("memo23/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 = {
    "urls": ["apify.com"],
    "keywords": ["seo tools"],
    "maxItems": 50,
    "proxy": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("memo23/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 '{
  "urls": [
    "apify.com"
  ],
  "keywords": [
    "seo tools"
  ],
  "maxItems": 50,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call memo23/ahrefs-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,memo23/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/AKcnO7qSh8NFiJ2Yp/builds/yKQbNl50ECJHJAwwO/openapi.json
