{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript Scraper: Channels & Playlists",
    "description": "Collect existing YouTube captions as JSON, SRT or VTT from videos, channels and playlists. Sync new videos and fetch fresh metadata. Result fees plus Apify usage.",
    "version": "0.9",
    "x-build-id": "2wwb3I1puernum1cI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datarelay~youtube-transcript-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datarelay-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/datarelay~youtube-transcript-api/runs": {
      "post": {
        "operationId": "runs-sync-datarelay-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/datarelay~youtube-transcript-api/run-sync": {
      "post": {
        "operationId": "run-sync-datarelay-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": {
          "startUrls": {
            "title": "Start urls",
            "type": "array",
            "description": "Public video IDs/URLs, channel URLs or playlist URLs. Strings or objects with a url field.",
            "default": []
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Search phrases. Each query is paginated up to the configured limit.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "Preferred caption languages in priority order.",
            "items": {
              "type": "string"
            },
            "default": [
              "en"
            ]
          },
          "translateTo": {
            "title": "Translate to",
            "type": "array",
            "description": "Additional target languages for native captions or YouTube translations. Each delivered language is a separate paid result.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "formats": {
            "title": "Formats",
            "type": "array",
            "description": "Output representations. Formats do not multiply paid rows.",
            "items": {
              "type": "string",
              "enum": [
                "text",
                "json",
                "srt",
                "vtt"
              ]
            },
            "default": [
              "text",
              "json"
            ]
          },
          "channelTabs": {
            "title": "Channel tabs",
            "type": "array",
            "description": "Channel tabs to crawl, including Shorts and streams.",
            "items": {
              "type": "string",
              "enum": [
                "videos",
                "shorts",
                "streams"
              ]
            },
            "default": [
              "videos"
            ]
          },
          "preferManual": {
            "title": "Prefer manual",
            "type": "boolean",
            "description": "Prefer manually uploaded captions within the selected language.",
            "default": true
          },
          "allowLanguageFallback": {
            "title": "Allow language fallback",
            "type": "boolean",
            "description": "Allow a different available language if none of the requested languages exist.",
            "default": false
          },
          "allLanguages": {
            "title": "All languages",
            "type": "boolean",
            "description": "Fetch one track per available language, up to maxTracks. Each delivered language is billed.",
            "default": false
          },
          "onlyNew": {
            "title": "Only new",
            "type": "boolean",
            "description": "Remember completed results for subsequent runs with the same syncKey. Use one run per syncKey at a time.",
            "default": false
          },
          "resetSync": {
            "title": "Reset sync",
            "type": "boolean",
            "description": "Clear the saved completed-result history for this syncKey.",
            "default": false
          },
          "includeExtraMetadata": {
            "title": "Include extra metadata",
            "type": "boolean",
            "description": "Fetch chapters, formats, comment count, subscriber count and other public fields with yt-dlp.",
            "default": false
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Include comment replies within the overall maxComments limit.",
            "default": true
          },
          "includeCommentAuthors": {
            "title": "Include comment authors",
            "type": "boolean",
            "description": "Include public author identity fields in comment output.",
            "default": false
          },
          "downloadAudio": {
            "title": "Download audio",
            "type": "boolean",
            "description": "Download and store an audio file. Separately billed; uses transfer and storage.",
            "default": false
          },
          "downloadVideo": {
            "title": "Download video",
            "type": "boolean",
            "description": "Download and store a video file. Separately billed; uses transfer and storage.",
            "default": false
          },
          "maxTracks": {
            "title": "Max tracks",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum original/translated caption tracks per video. Too many tracks produces an explicit limit error.",
            "default": 20
          },
          "maxVideos": {
            "title": "Max videos",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum unique videos attempted in this run, including unavailable and filtered videos.",
            "default": 100
          },
          "maxScannedVideos": {
            "title": "Max scanned videos",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum unique discovered IDs scanned, including already completed videos.",
            "default": 1000
          },
          "maxPagesPerSource": {
            "title": "Max pages per source",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum pages per search, playlist or channel tab. Increase for larger channels.",
            "default": 20
          },
          "maxRunSecs": {
            "title": "Max run secs",
            "minimum": 10,
            "maximum": 86400,
            "type": "integer",
            "description": "Soft run time budget in seconds.",
            "default": 1800
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Concurrent video jobs. Media downloads can require more memory.",
            "default": 3
          },
          "minDurationSeconds": {
            "title": "Min duration seconds",
            "minimum": 0,
            "type": "number",
            "description": "Minimum duration; checked against fresh metadata."
          },
          "maxDurationSeconds": {
            "title": "Max duration seconds",
            "minimum": 1,
            "type": "number",
            "description": "Maximum duration; checked against fresh metadata."
          },
          "minViews": {
            "title": "Min views",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum public view count; checked against fresh metadata."
          },
          "maxComments": {
            "title": "Max comments",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum total comments and replies per video. Zero disables comments. Each comment is a separate paid row.",
            "default": 0
          },
          "videoHeight": {
            "title": "Video height",
            "minimum": 144,
            "maximum": 2160,
            "type": "integer",
            "description": "Maximum downloaded video height.",
            "default": 720
          },
          "maxMediaMb": {
            "title": "Max media mb",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum stored media file size in MiB. Actual download traffic can be higher when streams are merged.",
            "default": 100
          },
          "maxMediaDurationSeconds": {
            "title": "Max media duration seconds",
            "minimum": 1,
            "maximum": 86400,
            "type": "integer",
            "description": "Maximum duration for media downloads. Live streams are excluded.",
            "default": 3600
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "metadata",
              "transcript",
              "combined",
              "tracks",
              "list"
            ],
            "type": "string",
            "description": "Choose metadata, captions, a combined package, track discovery or a video-ID list.",
            "default": "combined"
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "YouTube interface language.",
            "default": "en"
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "YouTube content region, not a guaranteed proxy exit country.",
            "default": "US"
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "relevance",
              "date",
              "views",
              "rating"
            ],
            "type": "string",
            "description": "YouTube search sorting. Channel videos use the selected tab default order.",
            "default": "relevance"
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Only videos published on or after this ISO date/time."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Only videos published on or before this ISO date/time. A date without a time means midnight UTC."
          },
          "syncKey": {
            "title": "Sync key",
            "pattern": "^[a-zA-Z0-9-]{0,40}$",
            "maxLength": 40,
            "type": "string",
            "description": "Saved-state name. Changing selection requires another key or resetSync.",
            "default": "default"
          },
          "commentsSort": {
            "title": "Comments sort",
            "enum": [
              "new",
              "top"
            ],
            "type": "string",
            "description": "Comment sort order.",
            "default": "new"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "On Apify, omitted proxy input uses US residential proxy. Explicit direct access or custom proxy settings override this default. No automatic fallback to direct access if the selected proxy is unavailable. Local omitted input stays direct."
          },
          "proxyRouting": {
            "title": "Native video proxy routing",
            "enum": [
              "single",
              "auto"
            ],
            "type": "string",
            "description": "single keeps the selected proxy for every request. Experimental auto uses datacenter for native-video pages/captions and residential for player API, with at most one fresh-residential recovery per video. Only on Apify with proxyConfiguration omitted and no translateTo. Explicit proxy settings, local runs and list mode keep single routing. Leave single until validating auto for your workload.",
            "default": "single"
          },
          "captionType": {
            "title": "Caption type",
            "enum": [
              "any",
              "manual",
              "generated"
            ],
            "type": "string",
            "description": "Strictly allow any, manual or YouTube-generated native captions. Unlike preferManual, manual/generated never substitute the other type. Manual also requires native manual translation targets.",
            "default": "any"
          },
          "saveSubtitleFiles": {
            "title": "Save downloadable subtitle files",
            "type": "array",
            "description": "Optional TXT, SRT and WebVTT files in the run key-value store. Reuses fetched captions; no extra result fee per format. Normal storage/transfer usage and retention apply.",
            "items": {
              "type": "string",
              "enum": [
                "txt",
                "srt",
                "vtt"
              ]
            },
            "default": []
          },
          "includeChunks": {
            "title": "Include transcript chunks",
            "type": "boolean",
            "description": "Create bounded overlapping character-based passages with original text and segment timestamps. No AI or tokenizer.",
            "default": false
          },
          "searchPhrases": {
            "title": "Find phrases in transcripts",
            "type": "array",
            "description": "Up to 50 literal phrases, each up to 200 characters. Searches these fetched transcripts, including across segments; returns exact quotes and segment timestamps.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "phraseCaseSensitive": {
            "title": "Case-sensitive phrase search",
            "type": "boolean",
            "description": "Require matching letter case. Phrases remain literal; whitespace can span segments.",
            "default": false
          },
          "maxSubtitleFileMb": {
            "title": "Maximum subtitle file size (MiB)",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum size of each subtitle file. Oversize/write failures preserve the transcript with explicit file errors.",
            "default": 5
          },
          "chunkSizeChars": {
            "title": "Chunk size (characters)",
            "minimum": 500,
            "maximum": 10000,
            "type": "integer",
            "description": "Target maximum characters per chunk; not tokens. Segment timestamps are retained; output also has a fixed byte cap.",
            "default": 2000
          },
          "chunkOverlapChars": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Overlap between neighboring chunks. Must be smaller than chunkSizeChars.",
            "default": 200
          },
          "maxChunksPerTranscript": {
            "title": "Maximum chunks per transcript",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Returned chunks per language. Truncation and its reason are explicit.",
            "default": 200
          },
          "maxPhraseMatches": {
            "title": "Maximum phrase matches per transcript",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Combined match limit across all phrases, returned in source order.",
            "default": 100
          },
          "phraseContextChars": {
            "title": "Phrase context (characters)",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Characters before and after each actual quote; segment-level timing is not word alignment.",
            "default": 80
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}