{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript API — RAG, Markdown, Chapters",
    "description": "Bulk YouTube transcripts, captions and subtitles to text: SRT, VTT, Markdown and timestamp-linked RAG chunks from videos, Shorts, playlists, channels and search. Failed videos are free.",
    "version": "0.2",
    "x-build-id": "fQSZdkOKbXnHjdpIW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/smartlinks~youtube-transcript-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-smartlinks-youtube-transcript-api",
        "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/smartlinks~youtube-transcript-api/runs": {
      "post": {
        "operationId": "runs-sync-smartlinks-youtube-transcript-api",
        "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/smartlinks~youtube-transcript-api/run-sync": {
      "post": {
        "operationId": "run-sync-smartlinks-youtube-transcript-api",
        "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": "Video or collection URLs",
            "minItems": 0,
            "maxItems": 10000,
            "type": "array",
            "description": "YouTube video, shorts or youtu.be URLs. Playlist/channel URLs require expandCollections.",
            "items": {
              "type": "string"
            }
          },
          "languages": {
            "title": "Preferred languages",
            "minItems": 1,
            "maxItems": 20,
            "type": "array",
            "description": "Ordered language codes; regional matching then any available track is used as fallback.",
            "items": {
              "type": "string"
            },
            "default": [
              "en"
            ]
          },
          "track": {
            "title": "Caption track",
            "enum": [
              "any",
              "manual",
              "auto"
            ],
            "type": "string",
            "description": "Prefer manual captions within each language when any is selected.",
            "default": "any"
          },
          "format": {
            "title": "Transcript format",
            "enum": [
              "segments",
              "json",
              "text",
              "srt",
              "vtt",
              "markdown"
            ],
            "type": "string",
            "description": "Segments and text are always retained. SRT/VTT/text/Markdown also appear in formatted. json aliases segments.",
            "default": "segments"
          },
          "includeMetadata": {
            "title": "Include metadata",
            "type": "boolean",
            "description": "Return available title, channel, duration, publication date and views; missing values are null.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Maximum concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Simultaneous video requests. Higher values can increase blocking.",
            "default": 50
          },
          "expandCollections": {
            "title": "Expand collections",
            "type": "boolean",
            "description": "List public playlist/channel video IDs, bounded per input. Listing can be partial or blocked.",
            "default": false
          },
          "maxVideosPerChannel": {
            "title": "Videos per collection",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum listed video IDs per playlist or channel input.",
            "default": 100
          },
          "max_results": {
            "title": "Maximum fetched videos",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum unique videos fetched. Collection expansion also stops when the planned row count reaches this limit. Stops and unprocessed rows are reported in OUTPUT.",
            "default": 1000
          },
          "max_cost_usd": {
            "title": "Maximum transcript event cost (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Optional extra cap on transcript event fees, using the effective configured price. Platform usage has its own Apify run budget."
          },
          "timeoutSecs": {
            "title": "Timeout per request",
            "minimum": 5,
            "maximum": 90,
            "type": "integer",
            "description": "Seconds per client request. Up to three clients can be attempted.",
            "default": 8
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Residential US by default. Custom proxies or no proxy can be selected; reliability differs.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          },
          "previousDatasetId": {
            "title": "Previous dataset",
            "type": "string",
            "description": "Reuse validated successful rows with matching language, track and translation settings without transcript charge. Prior failures are retried."
          },
          "resume_ids": {
            "title": "Retry only these video IDs",
            "type": "array",
            "description": "When nonempty, fetch only these IDs; matching previous successful rows are reused. Other entries receive free retryable rows.",
            "items": {
              "type": "string"
            }
          },
          "includeExtendedMetadata": {
            "title": "Look up publication date",
            "type": "boolean",
            "description": "Optional extra public metadata lookups when the player omits the publication date. Adds latency, no extra event. Unknown dates remain null; captions are still delivered. Requires includeMetadata.",
            "default": false
          },
          "publishedAfter": {
            "title": "Published on or after",
            "type": "string",
            "description": "Inclusive YYYY-MM-DD. Unknown dates return free retryable rows; filtering can require an extra watch metadata request."
          },
          "publishedBefore": {
            "title": "Published on or before",
            "type": "string",
            "description": "Inclusive YYYY-MM-DD. Applied to listed and direct videos before delivery/charging."
          },
          "searchQueries": {
            "title": "YouTube searches",
            "maxItems": 100,
            "type": "array",
            "description": "Up to 100 keyword searches. Public video IDs only, bounded per query; search ordering is not exhaustive.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300
            }
          },
          "maxVideosPerSearch": {
            "title": "Videos per search",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum IDs listed per search query.",
            "default": 20
          },
          "includeChunks": {
            "title": "RAG chunks",
            "type": "boolean",
            "description": "Add stable timestamp-linked word windows; original cues remain intact.",
            "default": true
          },
          "chunkUnit": {
            "title": "Chunk size unit",
            "enum": [
              "words",
              "chars",
              "tokens"
            ],
            "type": "string",
            "description": "Words, characters, or estimated tokens (characters / 4). Token sizing is not a model tokenizer.",
            "default": "words"
          },
          "chunkSize": {
            "title": "Chunk size",
            "minimum": 10,
            "maximum": 2000,
            "type": "integer",
            "description": "Maximum units per chunk, controlled by chunkUnit.",
            "default": 200
          },
          "chunkOverlap": {
            "title": "Chunk overlap",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Units shared by adjacent chunks; must not exceed half of chunkSize.",
            "default": 40
          },
          "includeMarkdown": {
            "title": "Markdown document",
            "type": "boolean",
            "description": "Add a document with timestamp links and available description chapters.",
            "default": true
          },
          "includeChapters": {
            "title": "Description chapters",
            "type": "boolean",
            "description": "Parse three or more ascending description timestamps beginning at zero. No inferred chapters; unavailable chapters return an empty list.",
            "default": true
          },
          "minAttemptsForSuccessRatio": {
            "title": "Minimum attempts for success ratio",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop new video work after this many attempts if fewer than 10% succeed. Independent of charges; persisted across restarts.",
            "default": 200
          },
          "maxConsecutiveFailures": {
            "title": "Maximum consecutive unsuccessful videos",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop new video work after this many consecutive unsuccessful attempts. Independent of charges; persisted across restarts.",
            "default": 500
          },
          "maxRunSecs": {
            "title": "Overall run deadline",
            "minimum": 30,
            "maximum": 3000,
            "type": "integer",
            "description": "Seconds across listing, retrieval and restarts, including ten seconds reserved for storage, billing and OUTPUT.",
            "default": 3000
          },
          "maxListingSources": {
            "title": "Maximum listing attempts",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Run-wide cap on playlist, channel and search listing attempts. Duplicate sources share a listing; checked before network work.",
            "default": 200
          },
          "searchInTranscripts": {
            "title": "Search inside transcripts",
            "maxItems": 50,
            "type": "array",
            "description": "Up to 50 literal terms (1–100 characters). Unicode case-insensitive whole-word search for single words and phrase matching across cues. Fetching still happens; no extra search fee.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100,
              "pattern": "\\S"
            },
            "default": []
          },
          "searchContextWords": {
            "title": "Words around each match",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Context words on each side of a hit. Match timestamps use the contributing caption cues.",
            "default": 12
          },
          "onlyVideosWithMatches": {
            "title": "Deliver only matching transcripts",
            "type": "boolean",
            "description": "Still fetches transcripts, but nonmatching videos produce free no_match rows without transcript text and are not charged. Fetching has no extra cost to the user. With no search terms, all fetched transcripts are nonmatching.",
            "default": false
          },
          "onlyNewVideos": {
            "title": "Only new videos (watch mode)",
            "type": "boolean",
            "description": "Skip previously delivered video IDs for this watch: no row, fetch or charge. Empty history delivers normally. Failures and no_match rows are retried on later runs. History keeps the newest 100,000 IDs.",
            "default": false
          },
          "watchId": {
            "title": "Watch ID (optional)",
            "pattern": "^[A-Za-z0-9_-]+$",
            "minLength": 1,
            "maxLength": 100,
            "type": "string",
            "description": "1–100 letters, digits, underscores or hyphens. Defaults to a hash of normalized source URLs, queries, retrieval and matching settings. Reuse an explicit ID to share history across changed inputs."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}