{
  "openapi": "3.0.1",
  "info": {
    "title": "Ahrefs Scraper: Domain Rating, Traffic, AI Leaderboards",
    "description": "Give it a list of domains and get Ahrefs Domain Rating, organic traffic, traffic value and 11 years of monthly history. Also pulls the public top websites ranking and the brands AI assistants mention most.",
    "version": "0.0",
    "x-build-id": "7DK6lGA01mAyBMY8Y"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sourabhbgp~ahrefs-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sourabhbgp-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/sourabhbgp~ahrefs-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sourabhbgp-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/sourabhbgp~ahrefs-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sourabhbgp-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "What to scrape",
            "enum": [
              "domain",
              "top-websites",
              "ai-leaderboards"
            ],
            "type": "string",
            "description": "Domain metrics: pass your own list of domains and get one row each. Top websites: pull the public ranking of the most visited sites. AI leaderboards: the brands AI assistants mention most and the websites they cite most, by month.",
            "default": "domain"
          },
          "domains": {
            "title": "Domains",
            "type": "array",
            "description": "One domain per line. A full URL is fine: it is reduced to the domain automatically. Entries that are not domains are skipped and reported, they do not stop the run. Used by the Domain metrics mode only.",
            "items": {
              "type": "string"
            }
          },
          "includeHistory": {
            "title": "Include monthly history",
            "type": "boolean",
            "description": "Adds the full monthly series of organic traffic, traffic value and referring domains, going back as far as the site is indexed (up to about 11 years). Costs no extra requests.",
            "default": true
          },
          "includeCountryBreakdown": {
            "title": "Include traffic by country",
            "type": "boolean",
            "description": "Adds the per country split of organic traffic with month over month change and share. The source publishes the top 5 countries.",
            "default": true
          },
          "includeRobotsStatus": {
            "title": "Include robots.txt crawl status",
            "type": "boolean",
            "description": "Adds whether AhrefsBot is allowed to crawl the domain, per host and per port. Costs one extra request per domain.",
            "default": false
          },
          "includeCompetitors": {
            "title": "Include competitors",
            "type": "boolean",
            "description": "Adds the competing sites the source lists for each domain, with their Domain Rating, traffic, traffic value, pages and a short description. Costs one extra request per domain.",
            "default": false
          },
          "country": {
            "title": "Country",
            "pattern": "^[a-z][a-z-]{1,40}$",
            "type": "string",
            "description": "Top websites mode only. Use worldwide, or a country slug such as united-states or germany. An unknown slug ends the run cleanly and charges nothing.",
            "default": "worldwide"
          },
          "category": {
            "title": "Category",
            "enum": [
              "",
              "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",
              "online-communities",
              "people-and-society",
              "pets-and-animals",
              "real-estate",
              "reference",
              "science",
              "shopping",
              "sports",
              "travel"
            ],
            "type": "string",
            "description": "Top websites mode only. Optional category filter. Combines with country, so Australia plus Finance returns the top Australian finance sites.",
            "default": ""
          },
          "listMode": {
            "title": "Ranking or trending",
            "enum": [
              "ranking",
              "trending"
            ],
            "type": "string",
            "description": "Top websites mode only. Ranking returns the top 100 sites. Trending returns the 10 biggest climbers and 10 biggest fallers, each tagged with a direction.",
            "default": "ranking"
          },
          "aiPlatforms": {
            "title": "AI platforms",
            "type": "array",
            "description": "AI leaderboards mode only. Pick one or more AI platforms, or All platforms for the combined board. Only platforms the source actually reports separately are listed here.",
            "items": {
              "type": "string",
              "enum": [
                "all",
                "GoogleAIOverviews",
                "GoogleAIMode",
                "Chatgpt",
                "Gemini",
                "Perplexity",
                "Copilot"
              ],
              "enumTitles": [
                "All platforms combined",
                "Google AI Overviews",
                "Google AI Mode",
                "ChatGPT",
                "Gemini",
                "Perplexity",
                "Copilot"
              ]
            },
            "default": [
              "all"
            ]
          },
          "aiMonthsBack": {
            "title": "Months of history",
            "minimum": 1,
            "maximum": 12,
            "type": "integer",
            "description": "AI leaderboards mode only. How many months back from the most recent published month. The source publishes 12 months.",
            "default": 1
          },
          "aiLeaderboard": {
            "title": "Which leaderboard",
            "enum": [
              "both",
              "brands",
              "sources"
            ],
            "type": "string",
            "description": "AI leaderboards mode only. Brands are the names AI assistants mention. Sources are the websites they cite.",
            "default": "both"
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard ceiling on billed rows, for every mode. Rows that are not charged (a domain the source does not index, an entry that is not a domain) do not count against it.",
            "default": 1000
          },
          "maxConcurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many requests to run in parallel. Higher is both faster AND cheaper: compute is billed on memory multiplied by run time, so finishing sooner costs less than the extra parallelism does.",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Defaults to Apify's automatic routing, which uses datacenter IPs. The Actor escalates to residential by itself if datacenter is refused, so there is normally nothing to change here.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}