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

# Get a timed transcript



## OpenAPI

````yaml /api-reference/openapi.json get /v1/providers/{provider}/videos/{id}/transcript
openapi: 3.1.0
info:
  title: video2ctx API
  version: 1.0.0
  license:
    name: Apache License 2.0
    identifier: Apache-2.0
  description: >-
    Consumer-facing contract for the hosted video2ctx API. First-party
    application and operator routes are documented separately at
    https://docs.video2ctx.dev/internals/overview.
servers:
  - url: https://api.video2ctx.dev
    description: Hosted video2ctx API
security: []
tags:
  - name: System
    description: Service status and machine-readable documentation.
  - name: Providers
    description: Supported external video providers and their capabilities.
  - name: Discovery
    description: Search, browse, and trend research.
  - name: Videos
    description: Video metadata and evidence.
  - name: Channels
    description: Channel inspection.
  - name: Playlists
    description: Playlist inspection.
  - name: Projects
    description: Private research projects and saved material.
  - name: Research
    description: Imports, jobs, cited answers, comparisons, and reports.
  - name: Exports
    description: Project export creation and download.
  - name: Monitoring
    description: Monitors, notifications, and digest preferences.
  - name: Billing
    description: Checkout, usage, and Stripe webhook handling.
paths:
  /v1/providers/{provider}/videos/{id}/transcript:
    get:
      tags:
        - Videos
      summary: Get a timed transcript
      operationId: getVideoTranscript
      parameters:
        - name: provider
          in: path
          required: true
          description: External video provider.
          schema:
            type: string
            enum:
              - youtube
            example: youtube
        - name: id
          in: path
          required: true
          description: Provider video ID.
          schema:
            type: string
            minLength: 1
            example: dQw4w9WgXcQ
        - name: lang
          in: query
          required: false
          description: >-
            Desired transcript language. The backend selects the default source
            track and translates only when necessary.
          schema:
            type: string
            example: hi
      responses:
        '200':
          description: Normalized timed transcript.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transcript'
          headers:
            X-Credits-Charged:
              $ref: '#/components/headers/CreditsCharged'
            X-Credits-Remaining:
              $ref: '#/components/headers/CreditsRemaining'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientCredits'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationError'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - bearerApiKey: []
        - sessionCookie: []
        - apiKey: []
        - demoUser: []
components:
  schemas:
    Transcript:
      type: object
      required:
        - videoId
        - track
        - segments
        - text
        - meta
      properties:
        videoId:
          type: string
        track:
          $ref: '#/components/schemas/CaptionTrack'
        translatedTo:
          $ref: '#/components/schemas/TranslationLanguage'
        segments:
          type: array
          items:
            $ref: '#/components/schemas/TranscriptSegment'
        granularity:
          type: string
          enum:
            - segment
            - word
        text:
          type: string
        meta:
          $ref: '#/components/schemas/SourceMetadata'
    CaptionTrack:
      type: object
      required:
        - id
        - name
        - languageCode
        - kind
        - isTranslatable
        - isDefault
      properties:
        id:
          type: string
        name:
          type: string
        languageCode:
          type: string
        kind:
          type: string
          enum:
            - manual
            - asr
            - unknown
        provenance:
          type: string
          enum:
            - manual
            - asr
            - unknown
        isTranslatable:
          type: boolean
        isDefault:
          type: boolean
    TranslationLanguage:
      type: object
      required:
        - languageCode
        - name
      properties:
        languageCode:
          type: string
        name:
          type: string
    TranscriptSegment:
      type: object
      required:
        - startMs
        - durationMs
        - endMs
        - text
      properties:
        startMs:
          type: integer
          minimum: 0
        durationMs:
          type: integer
          minimum: 0
        endMs:
          type: integer
          minimum: 0
        text:
          type: string
        words:
          type: array
          items:
            type: object
            additionalProperties: true
    SourceMetadata:
      type: object
      required:
        - provider
        - source
        - fetchedAt
        - partial
        - warnings
      properties:
        provider:
          type: string
          enum:
            - youtube
          description: Platform that owns the source resource.
        source:
          type: string
          example: allthingsyoutube
          description: >-
            Extractor or upstream implementation that produced the normalized
            response.
        fetchedAt:
          type: string
          format: date-time
        partial:
          type: boolean
        warnings:
          type: array
          items:
            type: string
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: QUERY_REQUIRED
            message:
              type: string
            details: {}
            requestId:
              type: string
  headers:
    CreditsCharged:
      description: Credits settled for this operation.
      schema:
        type: integer
        minimum: 0
    CreditsRemaining:
      description: Current balance in the owning user account after the request is metered.
      schema:
        type: integer
  responses:
    Unauthorized:
      description: Authentication is required.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InsufficientCredits:
      description: >-
        The user account does not have enough credits. Error code:
        INSUFFICIENT_CREDITS.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Credits-Charged:
          $ref: '#/components/headers/CreditsCharged'
        X-Credits-Remaining:
          $ref: '#/components/headers/CreditsRemaining'
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationError:
      description: The request failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: An unexpected server error occurred.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerApiKey:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: >-
        Permanent personal API key created in the dashboard. Example: curl -H
        "Authorization: Bearer aty_…" https://your-host/v1/projects
    sessionCookie:
      type: apiKey
      in: cookie
      name: better-auth.session_token
      description: >-
        Better Auth session cookie. A production deployment may use the
        secure-prefixed cookie name; same-origin browser requests send it
        automatically.
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Legacy-compatible header for a permanent personal API key. Prefer
        Authorization: Bearer aty_….
    demoUser:
      type: apiKey
      in: header
      name: X-Demo-User
      description: >-
        Local development only. Any stable value selects an isolated demo
        account. Rejected in production.

````