{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Comment Keyword Search",
    "description": "Find words and phrases in YouTube comments and replies. Search entire comment sections with any/all matching, case and whole-word controls, and date filters. Export complete matching comments with dates, likes, authors, and thread details.",
    "version": "0.1",
    "x-build-id": "WDhfzar8rUC33PhYr"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/unknownbrain~youtube-comment-keyword-search/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-unknownbrain-youtube-comment-keyword-search",
        "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/unknownbrain~youtube-comment-keyword-search/runs": {
      "post": {
        "operationId": "runs-sync-unknownbrain-youtube-comment-keyword-search",
        "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/unknownbrain~youtube-comment-keyword-search/run-sync": {
      "post": {
        "operationId": "run-sync-unknownbrain-youtube-comment-keyword-search",
        "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": [
          "videos",
          "searchTerms"
        ],
        "properties": {
          "videos": {
            "title": "Videos to search",
            "minItems": 1,
            "type": "array",
            "description": "By default, check all available comments and replies. Optionally set a scan limit for a video; limits count parents and replies together.",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "title": "Video URL",
                  "type": "string",
                  "editor": "textfield",
                  "description": "A YouTube watch, share, Shorts, live or embed URL containing a video ID."
                },
                "maxCommentsToCheck": {
                  "title": "Maximum comments to check (optional)",
                  "type": "integer",
                  "editor": "number",
                  "minimum": 1,
                  "description": "Leave empty to search all available comments and replies. This limits entries checked, not matching results."
                }
              },
              "required": [
                "url"
              ]
            }
          },
          "searchTerms": {
            "title": "Words or phrases to find",
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "description": "Enter each word or phrase separately. A phrase must appear together in the same comment. Matching entries retain their full text.",
            "items": {
              "type": "string"
            }
          },
          "matchMode": {
            "title": "Match any or all terms",
            "enum": [
              "any",
              "all"
            ],
            "type": "string",
            "description": "Any: return comments containing at least one term. All: every term must appear in the same comment or reply.",
            "default": "any"
          },
          "searchIn": {
            "title": "Where to search",
            "enum": [
              "both",
              "comments",
              "replies"
            ],
            "type": "string",
            "description": "A matching reply is returned even when its parent does not match.",
            "default": "both"
          },
          "caseSensitive": {
            "title": "Case-sensitive matching",
            "type": "boolean",
            "description": "Off: LOVE and love match the same term.",
            "default": false
          },
          "wholeWords": {
            "title": "Match whole words",
            "type": "boolean",
            "description": "On: cat does not match category. Turn off to find text inside longer words. Phrases are matched literally, allowing whitespace variations.",
            "default": true
          },
          "sort": {
            "title": "Comment sorting",
            "enum": [
              "newest",
              "top"
            ],
            "type": "string",
            "description": "Search in Newest first or Top comments order. Publication date filtering automatically selects Newest first.",
            "default": "newest"
          },
          "publishedAfter": {
            "title": "Scrape comments published after",
            "type": "string",
            "description": "Optional inclusive publication date: YYYY-MM-DD, 1 day (today), or 2 days (yesterday and today). Uses UTC days and selects Newest first. Replies are checked within qualifying parent threads. Leave empty to search all dates."
          },
          "enableFallback": {
            "title": "Verify empty results",
            "type": "boolean",
            "description": "Verify unexpected empty comment sections. Failed verification is reported explicitly.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Simultaneous videos",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Search up to this many videos simultaneously. Default: 3.",
            "default": 3
          },
          "videoTimeoutSeconds": {
            "title": "Active processing timeout per video",
            "minimum": 1,
            "type": "integer",
            "description": "Active processing timeout per video. Large comment sections may need more time. Timeouts are reported as partial scans; matching entries already saved are retained.",
            "default": 3600
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}