> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrapeunblocker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a YouTube video transcript

> Returns a YouTube video's captions as JSON: timestamped `segments` (`start`, `dur`, `text`) and a joined `text`, plus `availableLanguages`, the picked `language`, `isAutoGenerated`, and the video's `title`, `author` and `lengthSeconds`. Pass a video id or any YouTube video URL; choose a caption language with `lang`. Ideal for LLM/RAG pipelines, subtitles and content analysis.



## OpenAPI

````yaml /api-reference/openapi.json post /content/youtube-transcript
openapi: 3.1.0
info:
  title: ScrapeUnblocker API
  description: >-
    Public API for the ScrapeUnblocker proxy/anti-bot service. Authenticate
    every request with the `x-scrapeunblocker-key` header. Three endpoints are
    documented here: page-source extraction, Google SERP scraping, and image
    fetch. All other paths exist for internal operations and are intentionally
    hidden from this spec.
  version: 3.0.0
servers:
  - url: https://api.scrapeunblocker.com
    description: Production
security: []
paths:
  /content/youtube-transcript:
    post:
      tags:
        - Plugins
      summary: Get a YouTube video transcript
      description: >-
        Returns a YouTube video's captions as JSON: timestamped `segments`
        (`start`, `dur`, `text`) and a joined `text`, plus `availableLanguages`,
        the picked `language`, `isAutoGenerated`, and the video's `title`,
        `author` and `lengthSeconds`. Pass a video id or any YouTube video URL;
        choose a caption language with `lang`. Ideal for LLM/RAG pipelines,
        subtitles and content analysis.
      operationId: youtube_transcript_content_youtube_transcript_post
      parameters:
        - name: video
          in: query
          required: true
          schema:
            type: string
            description: Video id (dQw4w9WgXcQ) or any YouTube video URL.
            title: Video
          description: Video id (dQw4w9WgXcQ) or any YouTube video URL.
        - name: lang
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Preferred caption language code, e.g. 'en'. Omit for the
              default/first track. A prefix like 'en' matches 'en-US'.
            title: Lang
          description: >-
            Preferred caption language code, e.g. 'en'. Omit for the
            default/first track. A prefix like 'en' matches 'en-US'.
        - name: format
          in: query
          required: false
          schema:
            type: string
            description: >-
              Output shape: text, segments. 'segments' returns timestamps;
              'text' returns only the joined plaintext.
            default: segments
            title: Format
          description: >-
            Output shape: text, segments. 'segments' returns timestamps; 'text'
            returns only the joined plaintext.
        - name: proxy_country
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Exit-IP country (ISO-2) for the watch page. Default US.
            title: Proxy Country
          description: Exit-IP country (ISO-2) for the watch page. Default US.
      responses:
        '200':
          description: JSON with `segments`, `text` and video metadata.
          content:
            application/json:
              schema: {}
        '400':
          description: Invalid parameters.
        '404':
          description: This video has no captions.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '502':
          description: Blocked by YouTube, or captions could not be fetched.
        '504':
          description: Fetch timed out.
      security:
        - ScrapeUnblockerKey: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ScrapeUnblockerKey:
      type: apiKey
      in: header
      name: x-scrapeunblocker-key
      description: Your ScrapeUnblocker API key. Apply on every request.

````