{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript & AI Summary Extractor",
    "description": "Extract YouTube transcripts (timestamped, multi-language, SRT/VTT/CSV/TXT export), expand channels/playlists, and generate AI summaries with topic-based chapters. Proxy-aware with auto anti-block retries.",
    "version": "0.3",
    "x-build-id": "qg3cOblSl1mGweHQA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kind_cordial~youtube-transcript-ai-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kind_cordial-youtube-transcript-ai-extractor",
        "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/kind_cordial~youtube-transcript-ai-extractor/runs": {
      "post": {
        "operationId": "runs-sync-kind_cordial-youtube-transcript-ai-extractor",
        "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/kind_cordial~youtube-transcript-ai-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-kind_cordial-youtube-transcript-ai-extractor",
        "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",
            "type": "array",
            "description": "YouTube watch URLs, Shorts URLs, video IDs, OR channel/playlist URLs (channel pages, @handles, or ?list= playlist links). Channels/playlists are expanded to their videos automatically (capped by maxVideos).",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "Fetch mode",
            "enum": [
              "direct"
            ],
            "type": "string",
            "description": "Direct mode only. Browser/auto modes were removed in 0.3.",
            "default": "direct"
          },
          "maxVideos": {
            "title": "Max videos",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum number of videos to process in one run (across all URLs and expanded channels/playlists).",
            "default": 1
          },
          "preferredLanguage": {
            "title": "Preferred transcript language",
            "type": "string",
            "description": "Preferred transcript language code (e.g. 'en', 'es', 'hi'). Auto-generated captions are used as fallback when this language is unavailable. Defaults to 'en' when omitted.",
            "default": "en"
          },
          "languages": {
            "title": "Preferred transcript languages (legacy)",
            "type": "array",
            "description": "DEPRECATED in favor of preferredLanguage, kept for backward compatibility. Used only when preferredLanguage is omitted. Ordered list of language codes.",
            "items": {
              "type": "string"
            },
            "default": [
              "en",
              "en-US",
              "en-GB",
              "a.en"
            ]
          },
          "languagesExtended": {
            "title": "Extended fallback languages",
            "type": "array",
            "description": "Additional fallback language codes used when preferred language is unavailable. Defaults to the preferred language when omitted.",
            "items": {
              "type": "string"
            }
          },
          "includeRawTranscript": {
            "title": "Include raw transcript",
            "type": "boolean",
            "description": "Return timestamped segments and full text in output. Default true.",
            "default": true
          },
          "includeSummary": {
            "title": "Include AI summary",
            "type": "boolean",
            "description": "Generate an optional AI summary when a transcript is available. Requires an OpenAI-compatible API key (OPENAI_API_KEY + OPENAI_BASE_URL).",
            "default": false
          },
          "summaryModel": {
            "title": "Summary model",
            "type": "string",
            "description": "Model name used for optional summarization and chapter segmentation.",
            "default": "gpt-4o-mini"
          },
          "summaryLength": {
            "title": "Summary length",
            "enum": [
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "AI summary length. short = 3-5 bullets, medium = 5-8, long = 8-12.",
            "default": "medium"
          },
          "summaryLanguage": {
            "title": "Summary language",
            "type": "string",
            "description": "Language for the AI summary, independent of the transcript language (e.g. 'es', 'fr'). Leave empty for the model default (usually matches transcript)."
          },
          "enableChapters": {
            "title": "Enable chapter segmentation",
            "type": "boolean",
            "description": "Use AI to group the transcript into topic-based chapters with title + start/end times. Requires includeSummary + an OpenAI-compatible key.",
            "default": false
          },
          "outputFormat": {
            "title": "Export format",
            "enum": [
              "json",
              "srt",
              "vtt",
              "csv",
              "txt"
            ],
            "type": "string",
            "description": "Output format. json = full structured dataset row (default). srt/vtt/csv/txt = also attach a formatted transcript string to the row (srt, vtt, csv, or txt text file body).",
            "default": "json"
          },
          "maxRetries": {
            "title": "Max retries (anti-block)",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Number of exponential-backoff retries when YouTube returns a block/IP-ban (429-style) error. Each retry rotates the proxy when one is configured.",
            "default": 3
          },
          "maxTranscriptLength": {
            "title": "Max transcript length",
            "minimum": 1000,
            "maximum": 50000,
            "type": "integer",
            "description": "Truncate transcript text/segments after this many characters.",
            "default": 15000
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy for transcript fetching and channel/playlist expansion. Defaults to Apify RESIDENTIAL proxies (YouTube blocks datacenter IPs, so residential is required for reliable bulk/channel runs). Set useApifyProxy:true + apifyProxyGroups:[\"RESIDENTIAL\"], or supply your own proxyUrl. Leave empty to use the residential default.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}