{
  "openapi": "3.0.1",
  "info": {
    "title": "SEO Data Scraper for Ahrefs - Domain Rating, Traffic & Links",
    "description": "Scrape Ahrefs public Top-Websites data for any domain: Domain Rating, organic search traffic, traffic value in USD, organic keyword count, linking websites with monthly change, top keyword, top country and organic competitors. Independent tool, not affiliated with Ahrefs.",
    "version": "0.1",
    "x-build-id": "T9hErZN12IvFYcDyu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~ahrefs-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-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/scrapesage~ahrefs-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-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/scrapesage~ahrefs-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-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": {
          "domains": {
            "title": "Domains",
            "type": "array",
            "description": "Domains to analyse, one per line, e.g. <code>booking.com</code>. Full URLs and Ahrefs links are accepted and reduced to the host name (<code>www.</code> removed, and a site Ahrefs files under its www. host, such as <code>www.nhs.uk</code>, is still found); a subdomain stays as typed, because Ahrefs tracks some on their own (<code>de.wikipedia.org</code>). Ahrefs publishes a page only for domains in its index; anything else is reported as <i>not tracked</i> and is never charged.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Ahrefs URLs",
            "type": "array",
            "description": "Paste Ahrefs Top-Websites URLs directly, e.g. <code>https://ahrefs.com/websites/booking.com</code>. <b>Bulk import:</b> use this field&#39;s <i>Link remote text file</i> option to load a hosted list, or paste the list into <b>Import domains from a file</b> below.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "urlsFromFile": {
            "title": "Import domains from a file (one per line)",
            "type": "string",
            "description": "Bulk-load domains without adding them one at a time. Either <b>paste the whole list</b> (one per line), or give <b>a single link</b> to a public <code>.txt</code>/<code>.csv</code>, a Google Sheet or Drive share link, or an Apify key-value-store record. Blank lines, <code>#</code> comments, CRLF, a UTF-8 or UTF-16 file, quotes and extra CSV columns all parse; duplicates are analysed once. A file that cannot be read (a PDF, an Excel file, a Sheet that is not shared publicly) is named on the run card, and no domain is billed for it."
          },
          "includeHistory": {
            "title": "Include traffic and linking-websites history",
            "type": "boolean",
            "description": "Add the monthly organic traffic series Ahrefs charts on the page (since 2015 for older sites), month by month with traffic value, plus the monthly linking-websites history.",
            "default": true
          },
          "includeKeywords": {
            "title": "Include top keywords",
            "type": "boolean",
            "description": "Add the keyword sending the domain the most traffic (position, country, monthly visits) and the top 5 keywords Ahrefs lists, each with search volume, traffic, position and their monthly changes.",
            "default": true
          },
          "includeCountries": {
            "title": "Include top countries",
            "type": "boolean",
            "description": "Add the country sending the most traffic (visits, monthly change, share of total) and the top 5 countries with exact visits, the previous month and their share.",
            "default": true
          },
          "includeCompetitors": {
            "title": "Include organic competitors",
            "type": "boolean",
            "description": "Add the up to 5 domains ranking in the top 10 for the keywords this domain gets most of its traffic from, each with its traffic, monthly change and page count.",
            "default": true
          },
          "outputFields": {
            "title": "Output fields (leave empty for all)",
            "type": "array",
            "description": "Pick the fields you want and every record is trimmed to exactly those, handy for lean CSV/Sheets exports. <b>Nothing to memorise:</b> open the dropdown and tick, or start typing (<code>traffic</code>, <code>rating</code>, <code>keyword</code>) to filter. Leave empty to get every field.",
            "items": {
              "type": "string",
              "enum": [
                "type",
                "domain",
                "url",
                "siteTitle",
                "siteDescription",
                "domainRating",
                "linkingWebsites",
                "linkingWebsitesChange",
                "organicTraffic",
                "organicTrafficChange",
                "trafficValueUsd",
                "trafficValueChangeUsd",
                "organicKeywords",
                "globalRank",
                "dataMonth",
                "dateModified",
                "topCountry",
                "topCountryVisits",
                "topCountryChange",
                "topCountryShare",
                "topKeyword",
                "topKeywordPosition",
                "topKeywordCountry",
                "topKeywordVisits",
                "competitors",
                "competitorCount",
                "neighbourDomain",
                "neighbourVisits",
                "neighbourRank",
                "trafficHistory",
                "trafficHistoryPoints",
                "scrapedAt",
                "pageDescription",
                "globalRankChange",
                "countryRank",
                "countryRankCountry",
                "countryRankChange",
                "category",
                "categoryRank",
                "categoryRankChange",
                "organicTrafficExact",
                "organicTrafficChangeExact",
                "trafficValueUsdExact",
                "trafficValueChangeUsdExact",
                "linkingWebsitesExact",
                "linkingWebsitesChangeExact",
                "topCountries",
                "topCountriesText",
                "topKeywords",
                "topKeywordsText",
                "topCompetitorsCountry",
                "topCompetitors",
                "competitorsText",
                "similarlyRanked",
                "trafficHistoryMonthly",
                "linkingWebsitesHistory",
                "siteTextNote"
              ],
              "enumTitles": [
                "Record type (type)",
                "Domain (domain)",
                "Ahrefs URL (url)",
                "Site title (siteTitle)",
                "Site description (siteDescription)",
                "Domain Rating (domainRating)",
                "Linking websites (linkingWebsites)",
                "Linking websites change (linkingWebsitesChange)",
                "Organic search traffic (organicTraffic)",
                "Organic traffic change (organicTrafficChange)",
                "Traffic value USD (trafficValueUsd)",
                "Traffic value change USD (trafficValueChangeUsd)",
                "Organic keywords (organicKeywords)",
                "Global rank (globalRank)",
                "Data month (dataMonth)",
                "Date modified (dateModified)",
                "Top country (topCountry)",
                "Top country visits (topCountryVisits)",
                "Top country change (topCountryChange)",
                "Top country share (topCountryShare)",
                "Top keyword (topKeyword)",
                "Top keyword position (topKeywordPosition)",
                "Top keyword country (topKeywordCountry)",
                "Top keyword visits (topKeywordVisits)",
                "Competitors (competitors)",
                "Competitor count (competitorCount)",
                "Nearest-ranked domain (neighbourDomain)",
                "Nearest-ranked visits (neighbourVisits)",
                "Nearest-ranked rank (neighbourRank)",
                "Organic traffic history (trafficHistory)",
                "History points (trafficHistoryPoints)",
                "Scraped at (scrapedAt)",
                "Ahrefs page summary (pageDescription)",
                "Global rank change (globalRankChange)",
                "Country rank (countryRank)",
                "Country of the country rank (countryRankCountry)",
                "Country rank change (countryRankChange)",
                "Category (category)",
                "Category rank (categoryRank)",
                "Category rank change (categoryRankChange)",
                "Organic traffic, exact (organicTrafficExact)",
                "Organic traffic change, exact (organicTrafficChangeExact)",
                "Traffic value USD, exact (trafficValueUsdExact)",
                "Traffic value change USD, exact (trafficValueChangeUsdExact)",
                "Linking websites, exact (linkingWebsitesExact)",
                "Linking websites change, exact (linkingWebsitesChangeExact)",
                "Top 5 countries (topCountries)",
                "Top 5 countries, as text (topCountriesText)",
                "Top 5 keywords (topKeywords)",
                "Top 5 keywords, as text (topKeywordsText)",
                "Market of the competitors (topCompetitorsCountry)",
                "Top competitors with traffic and pages (topCompetitors)",
                "Competitors, as text (competitorsText)",
                "Similarly ranked websites (similarlyRanked)",
                "Monthly traffic and traffic value history (trafficHistoryMonthly)",
                "Monthly linking websites history (linkingWebsitesHistory)",
                "Why the site title or description is empty (siteTextNote)"
              ]
            }
          },
          "maxItems": {
            "title": "Max domains",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of domains to analyse in one run, in list order (a domain Ahrefs does not track counts as analysed but is never charged). Domains past this number are named on the run card.",
            "default": 100
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. Ahrefs serves these public pages to Apify datacenter proxies, which are used by default; a try that fails is repeated on a new proxy session. If the run card reports that Ahrefs did not answer for some domains, re-run them or switch to Residential.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}