{
  "openapi": "3.0.1",
  "info": {
    "title": "Ahrefs Scraper - Domain Rating, Traffic Value & Backlinks",
    "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.",
    "version": "0.1",
    "x-build-id": "mC9ghusgaRYidAVkl"
  },
  "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 registrable domain. 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 BOM, quotes and extra CSV columns all parse; duplicates are analysed once. A file that cannot be read says so and charges nothing."
          },
          "includeHistory": {
            "title": "Include organic traffic history",
            "type": "boolean",
            "description": "Add the long-run monthly organic-traffic series Ahrefs charts on the page.",
            "default": true
          },
          "includeKeywords": {
            "title": "Include top keyword",
            "type": "boolean",
            "description": "Add the single keyword sending the domain the most traffic, with its position, country and monthly visits.",
            "default": true
          },
          "includeCountries": {
            "title": "Include top country",
            "type": "boolean",
            "description": "Add the country sending the most traffic, with its visits, monthly change and share of total.",
            "default": true
          },
          "includeCompetitors": {
            "title": "Include organic competitors",
            "type": "boolean",
            "description": "Add the domains ranking in the top 10 for the same keywords this domain gets most of its traffic from.",
            "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"
              ],
              "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)"
              ]
            }
          },
          "maxItems": {
            "title": "Max domains",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of domains to analyse in one run.",
            "default": 100
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. Ahrefs serves these public pages cleanly to Apify datacenter proxies, which are used by default. If you ever see blocks, 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}