> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webrouter.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Majestic

> Majestic link intelligence: Trust Flow, Citation Flow, backlinks, referring domains, anchors and top pages.

![](https://mintcdn.com/webrouter/JBFYvcRI1PVnd4YX/logo/data-apis/majestic.webp?fit=max\&auto=format\&n=JBFYvcRI1PVnd4YX\&q=85\&s=7f1d1755bf59b65f7a9cdf4d9314933b)

[Web Catalog · SEO](https://docs.webrouter.net/data-apis.md?category=seo)

Needs&#x20;

`MAJESTIC_API_KEY`

Endpoints

6

Auth

Key in query

[Vendor docs](https://developer-support.majestic.com/api/)

## Setup

| Variable | | What it is |
| - | - | - |
| `MAJESTIC_API_KEY` | required | a Majestic API key (enable it from the API tab on majestic.com) |

Put them in your environment or `.env`; [Data APIs](https://docs.webrouter.net/vendors.md) covers the other ways.

## Notes

* Every command is a GET to /api/json with cmd naming the command; /api/xml answers XML instead. Majestic itself advises POST over GET for production use.
* Costs are in three allowances: Analysis units, Retrieval units (one per row returned) and Index Item units (GetIndexItemInfo only). Each endpoint note says what it spends.
* Set datasource to fresh or historic. The developer sandbox host (developer.majestic.com) returns a reduced dataset at no charge, but this entry targets the live host.
* Responses carry Code and ErrorMessage fields; check them as well as the HTTP status.

## Endpoints

GET

Get subscription info

Your subscriptions with remaining Analysis, Retrieval and Index Item units, plan names and index details.

[Open](#majestic-account-subscription-info)

GET

Index item info

Trust Flow, Citation Flow, backlink and referring-domain counts and topics for up to 100 domains, subdomains or URLs.

[Open](#majestic-index-item-info)

GET

Get backlink data

Backlinks to a domain, subdomain or URL with source, target, anchor, flags and dates.

[Open](#majestic-backlinks-list)

GET

Get referring domains

Referring domains for a domain, subdomain or URL with Trust Flow, Citation Flow, link counts and crawl dates.

[Open](#majestic-backlinks-refdomains)

GET

Get anchor text

Anchor text statistics for a target, or the referring domains and backlinks behind one anchor.

[Open](#majestic-backlinks-anchor-text)

GET

Get top pages

The best pages on a root domain or subdomain by backlinks, or a check that one URL is in the index.

[Open](#majestic-domain-top-pages)

### Get subscription info

GET

`/api/json`

`majestic.account.subscription_info`

Your subscriptions with remaining Analysis, Retrieval and Index Item units, plan names and index details.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`cmd` required</td><td>string</td><td>query</td><td>The command name. Always GetSubscriptionInfo for this call. One of `GetSubscriptionInfo` Example `GetSubscriptionInfo`</td></tr>
    <tr><td>`datasource`</td><td>string</td><td>query</td><td>Index to query: historic (default when your plan includes it) or fresh. Majestic advises always setting it. One of `fresh`, `historic`</td></tr>
  </tbody>
</table>

[Vendor docs](https://developer-support.majestic.com/api/commands/get-subscription-info.shtml)

```python Python theme={null}
router.call_data_api("majestic.account.subscription_info", {'cmd': 'GetSubscriptionInfo'})
```

```text MCP theme={null}
call_data_api(endpoint="majestic.account.subscription_info", params={"cmd": "GetSubscriptionInfo"})
```

> [!NOTE]
>
> * Uses no units. Check this before large pulls.

### Index item info

GET

`/api/json`

`majestic.index.item_info`

Trust Flow, Citation Flow, backlink and referring-domain counts and topics for up to 100 domains, subdomains or URLs.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`cmd` required</td><td>string</td><td>query</td><td>The command name. Always GetIndexItemInfo for this call. One of `GetIndexItemInfo` Example `GetIndexItemInfo`</td></tr>
    <tr><td>`datasource`</td><td>string</td><td>query</td><td>Index to query: historic (default when your plan includes it) or fresh. Majestic advises always setting it. One of `fresh`, `historic`</td></tr>
    <tr><td>`items` required</td><td>integer</td><td>query</td><td>How many item0..itemN parameters this call carries, 1 to 100. Items past item0 need a raw call. Example `1`</td></tr>
    <tr><td>`item0` required</td><td>string</td><td>query</td><td>A root domain, subdomain or exact URL. Example `majestic.com`</td></tr>

    <tr>
      <td>
        `DesiredTopics`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Number of Trust Flow topics returned (default 3; at most 30 for domains, 20 for subdomains, 10 for URLs).
      </td>
    </tr>

    <tr><td>`AddAllTopics`</td><td>integer</td><td>query</td><td>1 adds a TrustCategories column with the topic split. Example `1`</td></tr>

    <tr>
      <td>
        `EnableResourceUnitFailover`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        1 spends Analysis and Retrieval units once Index Item units run out (500 Analysis units per call plus 50 per item, and 1 Retrieval unit per item). Default 0.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developer-support.majestic.com/api/commands/get-index-item-info.shtml) · Same job: [Adyntel](https://docs.webrouter.net/data-apis/adyntel.md#adyntel-domain-keywords), [Ahrefs](https://docs.webrouter.net/data-apis/ahrefs.md#ahrefs-metrics), [akta.pro](https://docs.webrouter.net/data-apis/akta.md#akta-company-traffic), [Aviato](https://docs.webrouter.net/data-apis/aviato.md#aviato-company-web-traffic), [Keywords Everywhere](https://docs.webrouter.net/data-apis/keywordseverywhere.md#keywordseverywhere-domain-traffic), [Mangools](https://docs.webrouter.net/data-apis/mangools.md#mangools-site-overview)

```python Python theme={null}
router.call_data_api("majestic.index.item_info", {'cmd': 'GetIndexItemInfo', 'items': 1, 'item0': 'majestic.com', 'AddAllTopics': 1})
```

```text MCP theme={null}
call_data_api(endpoint="majestic.index.item_info", params={"cmd": "GetIndexItemInfo", "items": 1, "item0": "majestic.com", "AddAllTopics": 1})
```

> [!NOTE]
>
> * Spends one Index Item unit per item queried.
> * URLs with very few external backlinks may return estimates, flagged by Status MayExist.

### Get backlink data

GET

`/api/json`

`majestic.backlinks.list`

Backlinks to a domain, subdomain or URL with source, target, anchor, flags and dates.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`cmd` required</td><td>string</td><td>query</td><td>The command name. Always GetBackLinkData for this call. One of `GetBackLinkData` Example `GetBackLinkData`</td></tr>
    <tr><td>`datasource`</td><td>string</td><td>query</td><td>Index to query: historic (default when your plan includes it) or fresh. Majestic advises always setting it. One of `fresh`, `historic`</td></tr>
    <tr><td>`item` required</td><td>string</td><td>query</td><td>The URL, domain or subdomain to return backlinks for. Example `majestic.com`</td></tr>
    <tr><td>`Count`</td><td>integer</td><td>query</td><td>Number of backlinks to return. Default 100, maximum 50000. Example `100`</td></tr>
    <tr><td>`From`</td><td>integer</td><td>query</td><td>Result position to start from (0 is the first); use it to page. Example `0`</td></tr>
    <tr><td>`Mode`</td><td>integer</td><td>query</td><td>0 (default) returns top links including deleted ones; 1 removes deleted links. One of `0`, `1`</td></tr>
    <tr><td>`ShowDomainInfo`</td><td>integer</td><td>query</td><td>1 adds a data table about the referring domains. Default 0. One of `0`, `1`</td></tr>
    <tr><td>`MaxSourceURLsPerRefDomain`</td><td>integer</td><td>query</td><td>-1 (default), 1, 3 or 10: cap on source URLs taken from any one referring domain. One of `-1`, `1`, `3`, `10`</td></tr>
  </tbody>
</table>

[Vendor docs](https://developer-support.majestic.com/api/commands/get-back-link-data.shtml) · Same job: [Ahrefs](https://docs.webrouter.net/data-apis/ahrefs.md#ahrefs-backlinks), [Bing Webmaster Tools](https://docs.webrouter.net/data-apis/bing-webmaster.md#bing-webmaster-links-counts), [Keywords Everywhere](https://docs.webrouter.net/data-apis/keywordseverywhere.md#keywordseverywhere-domain-backlinks), [Mangools](https://docs.webrouter.net/data-apis/mangools.md#mangools-links-list), [Moz](https://docs.webrouter.net/data-apis/moz.md#moz-links-links), [Semrush](https://docs.webrouter.net/data-apis/semrush.md#semrush-backlinks-list)

```python Python theme={null}
router.call_data_api("majestic.backlinks.list", {'cmd': 'GetBackLinkData', 'item': 'majestic.com', 'Count': 100, 'From': 0})
```

```text MCP theme={null}
call_data_api(endpoint="majestic.backlinks.list", params={"cmd": "GetBackLinkData", "item": "majestic.com", "Count": 100, "From": 0})
```

> [!NOTE]
>
> * Costs 5000 Analysis units per call (more when sorting or filtering), plus one Retrieval unit per row returned.
> * Does not return links flagged as alt text.

### Get referring domains

GET

`/api/json`

`majestic.backlinks.refdomains`

Referring domains for a domain, subdomain or URL with Trust Flow, Citation Flow, link counts and crawl dates.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`cmd` required</td><td>string</td><td>query</td><td>The command name. Always GetRefDomains for this call. One of `GetRefDomains` Example `GetRefDomains`</td></tr>
    <tr><td>`datasource`</td><td>string</td><td>query</td><td>Index to query: historic (default when your plan includes it) or fresh. Majestic advises always setting it. One of `fresh`, `historic`</td></tr>
    <tr><td>`item0` required</td><td>string</td><td>query</td><td>A URL, subdomain or root domain. Example `majestic.com`</td></tr>
    <tr><td>`Count`</td><td>integer</td><td>query</td><td>Number of results. Default 100. Example `100`</td></tr>

    <tr>
      <td>
        `AnalysisDepth`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Most referring domains considered per root domain queried. Default 10000, maximum 100000.
      </td>
    </tr>

    <tr>
      <td>
        `MinMatchesRequired`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Minimum matches a domain needs when several items are queried. Default 1.
      </td>
    </tr>

    <tr>
      <td>
        `OrderBy1`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Primary sort column, 0-18 (0 matches, 1 Alexa rank, 12 Citation Flow, 13 Trust Flow, and so on; see the docs page).
      </td>
    </tr>

    <tr><td>`OrderDir1`</td><td>integer</td><td>query</td><td>1 descending, 0 ascending. One of `0`, `1`</td></tr>

    <tr>
      <td>
        `OrderBy2`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Secondary sort column, same values as OrderBy1.
      </td>
    </tr>

    <tr><td>`OrderDir2`</td><td>integer</td><td>query</td><td>Secondary sort direction. One of `0`, `1`</td></tr>
    <tr><td>`UsePrefixScan`</td><td>integer</td><td>query</td><td>1 enables prefix mode, like the Path (URL\*) option in Site Explorer. One of `0`, `1`</td></tr>
  </tbody>
</table>

[Vendor docs](https://developer-support.majestic.com/api/commands/get-ref-domains.shtml) · Same job: [Ahrefs](https://docs.webrouter.net/data-apis/ahrefs.md#ahrefs-refdomains), [Moz](https://docs.webrouter.net/data-apis/moz.md#moz-links-linking-root-domains), [Semrush](https://docs.webrouter.net/data-apis/semrush.md#semrush-backlinks-refdomains), [SE Ranking](https://docs.webrouter.net/data-apis/seranking.md#seranking-backlinks-refdomains), [Similarweb](https://docs.webrouter.net/data-apis/similarweb.md#similarweb-traffic-referrals)

```python Python theme={null}
router.call_data_api("majestic.backlinks.refdomains", {'cmd': 'GetRefDomains', 'item0': 'majestic.com', 'Count': 100})
```

```text MCP theme={null}
call_data_api(endpoint="majestic.backlinks.refdomains", params={"cmd": "GetRefDomains", "item0": "majestic.com", "Count": 100})
```

> [!NOTE]
>
> * Costs 1000 Analysis units per call plus one Retrieval unit per row.
> * Sorting needs no extra units.

### Get anchor text

GET

`/api/json`

`majestic.backlinks.anchor_text`

Anchor text statistics for a target, or the referring domains and backlinks behind one anchor.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`cmd` required</td><td>string</td><td>query</td><td>The command name. Always GetAnchorText for this call. One of `GetAnchorText` Example `GetAnchorText`</td></tr>
    <tr><td>`datasource`</td><td>string</td><td>query</td><td>Index to query: historic (default when your plan includes it) or fresh. Majestic advises always setting it. One of `fresh`, `historic`</td></tr>
    <tr><td>`item` required</td><td>string</td><td>query</td><td>The URL, subdomain or domain to query. Example `majestic.com`</td></tr>
    <tr><td>`TextMode`</td><td>integer</td><td>query</td><td>0 (default) returns anchors lowercased as found; 1 strips punctuation and delimiters. One of `0`, `1`</td></tr>
    <tr><td>`Mode`</td><td>integer</td><td>query</td><td>0 (default) aggregated anchor stats; 1 referring domains for an exact anchor; 2 backlinks for an anchor (needs CanReturnURLs earlier). One of `0`, `1`, `2`</td></tr>

    <tr>
      <td>
        `FilterAnchorText`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Anchor text to filter by, used with FilterAnchorTextMode.
      </td>
    </tr>

    <tr><td>`FilterAnchorTextMode`</td><td>integer</td><td>query</td><td>0 (default) no filter, 1 exact match, 2 anchors containing the text. One of `0`, `1`, `2`</td></tr>

    <tr>
      <td>
        `FilterRefDomain`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        With backlinks returned for one referring domain, that domain.
      </td>
    </tr>

    <tr>
      <td>
        `Count`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Number of results. Default 10, maximum 1000.
      </td>
    </tr>

    <tr>
      <td>
        `from`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        First result to return, for paging.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developer-support.majestic.com/api/commands/get-anchor-text.shtml) · Same job: [Moz](https://docs.webrouter.net/data-apis/moz.md#moz-links-anchor-text), [Semrush](https://docs.webrouter.net/data-apis/semrush.md#semrush-backlinks-anchors), [SE Ranking](https://docs.webrouter.net/data-apis/seranking.md#seranking-backlinks-anchors)

```python Python theme={null}
router.call_data_api("majestic.backlinks.anchor_text", {'cmd': 'GetAnchorText', 'item': 'majestic.com'})
```

```text MCP theme={null}
call_data_api(endpoint="majestic.backlinks.anchor_text", params={"cmd": "GetAnchorText", "item": "majestic.com"})
```

> [!NOTE]
>
> * Costs 1000 Analysis units per call plus one Retrieval unit per row.

### Get top pages

GET

`/api/json`

`majestic.domain.top_pages`

The best pages on a root domain or subdomain by backlinks, or a check that one URL is in the index.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`cmd` required</td><td>string</td><td>query</td><td>The command name. Always GetTopPages for this call. One of `GetTopPages` Example `GetTopPages`</td></tr>
    <tr><td>`datasource`</td><td>string</td><td>query</td><td>Index to query: historic (default when your plan includes it) or fresh. Majestic advises always setting it. One of `fresh`, `historic`</td></tr>
    <tr><td>`Query` required</td><td>string</td><td>query</td><td>A root domain, subdomain or one URL. Example `majestic.com`</td></tr>
    <tr><td>`Count`</td><td>integer</td><td>query</td><td>URLs to return. Default 10, maximum 10000. Example `10`</td></tr>
    <tr><td>`UsePrefixScan`</td><td>integer</td><td>query</td><td>1 enables prefix mode. One of `0`, `1`</td></tr>

    <tr>
      <td>
        `StartDoc`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Item to start from; defaults to 0.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developer-support.majestic.com/api/commands/get-top-pages.shtml) · Same job: [Ahrefs](https://docs.webrouter.net/data-apis/ahrefs.md#ahrefs-top-pages), [Mangools](https://docs.webrouter.net/data-apis/mangools.md#mangools-site-top-content), [Moz](https://docs.webrouter.net/data-apis/moz.md#moz-links-top-pages), [SpyFu](https://docs.webrouter.net/data-apis/spyfu.md#spyfu-seo-top-pages)

```python Python theme={null}
router.call_data_api("majestic.domain.top_pages", {'cmd': 'GetTopPages', 'Query': 'majestic.com', 'Count': 10})
```

```text MCP theme={null}
call_data_api(endpoint="majestic.domain.top_pages", params={"cmd": "GetTopPages", "Query": "majestic.com", "Count": 10})
```

> [!NOTE]
>
> * Costs 5000 Analysis units per call plus one Retrieval unit per row.
> * The only guaranteed way to check whether a URL is in the index.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.