{
  "openapi": "3.0.1",
  "info": {
    "title": "Backlink Checker API - Majestic Trust Flow and Citation Flow",
    "description": "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.",
    "version": "0.1",
    "x-build-id": "CvpSN2gAcfJjXk1ug"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~trust-flow-backlink-data-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-trust-flow-backlink-data-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/nabeelbaghoor~trust-flow-backlink-data-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-trust-flow-backlink-data-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/nabeelbaghoor~trust-flow-backlink-data-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-trust-flow-backlink-data-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "What to get",
            "enum": [
              "siteMetrics",
              "backlinks",
              "referringDomains",
              "anchorText",
              "topPages",
              "newLostBacklinks",
              "subscriptionInfo"
            ],
            "type": "string",
            "description": "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.",
            "default": "siteMetrics"
          },
          "items": {
            "title": "Domains, subdomains or URLs",
            "type": "array",
            "description": "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.",
            "items": {
              "type": "string"
            }
          },
          "datasource": {
            "title": "Index",
            "enum": [
              "fresh",
              "historic"
            ],
            "type": "string",
            "description": "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.",
            "default": "fresh"
          },
          "usePrefixScan": {
            "title": "Treat a URL as a path prefix",
            "type": "boolean",
            "description": "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.",
            "default": false
          },
          "desiredTopics": {
            "title": "Topical Trust Flow topics",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "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.",
            "default": 3
          },
          "addAllTopics": {
            "title": "Add all trust categories",
            "type": "boolean",
            "description": "Site metrics only. Adds a TrustCategories column listing every topic with its share and value.",
            "default": false
          },
          "removeDeletedLinks": {
            "title": "Leave out deleted links",
            "type": "boolean",
            "description": "Backlinks only. Removes links Majestic has seen deleted.",
            "default": false
          },
          "linksPerRefDomain": {
            "title": "Links per referring domain",
            "enum": [
              "-1",
              "1",
              "3",
              "10"
            ],
            "type": "string",
            "description": "Backlinks only. Limits how many source URLs come from any one referring domain. 1 gives one best backlink per referring domain.",
            "default": "-1"
          },
          "uniqueSourceUrls": {
            "title": "One link per source URL",
            "type": "boolean",
            "description": "Backlinks only. Returns each source URL once, even when it links several times with different anchors.",
            "default": false
          },
          "filterTopic": {
            "title": "Topic filter",
            "type": "string",
            "description": "Backlinks only. Only links matching this Majestic topic, such as Computers/Internet or News."
          },
          "backlinkSort": {
            "title": "Sort backlinks by",
            "enum": [
              "none",
              "AnchorText",
              "DateDeleted",
              "DomainCitationFlow",
              "DomainTrustFlow",
              "ExternalOutlinks",
              "FirstSeen",
              "InternalOutlinks",
              "LastSeen",
              "OutDomainsExternal",
              "SourceCitationFlow",
              "SourceTrustFlow",
              "SourceUrl",
              "TargetUrlLength",
              "TotalOutlinks"
            ],
            "type": "string",
            "description": "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).",
            "default": "none"
          },
          "sortDirection": {
            "title": "Sort direction",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Backlinks and referring domains: the direction of the chosen sort.",
            "default": "desc"
          },
          "filteringDepth": {
            "title": "Filtering depth",
            "enum": [
              "5000",
              "15000",
              "30000",
              "40000",
              "50000"
            ],
            "type": "string",
            "description": "Backlinks only, when sorting or filtering. How many of the top backlinks Majestic sorts and filters through.",
            "default": "5000"
          },
          "trustFlowMin": {
            "title": "Minimum source Trust Flow",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Backlinks only. Only links from pages with at least this Trust Flow (0 to 100)."
          },
          "trustFlowMax": {
            "title": "Maximum source Trust Flow",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Backlinks only. Only links from pages with at most this Trust Flow."
          },
          "citationFlowMin": {
            "title": "Minimum source Citation Flow",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Backlinks only. Only links from pages with at least this Citation Flow (0 to 100)."
          },
          "citationFlowMax": {
            "title": "Maximum source Citation Flow",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Backlinks only. Only links from pages with at most this Citation Flow."
          },
          "linkType": {
            "title": "Link type",
            "enum": [
              "any",
              "TextLink",
              "ImageLink",
              "Redirect",
              "Frame"
            ],
            "type": "string",
            "description": "Backlinks only.",
            "default": "any"
          },
          "followType": {
            "title": "Follow or nofollow",
            "enum": [
              "any",
              "follow",
              "nofollow"
            ],
            "type": "string",
            "description": "Backlinks only.",
            "default": "any"
          },
          "liveStatus": {
            "title": "Live or deleted",
            "enum": [
              "any",
              "live",
              "deleted"
            ],
            "type": "string",
            "description": "Backlinks only.",
            "default": "any"
          },
          "sourceLanguage": {
            "title": "Source page language",
            "type": "string",
            "description": "Backlinks only. A 2 letter language code, such as en or de."
          },
          "anchorContains": {
            "title": "Anchor text contains",
            "type": "string",
            "description": "Backlinks only. Only links whose anchor text contains this text (case insensitive)."
          },
          "sourceUrlContains": {
            "title": "Source URL contains",
            "type": "string",
            "description": "Backlinks only. Only links whose source URL contains this text."
          },
          "firstIndexedAfter": {
            "title": "First indexed after",
            "type": "string",
            "description": "Backlinks only. Only links Majestic first indexed after this date (YYYY-MM-DD)."
          },
          "lastSeenAfter": {
            "title": "Last seen after",
            "type": "string",
            "description": "Backlinks only. Only links Majestic last saw after this date (YYYY-MM-DD)."
          },
          "refDomainSort": {
            "title": "Sort referring domains by",
            "enum": [
              "default",
              "matches",
              "alexaRank",
              "refDomains",
              "extBackLinks",
              "indexedUrls",
              "crawledUrls",
              "firstCrawled",
              "lastSuccessfulCrawl",
              "ip",
              "subnet",
              "countryCode",
              "matchedLinks",
              "citationFlow",
              "trustFlow",
              "outDomainsExternal",
              "outLinksExternal",
              "outLinksInternal",
              "outLinksPages",
              "linkSaturation"
            ],
            "type": "string",
            "description": "Referring domains only. No extra unit cost.",
            "default": "default"
          },
          "analysisDepth": {
            "title": "Analysis depth",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Referring domains only. The most referring domains Majestic considers per item before sorting (provider default 10,000, maximum 100,000)."
          },
          "cleanAnchorText": {
            "title": "Clean anchor text",
            "type": "boolean",
            "description": "Anchor text only. Removes punctuation and delimiters from the anchors.",
            "default": false
          },
          "anchorFilter": {
            "title": "Anchor text filter",
            "type": "string",
            "description": "Anchor text only. Only anchors matching this text."
          },
          "anchorMatch": {
            "title": "Anchor filter match",
            "enum": [
              "contains",
              "exact"
            ],
            "type": "string",
            "description": "Anchor text only. How the anchor text filter matches.",
            "default": "contains"
          },
          "linkChange": {
            "title": "New or lost",
            "enum": [
              "new",
              "lost"
            ],
            "type": "string",
            "description": "New or lost backlinks only.",
            "default": "new"
          },
          "dateFrom": {
            "title": "Start date",
            "type": "string",
            "description": "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": {
            "title": "End date",
            "type": "string",
            "description": "New or lost backlinks only. YYYY-MM-DD."
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "The most rows this run returns and charges for. Majestic also spends 1 retrieval unit per row on your plan, so keep this modest.",
            "default": 100
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "Pacing. A rate limit answer is waited out and retried.",
            "default": 30
          },
          "apiKey": {
            "title": "API key",
            "type": "string",
            "description": "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."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}