{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript Scraper with AI Fallback",
    "description": "Get YouTube transcripts for any video, Short, playlist or channel. Official captions first, automatic Whisper AI fallback when a video has none. Full videos up to 3 h, 99 languages, SRT or plain text, MCP-ready for AI agents, cached discounts, and free error rows for failed videos.",
    "version": "0.1",
    "x-build-id": "d9a7PAE81Sx9VPSyq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/iddqd~tubescribe/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-iddqd-tubescribe",
        "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/iddqd~tubescribe/runs": {
      "post": {
        "operationId": "runs-sync-iddqd-tubescribe",
        "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/iddqd~tubescribe/run-sync": {
      "post": {
        "operationId": "run-sync-iddqd-tubescribe",
        "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",
        "required": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "YouTube URLs",
            "minItems": 1,
            "maxItems": 1000,
            "type": "array",
            "description": "Videos, Shorts, playlists or channels (for example https://www.youtube.com/watch?v=jNQXAC9IVRw, https://youtu.be/…, https://www.youtube.com/@handle). A channel is read from its Videos tab, newest first. Duplicates are removed.",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "title": "URL",
                  "type": "string",
                  "description": "A youtube.com or youtu.be URL.",
                  "pattern": "^https?://(www\\.|m\\.)?(youtube\\.com|youtu\\.be)/\\S+$"
                }
              }
            },
            "default": [
              {
                "url": "https://youtu.be/jNQXAC9IVRw"
              }
            ]
          },
          "maxItems": {
            "title": "Max transcripts",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "The most transcripts (video × track) this run delivers. It also caps the videos read from each playlist or channel, so it bounds the cost of a big channel.",
            "default": 100
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "captions",
              "ai"
            ],
            "type": "string",
            "description": "Official captions uses YouTube's captions and switches to AI automatically when a video has no captions (billed as AI minutes). Transcribe with AI always transcribes the audio. Billing follows the source that answered.",
            "default": "captions"
          },
          "language": {
            "title": "Language",
            "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$",
            "type": "string",
            "description": "A BCP 47 code such as en, de or pt-BR. Leave empty to get the video's default captions, or auto-detection for AI. When set, the AI transcribes in this language, so only set a language that is actually spoken in the video."
          },
          "tracks": {
            "title": "Tracks",
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "description": "original gives one transcript per video. all gives one transcript per caption language the video offers. Language codes such as en or es give one transcript per code. Each entry is a separate transcript and charge; an entry the actor cannot use is refused when the input is read.",
            "items": {
              "type": "string"
            }
          },
          "aiFallback": {
            "title": "AI fallback when a video has no captions",
            "type": "boolean",
            "description": "Only for mode captions. On: a video without captions is transcribed with AI and billed as AI minutes. Off: such a video ends as an error item and costs nothing.",
            "default": true
          },
          "outputFormats": {
            "title": "Output formats",
            "maxItems": 2,
            "uniqueItems": true,
            "type": "array",
            "description": "Derived fields to add to every transcript item: text is the transcript as one plain-text string, srt is it as a SubRip subtitle file. Both render snapshot.segments and cost nothing.",
            "items": {
              "type": "string",
              "enum": [
                "text",
                "srt"
              ],
              "enumTitles": [
                "Plain text",
                "SRT subtitles"
              ]
            },
            "default": []
          },
          "budgetSeconds": {
            "title": "Max media seconds per video",
            "minimum": 1,
            "maximum": 3600,
            "type": "integer",
            "description": "Transcribe only the first N media seconds of each video, for previews or to cap AI cost. The item is marked truncated, and only the delivered AI minutes are billed. Leave empty for the full video."
          },
          "forceRefresh": {
            "title": "Force refresh",
            "type": "boolean",
            "description": "Ignore cached transcripts and read the video again. Billed at the full (not cached) price.",
            "default": false
          },
          "concurrency": {
            "title": "Parallel videos",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "How many videos are processed at the same time. Higher is faster for big playlists and channels.",
            "default": 4
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}