{
  "openapi": "3.0.1",
  "info": {
    "title": "Backlink Checker and Keyword Research API - Ahrefs SEO Data",
    "description": "Backlink checker and keyword research with the Ahrefs API v3: Domain Rating, backlinks, referring domains, anchors, organic keywords, top pages, competitors, keyword volume, KD, CPC, keyword ideas and SERP overview. Bring your own Ahrefs API key.",
    "version": "0.1",
    "x-build-id": "4DLqPcx1wPTZpZBM0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~backlink-checker-keyword-research-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-backlink-checker-keyword-research-api",
        "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/nabeelbaghoor~backlink-checker-keyword-research-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-backlink-checker-keyword-research-api",
        "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/nabeelbaghoor~backlink-checker-keyword-research-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-backlink-checker-keyword-research-api",
        "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": {
          "mode": {
            "title": "What to get",
            "enum": [
              "domainOverview",
              "domainRating",
              "backlinks",
              "referringDomains",
              "anchors",
              "organicKeywords",
              "topPages",
              "organicCompetitors",
              "keywordMetrics",
              "matchingTerms",
              "relatedTerms",
              "serpOverview",
              "apiUnits"
            ],
            "type": "string",
            "description": "Domain overview returns Domain Rating, Ahrefs Rank, live and all-time backlinks and referring domains, organic keywords, organic traffic and traffic value for each target in one row (3 Ahrefs requests per target). Domain Rating is the cheap single-call version. Backlinks, Referring domains and Anchors are the Site Explorer link reports. Organic keywords, Top pages and Organic competitors are the Site Explorer search reports. Keyword metrics, Matching terms and Related terms are Keywords Explorer. SERP overview returns the top results for each keyword. API units and limits shows your key's unit allowance and usage, free.",
            "default": "domainOverview"
          },
          "targets": {
            "title": "Targets (domains or URLs)",
            "type": "array",
            "description": "Site Explorer modes. Domains such as ahrefs.com or URLs such as https://ahrefs.com/blog/, one per line. Each target is one lookup. ahrefs.com, yep.com and firehose.com are free test targets that spend no API units.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Keywords Explorer and SERP overview modes. One keyword per line. Keyword metrics reads them in batches of 100; matching and related terms use them together as seeds; SERP overview makes one request per keyword. \"ahrefs\", \"yep\" and \"firehose\" alone are free test keywords.",
            "items": {
              "type": "string"
            }
          },
          "country": {
            "title": "Country",
            "enum": [
              "all",
              "ad",
              "ae",
              "af",
              "ag",
              "ai",
              "al",
              "am",
              "ao",
              "ar",
              "as",
              "at",
              "au",
              "aw",
              "az",
              "ba",
              "bb",
              "bd",
              "be",
              "bf",
              "bg",
              "bh",
              "bi",
              "bj",
              "bn",
              "bo",
              "br",
              "bs",
              "bt",
              "bw",
              "by",
              "bz",
              "ca",
              "cd",
              "cf",
              "cg",
              "ch",
              "ci",
              "ck",
              "cl",
              "cm",
              "cn",
              "co",
              "cr",
              "cu",
              "cv",
              "cy",
              "cz",
              "de",
              "dj",
              "dk",
              "dm",
              "do",
              "dz",
              "ec",
              "ee",
              "eg",
              "es",
              "et",
              "fi",
              "fj",
              "fm",
              "fo",
              "fr",
              "ga",
              "gb",
              "gd",
              "ge",
              "gf",
              "gg",
              "gh",
              "gi",
              "gl",
              "gm",
              "gn",
              "gp",
              "gq",
              "gr",
              "gt",
              "gu",
              "gy",
              "hk",
              "hn",
              "hr",
              "ht",
              "hu",
              "id",
              "ie",
              "il",
              "im",
              "in",
              "iq",
              "is",
              "it",
              "je",
              "jm",
              "jo",
              "jp",
              "ke",
              "kg",
              "kh",
              "ki",
              "kn",
              "kr",
              "kw",
              "ky",
              "kz",
              "la",
              "lb",
              "lc",
              "li",
              "lk",
              "ls",
              "lt",
              "lu",
              "lv",
              "ly",
              "ma",
              "mc",
              "md",
              "me",
              "mg",
              "mk",
              "ml",
              "mm",
              "mn",
              "mq",
              "mr",
              "ms",
              "mt",
              "mu",
              "mv",
              "mw",
              "mx",
              "my",
              "mz",
              "na",
              "nc",
              "ne",
              "ng",
              "ni",
              "nl",
              "no",
              "np",
              "nr",
              "nu",
              "nz",
              "om",
              "pa",
              "pe",
              "pf",
              "pg",
              "ph",
              "pk",
              "pl",
              "pn",
              "pr",
              "ps",
              "pt",
              "py",
              "qa",
              "re",
              "ro",
              "rs",
              "ru",
              "rw",
              "sa",
              "sb",
              "sc",
              "se",
              "sg",
              "sh",
              "si",
              "sk",
              "sl",
              "sm",
              "sn",
              "so",
              "sr",
              "st",
              "sv",
              "td",
              "tg",
              "th",
              "tj",
              "tk",
              "tl",
              "tm",
              "tn",
              "to",
              "tr",
              "tt",
              "tw",
              "tz",
              "ua",
              "ug",
              "us",
              "uy",
              "uz",
              "vc",
              "ve",
              "vg",
              "vi",
              "vn",
              "vu",
              "ws",
              "ye",
              "yt",
              "za",
              "zm",
              "zw"
            ],
            "type": "string",
            "description": "The search market. Organic competitors, Keywords Explorer and SERP overview need one country; Domain overview, Organic keywords and Top pages also accept All countries.",
            "default": "us"
          },
          "scope": {
            "title": "Target scope",
            "enum": [
              "subdomains",
              "domain",
              "prefix",
              "exact"
            ],
            "type": "string",
            "description": "Site Explorer modes except Domain Rating. How much of the target to analyse, as in the Ahrefs web app.",
            "default": "subdomains"
          },
          "protocol": {
            "title": "Protocol",
            "enum": [
              "both",
              "http",
              "https"
            ],
            "type": "string",
            "description": "Site Explorer modes except Domain Rating. Which protocol of the target to analyse.",
            "default": "both"
          },
          "date": {
            "title": "Report date",
            "type": "string",
            "description": "Domain overview, Domain Rating, Organic keywords, Top pages and Organic competitors. The date to report metrics on (YYYY-MM-DD). Leave empty for today (UTC)."
          },
          "volumeMode": {
            "title": "Search volume mode",
            "enum": [
              "monthly",
              "average"
            ],
            "type": "string",
            "description": "Domain overview, Organic keywords, Top pages and Organic competitors. Affects volume, traffic and traffic value.",
            "default": "monthly"
          },
          "linkHistory": {
            "title": "Link history",
            "enum": [
              "live",
              "all_time",
              "since"
            ],
            "type": "string",
            "description": "Backlinks, Referring domains and Anchors. Live shows links that exist now; the others add lost links.",
            "default": "live"
          },
          "historySince": {
            "title": "Lost links since",
            "type": "string",
            "description": "Link history \"since a date\" only. Include links lost on or after this date (YYYY-MM-DD)."
          },
          "backlinkGrouping": {
            "title": "Backlink grouping",
            "enum": [
              "similar_links",
              "1_per_domain",
              "all"
            ],
            "type": "string",
            "description": "Backlinks only. How Ahrefs groups the backlinks it returns.",
            "default": "similar_links"
          },
          "dofollowOnly": {
            "title": "Dofollow only",
            "type": "boolean",
            "description": "Backlinks and Referring domains. Only dofollow backlinks, or only referring domains with at least one dofollow link to the target.",
            "default": false
          },
          "minDomainRating": {
            "title": "Minimum Domain Rating",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Backlinks and Referring domains. Only links from domains with at least this Domain Rating (0 to 100)."
          },
          "minVolume": {
            "title": "Minimum search volume",
            "minimum": 0,
            "type": "integer",
            "description": "Organic keywords, Matching terms and Related terms. Only keywords with at least this monthly search volume."
          },
          "maxDifficulty": {
            "title": "Maximum keyword difficulty",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Organic keywords, Matching terms and Related terms. Only keywords with a Keyword Difficulty (KD) of at most this (0 to 100)."
          },
          "maxPosition": {
            "title": "Maximum position",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Organic keywords only. Only keywords where the target ranks at this position or better, such as 10 for page one."
          },
          "matchingTermsType": {
            "title": "Matching terms type",
            "enum": [
              "all",
              "questions"
            ],
            "type": "string",
            "description": "Matching terms only. All ideas, or only ideas phrased as questions.",
            "default": "all"
          },
          "matchMode": {
            "title": "Match mode",
            "enum": [
              "terms",
              "phrase"
            ],
            "type": "string",
            "description": "Matching terms only. Ideas contain the seed words in any order, or as the exact phrase.",
            "default": "terms"
          },
          "relatedTermsType": {
            "title": "Related terms type",
            "enum": [
              "all",
              "also_rank_for",
              "also_talk_about"
            ],
            "type": "string",
            "description": "Related terms only. Keywords the top pages also rank for, terms they also mention, or both.",
            "default": "all"
          },
          "relatedViewFor": {
            "title": "Related terms from",
            "enum": [
              "top_10",
              "top_100"
            ],
            "type": "string",
            "description": "Related terms only. Which ranking pages the related keywords are drawn from.",
            "default": "top_10"
          },
          "topPositions": {
            "title": "SERP positions",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "SERP overview only. How many top organic positions to return per keyword. Leave empty for all available."
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The most rows this run returns and charges for. It is also the limit sent to Ahrefs, so it caps the API units spent: a report costs max(50, rows x per-row units).",
            "default": 100
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Pacing. Ahrefs allows 60 requests a minute by default and answers 429 above it, which the actor waits out and retries.",
            "default": 50
          },
          "apiKey": {
            "title": "Ahrefs API key",
            "type": "string",
            "description": "Your own Ahrefs API v3 key, created by a workspace owner or admin in Account settings, API keys (app.ahrefs.com/account/api-keys). Stored as a secret and sent only in the Authorization header; it is never logged. You can instead set the DATA_API_KEY environment secret."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}