{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript Scraper & Subtitles Download: Bulk, SRT",
    "description": "No login or cookies needed. Scrapes YouTube transcripts for a whole list of videos in one run. Get the full text, timestamped lines and SRT subtitles with the title, channel and views - youtube to text for RAG, notes or blog posts.",
    "version": "0.1",
    "x-build-id": "K7wwKoJsAIKJZMeOC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/h1018y~anvil-youtube-transcript-scraper-v2/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-h1018y-anvil-youtube-transcript-scraper-v2",
        "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/h1018y~anvil-youtube-transcript-scraper-v2/runs": {
      "post": {
        "operationId": "runs-sync-h1018y-anvil-youtube-transcript-scraper-v2",
        "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/h1018y~anvil-youtube-transcript-scraper-v2/run-sync": {
      "post": {
        "operationId": "run-sync-h1018y-anvil-youtube-transcript-scraper-v2",
        "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": {
          "videos": {
            "title": "YouTube videos",
            "type": "array",
            "description": "Video links in any form (watch, m.youtube.com, youtu.be, Shorts, live), 11-character video IDs, or a channel, playlist, search or hashtag link. One per line - paste as many as you like, e.g. https://www.youtube.com/watch?v=IELMSD2kdmk",
            "items": {
              "type": "string"
            }
          },
          "languages": {
            "title": "Transcript languages, in order",
            "type": "array",
            "description": "Language codes you want, best first (e.g. en, es, de). Uploaded captions are taken before auto-generated ones.",
            "default": [
              "en"
            ],
            "items": {
              "type": "string"
            }
          },
          "fallbackToAnyLanguage": {
            "title": "Fall back to any language",
            "type": "boolean",
            "description": "If none of your languages exist, return the transcript that is there instead of nothing.",
            "default": true
          },
          "includeSegments": {
            "title": "Include timestamped lines",
            "type": "boolean",
            "description": "Each line with its start time and duration in seconds.",
            "default": true
          },
          "includeSrt": {
            "title": "Include SRT subtitles",
            "type": "boolean",
            "description": "A ready .srt subtitle text in the srt field.",
            "default": false
          },
          "maxItems": {
            "title": "Max videos",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop after this many videos.",
            "default": 100
          },
          "includeTimestampedText": {
            "title": "Include text with timestamps",
            "type": "boolean",
            "description": "Adds a textWithTimestamps field: one line per caption, starting with [m:ss]. Easy to read and to paste into notes.",
            "default": false
          },
          "searchQueries": {
            "title": "Search terms",
            "type": "array",
            "description": "Words to search on YouTube, just like the search bar, e.g. web scraping tutorials. Each video found gives its transcript.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Direct URLs",
            "type": "array",
            "description": "The same links as YouTube videos above, in the form {\"url\": \"https://www.youtube.com/@TED/videos\"}.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxResults": {
            "title": "Maximum videos per search or channel",
            "minimum": 0,
            "maximum": 999999,
            "type": "integer",
            "description": "Regular videos to read per search term, channel or playlist, e.g. 10. With 0 (and the two below at 0) each gets 10.",
            "default": 0
          },
          "maxResultsShorts": {
            "title": "Maximum shorts per search or channel",
            "minimum": 0,
            "maximum": 999999,
            "type": "integer",
            "description": "Shorts to read per search term or channel, e.g. 5. Stays 0 for none once another maximum is set.",
            "default": 0
          },
          "maxResultStreams": {
            "title": "Maximum streams per channel",
            "minimum": 0,
            "maximum": 999999,
            "type": "integer",
            "description": "Past live streams to read per channel, e.g. 2. Stays 0 for none once another maximum is set.",
            "default": 0
          },
          "oldestPostDate": {
            "title": "Published on or after",
            "type": "string",
            "description": "Start of the date range: a date like 2024-01-31 or a span like 7 days. Only videos from that day on are returned."
          },
          "newestPostDate": {
            "title": "Published on or before",
            "type": "string",
            "description": "End of the date range, a date like 2024-12-31. With the field above it gives a real from-to range, checked on each video's own date."
          },
          "excludeChannels": {
            "title": "Ignore these channels",
            "type": "array",
            "description": "Channel names, @handles, channel IDs or links to leave out of the results, e.g. @MrBeast or freeCodeCamp.org.",
            "items": {
              "type": "string"
            }
          },
          "onlyNew": {
            "title": "Only new videos",
            "type": "boolean",
            "description": "On a schedule: read only videos this same input has not returned before, e.g. a channel's new uploads. Off still marks rows in changeType.",
            "default": false
          },
          "transcriptionAndSubtitle": {
            "title": "Transcription & subtitles",
            "enum": [
              "NONE",
              "ALWAYS_SUBTITLES",
              "TRANSCRIPTION_AS_FALLBACK",
              "ALWAYS_TRANSCRIBE"
            ],
            "type": "string",
            "description": "NONE gives video data only (no captions read). ALWAYS_SUBTITLES adds the subtitles field. The speech-to-text values read captions too."
          },
          "subtitlesLanguage": {
            "title": "Subtitle language",
            "type": "string",
            "description": "Tried before Transcript languages, e.g. de or pt-BR. Write any to take the language spoken in the video."
          },
          "subtitlesFormat": {
            "title": "Subtitle format",
            "enum": [
              "srt",
              "vtt",
              "xml",
              "plaintext"
            ],
            "type": "string",
            "description": "Format of the timed text in the subtitles field, e.g. srt. Used with Transcription & subtitles set to ALWAYS_SUBTITLES."
          },
          "sortingOrder": {
            "title": "Sorting order",
            "enum": [
              "relevance",
              "rating",
              "date",
              "views"
            ],
            "type": "string",
            "description": "Order of search results, e.g. views. date and views put the first 60 results in order here, as YouTube itself no longer does."
          },
          "dateFilter": {
            "title": "Date filter",
            "enum": [
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "YouTube's upload date filter for search, e.g. month. For an exact from-to range use the two date fields above."
          },
          "videoType": {
            "title": "Video type filter",
            "enum": [
              "video",
              "movie"
            ],
            "type": "string",
            "description": "YouTube's type filter for search, e.g. video or movie."
          },
          "lengthFilter": {
            "title": "Length filter",
            "enum": [
              "under4",
              "between420",
              "plus20",
              "under3",
              "between320"
            ],
            "type": "string",
            "description": "YouTube's length filter for search, e.g. between420 for the middle length. Short is under 3-4 minutes, long is over 20."
          },
          "useApifyProxy": {
            "title": "Use Apify Proxy",
            "type": "boolean",
            "description": "Recommended. YouTube limits plain data-center traffic.",
            "default": true
          },
          "proxyGroups": {
            "title": "Proxy groups",
            "type": "array",
            "description": "Optional Apify Proxy groups as a list. YouTube blocks data-center addresses, so RESIDENTIAL is prefilled, e.g. [\"RESIDENTIAL\"].",
            "items": {
              "type": "string"
            }
          },
          "webhookUrl": {
            "title": "Send results to (webhook URL)",
            "type": "string",
            "description": "Optional. An https address - your own system, Zapier, Make or a Slack incoming webhook - that gets each run's results as JSON (with 'only new' on: just the new ones). Example: https://hooks.slack.com/services/T000/B000/XXXX"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}