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

# /youtube/video/subtitles

> Get YouTube video subtitles/captions

**Price:** 1 credit

**⚠️ Common errors:** 412: No captions found for the specified language.



## OpenAPI

````yaml /openapi/social-media.json post /api/youtube/video/subtitles
openapi: 3.1.0
info:
  title: Any Site API
  description: >+
    Any Site API provides programmatic access to data from LinkedIn, Instagram,
    Twitter, and other platforms.


    ## Authentication


    All API endpoints require an `access-token` header with a valid API token.
    Tokens can be created in the [dashboard](https://app.anysite.io/).


    ## Pricing


    Each endpoint has a credit cost listed in its description. Credits are
    deducted from your token balance per request.

  version: 0.0.1
servers: []
security:
  - AccessToken: []
paths:
  /api/youtube/video/subtitles:
    post:
      tags:
        - YouTube
      summary: /youtube/video/subtitles
      description: |-
        Get YouTube video subtitles/captions

        **Price:** 1 credit

        **⚠️ Common errors:** 412: No captions found for the specified language.
      operationId: __api_youtube_video_subtitles_post
      parameters:
        - name: access-token
          in: header
          required: true
          schema:
            anyOf:
              - type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/YoutubeSubtitlesPayload'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/YoutubeSubtitle'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    YoutubeSubtitlesPayload:
      properties:
        timeout:
          type: integer
          maximum: 1500
          minimum: 20
          default: 300
        video:
          type: string
        lang:
          type: string
          default: en
      type: object
      required:
        - video
    YoutubeSubtitle:
      properties:
        '@type':
          type: string
          default: YoutubeSubtitle
        text:
          type: string
        subtitle_count:
          type: integer
        language:
          type: string
        subtitles:
          items:
            $ref: '#/components/schemas/YoutubeSubtitleLine'
          type: array
          default: []
      type: object
      required:
        - text
        - subtitle_count
        - language
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
      type: object
    YoutubeSubtitleLine:
      properties:
        '@type':
          type: string
          default: YoutubeSubtitleLine
        start:
          type: number
        duration:
          type: number
        text:
          type: string
      type: object
      required:
        - start
        - duration
        - text
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
        msg:
          type: string
        type:
          type: string
        input: {}
        ctx:
          type: object
      type: object
      required:
        - loc
        - msg
        - type
  securitySchemes:
    AccessToken:
      type: apiKey
      in: header
      name: access-token
      description: API token from the dashboard

````