# Ahrefs Scraper (`parsebird/ahrefs-scraper`) Actor

Scrape Ahrefs SEO data: Domain Rating, backlinks, organic traffic, keyword ideas, keyword difficulty, SERP, rank checks, AI search visibility, competitors and top websites. Export JSON, CSV, Excel.

- **URL**: https://apify.com/parsebird/ahrefs-scraper.md
- **Developed by:** [ParseBird](https://apify.com/parsebird) (community)
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.99 / 1,000 ahrefs 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

Ahrefs Scraper pulls SEO data from [Ahrefs](https://ahrefs.com)' free SEO tools and [AhrefsTop](https://ahrefstop.com/websites) for any website or keyword: Domain Rating, backlinks, organic traffic, keyword ideas, keyword difficulty, SERP results, rank checks, AI search visibility, organic competitors and top website rankings.

<table><tr>
<td style="border-left:4px solid #FF8800;padding:12px 16px;font-weight:600">
Run 14 Ahrefs search types on many domains and keywords in one go, from Domain Rating and top backlinks to Google AI Overview citations, with keyword data for 216 countries and one clean dataset row per lookup.
</td>
</tr></table>

<br>

<table>
<tr>
<td colspan="3" style="padding:10px 14px;background:#FFFFFF;border:1px solid #E7E5E4;border-radius:4px 4px 0 0">
<span style="color:#1C1917;font-size:14px;font-weight:700;letter-spacing:0.5px">ParseBird SEO Suite</span>
<span style="color:#78716C;font-size:13px">&nbsp;&nbsp;&bull;&nbsp;&nbsp;Authority, traffic, backlink &amp; keyword data</span>
</td>
</tr>
<tr>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-top:none;border-right:none;vertical-align:top;width:33%;background:#F5F5F4">
<a href="https://apify.com/parsebird/ahrefs-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">Ahrefs Scraper</a><br>
<span style="color:#1C1917;font-size:11px;font-weight:600">You are here</span>
</td>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-top:none;border-right:none;vertical-align:top;width:33%;background:#FFFFFF">
<a href="https://apify.com/parsebird/similarweb-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">Similarweb Scraper</a><br>
<span style="color:#78716C;font-size:11px">Traffic, ranks, similar sites</span>
</td>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-top:none;vertical-align:top;width:33%;background:#FFFFFF">
<a href="https://apify.com/parsebird/moz-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">MOZ Scraper</a><br>
<span style="color:#78716C;font-size:11px">Domain Authority, PA, Spam Score</span>
</td>
</tr>
<tr>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-top:none;border-right:none;border-radius:0 0 0 4px;vertical-align:top;width:33%;background:#FFFFFF">
<a href="https://apify.com/parsebird/ubersuggest-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">Ubersuggest Scraper</a><br>
<span style="color:#78716C;font-size:11px">Keyword volume, SERP, backlinks</span>
</td>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-top:none;border-right:none;vertical-align:top;width:33%;background:#FFFFFF"></td>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-top:none;border-radius:0 0 4px 0;vertical-align:top;width:33%;background:#FFFFFF"></td>
</tr>
</table>

##### Copy to your AI assistant

Copy this block into ChatGPT, Claude, Cursor, or any LLM to start using this actor.

```text
Ahrefs Scraper (Apify actor parsebird/ahrefs-scraper) returns SEO data from Ahrefs' free tools and AhrefsTop for websites and keywords. Call it with the Apify API client: client.actor("parsebird/ahrefs-scraper").call(run_input={"url": "make.com", "keyword": "ai agent", "include_web_authority": true, "include_traffic": true, "include_backlinks": true, "include_keywords_difficulty": true}). Inputs: url (string, domain or URL), urls (array of strings, bulk), keyword (string), keywords (array of strings, bulk), country (2-letter keyword database code, default "us"), mode ("subdomains" default, "domain", "prefix", "exact"), traffic_country (2-letter code or "" for worldwide), boolean switches include_web_authority (default true), include_traffic (default true), include_backlinks (default true), include_broken_links, include_competitors, include_xml_sitemap, include_keywords, include_keywords_difficulty, include_serp, include_keywords_ranking, include_ai_visibility, include_ai_overview, include_ai_mode, include_top_websites (all default false), category_top_websites (e.g. "all", "business", "news", "shopping"), country_top_websites (e.g. "worldwide", "united-states", "germany"), max_top_websites (1-1000, default 100), proxyConfiguration (optional). Output: one row per lookup with type (authority, traffic, backlinks, broken_links, competitors, xml_sitemap, keywords, keyword_difficulty, serp, keyword_ranking, ai_visibility, ai_overview, ai_mode, top_websites), domain or keyword, data_captured_at and the type's fields such as domain_rating, backlinks, refdomains, organic_traffic_monthly_avg, traffic_history, top_pages, top_keywords, top_backlinks, keyword_ideas, keyword_difficulty, serp_results, domain_position, total_ai_citations, citations_by_model, competitors, websites_rankings. Failed lookups have an error field and are not charged. API docs: https://apify.com/parsebird/ahrefs-scraper/api. Get a token: https://console.apify.com/settings/integrations
```

### What is Ahrefs Scraper?

**Ahrefs Scraper** gets the data behind [Ahrefs' free SEO tools](https://ahrefs.com/free-seo-tools) (Website Authority Checker, Website Traffic Checker, Backlink Checker, Broken Link Checker, Keyword Generator, Keyword Difficulty Checker, SERP Checker, Keyword Rank Checker, AI Visibility Checker, AI Overviews Tracker, AI Mode Tracker and Sitemap Generator) plus the public [AhrefsTop](https://ahrefstop.com/websites) website rankings, and returns it as structured JSON.

Use it as an **Ahrefs API alternative** for quick SEO checks at scale: no Ahrefs account, no API key and no browser work on your side. Type a domain such as `make.com` and a keyword such as `ai agent`, click **Start**, and download **Domain Rating, backlinks and organic traffic** as JSON, CSV or Excel about a minute later.

### What can Ahrefs Scraper do?

- 🔗 **Website authority and backlinks**: Domain Rating (DR), total backlinks, referring domains, dofollow metrics and the top 20 backlinks with anchor text, source page and the linking site's DR.
- 📈 **Organic traffic**: monthly average organic traffic and traffic value, recent traffic history, top pages, top countries and top keywords. Sites listed on AhrefsTop also get monthly traffic history going back years, exact traffic by country, organic keyword count and traffic rank.
- 🔑 **Keyword research**: keyword ideas and question ideas with difficulty and volume range, Keyword Difficulty (0 to 100), SERP results with Ahrefs page metrics, and where your domain ranks for a keyword.
- 🤖 **AI search visibility**: citations across ChatGPT, Gemini, Perplexity, Copilot, Grok, Google AI Overviews and Google AI Mode, with top cited domains, pages and topics.
- 🏆 **Competitors and top websites**: organic competitors of a site, and the AhrefsTop ranking of the top 1,000 websites worldwide or the top 100 by country and category, with trending up and trending down lists.
- 🧰 **Site checks**: broken inbound and outbound links, and up to 1,000 URLs from the site's sitemap as Ahrefs crawled it.
- 📦 **Bulk runs**: add many URLs and keywords; every search type you switch on runs for each one.

As an Apify Actor it also gives you [scheduling](https://docs.apify.com/platform/schedules) for weekly SEO monitoring, a [REST API](https://docs.apify.com/api/v2), [integrations](https://apify.com/integrations) with Google Sheets, Zapier, Make, Slack and webhooks, and exports to JSON, CSV, Excel, XML and HTML.

### What data can you extract from Ahrefs?

| Search type (`type`) | Needs | Main fields |
|-------|-------|-------------|
| `authority` | URL or domain | `domain_rating`, `backlinks`, `refdomains`, `dofollow_backlinks`, `dofollow_refdomains` |
| `traffic` | URL or domain | `organic_traffic_monthly_avg`, `traffic_value_monthly_avg_usd`, `traffic_history`, `top_pages`, `top_countries`, `top_keywords`, plus `traffic_history_all_time`, `traffic_by_country`, `traffic_rank`, `organic_keywords` for AhrefsTop sites |
| `backlinks` | URL or domain | `total_backlinks`, `total_referring_domains`, `top_backlinks` (anchor, source URL, target URL, DR, surrounding text), `referring_domains_history` |
| `broken_links` | URL or domain | `broken_links_inbound`, `broken_links_outbound` with HTTP codes and totals |
| `competitors` | URL or domain | `competitors` (domain, traffic, traffic change, pages) |
| `xml_sitemap` | URL or domain | `xml_sitemap_entries` (URL, last modified), `xml_sitemap_crawled_total` |
| `keywords` | Keyword | `keyword_ideas`, `keyword_ideas_questions` (difficulty label, volume range), totals |
| `keyword_difficulty` | Keyword | `keyword_difficulty`, `referring_domains_needed`, `serp_results` |
| `serp` | Keyword | `serp_results` (position, type, title, URL, page metrics) |
| `keyword_ranking` | Keyword + URL | `domain_position`, `domain_found`, `domain_top_result`, `keyword_ranking_results` |
| `ai_visibility` | Keyword or brand | `total_ai_citations`, `citations_by_model`, `monthly_citations_by_model`, `top_cited_domains`, `top_cited_pages`, `top_topics` |
| `ai_overview` / `ai_mode` | Keyword or brand | total mentions, monthly change, `ai_overview_citations_history`, `ai_mode_citations_history`, top cited domains and pages |
| `top_websites` | Category + country | `websites_rankings` (rank, rank change, domain, categories, traffic), `website_rankings_trending_up`, `website_rankings_trending_down` |

SERP page metrics include Ahrefs rank, Domain Rating, URL Rating, referring pages, referring domains, traffic, traffic value, keywords, top keyword and word count where Ahrefs has them.

### How to scrape Ahrefs data

1. Open [Ahrefs Scraper](https://apify.com/parsebird/ahrefs-scraper) in Apify Console.
2. Enter a **URL or domain**, a **Keyword**, or both. Add more in **More URLs or domains** and **More keywords** for bulk runs.
3. Pick the **Keyword country** and the **Search scope** (subdomains, domain, path prefix or exact URL).
4. Switch on the search types you need. Website authority, traffic and backlinks are on by default.
5. For a top websites list, switch on **Top websites ranking** and choose a category and country.
6. Click **Start**.
7. Download the results from the **Output** tab as JSON, CSV, Excel, XML or HTML, or read them through the [API](https://apify.com/parsebird/ahrefs-scraper/api).

### Input parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `url` | string | No\* | — | Website, domain or page, e.g. `make.com` |
| `urls` | array of strings | No\* | — | More websites for bulk analysis |
| `keyword` | string | No\* | — | Keyword, topic or brand, e.g. `ai agent` |
| `keywords` | array of strings | No\* | — | More keywords |
| `country` | string | No | `us` | Keyword database country (216 countries) |
| `mode` | string | No | `subdomains` | `subdomains`, `domain`, `prefix` or `exact` |
| `traffic_country` | string | No | worldwide | Limit traffic top pages and keywords to one country |
| `include_web_authority` | boolean | No | `true` | Domain Rating and backlink totals |
| `include_traffic` | boolean | No | `true` | Organic traffic data |
| `include_backlinks` | boolean | No | `true` | Backlink totals and top backlinks |
| `include_broken_links` | boolean | No | `false` | Broken inbound and outbound links |
| `include_competitors` | boolean | No | `false` | Organic competitors (AhrefsTop sites) |
| `include_xml_sitemap` | boolean | No | `false` | Up to 1,000 crawled sitemap URLs |
| `include_keywords` | boolean | No | `false` | Keyword ideas and questions |
| `include_keywords_difficulty` | boolean | No | `false` | Keyword Difficulty and SERP |
| `include_serp` | boolean | No | `false` | Top Google results |
| `include_keywords_ranking` | boolean | No | `false` | Your position for each keyword |
| `include_ai_visibility` | boolean | No | `false` | AI citations in ChatGPT, Gemini, Perplexity, Copilot, Grok and Google AI features |
| `include_ai_overview` | boolean | No | `false` | Google AI Overviews mentions |
| `include_ai_mode` | boolean | No | `false` | Google AI Mode mentions |
| `include_top_websites` | boolean | No | `false` | AhrefsTop top websites ranking |
| `category_top_websites` | string | No | `all` | Category, e.g. `business`, `news`, `shopping`, `health` |
| `country_top_websites` | string | No | `worldwide` | Country, e.g. `united-states`, `united-kingdom`, `germany` |
| `max_top_websites` | integer | No | 100 | Websites to return (up to 1,000 worldwide) |
| `proxyConfiguration` | object | No | off | Not needed in most cases |

\* Website search types need a URL, keyword search types need a keyword, keyword ranking needs both. AI search types use the keyword, or the domain when no keyword is given. Top websites needs neither.

### Output example

One row per lookup. A website authority row and a keyword difficulty row (SERP shortened):

```json
[
  {
    "data_captured_at": "2026-10-06T13:33:11.634364",
    "type": "authority",
    "domain": "make.com",
    "url": "make.com",
    "mode": "subdomains",
    "domain_rating": 90.0,
    "backlinks": 3666513,
    "refdomains": 44105,
    "dofollow_backlinks": 95,
    "dofollow_refdomains": 83
  },
  {
    "data_captured_at": "2026-10-06T13:41:02.118204",
    "type": "keyword_difficulty",
    "keyword": "ai agent",
    "country": "us",
    "keyword_difficulty": 80,
    "referring_domains_needed": 353,
    "serp_results": [
      {
        "position": 2,
        "position_with_metrics": 1,
        "type": "organic",
        "title": "What is an AI agent?",
        "url": "https://www.cloudflare.com/learning/ai/what-is-agentic-ai/",
        "metrics": {
          "rank": 96,
          "domain_rating": 94,
          "url_rating": 8,
          "refpages": 358,
          "domains": 151,
          "traffic": 0,
          "cost": 109,
          "keywords": 2,
          "top_keyword": "agents ai",
          "top_volume": 450
        }
      }
    ],
    "serp_source": "Cache",
    "serp_last_updated": "2026-10-03T16:33:21Z"
  }
]
```

A traffic row (lists shortened):

```json
{
  "type": "traffic",
  "domain": "make.com",
  "traffic_country": "worldwide",
  "organic_traffic_monthly_avg": 1017028,
  "traffic_value_monthly_avg_usd": 1320063.44,
  "traffic_history": [{ "date": "2026-09-01", "organic": 446407 }, { "date": "2026-10-01", "organic": 1021273 }],
  "top_pages": [{ "url": "https://community.make.com/t/make-com-feature-unavailable-facebook-login/96177", "traffic": 430284, "share": 98.28 }],
  "top_countries": [{ "country": "za", "share": 42.77 }],
  "top_keywords": [{ "keyword": "facebook login", "position": 2, "traffic": 427000 }],
  "listed_on_ahrefstop": true,
  "traffic_rank": [{ "scope": "Hobbies & Leisure", "rank": 24, "rank_change": 109 }],
  "latest_month_organic_traffic": 907700,
  "organic_keywords": 150400,
  "traffic_by_country": [{ "country": "IN", "traffic": 575897, "traffic_last_month": 80939, "traffic_share": 0.634 }],
  "ahrefstop_url": "https://ahrefstop.com/websites/make.com"
}
```

Download the dataset in JSON, CSV, Excel, XML or HTML from the Output tab.

### How much does it cost to scrape Ahrefs?

Ahrefs Scraper uses pay-per-event pricing. You pay for each result row saved to the dataset. Compute and proxy costs are included in the price.

| Event | Free plan | Bronze | Silver | Gold |
|-------|-----------|--------|--------|------|
| `result` (one search type for one domain or keyword) | **$8.99** / 1,000 | **$7.99** / 1,000 | **$6.99** / 1,000 | **$4.99** / 1,000 |

A run with one domain and the three default search types (authority, traffic, backlinks) saves 3 rows and costs about $0.027 on the Free plan. Checking authority, traffic and backlinks for 100 domains is 300 rows, about $2.70. A top websites list counts as one row, even with 1,000 websites inside. Lookups that fail are saved with an `error` field and are not charged. You can set a maximum cost per run in the run options, and the actor stops when it is reached.

### How does Ahrefs Scraper work?

1. Reads your URLs, keywords and switches and plans one lookup per search type and target.
2. Opens a short browser session on ahrefs.com to pass Ahrefs' visitor check, then closes it.
3. Calls the same data endpoints that Ahrefs' free tools use, a few at a time.
4. Adds AhrefsTop data (long traffic history, traffic by country, competitors, rankings) for websites listed there.
5. Cleans the responses into flat rows with snake_case field names and saves them to the dataset.

### FAQ

**Do I need an Ahrefs account or API key?**
No. The actor uses Ahrefs' free tools and AhrefsTop, which work without logging in.

**How is this different from the Ahrefs API?**
Ahrefs' official API needs a paid Ahrefs plan. This actor returns what the free tools show: top results, top backlinks, top pages and summary metrics. It's a good fit for quick DR checks, traffic snapshots, keyword difficulty checks and AI visibility across many domains or keywords, with Apify scheduling and integrations on top.

**Why are competitors or the long traffic history missing for my site?**
Those come from AhrefsTop, which lists roughly the top websites by organic traffic. Smaller sites still get authority, traffic, backlinks and keyword data from Ahrefs' free tools. A competitors lookup for a site that isn't listed returns an uncharged row with an `error` field.

**What do the search scope modes mean?**
`subdomains` covers the domain and all subdomains, `domain` covers the domain without subdomains, `prefix` covers every URL that starts with the path you entered, and `exact` covers only that URL. Use `exact` for a single page.

**Which countries are supported?**
Keyword ideas, keyword difficulty, SERP and keyword ranking support 216 country databases. Top websites rankings support 170 countries plus worldwide.

**How fresh is the data?**
It's whatever Ahrefs shows at the moment of the run. Each SERP row includes `serp_last_updated`, and `data_captured_at` marks when the row was saved.

**Can I run it on a schedule?**
Yes. Use [Apify schedules](https://docs.apify.com/platform/schedules) to track DR, traffic or AI citations weekly and send the results to Google Sheets, Slack or a webhook.

**How do I use the Ahrefs Scraper API in Python?**

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("parsebird/ahrefs-scraper").call(run_input={
    "urls": ["make.com", "zapier.com"],
    "keyword": "workflow automation",
    "include_keywords_difficulty": True,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["type"], item.get("domain") or item.get("keyword"), item.get("domain_rating"))
```

**How do I use it in JavaScript?**

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

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('parsebird/ahrefs-scraper').call({
    url: 'make.com',
    keyword: 'ai agent',
    include_ai_visibility: true,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

**Something is missing or broken. What should I do?**
Open an issue on the [Issues tab](https://apify.com/parsebird/ahrefs-scraper/issues). Feedback and feature requests are welcome.

### Is it legal to scrape Ahrefs?

Ahrefs Scraper only collects data that Ahrefs shows publicly in its free tools and on AhrefsTop, without logging in. It doesn't collect personal data. You are responsible for how you use the data, including following Ahrefs' terms and applicable laws in your jurisdiction. If you're unsure, ask a lawyer. Read more in Apify's post on [whether web scraping is legal](https://blog.apify.com/is-web-scraping-legal/).

### Other ParseBird scrapers

| Actor | What it does |
|-------|-------------|
| [Google Ads Transparency Center Scraper](https://apify.com/parsebird/google-ads-transparency-scraper) | Ads that any advertiser runs on Google |
| [Website Contact Finder](https://apify.com/parsebird/website-contact-finder) | Emails, phones and social links from websites |
| [Pinterest Keywords Discovery Tool](https://apify.com/parsebird/pinterest-keywords-discovery-tool) | Keyword ideas from Pinterest search |
| [SocialBlade Scraper](https://apify.com/parsebird/socialblade-scraper) | Creator stats and growth for YouTube, TikTok, Instagram, Twitch, Facebook |
| [TikTok Trends Scraper](https://apify.com/parsebird/tiktok-trends-scraper) | Trending hashtags, songs, creators and videos on TikTok |
| [Shopify Store Leads Scraper](https://apify.com/parsebird/shopify-store-leads-scraper) | Shopify stores with contact details |

# Changelog

This Actor's version history is a separate document: https://apify.com/parsebird/ahrefs-scraper/changelog.md

# Actor input Schema

## `url` (type: `string`):

Enter one website, domain or page to analyze, e.g. <code>make.com</code> or <code>https://www.make.com/en/pricing</code>. Used by authority, traffic, backlinks, broken links, competitors, sitemap and keyword ranking.

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

Add more websites for bulk analysis. Every search type you switch on runs for each one.

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

Enter a keyword, topic or brand, e.g. <code>ai agent</code>. Used by keyword ideas, keyword difficulty, SERP, keyword ranking and the AI search tools.

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

Add more keywords for bulk keyword research.

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

Country database for keyword ideas, keyword difficulty, SERP and keyword ranking.

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

How Ahrefs matches the URL. <b>Subdomains</b> = the domain with all its subdomains (*.domain.com/*). <b>Domain</b> = the domain without subdomains. <b>Prefix</b> = every URL that starts with the path. <b>Exact</b> = only that exact URL.

## `include_web_authority` (type: `boolean`):

Domain Rating, backlinks, referring domains and dofollow metrics.

## `include_traffic` (type: `boolean`):

Organic traffic, traffic value, traffic history, top pages, top countries and top keywords. Sites listed on AhrefsTop also get all-time monthly history, exact traffic by country and traffic rank.

## `include_backlinks` (type: `boolean`):

Backlink and referring-domain totals plus the top 20 backlinks with anchor text, source page and Domain Rating.

## `include_broken_links` (type: `boolean`):

Broken inbound links (links to 404 pages on the site) and broken outbound links found on the site.

## `include_competitors` (type: `boolean`):

Top competing websites with traffic and page counts. Only for sites listed on AhrefsTop (roughly the top sites by organic traffic).

## `include_xml_sitemap` (type: `boolean`):

Up to 1,000 URLs Ahrefs has crawled for the site, with last-modified dates.

## `traffic_country` (type: `string`):

Optional. Limit top pages and top keywords in the traffic results to one country. Leave empty for worldwide.

## `include_keywords` (type: `boolean`):

Keyword ideas and question ideas with difficulty and volume range.

## `include_keywords_difficulty` (type: `boolean`):

Ahrefs Keyword Difficulty (0-100), estimated referring domains needed for the top 10, and the SERP with page metrics.

## `include_serp` (type: `boolean`):

Top Google results for the keyword: organic results, AI Overview, discussions, videos and other SERP features, with Ahrefs metrics for the top pages.

## `include_keywords_ranking` (type: `boolean`):

Where each URL or domain ranks for each keyword, plus the SERP with your results marked.

## `include_ai_visibility` (type: `boolean`):

AI citations for the keyword or brand across ChatGPT, Gemini, Perplexity, Copilot, Grok, Google AI Overviews and AI Mode, with top cited domains, pages and topics. Uses the domain when no keyword is given.

## `include_ai_overview` (type: `boolean`):

Google AI Overview mentions for the keyword or brand, monthly citation history, top cited domains and pages.

## `include_ai_mode` (type: `boolean`):

Google AI Mode mentions for the keyword or brand, monthly citation history, top cited domains and pages.

## `include_top_websites` (type: `boolean`):

AhrefsTop ranking of the most visited websites by organic search traffic, plus trending up and down sites.

## `category_top_websites` (type: `string`):

Category of the top websites ranking.

## `country_top_websites` (type: `string`):

Country of the top websites ranking.

## `max_top_websites` (type: `integer`):

How many ranked websites to return. Worldwide with all categories goes up to 1,000; country or category rankings have up to 100.

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

Not needed in most cases. Use a proxy only if lookups start failing.

## Actor input object example

```json
{
  "url": "make.com",
  "keyword": "ai agent",
  "country": "us",
  "mode": "subdomains",
  "include_web_authority": true,
  "include_traffic": true,
  "include_backlinks": true,
  "include_broken_links": false,
  "include_competitors": false,
  "include_xml_sitemap": false,
  "traffic_country": "",
  "include_keywords": false,
  "include_keywords_difficulty": false,
  "include_serp": false,
  "include_keywords_ranking": false,
  "include_ai_visibility": false,
  "include_ai_overview": false,
  "include_ai_mode": false,
  "include_top_websites": false,
  "category_top_websites": "all",
  "country_top_websites": "worldwide",
  "max_top_websites": 100,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (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 = {
    "url": "make.com",
    "keyword": "ai agent"
};

// Run the Actor and wait for it to finish
const run = await client.actor("parsebird/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 = {
    "url": "make.com",
    "keyword": "ai agent",
}

# Run the Actor and wait for it to finish
run = client.actor("parsebird/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 '{
  "url": "make.com",
  "keyword": "ai agent"
}' |
apify call parsebird/ahrefs-scraper --silent --output-dataset

```

## MCP server setup

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