{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript Scraper",
    "description": "YouTube transcript API: bulk transcripts and captions for videos, Shorts, channels, playlists and searches. Timestamps, text, SRT/VTT, RAG-ready chunks, language fallback, translation. $2.50 per 1,000 transcripts; no captions = no charge.",
    "version": "1.0",
    "x-build-id": "JHhgXZ1E1T8opRBt7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jcwilk~youtube-transcripts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jcwilk-youtube-transcripts",
        "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/jcwilk~youtube-transcripts/runs": {
      "post": {
        "operationId": "runs-sync-jcwilk-youtube-transcripts",
        "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/jcwilk~youtube-transcripts/run-sync": {
      "post": {
        "operationId": "run-sync-jcwilk-youtube-transcripts",
        "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 or IDs",
            "type": "array",
            "description": "Any mix of video URLs, Shorts URLs, youtu.be links, 11-character video IDs, channel URLs or @handles, and playlist URLs or IDs.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Optional. Get transcripts of the top YouTube search results for each query.",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerSource": {
            "title": "Max videos per channel / playlist / search",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "How many of the newest videos to take from each channel tab, playlist or search query.",
            "default": 20
          },
          "channelContent": {
            "title": "Channel content",
            "enum": [
              "videos",
              "shorts",
              "videos+shorts",
              "streams",
              "all"
            ],
            "type": "string",
            "description": "Which channel tabs to read for channel inputs.",
            "default": "videos"
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Only channel/playlist/search videos published on or after this date (YYYY-MM-DD). Dates in listings are approximate (from '3 weeks ago')."
          },
          "languages": {
            "title": "Preferred languages",
            "type": "array",
            "description": "Caption language codes in order of preference, e.g. en, es, de. Regional variants match (en matches en-GB).",
            "default": [
              "en"
            ],
            "items": {
              "type": "string"
            }
          },
          "preferManualCaptions": {
            "title": "Prefer human-made captions",
            "type": "boolean",
            "description": "Use creator-uploaded captions over auto-generated ones when both exist.",
            "default": true
          },
          "fallbackToAnyLanguage": {
            "title": "Fall back to any language",
            "type": "boolean",
            "description": "If none of the preferred languages exist, return the video's original-language captions. Off = mark the video as no_captions (free).",
            "default": true
          },
          "translateTo": {
            "title": "Translate to",
            "type": "string",
            "description": "Optional language code (e.g. en). Uses YouTube's built-in caption translation when the chosen track is in another language."
          },
          "includeText": {
            "title": "Plain text",
            "type": "boolean",
            "description": "Full transcript as one string.",
            "default": true
          },
          "includeSegments": {
            "title": "Timestamped segments",
            "type": "boolean",
            "description": "Array of {start, duration, text} in seconds.",
            "default": true
          },
          "includeTimestampedText": {
            "title": "Text with [mm:ss] markers",
            "type": "boolean",
            "description": "Readable text with a timestamp every ~30 seconds.",
            "default": false
          },
          "includeChunks": {
            "title": "RAG chunks",
            "type": "boolean",
            "description": "Time-aligned chunks with start/end seconds and a deep link, ready for embeddings.",
            "default": false
          },
          "chunkSizeChars": {
            "title": "Chunk size (characters)",
            "minimum": 200,
            "maximum": 20000,
            "type": "integer",
            "description": "Approximate max characters per RAG chunk (about 4 characters per token).",
            "default": 2000
          },
          "includeSrt": {
            "title": "SRT subtitles",
            "type": "boolean",
            "description": "Add an SRT subtitle file as a string.",
            "default": false
          },
          "includeVtt": {
            "title": "WebVTT subtitles",
            "type": "boolean",
            "description": "Add a WebVTT subtitle file as a string.",
            "default": false
          },
          "metadataOnly": {
            "title": "Metadata only (no transcript)",
            "type": "boolean",
            "description": "Return title, channel, duration, views, description, keywords and caption languages without the transcript. Charged as video-metadata.",
            "default": false
          },
          "maxVideos": {
            "title": "Max videos in total",
            "minimum": 0,
            "type": "integer",
            "description": "Optional overall cap across all inputs (0 = no cap).",
            "default": 0
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Videos fetched in parallel.",
            "default": 5
          },
          "maxRetries": {
            "title": "Retries when blocked",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Attempts per video, each with a fresh proxy IP.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "YouTube blocks many cloud IPs. Residential proxy (default) is the most reliable; the Actor only transfers a few KB per video.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}