{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript Scraper - Captions, Subtitles & RAG API",
    "description": "Extract YouTube transcripts, captions, subtitles, timestamps, metadata, SRT, WebVTT, Markdown, and RAG-ready chunks from videos, Shorts, channels, and playlists. Works with bulk URLs and residential proxy support.",
    "version": "0.1",
    "x-build-id": "OstFbPovspWr6B7ZJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/meilimiao~yt-transcript-captions-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-meilimiao-yt-transcript-captions-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/meilimiao~yt-transcript-captions-api/runs": {
      "post": {
        "operationId": "runs-sync-meilimiao-yt-transcript-captions-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/meilimiao~yt-transcript-captions-api/run-sync": {
      "post": {
        "operationId": "run-sync-meilimiao-yt-transcript-captions-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",
        "required": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "YouTube URLs or video IDs",
            "type": "array",
            "description": "YouTube video URLs, Shorts URLs, playlist URLs, channel URLs, or raw 11-character video IDs. Start with a single video to test, then scale to bulk URLs.",
            "items": {
              "type": "string"
            }
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "json",
              "text",
              "srt",
              "vtt",
              "markdown"
            ],
            "type": "string",
            "description": "Choose how transcript text is formatted in formattedTranscript. JSON keeps structured fields only.",
            "default": "json"
          },
          "languages": {
            "title": "Language priority",
            "type": "array",
            "description": "Language codes in priority order. The Actor tries manual captions first, then auto-generated captions.",
            "default": [
              "en",
              "es",
              "ko"
            ],
            "items": {
              "type": "string"
            }
          },
          "translateTo": {
            "title": "Translate to language",
            "type": "string",
            "description": "Optional target language code, e.g. es, fr, de, zh. Uses YouTube built-in translation when available."
          },
          "includeMetadata": {
            "title": "Include video metadata",
            "type": "boolean",
            "description": "Include title, channel, duration, views, publish date, thumbnail, description, and tags when available.",
            "default": true
          },
          "includeTimestamps": {
            "title": "Include timestamped segments",
            "type": "boolean",
            "description": "Include per-caption segments with start time, duration, and text.",
            "default": true
          },
          "includeAvailableLanguages": {
            "title": "Include available languages",
            "type": "boolean",
            "description": "Return all transcript languages available on the video.",
            "default": true
          },
          "includeRagChunks": {
            "title": "Include RAG chunks",
            "type": "boolean",
            "description": "Split transcript into chunks suitable for vector databases and RAG pipelines.",
            "default": false
          },
          "chunkSize": {
            "title": "RAG chunk size",
            "minimum": 200,
            "maximum": 8000,
            "type": "integer",
            "description": "Approximate max characters per RAG chunk.",
            "default": 1000
          },
          "maxVideos": {
            "title": "Maximum videos",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Limit total videos processed, useful for channels and playlists.",
            "default": 100
          },
          "maxConcurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "How many videos to process in parallel. Default 2 is recommended for YouTube reliability; increase carefully for large proxy-backed runs.",
            "default": 2
          },
          "fallbackToAnyLanguage": {
            "title": "Fallback to any language",
            "type": "boolean",
            "description": "If requested languages are unavailable, use any available transcript instead of failing.",
            "default": true
          },
          "preserveFormatting": {
            "title": "Preserve caption formatting",
            "type": "boolean",
            "description": "Keep supported HTML formatting tags from YouTube captions.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Recommended: Apify Proxy with RESIDENTIAL group and US country. YouTube often blocks datacenter IPs, especially for bulk transcript extraction.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}