{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper - Videos, Search, Subtitles & Comments",
    "description": "Paste any YouTube URL or a search term and get the videos back as rows: title, channel, views, duration and date. Switch on subtitles, comments or sponsor deals to add them in the same run. No API key, no login, no Data API quota.",
    "version": "0.1",
    "x-build-id": "QUSG9vbXGTHHj3wuF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gganbukim~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gganbukim-youtube-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/gganbukim~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-gganbukim-youtube-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/gganbukim~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-gganbukim-youtube-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": {
          "startUrls": {
            "title": "YouTube URLs",
            "type": "array",
            "description": "Any mix of video, channel, @handle and playlist URLs. Channels and playlists are expanded into their videos; a video URL you pass is always kept, filters or not, because you already chose it.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search terms",
            "type": "array",
            "description": "Or search instead. Each term is run separately and every result becomes a row tagged with the term that found it. Use this with URLs or on its own.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max videos",
            "minimum": 1,
            "type": "integer",
            "description": "Total videos across everything you passed. This is the main cost control. URLs are served first and search fills what is left, so raise this when you pass both. Leave empty to take everything the input resolves to.",
            "default": 100
          },
          "channelTab": {
            "title": "Which videos from a channel",
            "enum": [
              "videos",
              "shorts",
              "live",
              "all"
            ],
            "type": "string",
            "description": "Only applies to channel URLs. Shorts carry no date or length on their shelf, so switch on subtitles or sponsors if you need those fields for them.",
            "default": "videos"
          },
          "searchSortBy": {
            "title": "Sort search results by",
            "enum": [
              "relevance",
              "views"
            ],
            "type": "string",
            "description": "Only applies to search terms. Two options and not four on purpose: YouTube's upload-date and rating sort params were measured returning relevance order anyway, and a sort that quietly does not sort is worse than no sort at all.",
            "default": "relevance"
          },
          "publishedWithinDays": {
            "title": "Only videos newer than (days)",
            "minimum": 0,
            "type": "integer",
            "description": "0 disables. Applies to videos found by search or by reading a channel or playlist. Listing pages publish relative dates (\"3 weeks ago\"), so this is accurate to about a day, and rows with no date at all — live streams, Shorts — are dropped rather than passed through unchecked. Filtered videos are not billed.",
            "default": 0
          },
          "minViewCount": {
            "title": "Minimum views",
            "minimum": 0,
            "type": "integer",
            "description": "0 disables. Applies to videos found by search or by reading a channel or playlist. Filtered videos are not billed.",
            "default": 0
          },
          "includeTranscript": {
            "title": "Add subtitles",
            "type": "boolean",
            "description": "Fetch each video's caption track and put it on the row. Billed per transcript delivered, and only when text actually came back — a video with no captions is free.",
            "default": false
          },
          "transcriptFormat": {
            "title": "Subtitle format",
            "enum": [
              "text",
              "srt",
              "vtt",
              "chunks"
            ],
            "type": "string",
            "description": "Plain text for reading and AI, SRT or VTT for re-uploading, chunks for a vector store.",
            "default": "text"
          },
          "transcriptLanguages": {
            "title": "Preferred subtitle languages",
            "type": "array",
            "description": "In order of preference. Falls back to any available track, auto-generated included.",
            "default": [
              "en"
            ],
            "items": {
              "type": "string"
            }
          },
          "includeComments": {
            "title": "Add comments",
            "type": "boolean",
            "description": "Write each video's top comments as their own rows. Billed per comment delivered.",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 0,
            "type": "integer",
            "description": "Comments arrive about 20 per request, so this is what a comments run costs.",
            "default": 20
          },
          "includeSponsorships": {
            "title": "Add sponsor deals",
            "type": "boolean",
            "description": "Read descriptions and spoken captions for brand deals: the sponsor, the tracked link, the discount code and the timestamp it was read at. Billed per deal found — videos with no deal are free.",
            "default": false
          },
          "includeChannelRow": {
            "title": "Add a channel summary row",
            "type": "boolean",
            "description": "One row per channel you passed, with subscribers, total video count, description, keywords, avatar and RSS URL. The record arrives with the listing, so this costs no extra request.",
            "default": false
          },
          "includeCreatorLead": {
            "title": "Add a creator lead row",
            "type": "boolean",
            "description": "One row per channel with the business email it publishes, audience and upload bands, and — when Add sponsor deals is also on — which brands already pay it. Switch that on too or the sponsor columns stay empty rather than reading as a zero.",
            "default": false
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "How many videos to read in parallel.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Leave the default. Runs start on cheap datacenter proxies and escalate to residential only once blocking is proven.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}