# Ahrefs Backlinks Scraper (`piotrv1001/ahrefs-backlinks-scraper`) Actor

Get the top backlinks Ahrefs shows for any domain or page: linking page URL and title, its Domain Rating, anchor text and surrounding text, target URL and redirects, plus the target's DR, backlink and referring-domain totals. No Ahrefs account needed.

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

## Pricing

from $1.00 / 1,000 backlinks

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

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

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

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

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

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

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

# README

### 🚀 Ahrefs Backlinks Scraper

Get the **top backlinks Ahrefs shows for any website or page**. The **Ahrefs Backlinks Scraper** returns the strongest links pointing at a domain: the linking page and its title, the linking site's Domain Rating, the anchor text and the text around it, the exact target URL and any redirects. Use it for competitor backlink research, link-building prospecting, PR mention tracking and SEO audits. No Ahrefs account needed.

### ✨ Features

- 🔗 **Top Backlinks per Domain**: Up to 20 of the strongest links Ahrefs knows for each domain or page, ranked as Ahrefs ranks them.
- 🏆 **Authority of Each Link**: The Domain Rating of every linking site, so the best prospects stand out.
- 📝 **Link Context**: Anchor text, the text before and after the link, the exact target URL and the redirect chain.
- 📊 **Target Totals on Every Row**: The target's own DR, total backlinks and referring domains, ready for pivot tables.
- 📋 **Many Domains in One Run**: Check a whole competitor list at once; repeated domains are checked once and links are never duplicated.

### 🛠️ How It Works

1. **Add domains or page URLs** – a domain (`apify.com`) covers the site and its subdomains; a page URL (`https://apify.com/store`) covers that exact page.
2. **Set the maximum number of backlinks** – the default is 100.
3. **Run the Scraper** – download the links as JSON, CSV or Excel, or pull them through the API.

### ⚙️ Input

| Field               | What it does                                                                                                   |
| ------------------- | -------------------------------------------------------------------------------------------------------------- |
| **Domains or URLs** | Domains or page URLs. Up to 20 top backlinks are returned for each.                                            |
| **Max results**     | Stop after this many backlinks across all domains. Default 100.                                                |

With an empty input the scraper returns the top backlinks of `apify.com`.

```json
{
    "domains": ["competitor-one.com", "competitor-two.com", "https://example.com/blog/best-post"],
    "maxItems": 500
}
```

### 💰 Pricing

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

| Event           | Price                              | What you get                                                                                                                       |
| --------------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| **Backlink**    | $0.001 per backlink ($1 per 1,000) | Linking page URL and title, linking site DR, anchor and surrounding text, target URL, redirect chain, plus the target's DR and totals |
| **Actor start** | $0.00005 per run                   | Charged once when the run starts.                                                                                                  |

Examples: the top 20 backlinks of one domain = $0.02 · 50 competitors (up to 1,000 links) = up to $1.00.

### 📊 Sample Output Data

```json
{
    "targetDomain": "apify.com",
    "rank": 2,
    "sourceUrl": "https://github.com/docling-project/docling",
    "sourceTitle": "GitHub - docling-project/docling: Get your documents ready for gen AI · GitHub",
    "sourceDomainRating": 97,
    "targetUrl": "https://apify.com/vancura/docling",
    "anchor": "Docling Actor",
    "textBefore": null,
    "textAfter": null,
    "redirectChain": [],
    "foundInRenderedHtml": false,
    "foundInRawHtml": true,
    "targetDomainRating": 82,
    "targetBacklinks": 3978770,
    "targetReferringDomains": 16892,
    "scrapedAt": "2026-10-14T08:09:35.470Z"
}
```

### ❓ FAQ

**How many backlinks do I get per domain?** Up to 20: the top links Ahrefs shows publicly for that domain or page. Domains with no known links return no rows and are not charged.

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

**Only need DR for a long list of domains?** The [Ahrefs Domain Rating Scraper](https://apify.com/piotrv1001/ahrefs-domain-rating-scraper) is cheaper per domain. For traffic estimates see the [Ahrefs Traffic Scraper](https://apify.com/piotrv1001/ahrefs-traffic-scraper).

### 🔗 More SEO Actors

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

This actor is not affiliated with or endorsed by Ahrefs.

# Actor input Schema

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

Domains (apify.com) or page URLs (https://apify.com/store). A domain covers its subdomains; a page URL is checked as that exact URL. Up to 20 top backlinks per entry.

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

Stop after this many backlinks.

## Actor input object example

```json
{
  "domains": [
    "apify.com"
  ],
  "maxItems": 100
}
```

# 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 = {
    "domains": [
        "apify.com"
    ],
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("piotrv1001/ahrefs-backlinks-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": ["apify.com"],
    "maxItems": 100,
}

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

```

## MCP server setup

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