YouTube Transcript API Transcripts API

Captions of a single video.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 1

GET /youtube/transcript Get Transcripts #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/youtubetranscriptapi-com:youtubetranscriptapi-com-transcripts-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

youtubetranscriptapi-com-transcripts-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: YouTubeTranscriptAPI REST Transcripts API
  version: 2.0.0
  summary: Fetch clean YouTube transcripts without 429 errors. Search, browse channels, and extract playlists through one REST API.
  description: 'Fetch YouTube transcripts, search YouTube, and list channel and playlist videos as JSON.


    **Authentication.** Send an API key on every request: `Authorization: Bearer tk_live_…`. Create keys at https://youtubetranscriptapi.com/dashboard/keys.


    **Credits.** Each operation''s price is in its description and in `x-credit-cost`. Only successful (200) responses are charged; errors and rate-limited requests never are. Free operations still need a balance of at least 1 credit. Without enough credits you get 402 with a link to billing. Plans: https://youtubetranscriptapi.com/pricing.


    **Errors.** Error bodies are `{ "detail": "…", "code": "…" }`. On 402 (`insufficient_credits`) `detail` is an object with the shortfall, a billing link and the plans; accounts without a plan also get `checkout_url`, a checkout that opens without signing in.


    **Balance.** Successful responses carry X-Credits-Charged and X-Credits-Remaining. GET /account/whoami returns the plan and balance for free.


    **Rate limits.** 300 requests per minute per API key by default, on a sliding one-minute window. Responses carry X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset; 429, 408 and 503 add Retry-After.


    **Caching.** X-Cache-Status is HIT when a stored result was served and MISS otherwise. Stored responses cost the same as fresh ones.'
  termsOfService: https://youtubetranscriptapi.com/legal/terms
  contact:
    name: YouTubeTranscriptAPI
    url: https://youtubetranscriptapi.com/contact
    email: hello@youtubetranscriptapi.com
servers:
- url: https://youtubetranscriptapi.com/api/v2
security:
- bearerAuth: []
tags:
- name: Transcripts
  description: Captions of a single video.
  externalDocs:
    url: https://youtubetranscriptapi.com/docs/api/transcript
paths:
  /youtube/transcript:
    get:
      operationId: getTranscript
      summary: Get Transcripts
      description: 'Extract YouTube transcripts with or without timestamps. Returns JSON segments or one text string, optionally with video metadata. Stored transcripts return X-Cache-Status: HIT. Costs 1 credit per successful (200) response; errors are never charged.'
      tags:
      - Transcripts
      externalDocs:
        url: https://youtubetranscriptapi.com/docs/api/transcript
      x-credit-cost: 1
      parameters:
      - name: video_url
        in: query
        required: true
        description: An 11-character video ID, or a youtube.com, m.youtube.com, music.youtube.com or youtu.be URL (watch, shorts, embed and live links).
        schema:
          type: string
          minLength: 1
        example: dQw4w9WgXcQ
      - name: language
        in: query
        required: false
        description: Preferred caption language code, such as en, es or de. Longer than 12 characters is truncated. If the video has no track in this language another one may be returned; the response's language field says which.
        schema:
          type: string
          default: en
      - name: format
        in: query
        required: false
        description: json returns an array of segments; text returns the transcript as one string.
        schema:
          type: string
          enum:
          - json
          - text
          default: json
      - name: include_timestamp
        in: query
        required: false
        description: Include start and duration (seconds) on each segment; with format=text, prefix each line with [start s]. 1, true, yes and on mean true; any other value means false.
        schema:
          type: boolean
          default: true
      - name: send_metadata
        in: query
        required: false
        description: Add a metadata block with the video title, author and thumbnail. 1, true, yes and on mean true; any other value means false.
        schema:
          type: boolean
          default: false
      responses:
        '200':
          description: The transcript.
          headers:
            X-Cache-Status:
              $ref: '#/components/headers/XCacheStatus'
            X-Credits-Charged:
              $ref: '#/components/headers/XCreditsCharged'
            X-Credits-Remaining:
              $ref: '#/components/headers/XCreditsRemaining'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transcript'
              examples:
                json_with_timestamps_and_metadata:
                  summary: format=json&include_timestamp=true&send_metadata=true
                  value:
                    video_id: dQw4w9WgXcQ
                    language: en
                    transcript:
                    - text: First caption line
                      start: 0
                      duration: 4.12
                    - text: Second caption line
                      start: 4.12
                      duration: 3.85
                    metadata:
                      title: Rick Astley - Never Gonna Give You Up
                      author_name: RickAstleyVEVO
                      author_url: https://www.youtube.com/@RickAstley
                      thumbnail_url: https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg
                json_without_timestamps:
                  summary: format=json&include_timestamp=false
                  value:
                    video_id: dQw4w9WgXcQ
                    language: en
                    transcript:
                    - text: First caption line
                    - text: Second caption line
                text:
                  summary: format=text&include_timestamp=true
                  value:
                    video_id: dQw4w9WgXcQ
                    language: en
                    transcript: '[0.0s] First caption line

                      [4.12s] Second caption line'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: The video has no captions, is private, or has been removed (`transcript_not_found`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                transcript_not_found:
                  value:
                    detail: 'Transcript unavailable: the video has no captions, is private, or has been removed'
                    code: transcript_not_found
        '408':
          $ref: '#/components/responses/Timeout'
        '422':
          description: A parameter is missing or invalid (`validation_error`). Not charged.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing_video_url:
                  value:
                    detail: 'Missing required parameter: video_url'
                    code: validation_error
                invalid_video:
                  value:
                    detail: video_url did not resolve to a valid YouTube video ID
                    code: validation_error
                invalid_format:
                  value:
                    detail: format must be either json or text
                    code: validation_error
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  schemas:
    TranscriptMetadata:
      type: object
      required:
      - title
      - author_name
      - author_url
      - thumbnail_url
      properties:
        title:
          type:
          - string
          - 'null'
          description: Video title.
        author_name:
          type:
          - string
          - 'null'
          description: Channel name.
        author_url:
          type:
          - string
          - 'null'
          description: Channel URL.
        thumbnail_url:
          type:
          - string
          - 'null'
          description: Video thumbnail URL.
    Error:
      type: object
      required:
      - detail
      - code
      properties:
        detail:
          type: string
          description: Human-readable message.
        code:
          type: string
          description: 'Machine-readable code: validation_error, continuation_unavailable, missing_auth, invalid_auth, account_frozen, transcript_not_found, channel_not_found, playlist_not_found, upstream_timeout, rate_limited, upstream_error, config_missing or internal.'
    PlanOffer:
      type: object
      required:
      - price_usd
      - interval
      - credits_per_interval
      - topup_usd_per_1k
      - url
      properties:
        price_usd:
          type: number
          description: Price per interval in US dollars.
        interval:
          type: string
          enum:
          - month
          - year
        credits_per_interval:
          type: integer
          description: 'Credits granted each interval: monthly each month, annual up front each year.'
        topup_usd_per_1k:
          type: number
          description: Top-up price per 1,000 credits on this plan.
        refund:
          type: string
          description: Refund terms, where the plan has them.
        url:
          type: string
          format: uri
          description: Billing page with this plan selected.
    TranscriptSegment:
      type: object
      required:
      - text
      description: One caption line. start and duration are present when include_timestamp is true.
      properties:
        text:
          type: string
        start:
          type: number
          description: Start time in seconds.
        duration:
          type: number
          description: Duration in seconds.
    Transcript:
      type: object
      required:
      - video_id
      - language
      - transcript
      properties:
        video_id:
          type: string
          description: 11-character YouTube video ID.
        language:
          type:
          - string
          - 'null'
          description: Language code of the returned caption track. Can differ from the requested language.
        transcript:
          oneOf:
          - type: array
            items:
              $ref: '#/components/schemas/TranscriptSegment'
            description: format=json
          - type: string
            description: 'format=text: one line per segment, each prefixed with [start s] when include_timestamp is true.'
        metadata:
          $ref: '#/components/schemas/TranscriptMetadata'
          description: Present when send_metadata is true.
    PaymentRequiredError:
      type: object
      required:
      - detail
      - code
      properties:
        detail:
          type: object
          required:
          - reason
          - required
          - available
          - message
          - action_label
          - action_url
          - plans
          properties:
            reason:
              type: string
              enum:
              - insufficient_credits
            required:
              type: integer
              description: 'Credits the call needs: its cost, or 1 for a free operation.'
            available:
              type: integer
              description: Spendable credits on the account.
            message:
              type: string
              description: The shortfall in numbers ("This call needs 20 credits; you have 5."), or that the credits have run out, then whether you need a plan, a top-up or an updated payment method.
            action_label:
              type: string
              description: Label for the suggested next step.
            action_url:
              type: string
              format: uri
              description: Billing page for the suggested next step.
            alt_action_label:
              type: string
              description: 'Monthly plans only: a second option, the upgrade to Annual.'
            alt_action_url:
              type: string
              format: uri
              description: Where alt_action_label leads.
            checkout_url:
              type: string
              format: uri
              description: 'Accounts without a plan only: a checkout for checkout_plan that opens without signing in, so it works from any browser, including the one inside an AI app. Valid for 7 days and only for this account. Absent for active or paused plans, which use action_url.'
            checkout_plan:
              type: string
              enum:
              - monthly
              - annual
              description: The plan checkout_url buys. Present whenever checkout_url is.
            plans:
              type: object
              description: Current price and credits of each plan.
              required:
              - monthly
              - annual
              properties:
                monthly:
                  $ref: '#/components/schemas/PlanOffer'
                annual:
                  $ref: '#/components/schemas/PlanOffer'
        code:
          type: string
          enum:
          - insufficient_credits
  responses:
    PaymentRequired:
      description: Not enough credits for this call. detail says why and links to billing. Not charged.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/XRateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/XRateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/XRateLimitReset'
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PaymentRequiredError'
          examples:
            insufficient_credits:
              value:
                detail:
                  message: This call needs 20 credits; you have 5. Choose a plan to keep going.
                  reason: insufficient_credits
                  required: 20
                  available: 5
                  action_label: Choose a plan
                  action_url: https://youtubetranscriptapi.com/dashboard/billing?from=402&plan=annual
                  plans:
                    monthly:
                      price_usd: 3
                      interval: month
                      credits_per_interval: 1000
                      topup_usd_per_1k: 2.5
                      url: https://youtubetranscriptapi.com/dashboard/billing?plan=monthly
                    annual:
                      price_usd: 30
                      interval: year
                      credits_per_interval: 15000
                      topup_usd_per_1k: 2
                      refund: Refundable within 14 days if under 1,000 credits are used
                      url: https://youtubetranscriptapi.com/dashboard/billing?plan=annual
                code: insufficient_credits
            free_credits_used:
              summary: Free account, with the no-login checkout link
              value:
                detail:
                  message: 'Your 100 free credits are used up. Annual: 15,000 credits for $30 ($2.5/mo). Monthly: 1,000 credits/mo for $3.'
                  reason: insufficient_credits
                  required: 1
                  available: 0
                  action_label: Choose a plan
                  action_url: https://youtubetranscriptapi.com/dashboard/billing?from=402&plan=annual
                  checkout_url: https://youtubetranscriptapi.com/u/eyJ1c2VyX2lkIjoi4oCmIn0.c2lnbmF0dXJl
                  checkout_plan: annual
                  plans:
                    monthly:
                      price_usd: 3
                      interval: month
                      credits_per_interval: 1000
                      topup_usd_per_1k: 2.5
                      url: https://youtubetranscriptapi.com/dashboard/billing?plan=monthly
                    annual:
                      price_usd: 30
                      interval: year
                      credits_per_interval: 15000
                      topup_usd_per_1k: 2
                      refund: Refundable within 14 days if under 1,000 credits are used
                      url: https://youtubetranscriptapi.com/dashboard/billing?plan=annual
                code: insufficient_credits
    Unauthorized:
      description: The bearer token is missing (`missing_auth`) or invalid or revoked (`invalid_auth`).
      headers:
        WWW-Authenticate:
          $ref: '#/components/headers/WWWAuthenticate'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missing_auth:
              value:
                detail: Missing bearer token
                code: missing_auth
            invalid_auth:
              value:
                detail: Invalid or revoked API key
                code: invalid_auth
    Timeout:
      description: The upstream fetch timed out (`upstream_timeout`). Safe to retry after Retry-After seconds. Not charged.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/XRateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/XRateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/XRateLimitReset'
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            upstream_timeout:
              value:
                detail: Upstream timed out; retry in a few seconds
                code: upstream_timeout
    Forbidden:
      description: API access for this account is paused while a payment dispute is reviewed (`account_frozen`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            account_frozen:
              value:
                detail: API access for this account is paused while a payment dispute is reviewed. Contact support.
                code: account_frozen
    Unavailable:
      description: 'Temporary failure: `upstream_error`, `internal` (the account check failed) or `config_missing`. Safe to retry after Retry-After seconds. Not charged.'
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            upstream_error:
              value:
                detail: Upstream unavailable; retry in a few seconds
                code: upstream_error
            internal:
              value:
                detail: Could not check your account right now; retry in a few seconds
                code: internal
    RateLimited:
      description: Rate limit exceeded (`rate_limited`). Wait Retry-After seconds, until the current one-minute window ends. Not charged.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/XRateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/XRateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/XRateLimitReset'
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            rate_limited:
              value:
                detail: Rate limit exceeded
                code: rate_limited
  headers:
    XCreditsCharged:
      description: Credits this call cost. 0 for free operations. Sent on 200 responses only; errors are never charged.
      schema:
        type: integer
        minimum: 0
    XCacheStatus:
      description: HIT when a stored result was served (transcripts, resolved channel IDs), otherwise MISS. Same price either way.
      schema:
        type: string
        enum:
        - HIT
        - MISS
    RetryAfter:
      description: 'Seconds to wait before retrying: until the window ends on 429, 3 on 408 and 503.'
      schema:
        type: integer
        minimum: 1
    XCreditsRemaining:
      description: Spendable credits left after this call. Sent on 200 responses; left out rather than estimated when the balance can't be read.
      schema:
        type: integer
        minimum: 0
    XRateLimitRemaining:
      description: Requests left in the current sliding one-minute window.
      schema:
        type: integer
        minimum: 0
    XRequestId:
      description: Request ID for support. Echoes the X-Request-Id you sent, otherwise generated.
      schema:
        type: string
    XRateLimitReset:
      description: Unix time, in seconds, when the current minute window ends.
      schema:
        type: integer
    WWWAuthenticate:
      description: Always Bearer.
      schema:
        type: string
        enum:
        - Bearer
    XRateLimitLimit:
      description: Requests allowed per minute for this API key.
      schema:
        type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key (tk_live_…)
      description: 'API key from the dashboard, sent as `Authorization: Bearer tk_live_…`.'
externalDocs:
  description: API reference
  url: https://youtubetranscriptapi.com/docs/api