{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript & Subtitles API – AI, Channels, Shorts",
    "description": "Get YouTube transcripts, subtitles and captions from any video, Short, playlist or channel as clean text, timestamps or SRT. Whisper AI for videos without captions. $0.004 per transcript, failed videos are free. Built for ChatGPT, Claude, RAG and n8n.",
    "version": "1.0",
    "x-build-id": "QilvA87FuA2hDObpW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tubetext~youtube-transcript-fast/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tubetext-youtube-transcript-fast",
        "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/tubetext~youtube-transcript-fast/runs": {
      "post": {
        "operationId": "runs-sync-tubetext-youtube-transcript-fast",
        "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/tubetext~youtube-transcript-fast/run-sync": {
      "post": {
        "operationId": "run-sync-tubetext-youtube-transcript-fast",
        "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": {
          "urls": {
            "title": "YouTube URLs",
            "type": "array",
            "description": "Video URLs or IDs, playlist URLs, or channel URLs (e.g. https://www.youtube.com/@mkbhd). Shorts and youtu.be links work too. Optional if you use search, trending or a dataset below.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Or: find YouTube videos by keyword",
            "type": "array",
            "description": "YouTube search terms, e.g. 'skincare routine'. Each search takes the top videos for the time range and sort below (up to 'Max videos per source').",
            "items": {
              "type": "string"
            }
          },
          "searchPublishedWithin": {
            "title": "Search: published within",
            "enum": [
              "hour",
              "today",
              "week",
              "month",
              "year",
              "any"
            ],
            "type": "string",
            "description": "Only videos uploaded within this time range (YouTube's own upload-date filter).",
            "default": "week"
          },
          "searchSortBy": {
            "title": "Search: sort by",
            "enum": [
              "views",
              "relevance",
              "date"
            ],
            "type": "string",
            "description": "'Most viewed' re-sorts the results by their actual view count.",
            "default": "views"
          },
          "trendingCountries": {
            "title": "Or: today's trending YouTube videos",
            "type": "array",
            "description": "Two-letter country codes, e.g. us, jp, de, br, in, kr, fr, gb. Takes the top of each country's daily trending list (source: kworb.net; YouTube retired its own trending page).",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Or: dataset with YouTube links (chain another Actor)",
            "type": "string",
            "description": "A dataset from another Actor run that contains YouTube video links (pick it, or paste its ID via API). With 'Sort dataset by views' the most viewed come first; 'Max videos per source' limits how many are taken. Read-only access to this one dataset is requested."
          },
          "datasetSortBy": {
            "title": "Sort dataset by",
            "enum": [
              "views",
              "original"
            ],
            "type": "string",
            "description": "How to pick videos from the dataset when it has more than 'Max videos per source'.",
            "default": "views"
          },
          "maxVideosPerSource": {
            "title": "Max videos per playlist/channel",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "For channel, playlist, search, trending and dataset inputs: how many videos to take from each (each transcript is billed as usual).",
            "default": 50
          },
          "channelSort": {
            "title": "Channel videos: newest or most viewed",
            "enum": [
              "newest",
              "popular"
            ],
            "type": "string",
            "description": "For channel links (including /shorts and /streams tabs): take the newest videos, or the channel's most viewed ones.",
            "default": "newest"
          },
          "skipAlreadyScraped": {
            "title": "Only new videos (skip already scraped)",
            "type": "boolean",
            "description": "Remember delivered videos in your account (key-value store 'tubetext-seen-videos') and skip them on later runs. Perfect for scheduled channel monitoring – you never pay twice for the same video.",
            "default": false
          },
          "languages": {
            "title": "Preferred languages",
            "type": "array",
            "description": "Language codes in order of preference (e.g. en, es, ja). For each video the first listed language that has captions is used, so put the language you want most first. If none is available, the video's original auto-generated transcript is returned.",
            "default": [
              "en"
            ],
            "items": {
              "type": "string"
            }
          },
          "preferManualCaptions": {
            "title": "Prefer human-made captions",
            "type": "boolean",
            "description": "Use creator-uploaded captions over YouTube auto-generated ones when both exist.",
            "default": true
          },
          "includeTimestampedText": {
            "title": "Include timestamped text",
            "type": "boolean",
            "description": "Adds a 'timestampedText' field with one [mm:ss] line per caption.",
            "default": true
          },
          "includeSrt": {
            "title": "Include SRT subtitles",
            "type": "boolean",
            "description": "Adds an 'srt' field with the transcript in SubRip (.srt) subtitle format.",
            "default": false
          },
          "includeSegments": {
            "title": "Include raw segments",
            "type": "boolean",
            "description": "Adds a 'segments' array with start, duration and text for each caption.",
            "default": false
          },
          "chunkWords": {
            "title": "RAG chunk size (words)",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Set e.g. 300 to add a 'chunks' array: transcript split into ~N-word blocks with start/end timestamps, never cutting a caption in half. Ready for vector databases. 0 = off.",
            "default": 0
          },
          "aiFallback": {
            "title": "AI transcription for videos without captions",
            "type": "boolean",
            "description": "When a video has no captions, download its audio and transcribe it with Whisper AI. Charged per started minute of audio, only when a transcript is delivered.",
            "default": false
          },
          "maxAiMinutesPerVideo": {
            "title": "Max video length for AI (minutes)",
            "minimum": 1,
            "maximum": 180,
            "type": "integer",
            "description": "Videos longer than this are skipped by AI transcription to keep costs predictable.",
            "default": 60
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "How many videos to process in parallel.",
            "default": 10
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}