{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript Scraper & API: Subtitles, Captions, SRT",
    "description": "Get the transcript of any YouTube video, Short or playlist: plain text, timestamps, SRT/VTT subtitles or RAG chunks, with publish date, views and likes. Any language, no API key. A video without captions gets a row that says why and is never billed. First 50 per run free, then $0.0075 each.",
    "version": "1.0",
    "x-build-id": "VQBoIRpHXZte9b0NO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jamhimself~youtube-transcript-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jamhimself-youtube-transcript-extractor",
        "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/jamhimself~youtube-transcript-extractor/runs": {
      "post": {
        "operationId": "runs-sync-jamhimself-youtube-transcript-extractor",
        "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/jamhimself~youtube-transcript-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-jamhimself-youtube-transcript-extractor",
        "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": {
          "videoUrls": {
            "title": "YouTube videos",
            "type": "array",
            "description": "YouTube video links or 11-character video IDs, one per line. Any way of writing the link works: watch, youtu.be, Shorts, embed, live, mobile, YouTube Music. A playlist link gets you every video in the playlist, and a channel link or @handle gets you the channel's newest videos (see \"Videos per playlist or channel\" below). A video listed twice is read once.",
            "items": {
              "type": "string"
            }
          },
          "languages": {
            "title": "Languages, in order of preference",
            "type": "array",
            "description": "Caption language codes, best first, for example en or es. If a video has none of them you get English, and if it has no English, the language spoken in the video. Every row says which language it carries. Not sure about the language? Write original to get the language spoken in each video.",
            "default": [
              "en"
            ],
            "items": {
              "type": "string"
            }
          },
          "onlyRequestedLanguages": {
            "title": "Only these languages",
            "type": "boolean",
            "description": "Skip a video that has none of the languages above, instead of falling back to another language. A skipped video is not billed, and its row lists the languages the video does have.",
            "default": false
          },
          "preferManual": {
            "title": "Prefer captions written by people",
            "type": "boolean",
            "description": "When a video has both written captions and YouTube's automatic ones in the same language, take the written ones. Switch off to take the automatic ones.",
            "default": true
          },
          "includePlainText": {
            "title": "Plain text",
            "type": "boolean",
            "description": "The whole transcript as one clean string in the \"text\" field, ready for an LLM or a document.",
            "default": true
          },
          "includeSegments": {
            "title": "Timestamped lines",
            "type": "boolean",
            "description": "The transcript line by line in the \"segments\" field, each with its start time and duration in seconds.",
            "default": true
          },
          "includeSrt": {
            "title": "SRT subtitles",
            "type": "boolean",
            "description": "The transcript as a SubRip (.srt) subtitle file in the \"srt\" field.",
            "default": false
          },
          "includeVtt": {
            "title": "VTT subtitles",
            "type": "boolean",
            "description": "The transcript as a WebVTT (.vtt) subtitle file in the \"vtt\" field.",
            "default": false
          },
          "ragChunking": {
            "title": "Chunks for RAG",
            "type": "boolean",
            "description": "The transcript cut into overlapping chunks in the \"chunks\" field, each with its start and end time and a link that opens the video at that moment. Ready for embeddings and vector databases (LangChain, LlamaIndex).",
            "default": false
          },
          "chunkMaxChars": {
            "title": "Chunk size (characters)",
            "minimum": 200,
            "maximum": 20000,
            "type": "integer",
            "description": "The most characters in one chunk.",
            "default": 1500
          },
          "chunkOverlapChars": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "About how many characters the end of one chunk shares with the start of the next.",
            "default": 200
          },
          "includeVideoDetails": {
            "title": "Description and keywords",
            "type": "boolean",
            "description": "Add the video's full description and its keywords to each row.",
            "default": false
          },
          "includeVideosWithoutTranscript": {
            "title": "A row for every video, also those without a transcript",
            "type": "boolean",
            "description": "A video that has no captions, is private, removed or age-restricted, or a link that is not a YouTube video, gets a row with ok: false and the reason, so nothing you put in goes missing. These rows are never billed. Switch off to get transcripts only; the reasons are then in the SKIPPED record of the run.",
            "default": true
          },
          "maxVideosPerSource": {
            "title": "Videos per playlist or channel",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "The most videos to take from each playlist or channel link. Single video links are not affected.",
            "default": 50
          },
          "concurrency": {
            "title": "Videos at once",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many videos are read at the same time.",
            "default": 10
          },
          "proxyCountryCode": {
            "title": "Country to read from",
            "type": "string",
            "description": "Two-letter country code, for a video that is only available in some countries. Leave empty for the United States."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}