{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Channel Scraper: Comments & Transcripts",
    "description": "Extract YouTube channel videos, search results, comments, transcripts, channel identity fields, normalized engagement metrics, velocity, quality scores, and outlier signals for SEO research, brand monitoring, and competitor analysis.",
    "version": "0.16",
    "x-build-id": "75u7unjdaLB03Lwss"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/runtime~youtube-channel-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-runtime-youtube-channel-scraper",
        "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/runtime~youtube-channel-scraper/runs": {
      "post": {
        "operationId": "runs-sync-runtime-youtube-channel-scraper",
        "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/runtime~youtube-channel-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-runtime-youtube-channel-scraper",
        "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": {
          "channel": {
            "title": "YouTube Channel URL",
            "type": "string",
            "description": "YouTube channel URL (e.g. https://www.youtube.com/@Nike). Required unless using global search with search_query only. Supports @handle, /channel/ID, /c/name, /user/name formats."
          },
          "search_query": {
            "title": "YouTube Search Query",
            "type": "string",
            "description": "Search term. If channel provided: searches within channel. If no channel: performs global YouTube search across all videos.",
            "default": ""
          },
          "max_videos": {
            "title": "Maximum Videos",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of videos to extract from the listing page. Recommended: 5-10 for quick tests, 30-100 for listing only, 10-30 when video_details=true.",
            "default": 5
          },
          "timeout": {
            "title": "Timeout Duration (seconds)",
            "minimum": 60,
            "maximum": 3600,
            "type": "integer",
            "description": "Maximum runtime in seconds. Recommended: 300 (5 min) for quick tests with 5 videos, 900 (15 min) for listing only, 1800+ (30+ min) when video_details=true with many comments.",
            "default": 300
          },
          "video_details": {
            "title": "Extract Video Details & Comments",
            "type": "boolean",
            "description": "Visit each video page to extract description, likes, comment count, comments, replies (optional), transcript (optional). Recommended: enable for comprehensive data.",
            "default": true
          },
          "comments_max": {
            "title": "Maximum Comments Per Video",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "Number of top-level comments to extract per video. Higher values increase processing time. Recommended: 5-10 for quick tests, 10-30 for most use cases, up to 200 for detailed analysis.",
            "default": 5
          },
          "comments_user_search": {
            "title": "Filter Comments by Author",
            "type": "string",
            "description": "Only keep comments whose author contains this substring (case-insensitive).",
            "default": ""
          },
          "comments_strategy": {
            "title": "Comments strategy",
            "enum": [
              "auto",
              "api",
              "ui"
            ],
            "type": "string",
            "description": "auto = API then UI fallback, api = Innertube only, ui = UI only",
            "default": "auto"
          },
          "includeReplies": {
            "title": "Include Replies (UI best-effort)",
            "type": "boolean",
            "description": "Replies extraction is best-effort via UI fallback.",
            "default": false
          },
          "output_mode": {
            "title": "Output Mode",
            "enum": [
              "full",
              "compact",
              "minimal"
            ],
            "type": "string",
            "description": "full = complete payload, compact = automation-friendly without heavy text blobs, minimal = smallest payload for routing/alerts.",
            "default": "full"
          },
          "include_run_metadata": {
            "title": "Include Run Metadata",
            "type": "boolean",
            "description": "Adds runMeta fields (runId/taskId/startedAt/mode) to each output item for automation traceability.",
            "default": false
          },
          "extract_transcript": {
            "title": "Extract Transcript",
            "type": "boolean",
            "description": "Legacy switch. If enabled and transcript_mode is not set, actor uses transcript_mode=auto.",
            "default": false
          },
          "transcript_mode": {
            "title": "Transcript Mode",
            "enum": [
              "auto",
              "api",
              "ui",
              "ui_strict",
              "off"
            ],
            "type": "string",
            "description": "auto = API then UI fallback, api = captionTracks/API only, ui = front click flow (more -> transcript), ui_strict = UI-only with extra diagnostics, off = disable transcript extraction.",
            "default": "auto"
          },
          "session_cookies": {
            "title": "Session Cookies (advanced)",
            "type": "array",
            "description": "Optional array of cookie objects to run in authenticated session (improves transcript availability on some videos)."
          },
          "cookie_string": {
            "title": "Cookie String (advanced)",
            "type": "string",
            "description": "Optional semicolon-separated cookies (e.g. SID=...; HSID=...). Parsed as YouTube cookies."
          },
          "safe_mode": {
            "title": "Safe Mode (more stable)",
            "type": "boolean",
            "description": "Blocks heavy resources, uses safer waits/timeouts. Recommended on large runs.",
            "default": true
          },
          "failOnNoResults": {
            "title": "Fail on no results",
            "type": "boolean",
            "description": "Fail the run when the channel or search listing stores no videos. Useful for validation and monitoring; leave disabled for normal jobs that may intentionally return empty datasets.",
            "default": false
          },
          "ui_mode": {
            "title": "UI Mode",
            "enum": [
              "simple",
              "pro",
              "debug"
            ],
            "type": "string",
            "description": "simple: quiet. pro: same behavior but intended for power users. debug: extra screenshots/logs.",
            "default": "simple"
          },
          "useApifyProxy": {
            "title": "Use Apify Proxy",
            "type": "boolean",
            "description": "Recommended.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Configure Apify Proxy / custom proxies.",
            "default": {}
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}