{
  "openapi": "3.0.1",
  "info": {
    "title": "Keyword Research & SERP Data",
    "description": "Research keywords, search-result data, related terms, and keyword clusters from publicly accessible search intelligence pages.",
    "version": "0.1",
    "x-build-id": "WGkElwk9my0QsfFDz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datascraperes~keyword-research-serp/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datascraperes-keyword-research-serp",
        "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/datascraperes~keyword-research-serp/runs": {
      "post": {
        "operationId": "runs-sync-datascraperes-keyword-research-serp",
        "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/datascraperes~keyword-research-serp/run-sync": {
      "post": {
        "operationId": "run-sync-datascraperes-keyword-research-serp",
        "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": [
          "keywords"
        ],
        "properties": {
          "keywords": {
            "title": "Keywords",
            "minItems": 1,
            "maxItems": 25,
            "type": "array",
            "description": "Required. Add one seed keyword per item, exactly as people search for it. You may enter up to 25 unique terms; blanks and duplicates are removed. Example: seo, abogados madrid, email marketing software.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          "countryCode": {
            "title": "Market code",
            "pattern": "^[A-Za-z]{2}$",
            "type": "string",
            "description": "Required market for every keyword. Use a two-letter code: ES for Spain, US for United States, UK for United Kingdom (not GB). The same keyword can produce different volume, difficulty and SERP data in each market.",
            "default": "ES"
          },
          "sections": {
            "title": "Report sections",
            "type": "array",
            "description": "Choose one or more values: stats for volume/difficulty; related for scored keyword opportunities; serp for organic and paid results; suggestions for extra unscored query ideas; clusters for top topics; top_url only when topDomain is filled. More sections return more datasets and can take longer.",
            "items": {
              "type": "string"
            },
            "default": [
              "serp",
              "stats",
              "suggestions",
              "related",
              "clusters"
            ]
          },
          "relatedLimit": {
            "title": "Related-keyword limit",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum requested rows for each related-keyword and cluster source. Start with 5. Raise it only when you need a broader idea list; the upstream service may still return fewer items.",
            "default": 5
          },
          "serpRows": {
            "title": "Organic SERP rows",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum organic ranking URLs to return per keyword when serp is selected. Use 10 for a quick competitor review or 30 for deeper analysis. The upstream service may return fewer rows.",
            "default": 30
          },
          "topDomain": {
            "title": "Domain to check its ranking page",
            "type": "string",
            "description": "Optional. Use only together with top_url. Enter a bare domain without http://, https://, paths or spaces, for example example.com. The Actor returns the URL from that domain which ranks best for each seed keyword. Leave empty when you do not need this comparison."
          },
          "delaySeconds": {
            "title": "Minimum delay between requests",
            "minimum": 0,
            "maximum": 30,
            "type": "number",
            "description": "Optional wait between upstream requests. Zero is the fastest tested sequential mode. If a large run returns rate-limit errors or incomplete data, retry affected keywords with 1–3 seconds. Higher values increase runtime.",
            "default": 0
          },
          "continueOnError": {
            "title": "Continue on keyword errors",
            "type": "boolean",
            "description": "Recommended. When enabled, a failure for one keyword creates an uncharged error row and the Actor continues with the rest. Disable only when you need the run to stop at the first keyword failure.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}