# Backlinks API: Backlink Checker for Any Domain (`touchrock/backlinks`) Actor

Get the backlinks of any domain, subdomain or page: linking URL, anchor text, dofollow or nofollow, page and domain rank, spam score, first and last seen. $2.00 per 1,000 backlinks + $0.03 per target; no backlinks, no charge.

- **URL**: https://apify.com/touchrock/backlinks.md
- **Developed by:** [Touchrock](https://apify.com/touchrock) (community)
- **Categories:** SEO tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.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

## Backlinks API: Backlink Checker for Any Domain

Get the **backlinks of any domain, subdomain or page**: the page that links, the page it links to, anchor text, dofollow or nofollow, page and domain rank, spam score, and when the link was first and last seen. Each target also gets its **total backlink count**. Live or lost links, all links or one per linking domain. No subscription.

**Price: $2.00 per 1,000 backlinks + $0.03 per target. Targets with no backlinks are free.**

### What you get for each backlink

| Field | What it means |
|---|---|
| `target` | The domain, subdomain or page you asked for |
| `urlFrom` | The page that contains the link |
| `domainFrom` | The domain of that page |
| `pageFromTitle` | Title of the linking page |
| `urlTo` | The page of your target the link points to |
| `anchor` | The clickable text of the link |
| `linkType` | `anchor` (text link), `image`, `redirect`, `canonical`, `alternate` or `meta` |
| `dofollow` | `true` for dofollow, `false` for nofollow |
| `attributes` | Link attributes such as `nofollow`, `ugc`, `sponsored` |
| `rank`, `pageFromRank`, `domainFromRank` | Strength of the backlink, of the linking page and of the linking domain, 0-100 (DataForSEO's rank, similar to PageRank) |
| `spamScore` | Spam score of the backlink, 0-100 (higher is spammier) |
| `domainFromCountry`, `pageFromLanguage` | Country of the linking domain and language of the linking page |
| `textBefore`, `textAfter` | Text right before and after the link |
| `location` | Where on the page the link is (`article`, `footer`, `nav`...) |
| `linksOnPage` | How many identical links that page has |
| `linksFromDomain` | In "one per linking domain" mode: how many backlinks that domain has in total |
| `isNew`, `isLost`, `isBroken` | New since the previous check, removed since, or pointing to a page that returns an error |
| `targetStatusCode` | HTTP status of the linked page |
| `imageUrl` | The image, for image links |
| `firstSeen`, `lastSeen` | When the link was first found and last checked |

Example row (real data, October 2026):

```json
{
  "target": "apify.com",
  "urlFrom": "https://crawlee.dev/",
  "urlTo": "https://apify.com/",
  "domainFrom": "crawlee.dev",
  "anchor": "Apify platform",
  "linkType": "anchor",
  "dofollow": true,
  "attributes": ["noopener", "noreferrer"],
  "spamScore": 0,
  "domainFromCountry": "US",
  "location": "footer",
  "isNew": false,
  "isLost": false,
  "isBroken": false,
  "targetStatusCode": 200,
  "firstSeen": "2022-07-14",
  "lastSeen": "2026-10-06"
}
```

### Totals per target

One record per target, in the key-value store record `TARGETS`: `totalBacklinks` (backlinks matching your filters in the index), `backlinksReturned` (rows delivered in this run) and `hasData` (`false` when there are none; not charged).

### Input

```json
{
  "targets": ["apify.com", "https://example.com/pricing"],
  "maxBacklinksPerTarget": 100,
  "mode": "all",
  "status": "live",
  "sortBy": "rank",
  "dofollowOnly": false,
  "includeSubdomains": true
}
```

- **targets**: up to 50 per run. `https://`, `www.` and a final `/` are removed from domains; duplicates are removed before anything is charged.
  - A **domain** (`example.com`) includes its subdomains (turn off `includeSubdomains` to exclude them).
  - A **page** (anything with a path, like `example.com/pricing`) gives only the links to that exact URL.
  - Entries that are not public websites (IP addresses, `localhost`, ports) are skipped and listed in the run's status message.
- **maxBacklinksPerTarget**: 1 to 10,000. Default 100.
- **mode**: `all` (default), `onePerDomain` (the strongest link from each linking domain: a list of referring domains) or `onePerAnchor`.
- **status**: `live` (default), `lost` or `all`.
- **sortBy**: `rank` (default, strongest backlinks first), `domainRank` (strongest linking domains first) or `newest`.
- **dofollowOnly**: only dofollow links. Off by default.
- **dryRun**: returns clearly fake sample rows (marked `sampleData: true`) to test an integration. Free.

### Pricing, exactly

| One target, backlinks returned | You pay |
|---|---|
| 10 | $0.05 |
| 100 | $0.23 |
| 1,000 | $2.03 |

- **$0.03 per target** ("Target with backlinks"), charged once per target, only when its first backlinks arrive. Apify may also bill its small standard Actor start fee.
- **$0.002 per backlink row** ("Backlink").
- Targets with no backlinks, skipped entries and failed requests are never charged.
- Your **maximum cost per run** is respected before each request: if it covers only part of the work, the rest is not requested and not charged, and the status message tells you.
- Users on the Apify Free plan can look up 1 target and 10 backlinks per run. Any paid Apify plan removes the limit.

### Where the data comes from

Backlinks come from the [DataForSEO](https://dataforseo.com/) Backlinks API, which runs its own web crawler and link index. Ranks and spam scores are DataForSEO's own metrics: they are not Ahrefs, Moz or Semrush numbers and will not match them. Each row shows `lastSeen`, the last time the crawler checked that link.

### Use it from code or an AI agent

Call it through the [Apify API](https://docs.apify.com/api/v2) or the Apify MCP server like any Actor. Backlink rows are in the default dataset (view `overview` for the main columns); totals per target are in the key-value store record `TARGETS`; a run summary (counts and amount charged) is in the record `OUTPUT`.

More SEO data from the same publisher: Ranked Keywords & Domain Overview API (`touchrock/ranked-keywords`) and Keyword Search Volume & Keyword Research API (`touchrock/keyword-volume`).

### Limits

- No historical charts of backlink growth.
- At most 10,000 backlinks per target per run.

### Support

Open an issue on the Actor's Issues tab.

# Actor input Schema

## `targets` (type: `array`):

Up to 50 per run. A domain (example.com) includes its subdomains unless you turn that off; a page URL (https://example.com/pricing) gives only the links to that page. https:// and www. are removed from domains.

## `maxBacklinksPerTarget` (type: `integer`):

Maximum backlinks to return for each target (1-10,000). Each backlink row is charged.

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

All backlinks, or only the best one per linking domain (good for counting referring domains), or one per anchor text.

## `status` (type: `string`):

Live: found on the last check. Lost: removed since. All: both.

## `sortBy` (type: `string`):

Which backlinks come first: the strongest links (rank), links from the strongest domains, or the newest.

## `dofollowOnly` (type: `boolean`):

Return only dofollow backlinks.

## `includeSubdomains` (type: `boolean`):

For a domain target, also count links to its subdomains (blog.example.com, shop.example.com...).

## `dryRun` (type: `boolean`):

Returns clearly fake SAMPLE rows to test your integration. Nothing is charged.

## Actor input object example

```json
{
  "targets": [
    "apify.com"
  ],
  "maxBacklinksPerTarget": 100,
  "mode": "all",
  "status": "live",
  "sortBy": "rank",
  "dofollowOnly": false,
  "includeSubdomains": true,
  "dryRun": false
}
```

# Actor output Schema

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

No description

## `targets` (type: `string`):

No description

## `summary` (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 = {
    "targets": [
        "apify.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("touchrock/backlinks").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 = { "targets": ["apify.com"] }

# Run the Actor and wait for it to finish
run = client.actor("touchrock/backlinks").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 '{
  "targets": [
    "apify.com"
  ]
}' |
apify call touchrock/backlinks --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,touchrock/backlinks"
        }
    }
}
```

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/2AlzciriTBG4US7ES/builds/rGYmhp3ZgAe3Rpkbf/openapi.json
