# Ahrefs Scraper - Domain Rating, Traffic, Top Websites & AI Rank (`topapi/ahrefs-seo-scraper`) Actor

Scrape Ahrefs website data without an account: Domain Rating, linking websites, organic traffic and value, keywords, ranks, top countries and keywords, competitors, monthly history since 2015, top-websites rankings and AI visibility leaderboards. From $0.045 per 1,000 websites.

- **URL**: https://apify.com/topapi/ahrefs-seo-scraper.md
- **Developed by:** [Top Api](https://apify.com/topapi) (community)
- **Categories:** SEO tools, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.05 / 1,000 websites

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

### What does Ahrefs SEO Scraper do?

**Ahrefs SEO Scraper** reads Ahrefs' public website data for any list of domains: **Domain Rating, linking websites (referring domains), organic search traffic and its dollar value, organic keywords, worldwide / country / category traffic ranks, the top 5 countries, the top 5 keywords, competing websites and the monthly history since 2015**. It also returns Ahrefs' **top-websites rankings** (worldwide top 1,000, 170 countries, 25 categories, monthly climbers and fallers) and the **AI Visibility Index** (the brands ChatGPT, Gemini, Perplexity, Copilot and Google AI Overviews / AI Mode mention most, and the websites they cite most). One row per website, ranking entry or AI leaderboard entry. SEO agencies, link builders, investors and lead-scoring teams use it as an **Ahrefs API alternative**.

- 🏅 **Authority**: Ahrefs Domain Rating and linking websites with the month's change, exact (not "4M").
- 🚦 **Traffic**: exact monthly organic visits, previous month, a year ago, traffic value in USD.
- 🌍 **Countries and keywords**: the 5 countries and 5 keywords that bring the most traffic, with volume, position and changes.
- 🥊 **Competitors**: competing and similarly ranked websites; a paid add-on reads the 10-competitor page with Domain Rating and traffic value.
- 📅 **History**: organic traffic and value per month since June 2015, referring domains per month since April 2015 (137 months for zapier.com).
- 🏆 **Top websites** and 🤖 **AI visibility** leaderboards, 12 months back.
- 🔑 **No Ahrefs account, no API key, no subscription**; domains Ahrefs does not track are listed and never charged.
- 🔔 **Monitor mode**, schedules, API, MCP, Make / Zapier / n8n.

### What data can you get from Ahrefs?

| | | |
|---|---|---|
| 🏅 Domain Rating `domainRating` | 🔗 Linking websites `linkingWebsites` | 🚦 Organic traffic `searchTraffic` |
| 💵 Traffic value `trafficValueUsd` | 🔑 Organic keywords `keywordsCount` | 🌐 Worldwide rank `globalRank` |
| 🗺️ Country rank `countryRank` | 📂 Category + rank `category`, `categoryRank` | 🌍 Top 5 countries `topCountries` |
| 🔎 Top 5 keywords `topKeywords` | 🥊 Competitors `competitors` | 📊 Similarly ranked `similarlyRanked` |
| 📅 Traffic history `trafficHistory` | 📈 Referring-domain history `linkingWebsitesHistory` | 🧾 Name + description `siteTitle`, `description` |
| 🏆 Ranking rows `rank`, `rankChange`, `newEntry` | 🔥 Trending up / down `trendDirection` | 🤖 AI brands + cited websites `label`, `value` |
| 🧩 10 competitors with DR (add-on) `competitorDetails` | 🕷️ AhrefsBot crawl status (add-on) `crawlStatus` | 🔔 Changes since last run `changeSinceLastRun` |

### How to scrape Ahrefs with Ahrefs SEO Scraper

1. [Create a free Apify account](https://console.apify.com/sign-up) (it comes with free monthly credit).
2. Open **Ahrefs SEO Scraper** and type your **Domains or URLs**, one per line (`zapier.com`).
3. Or pick **Top websites: countries** and categories, or **AI leaderboards: platforms**. All of them can run together.
4. Tick the add-ons you want (competitor details, crawl status) and set **Max rows**.
5. Click **Start**, then download the rows as JSON, CSV or Excel, or read them through the API.

### Input

| Parameter | Type | Description |
|---|---|---|
| **🌐 Websites** | | |
| `domains` | array | Domains, website URLs or Ahrefs / AhrefsTop pages (website, competitors or ranking pages). `www.`, case and paths are normalised. |
| `urlsFromFile` | string | A pasted list (text, CSV, JSON) or a public `.csv` / `.json` / `.txt` link, up to 2 MiB. |
| `allTrackedDomains` | boolean | Every website AhrefsTop tracks (about 200,000, from its sitemaps), up to Max rows. Default `false`. |
| `domainSuffixes`, `excludeKeywords` | array | Keep only `.de`, `.co.uk`...; skip domains containing a word. Free, before any page is read. |
| `includeHistory` | boolean | Monthly traffic, value and referring-domain history. Default `true`, free. |
| `historySince` | string | Keep history from this month (`2024-01`). |
| `includeCompetitorDetails` | boolean | Paid add-on: the 10-competitor page. Default `false`. |
| `includeCrawlStatus` | boolean | Paid add-on: AhrefsBot crawl status. Default `false`. |
| **🏆 Top websites** | | |
| `locations` | array | `worldwide`, `united-states`, `germany`... (170 countries). Empty = no rankings. |
| `topWebsitesCategories` | array | `all`, `finance`, `news`, `shopping`... (25 categories). |
| `topWebsitesMode` | string | `ranking`, `trending` (10 climbers + 10 fallers) or `both`. Default `ranking`. |
| `topWebsitesLimit` | integer | Rows per ranking: worldwide goes to 1,000, every other ranking to 100. Default 100. |
| `enrichTopWebsites` | boolean | Add each ranked website's full data to its row. |
| **🤖 AI leaderboards** | | |
| `aiPlatforms` | array | `all`, `google_ai_overviews`, `google_ai_mode`, `chatgpt`, `gemini`, `perplexity`, `copilot` (`grok`, `claude`: see Limits). |
| `aiMonths` | integer | Months back from the latest, 1-12. Default 1. |
| `aiLeaderboard` | string | `brands`, `sources` or `both`. Default `both`. |
| **🔎 Filters** (before the charge) | | |
| `minDomainRating`, `maxDomainRating`, `minSearchTraffic`, `minLinkingWebsites`, `onlyCategories` | | Rows that miss them are dropped free. |
| **🔔 Monitoring** | | |
| `monitorMode`, `monitorOutput`, `monitorStoreName` | | Only new or changed rows since the last run with the same name. |
| **⚙️ Run options** | | |
| `maxItems` | integer | Rows for the whole run (0 = no limit). Default 500. Add-ons do not count. |
| `maxConcurrency` | integer | Pages in parallel. Default 8. |
| `proxyConfiguration` | object | Optional; by default the actor reads directly and climbs to Apify datacenter, then residential, only when a route is refused. |

Rival field names work too: `urls`, `targets`, `websites`, `startUrls`, `location`, `topWebsitesCountry`, `topWebsitesCategory`, `listMode`, `includeCompetitors`, `includeRobotsStatus`, `onlyNew`, `stateKey`.

#### Input JSON

```json
{
    "domains": ["zapier.com", "semrush.com", "https://www.otodom.pl/"],
    "includeCompetitorDetails": true,
    "locations": ["worldwide"],
    "topWebsitesLimit": 100,
    "aiPlatforms": ["chatgpt"],
    "aiMonths": 3
}
```

#### Give the bare domain, not a page

AhrefsTop keeps one page per registrable domain. `https://www.zapier.com/apps` becomes `zapier.com`; a subdomain it does not list (`docs.github.com`) falls back once to `github.com` and the row says `resolvedFrom`. A few websites are listed under their `www.` host (`www.gov.mv`): give the `www.` form and both are tried.

#### Rankings are pages of 100

The worldwide all-categories ranking goes to 1,000 (ten pages); every country, category and country x category ranking stops at 100, and some are short (the United States finance ranking had 2 rows on 2026-10-28).

### Output

A real website row (`zapier.com`, 2026-10-28; arrays cut to their first entry):

```json
{
  "searchType": "website_details",
  "domain": "zapier.com",
  "siteTitle": "Zapier: Automate your work",
  "domainRating": 91,
  "linkingWebsites": 87196,
  "linkingWebsitesDelta": 980,
  "searchTraffic": 3631009,
  "searchTrafficDelta": 285411,
  "searchTrafficYearAgo": 4241549,
  "trafficValueUsd": 5253565,
  "keywordsCount": 819400,
  "globalRankLabel": ">1000",
  "category": "Computers & Electronics",
  "categoryRank": 95,
  "topCountries": [{ "countryCode": "US", "country": "United States", "traffic": 1248760, "trafficPrevious": 1337676, "share": 0.343 }],
  "topKeywords": [{ "keyword": "chatgpt", "volume": 18900000, "traffic": 121800, "position": 16, "positionChange": 31 }],
  "competitors": [{ "website": "wordstream.com", "traffic": 608000, "trafficDelta": -57500, "pages": 1100 }],
  "similarlyRanked": [{ "website": "youtube.com", "traffic": 3500000000, "rank": 1, "rankChange": 2 }],
  "trafficHistory": [{ "month": "2026-10-01", "searchTraffic": 3631009, "trafficValueUsd": 5253565 }],
  "historyMonths": 137,
  "dataMonth": "2026-10-01",
  "url": "https://ahrefstop.com/websites/zapier.com"
}
```

A ranking row and an AI leaderboard row (same run day):

```json
{ "searchType": "top_websites", "rankingCountry": "Worldwide", "rankingCategory": "Finance", "rankingList": "ranking",
  "rank": 1, "website": "investing.com", "category": "Finance", "searchTraffic": 89000000, "trafficDelta": 3500000, "dataMonth": "2026-10-01" }
{ "searchType": "ai_leaderboard", "platform": "chatgpt", "month": "2026-09-01", "leaderboard": "sources",
  "rank": 1, "label": "wikipedia.org", "website": "wikipedia.org", "url": "https://wikipedia.org", "value": 481262 }
```

#### Fields

Fill measured on 1,000 websites from AhrefsTop's own list (run vYGCapwqJV7vDdsbv, 2026-10-28), 1,020 ranking rows and 1,680 AI rows:

| Field | Fill | Meaning |
|---|---:|---|
| `searchTraffic`, `trafficValueUsd`, `trafficHistory`, `topCountries`, `similarlyRanked` | 100% | exact traffic and value, 5 countries, 5 neighbours |
| `linkingWebsites`, `linkingWebsitesHistory` | 98.6% | referring domains, exact, monthly |
| `domainRating` | 93.8% | Ahrefs DR (small sites carry a decimal, e.g. 2.6) |
| `competitors` | 91.7% | competing websites |
| `searchTrafficYearAgo` | 90.7% | traffic 12 months earlier |
| `topKeywords` | 88.6% | 5 keywords with volume, traffic, position |
| `siteTitle`, `description` | 96.8%, 96.2% | name and Ahrefs' description |
| `globalRankLabel`, `keywordsCount` | 39.1%, 36.5% | printed only for larger websites |
| `globalRank`, `countryRank`, `categoryRank` | 0.8%, 3.2%, 2.2% | only websites inside a published top 1,000 / 100 |
| `competitorDetails`, `crawlStatus` (add-ons) | 100% on 20 of 20 | 10 competitors with DR; AhrefsBot status |
| ranking `rank`, `website`, `searchTraffic` / `category` | 100% / 95.8% | trending rows have no category |
| AI `label`, `value`, `website` / `url` | 100% / 50% | brands have no URL, cited websites do |

`searchType` tells the three row kinds apart; columns that do not apply to a row are absent or `null`.

### Use cases

- 🔗 **Link building**: score outreach lists by Domain Rating and linking websites before you write.
- 🧲 **Lead scoring**: add traffic, value and category to a CRM list of company domains.
- 📊 **Competitor benchmarking**: line up competitors' traffic, value and keywords month by month.
- 💼 **Domain and website due diligence**: read 10 years of traffic history before you buy.
- 🗺️ **Market maps**: the top 100 websites of a country and category, with full data per site.
- 🤖 **AI search (GEO) reporting**: track which brands and sources ChatGPT, Gemini or AI Overviews favour each month.

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

Pay per row, no start fee:

| Event | Price |
|---|---|
| Website row | **$0.000045** ($0.045 per 1,000) |
| Top-websites ranking row | $0.0009 |
| AI leaderboard row | $0.0009 |
| Competitor details (add-on, per website) | $0.000045 |
| AhrefsBot crawl status (add-on, per website) | $0.000045 |

| Run | Rows | Price |
|---|---|---|
| 100 websites | 100 | $0.0045 |
| 1,000 websites + both add-ons | 1,000 | $0.135 |
| Worldwide top 1,000 + trending | 1,020 | $0.918 |
| ChatGPT boards, 12 months | 240 | $0.216 |

A domain AhrefsTop does not track, a filtered row and an unchanged monitor row cost nothing. Cap any run with **Maximum cost per run**; it stops at the cap and says so.

### Integrations, API, scheduling & MCP

- **Schedule** it monthly (Ahrefs updates AhrefsTop once a month) with **Monitor mode** on, and only changed websites come back.
- **Webhooks** send the finished dataset to your app; connect **Make, Zapier, n8n, Google Sheets** or **Slack** from the Integrations tab.
- **API**: run it from [Python](https://apify.com/topapi/ahrefs-seo-scraper/api/python) or [JavaScript](https://apify.com/topapi/ahrefs-seo-scraper/api/javascript) with `apify-client`, or call the REST endpoint.
- **MCP**: add it to Claude, Cursor or any MCP client through the [Apify MCP server](https://apify.com/topapi/ahrefs-seo-scraper/api/mcp).

### More SEO and website scrapers

- [SimilarWeb Scraper](https://apify.com/topapi/similarweb-scraper) - total website traffic, rank and competitors from SimilarWeb.
- [Website Technology Scraper](https://apify.com/topapi/website-technology-scraper) - tech stack, CMS and analytics of a website.
- [Bing Search Scraper](https://apify.com/topapi/bing-search-scraper) - Bing results, ads and People Also Ask.
- [Website Content Crawler](https://apify.com/topapi/website-content-crawler) - a site's pages as clean text and Markdown.

More from [TopApi](https://apify.com/topapi).

### Limits & empty runs

- **Coverage**: AhrefsTop publishes about 200,000 websites. Larger and established sites are there; a small or new site often is not, and comes back in the run summary as not tracked, free.
- **Not in the rows**: URL Rating, backlink totals and lists, broken links, top pages, keyword difficulty, search volume for your own keywords and keyword ideas. Ahrefs serves those only to its free tools after a Cloudflare Turnstile check.
- **Rounded values**: keyword volumes, competitor and ranking traffic are rounded as Ahrefs prints them (`608K`). Traffic, value, linking websites and country traffic on website rows are exact.
- **AI counts** are Ahrefs' live estimates and move a little between reads. Grok and Claude answer with the combined board (Ahrefs does not publish them on their own); those boards are skipped and not charged.
- **Speed**: 1,000 websites took 96 s; the worldwide 1,000 ranking 7 s; 12 months of 7 AI boards 156 s (past months are slow on Ahrefs' side).

### FAQ

#### How much does Ahrefs SEO Scraper cost?

$0.000045 per website row, $0.0009 per ranking or AI leaderboard row, $0.000045 per add-on, no start fee. See the cost table above.

#### How many results can Ahrefs SEO Scraper return?

Up to `maxItems` per run (0 = no limit): any number of your domains, about 200,000 tracked websites with `allTrackedDomains`, 1,000 worldwide ranking rows, 100 per other ranking, 20 rows per AI platform and month.

#### Can I monitor websites with Ahrefs SEO Scraper on a schedule?

Yes. Turn on `monitorMode` and schedule it; a run delivers only websites whose data month, traffic, Domain Rating, linking websites or rank changed, with `changeSinceLastRun`, and rankings' new entries and movers. A row delivered without a part a later run asks for (website data on ranking rows, competitor details, crawl status, history) comes back once with `changeType: "details"` and that part, charged like any delivered row.

#### Does Ahrefs SEO Scraper need an Ahrefs account or API key?

No. It reads Ahrefs' public pages with no login, cookie or key.

#### Why is a domain missing from the results?

AhrefsTop does not track it. The status message counts them and the run summary (key-value store, `RUN_SUMMARY`) lists them; they are never charged.

#### Can I get keyword difficulty or backlinks with Ahrefs SEO Scraper?

Not today: those come only from Ahrefs' free tools behind a Turnstile check. The rows carry Domain Rating, linking websites, top keywords with volume and position, and competitors.

#### Can I use Ahrefs SEO Scraper with the Apify API or an MCP server?

Yes: the API tab has ready Python, JavaScript and cURL calls, and the MCP tab connects it to AI agents.

#### Why did Ahrefs SEO Scraper return no results?

The status message says why: none of the domains are tracked, every row was filtered, nothing changed since the last monitor run, or Ahrefs refused every route (then the run fails and nothing is charged).

#### Your feedback

Found a gap or need a field? Open an issue on the Issues tab and we will look at it.

# Actor input Schema

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

Websites to look up, one per line: a domain (zapier.com), any URL on it (https://www.zapier.com/apps) or an Ahrefs / AhrefsTop page (ahrefs.com/websites/zapier.com, ahrefstop.com/websites/zapier.com/competitors, or a ranking page such as ahrefstop.com/websites/united-states/finance). www., case and paths are normalised; a subdomain AhrefsTop does not list falls back to its parent domain. A domain AhrefsTop does not track is listed in the run summary and never charged.

## `urlsFromFile` (type: `string`):

Paste a list (one domain or URL per line, a CSV whose first domain-looking cell per line is used, or a JSON array), or give a direct public download link to such a file (.csv / .json / .txt, up to 2 MiB).

## `allTrackedDomains` (type: `boolean`):

Read the full list of websites AhrefsTop publishes (about 200,000, from its sitemaps) and deliver a website row for each, up to Max rows. Combine with Domain endings, Exclude domains containing and the filters.

## `domainSuffixes` (type: `array`):

Keep only domains ending with one of these (.de, .co.uk, .fr). Applied before any page is read, at no cost.

## `excludeKeywords` (type: `array`):

Skip any domain whose name contains one of these words (case ignored), e.g. casino. Applied before any page is read, at no cost.

## `includeHistory` (type: `boolean`):

Add the monthly series to each website row: organic traffic and traffic value since June 2015, linking websites (referring domains) since April 2015. Free.

## `historySince` (type: `string`):

Keep only history months from this one on, e.g. 2024-01. Empty = every month.

## `includeCompetitorDetails` (type: `boolean`):

Read each website's AhrefsTop competitors page too: 10 competing websites with Domain Rating, traffic, traffic value, pages, ranks and description. One competitor-details event per website that has them.

## `includeCrawlStatus` (type: `boolean`):

Ask Ahrefs whether AhrefsBot may crawl each website: per host and port, allowed / partially allowed / disallowed, the robots.txt lines and when Ahrefs last checked. One crawl-status event per website Ahrefs has a status for.

## `locations` (type: `array`):

Top-websites rankings to read, by country: worldwide lists up to 1,000 websites, a country up to 100. Every country is read for every category and list type below. Leave empty to skip rankings.

## `topWebsitesCategories` (type: `array`):

Categories of the rankings (empty = all categories).

## `topWebsitesMode` (type: `string`):

The ranking itself, the trending lists (the 10 biggest climbers and 10 biggest fallers of the month), or both.

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

Rows taken from each ranking (worldwide all-categories goes to 1,000; every other ranking to 100).

## `enrichTopWebsites` (type: `boolean`):

Read each ranked website's own page too and add its full website data to the ranking row (charged as one top-website + one website event).

## `aiPlatforms` (type: `array`):

Ahrefs AI Visibility Index: the brands each AI assistant mentions most and the websites it cites most (top 10 each, per month). Leave empty to skip.

## `aiMonths` (type: `integer`):

How many months back from the latest one (1 to 12).

## `aiLeaderboard` (type: `string`):

Brands (names AI assistants mention), sources (websites they cite) or both.

## `minDomainRating` (type: `integer`):

Keep only websites with at least this Domain Rating. Every filter runs before the charge.

## `maxDomainRating` (type: `integer`):

Keep only websites with at most this Domain Rating.

## `minSearchTraffic` (type: `integer`):

Keep only websites with at least this many monthly organic search visits.

## `minLinkingWebsites` (type: `integer`):

Keep only websites linked from at least this many websites (referring domains).

## `onlyCategories` (type: `array`):

Keep only websites of these AhrefsTop categories.

## `monitorMode` (type: `boolean`):

Only deliver (and charge) what is new or changed since the last run with the same monitor name: a website when Ahrefs' data month, traffic, Domain Rating, linking websites or worldwide rank changed (with the changes since the last run), a ranking row when it is new to the ranking or moved, an AI leaderboard row when its month is new.

## `monitorOutput` (type: `string`):

What a monitor run delivers.

## `monitorStoreName` (type: `string`):

Named key-value store holding what earlier runs delivered. Give each schedule its own name.

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

Rows for the whole run, all kinds together (0 = no limit). Add-ons do not count as rows.

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

Pages read in parallel.

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

Optional. By default the actor reads directly and climbs to Apify datacenter, then residential, only when a route is refused. Set your own proxy to use it first.

## Actor input object example

```json
{
  "domains": [
    "zapier.com",
    "semrush.com",
    "wikipedia.org"
  ],
  "allTrackedDomains": false,
  "includeHistory": true,
  "includeCompetitorDetails": false,
  "includeCrawlStatus": false,
  "locations": [
    "worldwide"
  ],
  "topWebsitesMode": "ranking",
  "topWebsitesLimit": 10,
  "enrichTopWebsites": false,
  "aiPlatforms": [
    "all"
  ],
  "aiMonths": 1,
  "aiLeaderboard": "both",
  "monitorMode": false,
  "monitorOutput": "changes",
  "monitorStoreName": "ahrefs-seo-monitor",
  "maxItems": 500,
  "maxConcurrency": 8
}
```

# Actor output Schema

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

One item per website, top-websites ranking row or AI leaderboard row (the searchType field says which).

# 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 = {
    "domains": [
        "zapier.com",
        "semrush.com",
        "wikipedia.org"
    ],
    "locations": [
        "worldwide"
    ],
    "topWebsitesLimit": 10,
    "aiPlatforms": [
        "all"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("topapi/ahrefs-seo-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 = {
    "domains": [
        "zapier.com",
        "semrush.com",
        "wikipedia.org",
    ],
    "locations": ["worldwide"],
    "topWebsitesLimit": 10,
    "aiPlatforms": ["all"],
}

# Run the Actor and wait for it to finish
run = client.actor("topapi/ahrefs-seo-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 '{
  "domains": [
    "zapier.com",
    "semrush.com",
    "wikipedia.org"
  ],
  "locations": [
    "worldwide"
  ],
  "topWebsitesLimit": 10,
  "aiPlatforms": [
    "all"
  ]
}' |
apify call topapi/ahrefs-seo-scraper --silent --output-dataset

```

## MCP server setup

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