{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/transcriptapi-com/json-schema/transcriptapi-com-apitranscript-response-v2-schema.json",
  "title": "APITranscriptResponseV2",
  "description": "Public API response for v2 with a simplified contract.\n\n- When format=json, `transcript` is a list of segments (with or without timestamps).\n- When format=text, `transcript` is a plain string (with or without timestamps).\n- `metadata` is returned only when requested via send_metadata=true.\n- `length_seconds` / `lengthText` give the total video length; they are\n  `null` when the source doesn't expose a fixed length (e.g. live streams).",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/transcriptapi-com-openapi.json#/components/schemas/APITranscriptResponseV2",
  "properties": {
    "video_id": {
      "type": "string",
      "title": "Video Id",
      "description": "YouTube video ID"
    },
    "language": {
      "type": "string",
      "title": "Language",
      "description": "Language of the returned transcript"
    },
    "transcript": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/TranscriptSegment"
          },
          "type": "array"
        },
        {
          "items": {
            "$ref": "#/$defs/TranscriptSegmentTextOnly"
          },
          "type": "array"
        },
        {
          "type": "string"
        }
      ],
      "title": "Transcript"
    },
    "metadata": {
      "anyOf": [
        {
          "$ref": "#/$defs/app__api__v2__youtube__schemas__Metadata"
        },
        {
          "type": "null"
        }
      ]
    },
    "length_seconds": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Length Seconds",
      "description": "Total video length in whole seconds (e.g. 213). null when the source doesn't expose a fixed length — live streams and the rare fallback extraction path."
    },
    "lengthText": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Lengthtext",
      "description": "Total video length as a human-readable string, e.g. '3:33' or '1:02:45'. null in the same cases as length_seconds. Matches the lengthText format used by the search/channel/playlist endpoints."
    }
  },
  "type": "object",
  "required": [
    "video_id",
    "language",
    "transcript"
  ],
  "$defs": {
    "TranscriptSegment": {
      "properties": {
        "text": {
          "type": "string",
          "title": "Text"
        },
        "start": {
          "type": "number",
          "title": "Start"
        },
        "duration": {
          "type": "number",
          "title": "Duration"
        }
      },
      "type": "object",
      "required": [
        "text",
        "start",
        "duration"
      ],
      "title": "TranscriptSegment"
    },
    "TranscriptSegmentTextOnly": {
      "properties": {
        "text": {
          "type": "string",
          "title": "Text"
        }
      },
      "type": "object",
      "required": [
        "text"
      ],
      "title": "TranscriptSegmentTextOnly",
      "description": "Transcript segment without timestamp information."
    },
    "app__api__v2__youtube__schemas__Metadata": {
      "properties": {
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Title"
        },
        "author_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Author Name"
        },
        "author_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Author Url"
        },
        "thumbnail_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Thumbnail Url"
        }
      },
      "type": "object",
      "title": "Metadata"
    }
  }
}