# Backlink Checker API - Majestic Trust Flow and Citation Flow (`nabeelbaghoor/trust-flow-backlink-data-api`) Actor

Backlink checker with the Majestic API: Trust Flow, Citation Flow, Topical Trust Flow, backlinks, referring domains, anchor text, top pages and new or lost links from the Fresh and Historic index, for domains, subdomains and URLs. Bring your own key.

- **URL**: https://apify.com/nabeelbaghoor/trust-flow-backlink-data-api.md
- **Developed by:** [Nabeel Hassan](https://apify.com/nabeelbaghoor) (community)
- **Categories:** SEO tools, Marketing, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 site metrics returneds

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

## Backlink Checker API - Majestic Trust Flow and Citation Flow

Check backlinks, Trust Flow and Citation Flow for any domain, subdomain or URL with the Majestic API and your own API key, and get site metrics, backlinks, referring domains, anchor text, top pages and new or lost links as clean dataset rows.

Works with the Majestic API (api.majestic.com/api/json), the link intelligence API behind Majestic Site Explorer, reading either the Fresh Index or the Historic Index. The actor turns a list of domains, subdomains or URLs into deduplicated rows you can download as JSON, CSV or Excel, schedule, or feed into SEO dashboards, link audits, outreach lists, Google Sheets, Looker Studio and AI agents. Bring your own API key.

BYOK, not live-tested: every command, parameter and enum comes from Majestic's public developer documentation at developer-support.majestic.com, but the actor has not been run against a live Majestic account.

### What it does

- **Site metrics (bulk backlink checker)**: Trust Flow, Citation Flow, Topical Trust Flow, external backlinks, referring domains, referring IPs and subnets, EDU and GOV links, follow and live link counts, crawl status and page title for up to 100 domains, subdomains or URLs per call.
- **Backlinks**: the links pointing at a domain, subdomain or URL, with source URL, anchor text, source and target Trust Flow and Citation Flow, link type, nofollow, redirect, image and deleted flags, first indexed and last seen dates. Sort by 14 fields and filter by Trust Flow, Citation Flow, link type, follow or nofollow, live or deleted, source language, anchor text, source URL and dates.
- **Referring domains**: the domains linking to an item, with Trust Flow, Citation Flow, matched links, IP, subnet, hosting country, language and Topical Trust Flow, sorted by any of Majestic's 19 orders.
- **Anchor text**: the link texts used, with referring domains, total, deleted and nofollow link counts and estimated link Trust Flow and Citation Flow.
- **Top pages**: the strongest pages of a domain or subdomain, with backlinks, referring domains, crawl result, Trust Flow and Citation Flow.
- **New or lost backlinks**: links Majestic found, or saw lost, in a date range.
- **API subscription info**: your remaining analysis, retrieval and index item units and the index dates, free.
- **Fresh or Historic Index** for every mode, and a path prefix scope for URL folders.
- **Pay only for results**: refused, empty and not found lookups are recorded as a free row that says why, never charged.

### How to get an API key

Majestic API access comes with the Majestic API plan (and legacy Platinum plans). In your Majestic account open the API tab (majestic.com/account/api), switch on Enable API, and copy your API key into the API key field, or set the `DATA_API_KEY` environment secret. This actor never ships a shared key.

#### What a run costs in Majestic units

Majestic spends units from your plan on every call, as documented per command: 1 index item unit per item for site metrics; 5,000 analysis units per backlinks call (10,000 to 20,000 with sorting or filtering); 1,000 per referring domains item; 1,000 per anchor text call; 5,000 per top pages item; 500 per day of new or lost backlinks; and 1 retrieval unit for every row returned. Subscription info costs nothing. `maxResults` caps the rows a run returns, so the default is a modest 100.

### Input

| Field | Used by | What it does |
| --- | --- | --- |
| `mode` | all | `siteMetrics`, `backlinks`, `referringDomains`, `anchorText`, `topPages`, `newLostBacklinks` or `subscriptionInfo` |
| `items` | all but subscription info | Domains, subdomains or URLs, one per line |
| `datasource` | all | `fresh` (default) or `historic` |
| `usePrefixScan` | link modes | Treat a URL as a path prefix (URL\*) |
| `desiredTopics`, `addAllTopics` | site metrics | Topical Trust Flow topics per item, all trust categories |
| `removeDeletedLinks`, `linksPerRefDomain`, `uniqueSourceUrls`, `filterTopic` | backlinks | Leave out deleted links, cap links per referring domain, one link per source URL, topic filter |
| `backlinkSort`, `sortDirection`, `filteringDepth` | backlinks | Sort field, direction and how many top links to sort through |
| `trustFlowMin`, `trustFlowMax`, `citationFlowMin`, `citationFlowMax` | backlinks | Source page Flow Metric ranges, 0 to 100 |
| `linkType`, `followType`, `liveStatus`, `sourceLanguage` | backlinks | Text, image, redirect or frame; follow or nofollow; live or deleted; 2 letter language |
| `anchorContains`, `sourceUrlContains`, `firstIndexedAfter`, `lastSeenAfter` | backlinks | Text and date filters |
| `refDomainSort`, `analysisDepth` | referring domains | Sort order, domains considered |
| `cleanAnchorText`, `anchorFilter`, `anchorMatch` | anchor text | Clean punctuation, filter text, contains or exact |
| `linkChange`, `dateFrom`, `dateTo` | new or lost backlinks | New or lost, date range |
| `maxResults` | all | Row ceiling for the run (default 100, up to 50,000) |
| `requestsPerMinute` | all | Pacing (default 30) |
| `apiKey` | all | Your Majestic API key, stored as a secret |

A command only receives the parameters its documentation lists; an input that belongs to another mode is left off with a warning.

Example input, the 200 strongest live, followed backlinks of a site from the Fresh Index:

```json
{
    "mode": "backlinks",
    "items": ["example.com"],
    "datasource": "fresh",
    "backlinkSort": "SourceTrustFlow",
    "sortDirection": "desc",
    "followType": "follow",
    "liveStatus": "live",
    "trustFlowMin": 20,
    "maxResults": 200
}
```

### Example output

An example backlink row, shaped from Majestic's documented sample response. The common columns come first; every field Majestic returns follows unchanged.

```json
{
    "mode": "backlinks",
    "modeLabel": "Backlinks",
    "recordType": "backlink",
    "identifier": "majestic.com",
    "found": true,
    "datasource": "fresh",
    "url": "https://www.aspfree.com/",
    "sourceUrl": "https://www.aspfree.com/",
    "targetUrl": "https://majestic.com/",
    "domain": "www.aspfree.com",
    "anchorText": "majestic logo",
    "trustFlow": 62,
    "citationFlow": 50,
    "refDomains": null,
    "backlinks": null,
    "firstIndexed": "2017-07-14",
    "lastSeen": "2017-10-14",
    "retrievedAt": "2026-10-14T09:00:00.000Z",
    "note": null,
    "SourceURL": "https://www.aspfree.com/",
    "AnchorText": "majestic logo",
    "SourceTitle": "ASP Free - ASP Help, ASP Tutorials, ASP Programming, ASP Code - ASP Free",
    "FlagNoFollow": 1,
    "FlagImages": 1,
    "FlagDeleted": 0,
    "TargetURL": "https://majestic.com/",
    "FirstIndexedDate": "2017-07-14",
    "LastSeenDate": "2017-10-14",
    "LinkType": "ImageLink",
    "SourceCitationFlow": 50,
    "SourceTrustFlow": 62,
    "SourceTopicalTrustFlow_Topic_0": "Computers/Programming/Internet",
    "SourceTopicalTrustFlow_Value_0": 61
}
```

A site metrics row carries `trustFlow`, `citationFlow`, `refDomains` and `backlinks` plus every GetIndexItemInfo column (RefIPs, RefSubNets, RefDomainsEDU, RefDomainsGOV, LastCrawlResult, Title, TopicalTrustFlow_Topic_0 and so on).

### FAQ

#### How much does the Majestic backlink checker API actor cost?

You pay Apify per row returned: $0.01 per site metrics row (Trust Flow, Citation Flow and link counts for one domain, subdomain or URL) and $0.005 per backlink, referring domain, anchor text, top page or new or lost link row. Subscription info, refused lookups, empty answers and items Majestic does not find are free. Your Majestic subscription is billed separately by Majestic.

#### Do I need my own Majestic API key?

Yes. This is a bring your own key actor. You need a Majestic plan with API access (the API plan, or a legacy Platinum plan) and API enabled on the API tab of your Majestic account. A run without a key ends straight away with a message saying where to get one; it never fails.

#### What is the difference between the Fresh Index and the Historic Index?

The Fresh Index holds the most recently crawled links and is updated throughout the day, so its Trust Flow and Citation Flow are the most current. The Historic Index is Majestic's largest index, spanning more than five years, and is better for link history and links that are no longer live.

#### What are Trust Flow and Citation Flow?

They are Majestic's Flow Metrics, scored 0 to 100. Citation Flow measures how much link equity a URL or site has, and Trust Flow how closely it links to trusted seed sites. Topical Trust Flow splits Trust Flow by topic, such as Computers/Internet or News.

#### Are there limits?

GetIndexItemInfo takes up to 100 items per call, GetBackLinkData returns up to 50,000 backlinks per call, GetTopPages up to 10,000 pages, GetAnchorText up to 1,000 anchors per page and GetNewLostBackLinks up to 1,000 links. Sorting and filtering backlinks works on the top 5,000 to 50,000 links only. Your plan's analysis, retrieval and index item units cap how much you can read per period; when they run out the run ends cleanly and says so.

#### What do Majestic's terms allow?

Majestic licenses its standard API for internal use: its terms say you may not resell or create derivative works of its data without written consent, and offer reseller plans and the OpenApps program for tools that serve other people. This actor only reads data into your own Apify dataset with your own key. Use the results for your own research and SEO work, and talk to Majestic about a reseller licence before republishing or reselling the data.

#### Is the data stored anywhere else?

Rows go only to the run's dataset in your Apify account. The API key is stored as an Apify secret, sent only in the POST body to api.majestic.com and removed from every log line, including the error Majestic returns for a wrong key, which repeats the key back.

### Keywords

backlink checker API, Majestic API, Trust Flow API, Citation Flow checker, Topical Trust Flow, referring domains API, anchor text checker, bulk backlink checker, link intelligence, top pages, new and lost backlinks, Fresh Index, Historic Index, SEO backlink data, link audit

# Actor input Schema

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

Site metrics reads Trust Flow, Citation Flow, Topical Trust Flow, external backlink and referring domain counts for up to 100 items per call. Backlinks lists the links pointing at an item, with filters and sorting. Referring domains lists the domains linking to it. Anchor text lists the link texts used. Top pages lists the strongest pages of a domain or subdomain. New or lost backlinks lists links found or lost in a date range. API subscription info reads your remaining Majestic units and costs nothing.

## `items` (type: `array`):

One per line. A root domain (example.com) covers every subdomain, a subdomain (www.example.com) covers only that host, and a URL (https://www.example.com/page) covers that page only. Not used by the subscription info mode.

## `datasource` (type: `string`):

Which Majestic index to query. The Fresh Index is updated through the day and gives the most accurate Flow Metrics; the Historic Index is the largest and reaches back more than five years.

## `usePrefixScan` (type: `boolean`):

Link modes only. Analyses every URL that starts with the given URL, like the Path (URL\*) scope in Majestic Site Explorer. Majestic refuses this when the prefix cannot be queried in real time.

## `desiredTopics` (type: `integer`):

Site metrics only. How many Topical Trust Flow topics to return per item: up to 30 for root domains, 20 for subdomains and 10 for URLs.

## `addAllTopics` (type: `boolean`):

Site metrics only. Adds a TrustCategories column listing every topic with its share and value.

## `removeDeletedLinks` (type: `boolean`):

Backlinks only. Removes links Majestic has seen deleted.

## `linksPerRefDomain` (type: `string`):

Backlinks only. Limits how many source URLs come from any one referring domain. 1 gives one best backlink per referring domain.

## `uniqueSourceUrls` (type: `boolean`):

Backlinks only. Returns each source URL once, even when it links several times with different anchors.

## `filterTopic` (type: `string`):

Backlinks only. Only links matching this Majestic topic, such as Computers/Internet or News.

## `backlinkSort` (type: `string`):

Backlinks only. Sorting or any backlink filter below makes Majestic spend an extra 5,000 analysis units per call (plus more for a deeper filtering depth).

## `sortDirection` (type: `string`):

Backlinks and referring domains: the direction of the chosen sort.

## `filteringDepth` (type: `string`):

Backlinks only, when sorting or filtering. How many of the top backlinks Majestic sorts and filters through.

## `trustFlowMin` (type: `integer`):

Backlinks only. Only links from pages with at least this Trust Flow (0 to 100).

## `trustFlowMax` (type: `integer`):

Backlinks only. Only links from pages with at most this Trust Flow.

## `citationFlowMin` (type: `integer`):

Backlinks only. Only links from pages with at least this Citation Flow (0 to 100).

## `citationFlowMax` (type: `integer`):

Backlinks only. Only links from pages with at most this Citation Flow.

## `linkType` (type: `string`):

Backlinks only.

## `followType` (type: `string`):

Backlinks only.

## `liveStatus` (type: `string`):

Backlinks only.

## `sourceLanguage` (type: `string`):

Backlinks only. A 2 letter language code, such as en or de.

## `anchorContains` (type: `string`):

Backlinks only. Only links whose anchor text contains this text (case insensitive).

## `sourceUrlContains` (type: `string`):

Backlinks only. Only links whose source URL contains this text.

## `firstIndexedAfter` (type: `string`):

Backlinks only. Only links Majestic first indexed after this date (YYYY-MM-DD).

## `lastSeenAfter` (type: `string`):

Backlinks only. Only links Majestic last saw after this date (YYYY-MM-DD).

## `refDomainSort` (type: `string`):

Referring domains only. No extra unit cost.

## `analysisDepth` (type: `integer`):

Referring domains only. The most referring domains Majestic considers per item before sorting (provider default 10,000, maximum 100,000).

## `cleanAnchorText` (type: `boolean`):

Anchor text only. Removes punctuation and delimiters from the anchors.

## `anchorFilter` (type: `string`):

Anchor text only. Only anchors matching this text.

## `anchorMatch` (type: `string`):

Anchor text only. How the anchor text filter matches.

## `linkChange` (type: `string`):

New or lost backlinks only.

## `dateFrom` (type: `string`):

New or lost backlinks only. YYYY-MM-DD. Leave empty for the most recent day in the index. Majestic spends 500 analysis units per day in the range.

## `dateTo` (type: `string`):

New or lost backlinks only. YYYY-MM-DD.

## `maxResults` (type: `integer`):

The most rows this run returns and charges for. Majestic also spends 1 retrieval unit per row on your plan, so keep this modest.

## `requestsPerMinute` (type: `integer`):

Pacing. A rate limit answer is waited out and retried.

## `apiKey` (type: `string`):

Your own Majestic API key, from the API tab of your Majestic account (majestic.com/account/api), with Enable API switched on. Stored as a secret and sent only in the POST body to api.majestic.com; it is never logged. You can instead set the DATA_API_KEY environment secret.

## Actor input object example

```json
{
  "mode": "siteMetrics",
  "items": [
    "majestic.com"
  ],
  "datasource": "fresh",
  "usePrefixScan": false,
  "desiredTopics": 3,
  "addAllTopics": false,
  "removeDeletedLinks": false,
  "linksPerRefDomain": "-1",
  "uniqueSourceUrls": false,
  "backlinkSort": "none",
  "sortDirection": "desc",
  "filteringDepth": "5000",
  "linkType": "any",
  "followType": "any",
  "liveStatus": "any",
  "refDomainSort": "default",
  "cleanAnchorText": false,
  "anchorMatch": "contains",
  "linkChange": "new",
  "maxResults": 100,
  "requestsPerMinute": 30
}
```

# Actor output Schema

## `records` (type: `string`):

One row per site, backlink, referring domain, anchor text or page.

# 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 = {
    "items": [
        "majestic.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nabeelbaghoor/trust-flow-backlink-data-api").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 = { "items": ["majestic.com"] }

# Run the Actor and wait for it to finish
run = client.actor("nabeelbaghoor/trust-flow-backlink-data-api").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 '{
  "items": [
    "majestic.com"
  ]
}' |
apify call nabeelbaghoor/trust-flow-backlink-data-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nabeelbaghoor/trust-flow-backlink-data-api"
        }
    }
}
```

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/yGhTLzU8XMzYvEaCl/builds/CvpSN2gAcfJjXk1ug/openapi.json
