# SEO Data Scraper for Ahrefs - Domain Rating, Traffic & Links (`scrapesage/ahrefs-scraper`) Actor

Scrape Ahrefs public Top-Websites data for any domain: Domain Rating, organic search traffic, traffic value in USD, organic keyword count, linking websites with monthly change, top keyword, top country and organic competitors. Independent tool, not affiliated with Ahrefs.

- **URL**: https://apify.com/scrapesage/ahrefs-scraper.md
- **Developed by:** [Scrape Sage](https://apify.com/scrapesage) (community)
- **Categories:** SEO tools, Agents, Integrations
- **Features:** Limited permissions
- **Stats:** 80 total users, 34 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 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

## SEO Data Scraper for Ahrefs - Domain Rating, Traffic & Links

> **Disclaimer:** This Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by Ahrefs or any of its subsidiaries. All trademarks mentioned are the property of their respective owners. "Ahrefs" is referenced only to describe the publicly available website this Actor collects data from.

Turn any list of domains into a clean SEO table built on **Ahrefs' own numbers**: Domain Rating, organic keyword count, and organic search traffic, **traffic value in dollars** and linking websites with their monthly change. You also get the site's title and description, its worldwide, country and category rank, the top 5 keywords, the top 5 countries, up to 5 organic competitors and the **month-by-month history** of traffic, traffic value and linking websites.

**No Ahrefs subscription. No API key. No browser.** It reads Ahrefs' free, public **Top Websites** pages (`ahrefs.com/websites/<domain>`, which Ahrefs redirects to `ahrefstop.com`), one page per domain.

### What you get for every domain

| Data | Included |
| --- | --- |
| **Domain Rating (DR)** | ✅ |
| Linking websites (referring domains) | ✅ with monthly change and a monthly history |
| Organic search traffic | ✅ with monthly change, rounded as Ahrefs prints it and exact |
| **Traffic value in USD** | ✅ with monthly change, rounded and exact |
| Organic keyword count | ✅ |
| Site title and a description of the site | ✅ (when Ahrefs hides one, `siteTextNote` says why) |
| Worldwide, country and category rank, each with its change | ✅ |
| Top 5 keywords with search volume, traffic, position and their changes | ✅ |
| Top 5 countries with exact visits, the previous month and share | ✅ |
| Up to 5 organic competitors with their traffic and page count | ✅ |
| **Monthly organic traffic and traffic value since 2015** (about 137 months for established sites) | ✅ |

**57 fields per domain.** Domains Ahrefs does not track are reported on the run card and **never charged**.

#### Pairs with Semrush

Ahrefs and Semrush measure different things, and serious research uses both. **Ahrefs `organicTraffic` is organic search traffic only**; the visits figure of [Semrush Scraper](https://apify.com/scrapesage/semrush-scraper) counts all visits, so the two numbers differ by design. Run them side by side for Authority Score, bounce rate, organic vs paid traffic and AI-assistant referrals next to Ahrefs' DR and traffic value.

### Use cases

- **Link-building prospecting**: filter a prospect list by DR and linking websites before outreach.
- **SEO due diligence**: traffic value, DR and the month-by-month traffic history before buying a site.
- **Competitor benchmarking**: DR, traffic, keyword counts and each site's own competitors side by side.
- **Lead scoring**: qualify agency prospects by real organic traffic, with a one-line description of what each site is.
- **Portfolio monitoring**: schedule weekly and watch DR, rank and linking websites move.

### How to use

1. Add your domains under **Domains** (one per line), or paste or link a list under **Import domains from a file**.
2. Hit **Start**.
3. Export JSON, CSV or Excel, or pull the dataset from the API. The Output tab has five views: Website metrics, Site profile, Top keywords & countries, Competitors and Exact monthly figures.

### Input

```json
{
    "domains": ["booking.com", "stripe.com"],
    "includeHistory": true,
    "includeKeywords": true,
    "includeCountries": true,
    "includeCompetitors": true,
    "maxItems": 100
}
```

- **domains**: domains to analyse. Full URLs and Ahrefs links are reduced to the host name (`www.` removed; a site Ahrefs files under its www. host, such as `www.nhs.uk`, is still found). A subdomain stays as typed, because Ahrefs tracks some on their own (`de.wikipedia.org`).
- **startUrls**: paste Ahrefs URLs directly; also accepts the Console's **Link remote text file** option.
- **urlsFromFile**: paste a whole list, or give **one link** to a `.txt`/`.csv`, a Google Sheet, a Drive share or a key-value-store record. Blank lines, `#` comments, CRLF, UTF-8 or UTF-16 files, quotes and extra CSV columns all parse; duplicates are analysed once. A link that is not a text list (a PDF, an Excel file, a Sheet that is not shared publicly) is named on the run card, and no domain is billed for it.
- **includeHistory / includeKeywords / includeCountries / includeCompetitors**: toggle sections. All come from one page load, so turning one off makes the record leaner, not cheaper.
- **outputFields** *(pick-list)*: tick exactly the fields you want; the dropdown lists all 57 with plain-English labels and their exact key.
- **maxItems**: the most domains to analyse in one run, in list order. Domains past it are named on the run card.
- **proxyConfiguration**: Apify datacenter proxy by default; a try that fails is repeated on a new proxy session. If the first 8 domains all fail without a single answer from Ahrefs (a custom proxy that does not work, for example), the run stops there and its card says why, so a broken proxy setting never runs through your whole list.

### Output

One record per domain (`type: "website"`). Real record for booking.com, with the long lists cut to two entries:

```json
{
    "type": "website",
    "domain": "booking.com",
    "url": "https://ahrefstop.com/websites/booking.com",
    "siteTitle": "Booking.com | Official site | The best prices for hotels",
    "siteDescription": "Booking.com is an online platform that aggregates lodging options worldwide, including hotels, apartments, hostels, and other accommodations...",
    "domainRating": 93,
    "linkingWebsites": 256200,
    "linkingWebsitesChange": 1200,
    "organicTraffic": 59800000,
    "organicTrafficChange": -18000000,
    "trafficValueUsd": 16200000,
    "trafficValueChangeUsd": -3700000,
    "organicKeywords": 3000000,
    "globalRank": 66,
    "dataMonth": "October 2026",
    "topCountry": "United States",
    "topCountryVisits": 5400000,
    "topCountryShare": 0.089,
    "topKeyword": "booking",
    "topKeywordPosition": 1,
    "topKeywordCountry": "United States",
    "topKeywordVisits": 553000,
    "competitors": ["expedia.com", "hotels.com", "travelweekly.com", "trivago.com", "tripadvisor.com"],
    "competitorCount": 5,
    "neighbourDomain": "grupogilleon.com",
    "neighbourRank": 65,
    "trafficHistory": [1877318, 2503155, 2707242],
    "trafficHistoryPoints": 137,
    "globalRankChange": -19,
    "category": "Travel",
    "categoryRank": 2,
    "categoryRankChange": -1,
    "organicTrafficExact": 59834661,
    "organicTrafficChangeExact": -18095444,
    "trafficValueUsdExact": 16162455,
    "linkingWebsitesExact": 256173,
    "topCountries": [
        { "country": "United States", "countryCode": "US", "visits": 5356596, "visitsPrevMonth": 5624370, "visitsChange": -267774, "share": 0.089 },
        { "country": "Italy", "countryCode": "IT", "visits": 5057773, "visitsPrevMonth": 7460016, "visitsChange": -2402243, "share": 0.084 }
    ],
    "topCountriesText": "United States 8.9%, Italy 8.4%, Germany 7.5%, Spain 6.5%, United Kingdom 5.8%",
    "topKeywords": [
        { "keyword": "booking", "position": 1, "positionChange": null, "volume": 647000, "volumeChange": -3000, "traffic": 553000, "trafficChange": 369800 },
        { "keyword": "booking.com", "position": 1, "positionChange": null, "volume": 306000, "volumeChange": 11000, "traffic": 84800, "trafficChange": 3000 }
    ],
    "topCompetitors": [
        { "domain": "expedia.com", "traffic": 12800000, "trafficChange": -426300, "pages": 404800 },
        { "domain": "hotels.com", "traffic": 5600000, "trafficChange": -1100000, "pages": 153400 }
    ],
    "trafficHistoryMonthly": [
        { "month": "2026-09", "organicTraffic": 77930105, "trafficValueUsd": 19825660 },
        { "month": "2026-10", "organicTraffic": 59834661, "trafficValueUsd": 16162455 }
    ],
    "linkingWebsitesHistory": [
        { "month": "2026-08", "linkingWebsites": 254986 },
        { "month": "2026-09", "linkingWebsites": 256173 }
    ]
}
```

#### Field guide

- **Headline figures:** `domainRating`, `linkingWebsites`, `organicTraffic`, `trafficValueUsd` and `organicKeywords`. The change fields `linkingWebsitesChange`, `organicTrafficChange` and `trafficValueChangeUsd` are the move since the previous month, empty when Ahrefs shows no change for that month.
- **Exact figures:** `organicTrafficExact`, `trafficValueUsdExact`, `linkingWebsitesExact` and their `...ChangeExact` twins are the unrounded figures of the latest month from the chart data on the same page. A change twin is empty when the chart has no figure for the month before (a few sites' charts skip months).
- **Ranks:** `globalRank` (Ahrefs' worldwide top 1,000 by traffic), `countryRank` + `countryRankCountry`, `category` + `categoryRank`. Rank changes count places moved, positive = up; they are empty when Ahrefs shows no arrow (the rank did not move, or the site is new to the ranking).
- **Keywords:** `topKeyword...` is the keyword sending the most traffic; `topKeywords` lists the top 5 with search volume, traffic and position, for the market in `topKeywordCountry`.
- **Countries:** `topCountry...` is the country sending the most traffic; `topCountries` lists the top 5 with exact visits, the previous month and share of all search traffic.
- **Competitors:** `competitors` lists the domains ranking in the top 10 for the keywords the site gets most of its traffic from; `topCompetitors` adds each one's traffic, change and page count; `topCompetitorsCountry` is the market they were measured in.
- **Nearest ranks:** `neighbourDomain` / `neighbourVisits` / `neighbourRank` and `similarlyRanked` (five sites around it) for sites in the worldwide top 1,000.
- **History:** `trafficHistory` is the organic traffic series of Ahrefs' chart, oldest first. Ahrefs leaves out months it has no figure for, so use `trafficHistoryMonthly` (the same points with their month and traffic value) when dates matter. `linkingWebsitesHistory` is the monthly linking websites.
- **Text note:** `siteTextNote` is set only when `siteTitle` or `siteDescription` is empty because Ahrefs hid it: it shows "Explicit content" in place of some sites' title or description (reddit.com's description, for one), and once left a template slot such as "\[unspecified services]" in its description.
- **Text twins** (`topCountriesText`, `topKeywordsText`, `competitorsText`) put the lists in one readable cell for CSV and Sheets.
- **Page facts:** `dataMonth` is the month the figures describe, `pageDescription` is Ahrefs' own summary sentence of the page, `dateModified` the page date, `scrapedAt` when this run read it.

#### What to expect (field coverage)

Measured on 1 November 2026 on two samples: 118 of the world's most-visited websites, and 34 varied sites (mega-sites, SaaS, retail, news, sites in Japan, Germany, Turkey, Russia and Argentina, and small sites outside Ahrefs' ranking). Smaller sites sit outside more of Ahrefs' rankings, so they carry fewer rank fields.

| Field | 118 top sites | 34 varied sites |
|---|---|---|
| `domainRating`, `linkingWebsites`, `linkingWebsitesChange`, `organicTraffic`, `organicTrafficChange`, `trafficValueUsd`, `organicTrafficExact`, `trafficValueUsdExact`, `linkingWebsitesExact`, `linkingWebsitesChangeExact`, `dataMonth`, top country, `topCountries`, all three histories | 100% | 100% |
| `trafficValueChangeUsd`, `organicTrafficChangeExact`, `trafficValueChangeUsdExact` | 99% | 100% |
| Top keyword, `topKeywords` | 97% | 100% |
| `siteDescription` | 96% | 100% |
| `siteTitle` | 95% | 97% |
| `competitors`, `topCompetitors` | 99% | 97% |
| `organicKeywords` | 97% | 88% |
| `category`, `categoryRank` | 97% | 73% |
| `globalRank`, `neighbour...`, `similarlyRanked` | 100% | 67% |
| `globalRankChange` | 95% | 64% |
| `countryRank` | 90% | 50% |
| `countryRankChange` | 80% | 38% |
| `categoryRankChange` | 63% | 58% |

Why a field is empty: Ahrefs prints the keyword count only for sites in its ranked lists, and the global rank and nearest ranks only for its worldwide top 1,000 by traffic. A rank change is empty when Ahrefs shows no arrow (the rank did not move, or the site is new to that ranking). For a few sites Ahrefs lists no keywords or competitors, or shows "Explicit content" in place of the title or description, and `siteTextNote` then says so.

**Numbers are Ahrefs' own.** The headline fields are the figures Ahrefs prints on the page, abbreviated there (`256.2K`, `$16.2M`) and expanded here to plain numbers, so they are exact to the printed precision. The `...Exact` fields carry the same month unrounded. For sites outside Ahrefs' ranked list the page prints no traffic tiles, so traffic and traffic value come from the page's own figures and chart data, and `dataMonth` is the month of the latest traffic figure Ahrefs has (for a few sites Ahrefs stopped updating, that month can be in the past).

### Automate & schedule

Pair with Apify **Schedules** to re-check a prospect or portfolio list weekly and push to Google Sheets, Slack or your warehouse.

### Use with AI assistants (MCP)

Expose this actor to Claude, ChatGPT or any MCP client via the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp) and ask for SEO metrics in plain language.

### Agent-ready: autonomous payments (x402 & Skyfire)

This actor is **agent-ready**: AI agents can discover it, run it, and **pay for it autonomously**, with no Apify account and no human in the loop. It uses [pay-per-event](https://docs.apify.com/platform/actors/publishing/monetize/pay-per-event) pricing and [limited permissions](https://docs.apify.com/platform/actors/development/permissions), so it qualifies for Apify's agentic-payment standards:

- **[x402](https://docs.apify.com/platform/integrations/x402)**: an open, HTTP-native payment protocol. Agents pay per run in USDC on the Base network directly through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp), with no account and no API key.
- **[Skyfire](https://docs.apify.com/platform/integrations/skyfire)**: agent-to-service payments for fully autonomous AI-agent workflows.

Building an AI agent, MCP tool, or autonomous data pipeline? This scraper is ready to plug in and pay as it goes.

### Pricing

Pay per event: **one charge per website delivered** (one domain's record), at the price shown on this page's Pricing tab. From 16 November 2026, each run also pays a small start fee when it starts: one fee for a run of up to 1 GB of memory (the default), plus one per extra GB; the Pricing tab shows the amount. Domains Ahrefs does not track, domains whose page could not be read and domains a run did not reach are never charged. Set a maximum cost per run (the start fee counts toward it) and the run stops before it fetches a domain the limit cannot pay for, and its run card says so.

### Integrate with any app

Connect the dataset to thousands of apps - no code required:

- **[Make](https://docs.apify.com/platform/integrations/make)** - multi-step automation scenarios.
- **[Zapier](https://docs.apify.com/platform/integrations/zapier)** - push new records straight into your CRM or spreadsheet.
- **[Slack](https://docs.apify.com/platform/integrations/slack)** - get notified when a scheduled run finds something new.
- **[Google Drive / Sheets](https://docs.apify.com/platform/integrations/drive)** - auto-export every run to a spreadsheet.
- **[Airbyte](https://docs.apify.com/platform/integrations/airbyte)** - pipe results into your data warehouse.
- **[GitHub](https://docs.apify.com/platform/integrations/github)** - trigger runs from commits or releases.

### More scrapers from scrapesage

Related Actors in the same category:

- **[Semrush Scraper](https://apify.com/scrapesage/semrush-scraper)** - Traffic, Authority Score, Backlinks & Keywords
- **[Instagram Hashtag Scraper](https://apify.com/scrapesage/instagram-hashtag-scraper)** - Filtered Post Search
- **[Google Play Store Scraper](https://apify.com/scrapesage/google-play-scraper)** - Apps, Reviews & Developer Leads
- **[Keyword Research Scraper](https://apify.com/scrapesage/keyword-research-scraper)** - Google, YouTube, Amazon & More
- **[Google Trends Scraper](https://apify.com/scrapesage/google-trends-scraper)** - Interest, Regions & Trends
- **[Bing Ads Library Scraper](https://apify.com/scrapesage/bing-ads-library-scraper)** - Microsoft Ads Transparency

### FAQ

**Does this need an Ahrefs subscription?** No. It reads only the free Top-Websites pages Ahrefs publishes publicly.

**Why is a domain "not tracked"?** Ahrefs publishes a page only for domains in its index, which leaves out many small or new sites. Use the domain itself (`example.com`, not a page URL); a subdomain is looked up as typed.

**Why do some sites have no global rank?** Ahrefs ranks the top 1,000 sites by traffic worldwide; sites below that show only a category or country rank, or none.

**Why is the traffic number lower than Semrush's?** Different metrics. Ahrefs reports **organic search traffic**; Semrush's visits figure counts all traffic. Both are estimates from each vendor's own model.

**Can I import a big list?** Yes: paste it, link it, or use the Start-URLs *Link remote text file* option. A file that cannot be read is named on the run card, and no domain is billed for it.

**How do I know what happened in a run?** The run card says it: how many domains were delivered, which ones Ahrefs does not track, which ones got no answer, and whether a time limit, a cost limit or a proxy that never answered stopped the run early.

### Disclaimer

**This Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by Ahrefs or any of its subsidiaries. All trademarks mentioned are the property of their respective owners.**

"Ahrefs" and any related marks are the property of their respective owners and are used here only in a descriptive, nominative sense - to identify the publicly accessible website from which this Actor collects data. This Actor is not an official Ahrefs product, is not authorised or certified by Ahrefs, and does not distribute Ahrefs software. It collects only publicly available information; you are responsible for ensuring your use of that data complies with applicable laws, regulations and the terms of the source website.

### Need help?

Open an issue on the actor's **Issues** tab - feature requests genuinely do get built.

***

*Not affiliated with, endorsed by, or sponsored by Ahrefs. "Ahrefs" is a trademark of its respective owner and is used here only to describe what this tool reads. Scrapes public pages only.*

# Actor input Schema

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

Domains to analyse, one per line, e.g. <code>booking.com</code>. Full URLs and Ahrefs links are accepted and reduced to the host name (<code>www.</code> removed, and a site Ahrefs files under its www. host, such as <code>www.nhs.uk</code>, is still found); a subdomain stays as typed, because Ahrefs tracks some on their own (<code>de.wikipedia.org</code>). Ahrefs publishes a page only for domains in its index; anything else is reported as <i>not tracked</i> and is never charged.

## `startUrls` (type: `array`):

Paste Ahrefs Top-Websites URLs directly, e.g. <code>https://ahrefs.com/websites/booking.com</code>. <b>Bulk import:</b> use this field's <i>Link remote text file</i> option to load a hosted list, or paste the list into <b>Import domains from a file</b> below.

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

Bulk-load domains without adding them one at a time. Either <b>paste the whole list</b> (one per line), or give <b>a single link</b> to a public <code>.txt</code>/<code>.csv</code>, a Google Sheet or Drive share link, or an Apify key-value-store record. Blank lines, <code>#</code> comments, CRLF, a UTF-8 or UTF-16 file, quotes and extra CSV columns all parse; duplicates are analysed once. A file that cannot be read (a PDF, an Excel file, a Sheet that is not shared publicly) is named on the run card, and no domain is billed for it.

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

Add the monthly organic traffic series Ahrefs charts on the page (since 2015 for older sites), month by month with traffic value, plus the monthly linking-websites history.

## `includeKeywords` (type: `boolean`):

Add the keyword sending the domain the most traffic (position, country, monthly visits) and the top 5 keywords Ahrefs lists, each with search volume, traffic, position and their monthly changes.

## `includeCountries` (type: `boolean`):

Add the country sending the most traffic (visits, monthly change, share of total) and the top 5 countries with exact visits, the previous month and their share.

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

Add the up to 5 domains ranking in the top 10 for the keywords this domain gets most of its traffic from, each with its traffic, monthly change and page count.

## `outputFields` (type: `array`):

Pick the fields you want and every record is trimmed to exactly those, handy for lean CSV/Sheets exports. <b>Nothing to memorise:</b> open the dropdown and tick, or start typing (<code>traffic</code>, <code>rating</code>, <code>keyword</code>) to filter. Leave empty to get every field.

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

Maximum number of domains to analyse in one run, in list order (a domain Ahrefs does not track counts as analysed but is never charged). Domains past this number are named on the run card.

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

Proxy settings. Ahrefs serves these public pages to Apify datacenter proxies, which are used by default; a try that fails is repeated on a new proxy session. If the run card reports that Ahrefs did not answer for some domains, re-run them or switch to Residential.

## Actor input object example

```json
{
  "domains": [
    "booking.com",
    "stripe.com"
  ],
  "urlsFromFile": "",
  "includeHistory": true,
  "includeKeywords": true,
  "includeCountries": true,
  "includeCompetitors": true,
  "maxItems": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

All analysed domains as JSON items in the default dataset.

# 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": [
        "booking.com",
        "stripe.com"
    ],
    "urlsFromFile": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapesage/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 = {
    "domains": [
        "booking.com",
        "stripe.com",
    ],
    "urlsFromFile": "",
}

# Run the Actor and wait for it to finish
run = client.actor("scrapesage/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 '{
  "domains": [
    "booking.com",
    "stripe.com"
  ],
  "urlsFromFile": ""
}' |
apify call scrapesage/ahrefs-scraper --silent --output-dataset

```

## MCP server setup

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