{
  "openapi": "3.0.1",
  "info": {
    "title": "Competitor Keywords, Ranked Keywords & Keyword Gap",
    "description": "Get the organic Google keywords any domain ranks for, its SEO competitors, and your keyword gap (content gap): keywords competitors rank for and you don't. With position, URL, traffic, search volume, CPC, keyword difficulty and intent. Semrush and Ahrefs alternative on an official API, 50 countries.",
    "version": "0.0",
    "x-build-id": "ndSeWP0wqnO8bTanX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/precisionlabs~competitor-keywords/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-precisionlabs-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/precisionlabs~competitor-keywords/runs": {
      "post": {
        "operationId": "runs-sync-precisionlabs-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/precisionlabs~competitor-keywords/run-sync": {
      "post": {
        "operationId": "run-sync-precisionlabs-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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "What to find",
            "enum": [
              "ranked",
              "competitors",
              "gap"
            ],
            "type": "string",
            "description": "<b>Ranked keywords</b>: the Google keywords each domain ranks for, with position, URL and estimated traffic. <b>Competitors</b>: the domains that rank for the same keywords. <b>Keyword gap</b>: keywords your competitors rank for and <b>Your domain</b> doesn't.",
            "default": "ranked"
          },
          "domains": {
            "title": "Domains",
            "type": "array",
            "description": "One domain per line, such as <code>example.com</code>. Full URLs and <code>www.</code> are fine. For <b>Keyword gap</b>, these are the competitors to compare with; leave empty to use the domain's top organic competitors.",
            "items": {
              "type": "string"
            }
          },
          "yourDomain": {
            "title": "Your domain (keyword gap only)",
            "type": "string",
            "description": "The site to find missing keywords for, such as <code>example.com</code>. Only used in <b>Keyword gap</b> mode."
          },
          "location": {
            "title": "Country",
            "enum": [
              "2840",
              "2826",
              "2124",
              "2036",
              "2554",
              "2372",
              "2276",
              "2250",
              "2724",
              "2380",
              "2528",
              "2056",
              "2756",
              "2040",
              "2620",
              "2616",
              "2203",
              "2642",
              "2348",
              "2300",
              "2752",
              "2578",
              "2208",
              "2246",
              "2804",
              "2792",
              "2376",
              "2784",
              "2682",
              "2818",
              "2710",
              "2566",
              "2404",
              "2356",
              "2702",
              "2458",
              "2360",
              "2608",
              "2764",
              "2704",
              "2392",
              "2410",
              "2158",
              "2344",
              "2076",
              "2484",
              "2032",
              "2152",
              "2170",
              "2604"
            ],
            "type": "string",
            "description": "Which Google to measure: rankings and search volumes differ by country. Use the Google Ads location code, such as 2840 (United States), 2826 (United Kingdom) or 2276 (Germany).",
            "default": "2840"
          },
          "language": {
            "title": "Language",
            "enum": [
              "auto",
              "ar",
              "zh-CN",
              "zh-TW",
              "cs",
              "da",
              "nl",
              "en",
              "fi",
              "fr",
              "de",
              "el",
              "he",
              "hi",
              "hu",
              "id",
              "it",
              "ja",
              "ko",
              "ms",
              "nb",
              "pl",
              "pt",
              "ro",
              "ru",
              "es",
              "sv",
              "tl",
              "th",
              "tr",
              "uk",
              "vi"
            ],
            "type": "string",
            "description": "Search language. Each country has data for its main languages only, for example English or Spanish in the United States; the run tells you which if you pick another.",
            "default": "auto"
          },
          "maxResults": {
            "title": "Max keywords per domain",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "For <b>Ranked keywords</b>, the most keywords per domain, highest estimated traffic first. For <b>Keyword gap</b>, the most missing keywords in total (up to 1,000 from each competitor).",
            "default": 1000
          },
          "maxCompetitors": {
            "title": "Max competitors",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "For <b>Competitors</b>, how many to return per domain. For <b>Keyword gap</b> without a competitor list, how many top competitors to compare with (up to 20; each one is a data request).",
            "default": 10
          },
          "maxPosition": {
            "title": "Top positions only",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Only count rankings in Google's top N. 20 covers the first two pages; 100 includes everything DataForSEO tracks.",
            "default": 20
          },
          "minSearchVolume": {
            "title": "Min monthly searches",
            "minimum": 0,
            "type": "integer",
            "description": "Skip keywords searched less often than this.",
            "default": 0
          },
          "includeCloseVariants": {
            "title": "Include close variants",
            "type": "boolean",
            "description": "Off: near-duplicates such as plurals and spelling variants are folded into one keyword. On: list every variant.",
            "default": false
          },
          "excludeBigSites": {
            "title": "Leave out giant sites",
            "type": "boolean",
            "description": "Leave sites like Wikipedia, YouTube and Amazon out of competitor lists. They rank for almost everything, so they're rarely useful competitors.",
            "default": true
          },
          "includeNavigational": {
            "title": "Include navigational keywords (keyword gap)",
            "type": "boolean",
            "description": "Off: the keyword gap skips searches for a specific site or brand, such as \"facebook login\", which you usually can't win.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}