{
  "openapi": "3.0.1",
  "info": {
    "title": "Semrush API Scraper - Keywords, Domain, Competitors, Backlinks",
    "description": "No login or Semrush subscription required. Four modes in one actor: keyword research (volume, CPC, difficulty, intent), domain overview (authority score, traffic trend, top keywords), organic competitors, and authority-scored backlinks (anchors, referring domains). 47 country databases.",
    "version": "0.0",
    "x-build-id": "35UoAIsucJXPBw4ho"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pnda~semrush-keyword/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pnda-semrush-keyword",
        "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/pnda~semrush-keyword/runs": {
      "post": {
        "operationId": "runs-sync-pnda-semrush-keyword",
        "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/pnda~semrush-keyword/run-sync": {
      "post": {
        "operationId": "run-sync-pnda-semrush-keyword",
        "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": "Mode",
            "enum": [
              "keyword",
              "domain",
              "competitors",
              "backlinks"
            ],
            "type": "string",
            "description": "What to extract. Keyword research, full domain overview, organic competitors, or backlink profile. Each mode uses a different set of the fields below.",
            "default": "keyword"
          },
          "q": {
            "title": "Query (single)",
            "type": "string",
            "description": "One target to analyze: a keyword in `keyword` mode (e.g. \"digital marketing\"), a domain in `domain`, `competitors` and `backlinks` modes (e.g. \"example.com\"). Ignored when Queries below is filled."
          },
          "queries": {
            "title": "Queries (batch, up to 100)",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "Analyze up to 100 targets in a single run instead of one run per target. Takes precedence over Query above. Every output row carries a `query` field naming the target it came from, so the batch can be split apart again.",
            "items": {
              "type": "string"
            }
          },
          "db": {
            "title": "Database / country",
            "enum": [
              "us",
              "uk",
              "ca",
              "au",
              "br",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "se",
              "dk",
              "be",
              "no",
              "ie",
              "ar",
              "mx",
              "co",
              "cl",
              "pe",
              "in",
              "sg",
              "id",
              "ph",
              "my",
              "th",
              "vn",
              "jp",
              "hk",
              "cn",
              "tr",
              "za",
              "il",
              "sa",
              "ae",
              "pl",
              "cz",
              "ro",
              "hu",
              "at",
              "ch",
              "pt",
              "fi",
              "gr",
              "nz",
              "ru",
              "ua"
            ],
            "type": "string",
            "description": "Country database. Used in `keyword`, `domain` and `competitors` modes. Ignored in `backlinks` mode.",
            "default": "us"
          },
          "type": {
            "title": "Match type (keyword mode)",
            "enum": [
              "phrase",
              "exact",
              "broad",
              "related"
            ],
            "type": "string",
            "description": "Keyword match type. Used in `keyword` mode only.",
            "default": "phrase"
          },
          "pages": {
            "title": "Number of pages (keyword mode)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many pages of keywords to fetch per query, 100 results per page. Used in `keyword` mode only.",
            "default": 1
          },
          "sort_by": {
            "title": "Sort by (competitors mode)",
            "enum": [
              "competition_level",
              "common_keywords",
              "traffic"
            ],
            "type": "string",
            "description": "How to rank the organic competitors returned. Used in `competitors` mode only.",
            "default": "competition_level"
          },
          "target": {
            "title": "Target URL (backlinks mode, single query only)",
            "type": "string",
            "description": "Specific target URL for the backlink report. Optional - defaults to the value of Query. Used in `backlinks` mode only, and ignored when running a batch."
          },
          "target_type": {
            "title": "Target type (backlinks mode)",
            "enum": [
              "root_domain",
              "domain",
              "url"
            ],
            "type": "string",
            "description": "Scope of the backlink report. Used in `backlinks` mode only.",
            "default": "root_domain"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}