{
  "openapi": "3.0.1",
  "info": {
    "title": "Semrush Alternative: Competitor Keywords, Gap and Rankings",
    "description": "Domain overview, organic competitors, keyword gap and ranked keywords for any domain and country, from the DataForSEO Labs index. Watch mode lists keywords gained and lost since the last run and can call a webhook. Pay per row, no subscription.",
    "version": "0.1",
    "x-build-id": "2UdoXy06uX4n842O5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/alexmorain~seo-competitor-keywords/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-alexmorain-seo-competitor-keywords",
        "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/alexmorain~seo-competitor-keywords/runs": {
      "post": {
        "operationId": "runs-sync-alexmorain-seo-competitor-keywords",
        "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/alexmorain~seo-competitor-keywords/run-sync": {
      "post": {
        "operationId": "run-sync-alexmorain-seo-competitor-keywords",
        "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": [
          "domains"
        ],
        "properties": {
          "domains": {
            "title": "Domains",
            "minItems": 1,
            "maxItems": 1000,
            "type": "array",
            "description": "One domain or URL per line, up to 1,000 distinct targets. In the default target mode <code>www.apify.com</code> and <code>https://apify.com/store</code> are both read as <code>apify.com</code>, so every row covers the whole site. Duplicates are removed. A line that is not a valid domain comes back as an <code>invalid_input</code> row and is not charged.",
            "items": {
              "type": "string"
            }
          },
          "targetMode": {
            "title": "Target mode",
            "enum": [
              "domain",
              "exact"
            ],
            "type": "string",
            "description": "<b>Registered domain</b> (default): the whole site, subdomains included, whatever form you paste. <b>Exact host</b>: the host as written, so <code>blog.example.com</code> stays a subdomain. In both modes a path is removed and the row says so.",
            "default": "domain"
          },
          "country": {
            "title": "Country",
            "enum": [
              "us",
              "gb",
              "ca",
              "au",
              "ie",
              "nz",
              "in",
              "fr",
              "de",
              "es",
              "it",
              "nl",
              "be",
              "pt",
              "br",
              "mx",
              "jp",
              "ch",
              "se",
              "pl"
            ],
            "type": "string",
            "description": "Country of the Google results. Always set: a search without a country mixes every country and gives numbers several times larger. The choice is written in every row.",
            "default": "us"
          },
          "includeCompetitors": {
            "title": "Organic competitors",
            "type": "boolean",
            "description": "Adds the domains that rank for the same keywords: shared keywords, average position, their own keywords and traffic. Charged per list and per row.",
            "default": false
          },
          "maxCompetitors": {
            "title": "Max competitors per domain",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Upper limit of competitor rows for each domain. The domain itself is never one of them.",
            "default": 10
          },
          "excludeTopDomains": {
            "title": "Skip the big generic sites",
            "type": "boolean",
            "description": "Leave out YouTube, Reddit, Facebook, Google, Quora and similar sites that rank for almost everything. <b>Keep it on</b> unless you want them: without it the list starts with these sites, not with real competitors.",
            "default": true
          },
          "includeKeywordGap": {
            "title": "Keyword gap",
            "type": "boolean",
            "description": "Keywords where a competitor ranks and your domain does not, sorted by search volume: volume, CPC, difficulty, intent, the competitor's position and page. One list per competitor.<br><br>Without competitor domains below, the gap uses the first competitors found, so <b>the competitor list is read, delivered and charged too</b>, even if the option above is off.",
            "default": false
          },
          "competitorDomains": {
            "title": "Competitor domains",
            "maxItems": 10,
            "type": "array",
            "description": "Optional, up to 10 domains, written like the domains above. Each one is compared to every domain of the run (a domain is never compared to itself). Leave empty to use the competitors found.",
            "items": {
              "type": "string"
            }
          },
          "gapCompetitors": {
            "title": "Competitors found to compare",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Used when no competitor domain is given: the gap is read for this many of the first competitors found. It cannot exceed the maximum number of competitors.",
            "default": 3
          },
          "maxGapKeywords": {
            "title": "Max gap keywords per competitor",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Upper limit of keyword rows for each domain and competitor pair.",
            "default": 100
          },
          "includeRankedKeywords": {
            "title": "Ranked keywords",
            "type": "boolean",
            "description": "Adds one row per keyword the domain ranks for, by search volume: position, page, volume, CPC, difficulty, intent, estimated traffic.",
            "default": false
          },
          "maxRankedKeywords": {
            "title": "Max ranked keywords per domain",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Upper limit of ranked keyword rows for each domain. Read in pages of 1,000.",
            "default": 100
          },
          "monitor": {
            "title": "Watch gained and lost keywords",
            "type": "boolean",
            "description": "Delivers the keywords a domain gained and lost since the last check, newest first, and <b>never delivers the same change twice</b>: schedule the Actor and only pay for what changed. A keyword reported as lost and later gained again is reported again. The memory is kept in a named store, <code>competitor-keywords-monitor</code>, in your account.<br><br><b>Billing:</b> each page read bills one list page, even an empty one. The data provider's rankings lag about a week behind, so a short schedule often finds nothing new.",
            "default": false
          },
          "maxChangesPerDomain": {
            "title": "Max changes per domain and list",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of rows for each domain, in the gained list and in the lost list separately. The Actor delivers the most recent changes first. If more changed since the last check, the older ones are left out on purpose and the next check starts after the newest one delivered: you get the N most recent changes per domain since the last check.",
            "default": 100
          },
          "monitorLookbackDays": {
            "title": "First check: look back (days)",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "How far back the very first check of a watch looks. Later checks start from the newest ranking date read by the previous complete check.",
            "default": 30
          },
          "monitorName": {
            "title": "Watch name",
            "maxLength": 100,
            "type": "string",
            "description": "Name of the memory. Leave empty and the memory depends only on the country and the target mode: adding or removing a domain keeps what the other domains already delivered. A name lets you keep several separate watches. Even with a name, a different country or target mode starts a separate memory.",
            "default": ""
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Optional. The run summary and the number of gained and lost keywords per domain are sent there by POST when the run ends (Slack, Discord, Zapier...). The URL is never written to a log."
          },
          "cacheMaxAgeHours": {
            "title": "Reuse identical requests for (hours)",
            "minimum": 0,
            "maximum": 720,
            "type": "integer",
            "description": "The keyword database is updated once a month. A request identical to one already made <b>from your account</b> within this many hours is answered from a cache stored in your account (named key-value store <code>competitor-keywords-cache</code>), with the same data. Not used when the watch is on. Set to <code>0</code> to always fetch fresh data.",
            "default": 168
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}