{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper: Transcripts, Comments & Monitor",
    "description": "No login or API key. YouTube transcripts at a flat $1.50 per 1,000 and free when a video has none, comments with replies, channel data, and videos from search, channels, Shorts and playlists with exact views and likes. Monitor channels for new videos with Slack, Discord or Telegram alerts.",
    "version": "0.2",
    "x-build-id": "JnVUU7RddrrRmqj0r"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/hydedata~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-hydedata-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/hydedata~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-hydedata-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/hydedata~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-hydedata-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": {
          "searchQueries": {
            "title": "Search terms",
            "type": "array",
            "description": "Search YouTube like you would in its search bar. Each term returns up to \"Limit per source\" videos, with the filters below.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "YouTube links",
            "type": "array",
            "description": "Videos, Shorts, channels (@handle, /channel/, /c/ or /user/ links, or a channel's /videos, /shorts or /streams tab), playlists and search result pages. Bare video IDs and @handles work too.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxResults": {
            "title": "Limit per source (each search, channel tab or playlist)",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "How many videos to take from each source. A source is one search term, one channel tab or one playlist, so 3 search terms at 20 return up to 60 videos. Raise this to get more from a channel. Channels go newest first unless you pick another order. Videos you link directly are always included. If the run has only one source and \"Limit for the whole run\" is higher, that higher number is used.",
            "default": 20
          },
          "maxVideos": {
            "title": "Limit for the whole run (all sources together)",
            "minimum": 1,
            "type": "integer",
            "description": "Stops the run once this many rows are delivered in total, counting every source and every video you link (channels, with channel output). Leave empty for no total. It caps the total and doesn't make a source return more than \"Limit per source\", with one exception: when the run has exactly one search, channel tab or playlist, this is how many videos that source returns. One channel with this set to 100 returns up to 100."
          },
          "channelTabs": {
            "title": "Channel tabs",
            "type": "array",
            "description": "Which of a channel's tabs to scrape when you link the channel itself. Each tab is a source with its own limit. A link to one tab (youtube.com/@mkbhd/shorts) scrapes just that tab.",
            "items": {
              "type": "string",
              "enum": [
                "videos",
                "shorts",
                "streams"
              ],
              "enumTitles": [
                "Videos",
                "Shorts",
                "Live streams"
              ]
            },
            "default": [
              "videos"
            ]
          },
          "outputMode": {
            "title": "Output",
            "enum": [
              "videos",
              "transcripts",
              "channels"
            ],
            "type": "string",
            "description": "Videos: one row per video with every field. Transcripts only: video ID, title, channel, language and the transcript text, nothing else; you pay only for videos that have a transcript. Channels: one row per channel with its description, links, country, joined date, total views, video count and subscribers, for channels you link and for the channels a search or playlist turns up.",
            "default": "videos"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "views"
            ],
            "type": "string",
            "description": "Relevance is YouTube's default order. View count puts the most watched first. For the newest videos, use Upload date below.",
            "default": "relevance"
          },
          "uploadDate": {
            "title": "Upload date",
            "enum": [
              "any",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Only videos uploaded in this window.",
            "default": "any"
          },
          "duration": {
            "title": "Duration",
            "enum": [
              "any",
              "under4",
              "between4and20",
              "over20"
            ],
            "type": "string",
            "description": "Only videos of this length.",
            "default": "any"
          },
          "searchType": {
            "title": "Result type",
            "enum": [
              "video",
              "shorts",
              "channel"
            ],
            "type": "string",
            "description": "Regular videos, Shorts only, or channels. Channels returns one row per matching channel instead of videos.",
            "default": "video"
          },
          "features": {
            "title": "Features",
            "type": "array",
            "description": "Only videos with all of these.",
            "items": {
              "type": "string",
              "enum": [
                "subtitles",
                "hd",
                "4k",
                "live",
                "creativeCommons",
                "hdr",
                "360",
                "vr180",
                "3d",
                "location",
                "purchased"
              ],
              "enumTitles": [
                "Subtitles/CC",
                "HD",
                "4K",
                "Live now",
                "Creative Commons",
                "HDR",
                "360°",
                "VR180",
                "3D",
                "Location",
                "Purchased"
              ]
            }
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Search as a viewer in this country, as a two-letter code (US, GB, MX, DE, BR, IN, JP). Changes which videos rank. Leave empty for the United States."
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Search in this interface language, as a code (en, es, de, fr, pt-BR, ja). Changes which videos rank, and titles come back in it when the creator translated them. Leave empty for English. With another language, keep \"Video details\" on: views and dates come from the video's own page."
          },
          "channelSort": {
            "title": "Channel video order",
            "enum": [
              "newest",
              "popular",
              "oldest"
            ],
            "type": "string",
            "description": "The order a channel's Videos, Shorts and Live tabs are read in. Popular gets a channel's most viewed videos, Oldest its first uploads. Monitor mode always reads newest first.",
            "default": "newest"
          },
          "includeChannelDetails": {
            "title": "Channel details on every video",
            "type": "boolean",
            "description": "Adds the channel's description, links, country, joined date, total views and video count to each video row. Read once per channel per run, at no extra cost.",
            "default": false
          },
          "postedAfter": {
            "title": "Posted after",
            "type": "string",
            "description": "Only videos published on or after this date, or within this many days (e.g. 7 days). Channel tabs stop reading once they're past it."
          },
          "postedBefore": {
            "title": "Posted before",
            "type": "string",
            "description": "Only videos published on or before this date, or at least this long ago (e.g. 30 days). With \"Posted after\" it makes a date range. For an old range on a big channel, set \"Channel video order\" to Oldest first."
          },
          "minViews": {
            "title": "At least this many views",
            "minimum": 0,
            "type": "integer",
            "description": "Drop videos with fewer views. Live streams have no view count yet and are kept."
          },
          "titleIncludes": {
            "title": "Title must include",
            "type": "array",
            "description": "Keep only videos whose title has at least one of these words or phrases. Not case-sensitive.",
            "items": {
              "type": "string"
            }
          },
          "titleExcludes": {
            "title": "Title must not include",
            "type": "array",
            "description": "Drop videos whose title has any of these words or phrases. Not case-sensitive.",
            "items": {
              "type": "string"
            }
          },
          "includeDetails": {
            "title": "Video details",
            "type": "boolean",
            "description": "Exact views, likes, comment count, publish date and time, full description and its links, tags, hashtags, category, chapters and the channel's subscriber count. Included at no extra cost. Turn off for faster listings with just what search and channel pages show.",
            "default": true
          },
          "includeTranscript": {
            "title": "Transcripts",
            "type": "boolean",
            "description": "The video's captions as text: uploaded by the creator when there are some, else YouTube's auto-generated ones. Charged per video that gets one. Videos without captions are free.",
            "default": false
          },
          "maxComments": {
            "title": "Comments per video",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Top-level comments to include per video: text, likes, reply count, when posted, pinned, and whether the channel owner wrote it. Commenters' names aren't collected. Charged per comment. 0 turns comments off.",
            "default": 0
          },
          "transcriptLanguages": {
            "title": "Transcript languages",
            "type": "array",
            "description": "Language codes in order of preference (e.g. en, es, de). en matches every English track (en-US, en-GB).",
            "default": [
              "en"
            ],
            "items": {
              "type": "string"
            }
          },
          "transcriptAnyLanguage": {
            "title": "Fall back to the spoken language",
            "type": "boolean",
            "description": "When a video has none of your languages, get its captions in the language spoken in it instead of none.",
            "default": true
          },
          "transcriptAutoGenerated": {
            "title": "Allow auto-generated captions",
            "type": "boolean",
            "description": "Use YouTube's automatic captions when the creator didn't upload any. Most videos only have those.",
            "default": true
          },
          "transcriptFormat": {
            "title": "Transcript format",
            "enum": [
              "text",
              "timestamped",
              "srt",
              "vtt"
            ],
            "type": "string",
            "description": "Plain text is always included. Timestamped adds every line with its start time and duration. SRT and VTT add a ready subtitle file as text.",
            "default": "text"
          },
          "transcriptClean": {
            "title": "Clean transcript text",
            "type": "boolean",
            "description": "Adds the transcript as plain reading text in \"transcriptClean\": sound tags like [Music] and (applause), music notes and speaker marks removed, lines joined. Done by fixed rules, so words are never changed. In transcripts-only output it replaces the plain \"transcript\" field.",
            "default": false
          },
          "commentsSort": {
            "title": "Comment order",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Top comments as YouTube ranks them, or the newest first.",
            "default": "top"
          },
          "maxRepliesPerComment": {
            "title": "Replies per comment",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Replies to include under each collected comment, oldest first: text, likes and when posted. Repliers' names aren't collected. Each reply is charged like a comment. 0 leaves replies out.",
            "default": 0
          },
          "commentsNewerThan": {
            "title": "Comments newer than",
            "type": "string",
            "description": "Only comments and replies posted on or after this date, or within this long (e.g. 7 days). YouTube shows comment dates as \"2 days ago\", so the cutoff is approximate. Works best with \"Newest first\". Older comments are dropped before you are charged."
          },
          "monitorMode": {
            "title": "Monitor mode (new videos only)",
            "type": "boolean",
            "description": "Remembers what each search, channel and playlist returned and only outputs videos that are new since the last run. Use with a Schedule. The first run returns the current videos as the baseline. Runs that find nothing new cost nothing but the start.",
            "default": false
          },
          "trackStats": {
            "title": "Track views, likes and comments of new videos",
            "type": "boolean",
            "description": "In monitor mode, reads each delivered video again on later runs and outputs it with how its views, likes and comments moved since the last run (monitorStatus \"updated\"). With comments on, an updated row holds only comments posted since. Each updated row is charged as a video. A video whose counts did not move is skipped for free.",
            "default": false
          },
          "trackStatsDays": {
            "title": "Track each video for (days)",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "How long after a video is first delivered its counts keep being read.",
            "default": 7
          },
          "alertKeywords": {
            "title": "Alert keywords",
            "type": "array",
            "description": "Words or phrases to watch for in video titles and, with transcripts on, in what is said. Every row lists the ones it matched in \"alertKeywordsMatched\", and webhook and Telegram alerts are sent only for videos that match. Whole words, not case-sensitive.",
            "items": {
              "type": "string"
            }
          },
          "notifyWebhookUrl": {
            "title": "Send new videos to a webhook (optional)",
            "type": "string",
            "description": "Paste a Discord or Slack incoming webhook URL to get each run's videos as a message with thumbnails. Any other URL gets the rows as JSON. Only sent when the run delivers something; in monitor mode the first run's baseline isn't sent."
          },
          "telegramBotToken": {
            "title": "Telegram bot token",
            "type": "string",
            "description": "Also send alerts to Telegram. Create a bot with @BotFather and paste its token here."
          },
          "telegramChatId": {
            "title": "Telegram chat ID",
            "type": "string",
            "description": "The chat, group or channel ID the bot posts to."
          },
          "stateStoreName": {
            "title": "Monitor state store name",
            "type": "string",
            "description": "Named key-value store that keeps monitor memory between runs. Use different names to run independent monitors.",
            "default": "youtube-monitor-state"
          },
          "stateRetentionDays": {
            "title": "Forget sources after (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Searches, channels and playlists not checked for this many days are dropped from monitor memory.",
            "default": 90
          },
          "maxConcurrency": {
            "title": "Videos at once",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Videos fetched at the same time, each request on its own proxy IP.",
            "default": 20
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify datacenter proxies work for YouTube. When YouTube asks a datacenter IP to sign in before listing a video's captions, the Actor retries that one request on a residential IP by itself.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}