{
  "openapi": "3.0.1",
  "info": {
    "title": "Ahrefs Scraper - Domain Rating, Backlinks & Keywords",
    "description": "Get Ahrefs SEO data without a subscription: Domain Rating, backlinks, broken links, organic traffic, keyword ideas, keyword difficulty, SERP, rank checks and AI citations for any domain or keyword. Export to CSV, JSON or Excel, schedule runs or use the API.",
    "version": "0.1",
    "x-build-id": "30B1Ecw9FSiXz7fGo"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automly~ahrefs-seo-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automly-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/automly~ahrefs-seo-scraper/runs": {
      "post": {
        "operationId": "runs-sync-automly-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/automly~ahrefs-seo-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-automly-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",
        "required": [
          "searchType"
        ],
        "properties": {
          "searchType": {
            "title": "What to get",
            "enum": [
              "website_authority",
              "backlinks_overview",
              "backlinks_list",
              "broken_links",
              "traffic_overview",
              "keyword_ideas",
              "keyword_difficulty",
              "keyword_metrics",
              "serp_overview",
              "keyword_rank",
              "ai_visibility",
              "ai_mode_tracker",
              "ai_overviews_tracker",
              "sitemap",
              "website_details",
              "top_websites"
            ],
            "type": "string",
            "description": "Pick the data you want. URL tools use the URLs or domains below; keyword tools use the keywords; the rank checker uses both.",
            "default": "website_authority"
          },
          "urls": {
            "title": "URLs or domains",
            "type": "array",
            "description": "Enter one or more domains or page URLs (apify.com, https://example.com/blog). Used by the website, backlink, traffic, sitemap, AI and rank tools. For the AI tools, a brand name works too.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Enter one or more keywords for keyword ideas, difficulty, metrics, SERP and the rank checker. The rank checker checks every URL above against every keyword.",
            "items": {
              "type": "string"
            }
          },
          "keyword": {
            "title": "Keyword (single)",
            "type": "string",
            "description": "One keyword; the same as adding it to Keywords. Kept so inputs from other Ahrefs actors work unchanged."
          },
          "mode": {
            "title": "URL mode",
            "enum": [
              "subdomains",
              "domain",
              "prefix",
              "exact"
            ],
            "type": "string",
            "description": "What part of the website the backlink, broken link and traffic tools look at.",
            "default": "subdomains"
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Two-letter country code for keyword and SERP data: us, gb, de, fr, in, ...",
            "default": "us"
          },
          "searchEngine": {
            "title": "Search engine (keyword ideas)",
            "enum": [
              "Google",
              "Bing",
              "YouTube",
              "Amazon",
              "Yahoo",
              "Yandex",
              "Baidu",
              "ChatGPT",
              "Gemini",
              "Perplexity",
              "Copilot",
              "Grok",
              "GoogleAIMode",
              "GoogleImages",
              "GoogleNews",
              "GoogleVideos",
              "Daum",
              "Naver",
              "Seznam",
              "Yep"
            ],
            "type": "string",
            "description": "Where keyword ideas come from. Ahrefs currently has keyword ideas for Google only; other engines return none, and nothing is charged for them.",
            "default": "Google"
          },
          "topWebsitesLimit": {
            "title": "Number of websites",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many websites to return from the worldwide ranking (up to 1,000). A country or category list has up to 100.",
            "default": 100
          },
          "topWebsitesMode": {
            "title": "List",
            "enum": [
              "ranking",
              "trending"
            ],
            "type": "string",
            "description": "The ranking itself, or the websites that moved the most this month.",
            "default": "ranking"
          },
          "topWebsitesCountry": {
            "title": "Country",
            "type": "string",
            "description": "Country name in lowercase with dashes: worldwide, united-states, germany, united-kingdom, india, ...",
            "default": "worldwide"
          },
          "topWebsitesCategory": {
            "title": "Category",
            "enum": [
              "all",
              "arts-and-entertainment",
              "autos-and-vehicles",
              "beauty-and-fitness",
              "books-and-literature",
              "business",
              "computers-and-electronics",
              "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"
            ],
            "type": "string",
            "description": "Limit the list to one category.",
            "default": "all"
          },
          "includeDetails": {
            "title": "Include website details",
            "type": "boolean",
            "description": "Add each website's details: exact monthly traffic history, traffic by country, top keywords, competitors, Domain Rating and referring domains history.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "The default works for every tool.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}