{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript Scraper | Captions API, Bulk, Shorts",
    "description": "Extract YouTube transcripts in bulk at $0.90 per 1,000 videos ($0.60 on paid plans) plus a $0.0001 start fee and $0.0001 per hour beyond 3 h. Videos, Shorts, channels, playlists, search terms; YouTube captions as text, timestamps, AI chunks, chapters. No captions, no charge.",
    "version": "0.1",
    "x-build-id": "MXZV4PiwRbkgu3i2K"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/aurelix~youtube-transcript-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-aurelix-youtube-transcript-scraper",
        "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/aurelix~youtube-transcript-scraper/runs": {
      "post": {
        "operationId": "runs-sync-aurelix-youtube-transcript-scraper",
        "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/aurelix~youtube-transcript-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-aurelix-youtube-transcript-scraper",
        "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": {
          "videos": {
            "title": "Videos",
            "type": "array",
            "description": "Video URLs or 11-character IDs in any form, e.g. ['https://www.youtube.com/watch?v=dQw4w9WgXcQ', 'https://youtu.be/jNQXAC9IVRw', 'dQw4w9WgXcQ']. Shorts, live, embed and youtube-nocookie links work, as do links with timestamps or playlist parameters; several links pasted into one entry are split. A channel or playlist URL pasted here is treated as one.",
            "items": {
              "type": "string"
            }
          },
          "channels": {
            "title": "Channels (latest videos)",
            "type": "array",
            "description": "Channel URLs, @handles or UC… channel IDs, e.g. ['https://www.youtube.com/@veritasium', '@mkbhd']. The latest videos from the channel's Videos tab are read, newest first, up to 'Max videos per channel, playlist or search'.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "playlists": {
            "title": "Playlists",
            "type": "array",
            "description": "Playlist URLs or IDs, e.g. ['https://www.youtube.com/playlist?list=PLFs4vir_WsTwEd-nJgVJCZPNL3HALHHpF'], read in playlist order.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "YouTube searches, e.g. ['python tutorial']. The top video results (no Shorts, channels or playlists) are read in YouTube's relevance order.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerSource": {
            "title": "Max videos per channel, playlist or search",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "How many videos to read from each channel, playlist and search term, e.g. 20. Videos given directly are always read.",
            "default": 10
          },
          "languages": {
            "title": "Preferred languages",
            "type": "array",
            "description": "Caption languages in order of preference, as codes, e.g. ['en', 'es']. 'en' also matches en-US and en-GB. Within a language a creator's own captions beat auto-generated ones. If none is available the video's own caption track is returned and 'language_fallback' is true. Empty = the video's own track.",
            "default": [
              "en"
            ],
            "items": {
              "type": "string"
            }
          },
          "includeAutoGenerated": {
            "title": "Include auto-generated captions",
            "type": "boolean",
            "description": "Use YouTube's automatic (speech recognition) captions when the creator uploaded none. Off = only creator-made captions; videos with only automatic ones are skipped and not charged.",
            "default": true
          },
          "includeSegments": {
            "title": "Include timestamped segments",
            "type": "boolean",
            "description": "Add 'segments': every caption line with start and end in seconds, e.g. {start: 12.4, end: 15.1, text: '...'}. Off = plain text and chunks only, for smaller output.",
            "default": true
          },
          "chunkSize": {
            "title": "AI chunk size (characters)",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Split each transcript into 'chunks' of about this many characters for RAG and embeddings, e.g. 1000 (about 200 to 250 tokens). Chunks never cut a caption line and carry their start and end time and a timestamped link. 0 = no chunks.",
            "default": 1000
          },
          "chunkOverlap": {
            "title": "AI chunk overlap (characters)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Characters repeated from the end of one chunk at the start of the next, e.g. 100, so context is not lost at a boundary. Must be smaller than the chunk size.",
            "default": 100
          },
          "incremental": {
            "title": "Only new videos since last run",
            "type": "boolean",
            "description": "Return only videos not returned by a previous run with the same inputs, e.g. for a daily schedule on a channel. Videos skipped for missing captions are tried again next time (YouTube adds automatic captions a few hours after upload).",
            "default": false
          },
          "stateKey": {
            "title": "Incremental state name (optional)",
            "type": "string",
            "description": "Name for the 'new since last run' memory, e.g. 'my-channel-feed'. Leave empty to derive it from the inputs."
          },
          "residentialFallback": {
            "title": "Retry on a residential IP when blocked",
            "type": "boolean",
            "description": "YouTube asks many cloud IPs to confirm they are not a bot. Off (default): datacenter IPs only; if the first 60 tried (or the first 20 seconds) are all refused, the run stops early, says so, and charges nothing for the videos it could not read. On: at that point the run moves to residential IPs for up to 20 videos (one 'residential-retry' fee per run, charged only when they return at least one transcript). Turn on for scheduled or large runs that must finish.",
            "default": false
          },
          "slackWebhookUrl": {
            "title": "Slack webhook URL (optional)",
            "type": "string",
            "description": "After each run, post a short digest to Slack: how many results were saved (new ones only when 'Only new videos since last run' is on) and the top 10 with links, e.g. https://hooks.slack.com/services/T000/B000/XXXX. Nothing is posted when the run saved nothing. Leave empty to skip."
          },
          "webhookUrl": {
            "title": "Webhook URL (optional)",
            "type": "string",
            "description": "After each run, POST the same digest as JSON (actor, newOnly, count, items = top 10 results, runUrl, text) to any URL, e.g. a Zapier, Make or n8n webhook. Nothing is sent when the run saved nothing. Leave empty to skip."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}