{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Video Details & Comments Scraper",
    "description": "YouTube Video Details Scraper extracts structured data from YouTube videos, including titles, descriptions, tags, views, likes, upload dates, channels, and more. Ideal for research, trend analysis, SEO optimization, and automated video data collection",
    "version": "0.1",
    "x-build-id": "6WYiC1mrowv0Wb5xc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/simpleapi~youtube-video-details-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-simpleapi-youtube-video-details-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/simpleapi~youtube-video-details-scraper/runs": {
      "post": {
        "operationId": "runs-sync-simpleapi-youtube-video-details-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/simpleapi~youtube-video-details-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-simpleapi-youtube-video-details-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",
        "required": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "🎯 Video URLs or IDs",
            "type": "array",
            "description": "One YouTube **video** per line. Accepts `youtube.com/watch?v=…`, `youtu.be/…`, `/shorts/…`, `/live/…`, `/embed/…` or a bare 11-character video ID.\n\nPlaylist, channel and search URLs are rejected with a machine-readable reason instead of returning a malformed row.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "🔢 Video Limit",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many **videos**. Comment rows are not counted against it. `0` = process every URL supplied. Default `0`.",
            "default": 0
          },
          "commentsPerVideo": {
            "title": "💬 Top-Level Comments Per Video",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "How many **top-level** comment threads to pull from each video.\n\nSet `0` to skip the comment section entirely and behave like a metadata-only run. Example: `commentsPerVideo=20` + `maxRepliesPerComment=3` → up to 20 threads and up to 60 replies = up to 80 comment rows per video. Default `20`, maximum `500`.\n\nComments cost time: roughly 15–20 s per 30 comments on top of the metadata request.",
            "default": 20
          },
          "includeReplies": {
            "title": "↩️ Include Threaded Replies",
            "type": "boolean",
            "description": "Turn the reply tree off in one click. When off, `maxRepliesPerComment` is forced to `0` and only top-level comments are returned. Default `true`.",
            "default": true
          },
          "maxRepliesPerComment": {
            "title": "↩️ Replies Per Comment",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Hard cap on replies collected **for each individual thread** — not a slice of a flat list. `3` means every thread returns at most 3 replies, so one huge thread cannot swallow your budget. `0` = no replies. Default `3`, maximum `100`.",
            "default": 3
          },
          "sortCommentsBy": {
            "title": "🔀 Comment Sort",
            "enum": [
              "top",
              "new"
            ],
            "type": "string",
            "description": "`top` returns YouTube's ranked comments (best for finding the loudest feedback). `new` returns the most recent (best for monitoring a fresh upload). Default `top`.",
            "default": "top"
          },
          "commentsDataset": {
            "title": "🗂️ Where Comment Rows Go",
            "enum": [
              "default",
              "separate",
              "both"
            ],
            "type": "string",
            "description": "`default` puts comments in the main dataset alongside the video rows. `separate` sends them to a per-run child dataset named `<runId>-comments` and keeps the main dataset to one row per video. `both` writes to each. Default `default`.",
            "default": "default"
          },
          "onlyCreatorReplies": {
            "title": "👤 Only What The Creator Answered",
            "type": "boolean",
            "description": "Keep only comments and replies written by the channel owner. With **Keep Thread Context** on (the default) the original comment they replied to is kept too, so each row pair reads as question → creator answer. Default `false`.",
            "default": false
          },
          "commentKeywords": {
            "title": "🔍 Must Contain Any Of",
            "type": "array",
            "description": "Keep a comment only if its text contains at least one of these words. Case-insensitive. Example: `how do i`, `tutorial`, `broken`. Leave empty to keep everything.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeCommentKeywords": {
            "title": "🚫 Must Not Contain",
            "type": "array",
            "description": "Drop any comment containing one of these words — useful for stripping spam and giveaway bait. Case-insensitive. Applied before the must-contain list.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minCommentLikes": {
            "title": "👍 Minimum Likes",
            "minimum": 0,
            "type": "integer",
            "description": "Drop comments below this like count. Example: `10` keeps only comments the audience actually upvoted. `0` = keep all. Default `0`.",
            "default": 0
          },
          "keepThreadContext": {
            "title": "🧵 Keep Thread Context",
            "type": "boolean",
            "description": "When a reply survives the filters but its parent comment does not, add the parent back so the reply is readable. Default `true`.",
            "default": true
          },
          "includeTranscript": {
            "title": "📜 Include Transcript",
            "type": "boolean",
            "description": "Download the caption track and return it as timed cues. Turn off to make runs noticeably faster when you only need metadata and comments. Default `true`.",
            "default": true
          },
          "includeChannelProfile": {
            "title": "📺 Include Channel Logo Lookup",
            "type": "boolean",
            "description": "Fetch the channel About page to resolve the channel avatar URL. Costs one extra request per video. Turn off for faster runs. Default `true`.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy",
            "type": "object",
            "description": "**Residential proxy is strongly recommended and is the default here.** Measured on this platform over an 8-video batch: datacenter succeeded 1/8 (the rest hit YouTube's \"Sign in to confirm you're not a bot\" wall), residential succeeded 7/8.\n\nIf a request is walled, this Actor rotates to a fresh residential session and retries — up to 3 attempts per video. The tier that actually worked is reported in the `proxyTierUsed` output column.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}