{
  "openapi": "3.0.1",
  "info": {
    "title": "Ahrefs Scraper & Competitor Comparison",
    "description": "🚀 Ahrefs Scraper automates extracting SEO data from Ahrefs to power competitor research, backlink analysis, and content strategy. 📈 Fast, reliable, and built for growth teams. 🤖 Perfect for agencies & analysts.",
    "version": "0.2",
    "x-build-id": "942QgkwMyBCd2WLfX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/simpleapi~ahrefs-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-simpleapi-ahrefs-scraper",
        "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/simpleapi~ahrefs-scraper/runs": {
      "post": {
        "operationId": "runs-sync-simpleapi-ahrefs-scraper",
        "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/simpleapi~ahrefs-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-simpleapi-ahrefs-scraper",
        "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": {
          "keyword": {
            "title": "💡 Keyword or Brand",
            "type": "string",
            "description": "The keyword (or brand, for AI Visibility) to research on Ahrefs."
          },
          "url": {
            "title": "🌐 URL or Domain",
            "type": "string",
            "description": "The single URL or domain to analyse on Ahrefs (e.g. make.com). For many targets at once, use the bulk field below."
          },
          "country": {
            "title": "🗺️ Country",
            "enum": [
              "af",
              "al",
              "dz",
              "as",
              "ad",
              "ao",
              "ai",
              "ag",
              "ar",
              "am",
              "au",
              "at",
              "az",
              "bs",
              "bh",
              "bd",
              "by",
              "be",
              "bz",
              "bj",
              "bt",
              "bo",
              "ba",
              "bw",
              "br",
              "bn",
              "bg",
              "bf",
              "bi",
              "kh",
              "cm",
              "ca",
              "cv",
              "cf",
              "td",
              "cl",
              "co",
              "cg",
              "cd",
              "ck",
              "cr",
              "ci",
              "hr",
              "cy",
              "cz",
              "dk",
              "dj",
              "dm",
              "do",
              "ec",
              "eg",
              "sv",
              "ee",
              "et",
              "fj",
              "fi",
              "fr",
              "ga",
              "gm",
              "ge",
              "de",
              "gh",
              "gi",
              "gr",
              "gl",
              "gp",
              "gt",
              "gg",
              "gy",
              "ht",
              "hn",
              "hk",
              "hu",
              "is",
              "in",
              "id",
              "iq",
              "ie",
              "il",
              "it",
              "jm",
              "jp",
              "je",
              "jo",
              "kz",
              "ke",
              "ki",
              "kr",
              "kw",
              "kg",
              "la",
              "lv",
              "lb",
              "ls",
              "ly",
              "li",
              "lt",
              "lu",
              "mk",
              "mg",
              "mw",
              "my",
              "mv",
              "ml",
              "mt",
              "mu",
              "mx",
              "fm",
              "md",
              "mn",
              "me",
              "ms",
              "ma",
              "mz",
              "mm",
              "na",
              "nr",
              "np",
              "nl",
              "nz",
              "ni",
              "ne",
              "ng",
              "nu",
              "no",
              "om",
              "pk",
              "ps",
              "pa",
              "pg",
              "py",
              "pe",
              "ph",
              "pn",
              "pl",
              "pt",
              "pr",
              "qa",
              "ro",
              "ru",
              "rw",
              "sh",
              "vc",
              "ws",
              "sm",
              "st",
              "sa",
              "sn",
              "rs",
              "sc",
              "sl",
              "sg",
              "sk",
              "si",
              "sb",
              "so",
              "za",
              "es",
              "lk",
              "sr",
              "se",
              "ch",
              "tw",
              "tj",
              "tz",
              "th",
              "tl",
              "tg",
              "tk",
              "to",
              "tt",
              "tn",
              "tr",
              "tm",
              "ug",
              "ua",
              "ae",
              "gb",
              "us",
              "uy",
              "uz",
              "vu",
              "ve",
              "vn",
              "vg",
              "vi",
              "zm",
              "zw"
            ],
            "type": "string",
            "description": "Country to localise keyword, SERP and traffic results.",
            "default": "us"
          },
          "mode": {
            "title": "🎚️ Mode",
            "enum": [
              "subdomains",
              "exact"
            ],
            "type": "string",
            "description": "Scope of the domain analysis: 'subdomains' (whole site incl. subdomains) or 'exact' (just the exact URL/host).",
            "default": "subdomains"
          },
          "urls": {
            "title": "📊 Domains to Compare (Bulk)",
            "type": "array",
            "description": "The domains/URLs to scrape and rank side by side. Add 2 or more to build the competitor scoreboard and keyword gap. When set, this overrides the single URL field above.",
            "items": {
              "type": "string"
            }
          },
          "include_web_authority": {
            "title": "🏆 Include Domain Overview / Website Authority",
            "type": "boolean",
            "description": "Needs a Domain/URL. If checked, includes Domain Rating, backlinks & referring-domain counts.",
            "default": true
          },
          "include_traffic": {
            "title": "📊 Include Web-Traffic",
            "type": "boolean",
            "description": "Needs a Domain/URL. If checked, includes estimated monthly visits, traffic value, history, top pages/countries/keywords.",
            "default": true
          },
          "include_ai_visibility": {
            "title": "🤖 Include AI Visibility Search (New)",
            "type": "boolean",
            "description": "Needs a Brand/Keyword. If checked, includes AI citations across LLMs, top cited domains/pages & topics.",
            "default": false
          },
          "include_keywords": {
            "title": "💡 Include Keywords Search",
            "type": "boolean",
            "description": "Needs a Keyword and Country. If checked, includes keyword ideas + question ideas with volumes.",
            "default": false
          },
          "include_keywords_difficulty": {
            "title": "⚙️ Include Keywords Difficulty Search",
            "type": "boolean",
            "description": "Needs a Keyword and Country. If checked, includes the Keyword Difficulty score + ranking SERP.",
            "default": false
          },
          "include_keywords_ranking": {
            "title": "🎯 Include Keywords Ranking Search",
            "type": "boolean",
            "description": "Needs a Keyword, Domain and Country. If checked, includes where the domain ranks for the keyword.",
            "default": false
          },
          "include_serp": {
            "title": "🔎 Include SERP Search",
            "type": "boolean",
            "description": "Needs a Keyword and Country. If checked, includes the full SERP overview for the keyword.",
            "default": false
          },
          "include_backlinks": {
            "title": "🔗 Include Backlinks Search",
            "type": "boolean",
            "description": "Needs a Domain/URL. If checked, includes the backlink & referring-domain overview.",
            "default": true
          },
          "include_broken_links": {
            "title": "🧩 Include Broken Links Search",
            "type": "boolean",
            "description": "Needs a Domain/URL. If checked, includes broken inbound & outbound links.",
            "default": false
          },
          "include_top_websites": {
            "title": "🌍 Include AhrefsTop Trending Websites Search",
            "type": "boolean",
            "description": "If checked, includes the top trending websites from AhrefsTop.com — the Top 1000 (worldwide + all categories) or Top 100 when filtered by category/country. Does not need a Keyword or Domain.",
            "default": false
          },
          "category_top_websites": {
            "title": "🗂️ Category (Top Websites Search Only)",
            "enum": [
              "all",
              "beauty-and-fitness",
              "books-and-literature",
              "business",
              "computers-and-electronics",
              "arts-and-entertainment",
              "finance",
              "food-and-drink",
              "games",
              "health",
              "hobbies-and-leisure",
              "home-and-garden",
              "internet-and-telecom",
              "jobs-and-education",
              "law-and-government",
              "news",
              "people-and-society",
              "pets-and-animals",
              "real-estate",
              "reference",
              "science",
              "shopping",
              "social-networks",
              "sports",
              "travel-and-transportation",
              "autos-and-vehicles"
            ],
            "type": "string",
            "description": "Category to filter the AhrefsTop trending websites ranking.",
            "default": "all"
          },
          "country_top_websites": {
            "title": "🌎 Country (Top Websites Search Only)",
            "enum": [
              "worldwide",
              "af",
              "al",
              "dz",
              "as",
              "ad",
              "ao",
              "ai",
              "ag",
              "ar",
              "am",
              "au",
              "at",
              "az",
              "bs",
              "bh",
              "bd",
              "by",
              "be",
              "bz",
              "bj",
              "bt",
              "bo",
              "ba",
              "bw",
              "br",
              "bn",
              "bg",
              "bf",
              "bi",
              "kh",
              "cm",
              "ca",
              "cv",
              "cf",
              "td",
              "cl",
              "co",
              "cg",
              "cd",
              "ck",
              "cr",
              "ci",
              "hr",
              "cy",
              "cz",
              "dk",
              "dj",
              "dm",
              "do",
              "ec",
              "eg",
              "sv",
              "ee",
              "et",
              "fj",
              "fi",
              "fr",
              "ga",
              "gm",
              "ge",
              "de",
              "gh",
              "gi",
              "gr",
              "gl",
              "gp",
              "gt",
              "gg",
              "gy",
              "ht",
              "hn",
              "hk",
              "hu",
              "is",
              "in",
              "id",
              "iq",
              "ie",
              "il",
              "it",
              "jm",
              "jp",
              "je",
              "jo",
              "kz",
              "ke",
              "ki",
              "kr",
              "kw",
              "kg",
              "la",
              "lv",
              "lb",
              "ls",
              "ly",
              "li",
              "lt",
              "lu",
              "mk",
              "mg",
              "mw",
              "my",
              "mv",
              "ml",
              "mt",
              "mu",
              "mx",
              "fm",
              "md",
              "mn",
              "me",
              "ms",
              "ma",
              "mz",
              "mm",
              "na",
              "nr",
              "np",
              "nl",
              "nz",
              "ni",
              "ne",
              "ng",
              "nu",
              "no",
              "om",
              "pk",
              "ps",
              "pa",
              "pg",
              "py",
              "pe",
              "ph",
              "pn",
              "pl",
              "pt",
              "pr",
              "qa",
              "ro",
              "ru",
              "rw",
              "sh",
              "vc",
              "ws",
              "sm",
              "st",
              "sa",
              "sn",
              "rs",
              "sc",
              "sl",
              "sg",
              "sk",
              "si",
              "sb",
              "so",
              "za",
              "es",
              "lk",
              "sr",
              "se",
              "ch",
              "tw",
              "tj",
              "tz",
              "th",
              "tl",
              "tg",
              "tk",
              "to",
              "tt",
              "tn",
              "tr",
              "tm",
              "ug",
              "ua",
              "ae",
              "gb",
              "us",
              "uy",
              "uz",
              "vu",
              "ve",
              "vn",
              "vg",
              "vi",
              "zm",
              "zw"
            ],
            "type": "string",
            "description": "Country to filter the AhrefsTop trending websites ranking.",
            "default": "worldwide"
          },
          "compareDomains": {
            "title": "📊 Build Competitor Scoreboard",
            "type": "boolean",
            "description": "Rank the bulk domains side by side (Domain Rating, monthly organic traffic, traffic value, referring domains). Needs 2+ domains in the bulk field and the Domain Overview / Web-Traffic datasets enabled.",
            "default": true
          },
          "rankBy": {
            "title": "🥇 Rank Scoreboard By",
            "enum": [
              "domainRating",
              "trafficMonthlyAvg",
              "trafficValue",
              "refdomains"
            ],
            "type": "string",
            "description": "Metric used to order the competitor scoreboard (highest first).",
            "default": "trafficMonthlyAvg"
          },
          "keywordOverlap": {
            "title": "🧩 Compute Keyword Gap",
            "type": "boolean",
            "description": "Diff each domain's free top-keyword sample into shared keywords and an approximate keyword gap for the target domain below. Approximation over Ahrefs' free top-keyword sample — not the paid Content Gap.",
            "default": true
          },
          "gapTargetDomain": {
            "title": "🎯 Gap Target Domain",
            "type": "string",
            "description": "The domain whose keyword gap you want — keywords its competitors rank for but it does not, within the sampled set. Leave empty to use the first bulk domain."
          },
          "captchaApiKey": {
            "title": "🔐 Captcha Solver API Key",
            "type": "string",
            "description": "Your CapSolver (or 2Captcha) API key, used to solve the Cloudflare Turnstile that gates every Ahrefs free tool. Required to collect data. Stored securely and never logged. Can also be supplied via the AHREFS_CAPTCHA_KEY env var."
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy Configuration",
            "type": "object",
            "description": "The scraper starts on a DIRECT connection and only escalates to a datacenter, then residential proxy if Ahrefs blocks it. Pick a country here to localise residential fallback.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}