{
  "openapi": "3.0.1",
  "info": {
    "title": "Ahrefs Scraper — Backlinks, Traffic, Keywords & AI Visibility",
    "description": "Ahrefs SEO data for websites, keywords and brands: DR, backlinks, broken links, organic traffic and long history, competitors, Google SERP and AI visibility. Bulk CSV/JSON imports, country/category rankings and comparison tables. No Ahrefs account required.",
    "version": "0.1",
    "x-build-id": "U5sLEjRpjhIbY9RIJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/trakk~ahrefs-seo-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-trakk-ahrefs-seo-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/trakk~ahrefs-seo-scraper/runs": {
      "post": {
        "operationId": "runs-sync-trakk-ahrefs-seo-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/trakk~ahrefs-seo-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-trakk-ahrefs-seo-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": {
          "task": {
            "title": "Report",
            "enum": [
              "website",
              "links",
              "traffic",
              "keywords",
              "brands",
              "compare",
              "rankings",
              "sitemap",
              "custom"
            ],
            "type": "string",
            "description": "Choose a report and enter its websites, keywords, or brands. Website rankings uses its own filters.",
            "default": "custom"
          },
          "urls": {
            "title": "Websites",
            "type": "array",
            "description": "One domain or URL per line. For Compare, add the benchmark website first.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "One search phrase per entry for keyword research.",
            "items": {
              "type": "string"
            }
          },
          "brands": {
            "title": "Brands",
            "type": "array",
            "description": "One brand name per entry for global AI visibility.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of saved results across this run. Each result is one website, keyword, brand or ranking entry.",
            "default": 1000
          },
          "mode": {
            "title": "Website scope",
            "enum": [
              "exact",
              "prefix",
              "domain",
              "subdomains"
            ],
            "type": "string",
            "description": "Domain + subdomains, domain only, a path prefix or an exact URL. Extended profiles and organic competitors remain domain-level reports.",
            "default": "subdomains"
          },
          "country": {
            "title": "Search country",
            "type": "string",
            "description": "Two-letter country code for keyword difficulty, SERP, rank and keyword ideas, for example us, gb or de. AI brand metrics are global. UK is normalized to GB. Native suggestions currently use verified default-market pairs: Google/Bing/YouTube/Amazon/Yahoo us; Yandex ru; Baidu cn; Naver kr; Seznam cz.",
            "default": "us"
          },
          "searchEngine": {
            "title": "Keyword ideas engine",
            "enum": [
              "Google",
              "Bing",
              "YouTube",
              "Amazon",
              "Yahoo",
              "Yandex",
              "Baidu",
              "Naver",
              "Seznam"
            ],
            "type": "string",
            "description": "Choose the source for ideas and native suggestions. Keyword difficulty and organic search results use Google.",
            "default": "Google"
          },
          "rankDomain": {
            "title": "Domain to find in Google",
            "type": "string",
            "description": "Optional domain to look for in the returned Google results."
          },
          "topWebsitesCountry": {
            "title": "Ranking country",
            "enum": [
              "worldwide",
              "ad",
              "ae",
              "af",
              "ag",
              "al",
              "am",
              "ao",
              "ar",
              "at",
              "au",
              "az",
              "ba",
              "bd",
              "be",
              "bf",
              "bg",
              "bh",
              "bi",
              "bj",
              "bn",
              "bo",
              "br",
              "bs",
              "bt",
              "bw",
              "by",
              "bz",
              "ca",
              "cd",
              "cf",
              "cg",
              "ch",
              "ci",
              "cl",
              "cm",
              "co",
              "cr",
              "cv",
              "cy",
              "cz",
              "de",
              "dj",
              "dk",
              "do",
              "dz",
              "ec",
              "ee",
              "eg",
              "es",
              "et",
              "fi",
              "fj",
              "fr",
              "ga",
              "gb",
              "ge",
              "gg",
              "gh",
              "gi",
              "gl",
              "gm",
              "gp",
              "gr",
              "gt",
              "gy",
              "hk",
              "hn",
              "hr",
              "ht",
              "hu",
              "id",
              "ie",
              "il",
              "im",
              "in",
              "iq",
              "is",
              "it",
              "je",
              "jm",
              "jo",
              "jp",
              "ke",
              "kg",
              "kh",
              "kr",
              "kw",
              "kz",
              "la",
              "lb",
              "li",
              "lk",
              "ls",
              "lt",
              "lu",
              "lv",
              "ly",
              "ma",
              "md",
              "me",
              "mg",
              "mk",
              "ml",
              "mm",
              "mn",
              "mt",
              "mu",
              "mv",
              "mw",
              "mx",
              "my",
              "mz",
              "na",
              "ne",
              "ng",
              "ni",
              "nl",
              "no",
              "np",
              "nz",
              "om",
              "pa",
              "pe",
              "pg",
              "ph",
              "pk",
              "pl",
              "pr",
              "ps",
              "pt",
              "py",
              "qa",
              "ro",
              "rs",
              "ru",
              "rw",
              "sa",
              "sc",
              "se",
              "sg",
              "si",
              "sk",
              "sl",
              "sn",
              "so",
              "sr",
              "sv",
              "td",
              "tg",
              "th",
              "tj",
              "tl",
              "tm",
              "tn",
              "tr",
              "tt",
              "tw",
              "tz",
              "ua",
              "ug",
              "us",
              "uy",
              "uz",
              "vc",
              "ve",
              "vi",
              "vn",
              "za",
              "zm",
              "zw"
            ],
            "type": "string",
            "description": "Country whose published ranking is requested. Independent of the keyword country.",
            "default": "worldwide"
          },
          "topWebsitesCategory": {
            "title": "Ranking category",
            "enum": [
              "",
              "Arts & Entertainment",
              "Autos & Vehicles",
              "Beauty & Fitness",
              "Books & Literature",
              "Business & Industrial",
              "Computers & Electronics",
              "Entertainment",
              "Finance",
              "Food & Drink",
              "Games",
              "Health",
              "Hobbies & Leisure",
              "Home & Garden",
              "Internet & Telecom",
              "Jobs & Education",
              "Law & Government",
              "News",
              "Online Communities",
              "People & Society",
              "Pets & Animals",
              "Real Estate",
              "Reference",
              "Science",
              "Shopping",
              "Sports",
              "Travel"
            ],
            "type": "string",
            "description": "Only return Top Websites in this category. Leave as 'All categories' for the full ranking.",
            "default": ""
          },
          "topWebsitesRanking": {
            "title": "Ranking or trend",
            "enum": [
              "ranking",
              "trending_up",
              "trending_down"
            ],
            "type": "string",
            "description": "Choose the top ranking or the source-published trending sample. Trending lists are usually shorter.",
            "default": "ranking"
          },
          "topWebsitesLimit": {
            "title": "Maximum ranked websites",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum matching ranking rows saved, within the global result and charge limits. Up to 1000 worldwide ranking rows across pages; country/category and trending lists may publish fewer.",
            "default": 100
          },
          "maxSitemapUrls": {
            "title": "Maximum sitemap URLs per website",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of sitemap entries to export per website. Sitemap entries use their existing separate event.",
            "default": 1000
          },
          "customTools": {
            "title": "Tools for Custom toolbox",
            "type": "array",
            "description": "Only used when the report is Custom toolbox. Select any combination. With an empty selection, existing JSON include… options apply; their defaults are authority + traffic for websites and difficulty + ideas for keywords. Native suggestions are collected only when you explicitly select native_suggestions. They have separate source-labelled fields and no Ahrefs volume or difficulty labels.",
            "items": {
              "type": "string",
              "enum": [
                "authority",
                "traffic",
                "backlinks",
                "broken_links",
                "profile",
                "competitors",
                "keyword_difficulty",
                "keyword_ideas",
                "native_suggestions",
                "serp",
                "ai_visibility",
                "ai_overviews",
                "ai_mode",
                "rankings",
                "sitemap",
                "comparison"
              ],
              "enumTitles": [
                "Domain Rating & link totals",
                "Organic traffic",
                "Backlink sample",
                "Broken inbound & outbound links",
                "Extended profile & long history",
                "Organic competitors",
                "Keyword difficulty & Google SERP",
                "Keyword ideas",
                "Native search suggestions (no volume metrics)",
                "Standalone Google SERP",
                "AI brand visibility",
                "Google AI Overviews mentions",
                "Google AI Mode mentions",
                "Website rankings & trends",
                "Sitemap URL export",
                "Comparison from collected website data"
              ]
            }
          },
          "urlsFromFile": {
            "title": "Import websites from a file or pasted list",
            "type": "string",
            "description": "Optional public CSV, JSON or text download URL, or a pasted domain list. Maximum 2 MiB. CSV headers and duplicates are handled. Private files and HTML share pages need a direct public download link. Use a website report or Custom toolbox; other reports do not download this file."
          },
          "withQuestionIdeas": {
            "title": "Include question keywords",
            "type": "boolean",
            "description": "Also return question-style keyword ideas.",
            "default": false
          },
          "enrichKeywordIdeas": {
            "title": "Add real difficulty to keyword ideas",
            "type": "boolean",
            "description": "Add source-published numeric difficulty to the selected top keyword ideas. The number enriched is controlled by Max enriched ideas. Other ideas retain their published difficulty labels.",
            "default": false
          },
          "maxEnrichedIdeas": {
            "title": "Max enriched ideas per seed",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many top ideas per seed keyword get a real numeric difficulty when the option above is on.",
            "default": 10
          },
          "protocol": {
            "title": "Protocol",
            "type": "string",
            "description": "Which protocol to count traffic for (site-level tools).",
            "default": "both"
          },
          "includeWebsiteAuthority": {
            "title": "Domain Rating & backlinks overview",
            "type": "boolean",
            "description": "Domain Rating, backlinks, referring domains (per URL).",
            "default": true
          },
          "includeTraffic": {
            "title": "Organic traffic",
            "type": "boolean",
            "description": "Estimated monthly organic traffic and its history.",
            "default": true
          },
          "includeBacklinks": {
            "title": "Top backlinks list",
            "type": "boolean",
            "description": "Save the top backlinks per URL to a separate Backlinks dataset.",
            "default": false
          },
          "includeBrokenLinks": {
            "title": "Broken inbound and outbound links",
            "type": "boolean",
            "description": "Broken incoming links and broken destinations linked from the site, with source/target URLs, context, HTTP codes and published totals.",
            "default": false
          },
          "includeWebsiteProfile": {
            "title": "Extended website profile and long history",
            "type": "boolean",
            "description": "Published AhrefsTop domain profile: long monthly traffic/value history, referring-domain history, organic keyword count, country traffic, keyword sample and competitor sample. Domain scope, including when the main URL scope is a page.",
            "default": false
          },
          "includeCompetitors": {
            "title": "Organic competitors report",
            "type": "boolean",
            "description": "Available AhrefsTop organic competitor sample with traffic, value and authority metrics. Can run independently. The analysed site itself is excluded.",
            "default": false
          },
          "compareDomains": {
            "title": "Compare the collected websites",
            "type": "boolean",
            "description": "Add a Comparison table using the first website as primary. Includes authority/traffic ranks, compatible-period traffic shares, sampled keyword gaps and referring-host opportunities when the corresponding data options are enabled. Up to 1000 websites. No additional result event for this table.",
            "default": false
          },
          "includeSitemap": {
            "title": "Sitemap (URL list)",
            "type": "boolean",
            "description": "URLs published by Ahrefs sitemap crawl, exported to a separate Sitemap table. The result includes source counts. Exported URLs use the existing sitemap-url event and respect the remaining charge budget.",
            "default": false
          },
          "includeKeywordDifficulty": {
            "title": "Keyword difficulty & SERP",
            "type": "boolean",
            "description": "Keyword difficulty, referring domains needed to rank and the source-published Google SERP, including available page metrics and SERP features.",
            "default": true
          },
          "includeSerp": {
            "title": "Standalone Google SERP",
            "type": "boolean",
            "description": "Available Google organic results, source positions, DR/UR, page traffic/value, keywords and SERP features such as AI Overview and People Also Ask. The difficulty option already includes this available SERP and avoids a duplicate lookup.",
            "default": false
          },
          "includeKeywordIdeas": {
            "title": "Keyword ideas",
            "type": "boolean",
            "description": "Keyword suggestions (with volume & difficulty labels) for each keyword.",
            "default": true
          },
          "brand": {
            "title": "Brand (for AI tools)",
            "type": "string",
            "description": "Optional single brand to attach global AI metrics to each keyword result. With no keywords it produces a brand result when an AI option is enabled. Use Brands for bulk brand-only results."
          },
          "includeAiVisibility": {
            "title": "AI visibility (citations by model)",
            "type": "boolean",
            "description": "Published citations by assistant, monthly history, cited domains/pages, topics and model trend calculations. Requires a brand or brands.",
            "default": false
          },
          "includeAiOverviews": {
            "title": "AI overviews tracker",
            "type": "boolean",
            "description": "Global Google AI Overviews brand mentions, source timeline, cited domains/pages and topics. Requires a brand or brands.",
            "default": false
          },
          "includeAiMode": {
            "title": "AI mode tracker",
            "type": "boolean",
            "description": "Global Google AI Mode brand mentions, source timeline, cited domains/pages and topics. Requires a brand or brands.",
            "default": false
          },
          "includeTopWebsites": {
            "title": "Top websites ranking",
            "type": "boolean",
            "description": "Public AhrefsTop rankings by country/category or trending up/down. Runs without websites, keywords, brands or a configured data-access service.",
            "default": false
          },
          "minDomainRating": {
            "title": "Min Domain Rating",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Keep only domains with DR at or above this (0–100)."
          },
          "maxDomainRating": {
            "title": "Max Domain Rating",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Keep only domains with DR at or below this (0–100)."
          },
          "minBacklinks": {
            "title": "Min backlinks",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only domains with at least this many backlinks."
          },
          "minRefDomains": {
            "title": "Min referring domains",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only domains with at least this many referring domains."
          },
          "minOrganicTraffic": {
            "title": "Min organic traffic",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only domains with at least this much monthly organic traffic."
          },
          "minTrafficValueUsd": {
            "title": "Min traffic value ($)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only domains whose monthly organic traffic value is at least this."
          },
          "minKeywordDifficulty": {
            "title": "Min keyword difficulty",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Keep only keywords with KD at or above this (0–100)."
          },
          "maxKeywordDifficulty": {
            "title": "Max keyword difficulty",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Keep only keywords with KD at or below this (0–100)."
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Override the number of targets processed in parallel. Large Website overview runs can use up to 15 targets; other reports default to 5."
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Attempt allowance for temporary source errors. More attempts may increase runtime.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Proxy configuration.",
            "default": {
              "useApifyProxy": true
            }
          },
          "includeNativeSuggestions": {
            "title": "Native search suggestions",
            "type": "boolean",
            "description": "Explicit first-party autocomplete data, separate from Ahrefs ideas. Verified default markets: Google/Bing/YouTube/Amazon/Yahoo US, Yandex RU, Baidu CN, Naver KR, Seznam CZ.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}