YouTube

YouTube Audio Transcript API

Speech-to-text for YouTube audio.

Transcribes YouTube audio with AI speech-to-text when the video has no published captions (or when you want speech-to-text regardless). Audio with no speech answers 422 NO_SPEECH at 0 credits, remembered for 24 hours. Separate from /transcript — that endpoint only returns YouTube's caption tracks. Pricing is duration-based and honest: creditsUsed = ceil(durationSeconds / 60) × 2 (badge: 2 credits/min of audio). Success includes estimatedCredits (same number) so maxCredits is usable without doing the arithmetic. Pass maxCredits to refuse expensive jobs before any STT runs (400 cost_exceeds_max, 0 credits). Measured end-to-end: ~20 min of audio ≈ 12s, ~82 min ≈ 49s. Audio is re-encoded to 16 kHz mono 32 kbps before upload so podcast-length jobs stay under the ~25 MB ceiling. Sync path is capped at 90 minutes so the request finishes inside the 110s request deadline; longer videos return 400 duration_too_long with estimatedCredits before any STT spend. An audio download miss is 502 audio_extract_failed with a split reason: blocked_rate (403/429, retryable, retryAfterSeconds=300), extract_timeout (retryable, 60s), extractor_unavailable (signed-URL / extractor miss, retryable, 120s), no_audio_format / restricted / live_unavailable (this video, retryable false). estimatedCreditsIfRetried is only present when retryable is true. A permanent miss with no captions sets obtainable:false and says no transcript is obtainable — it does not leave suggestedEndpoint:null as an open loop. Download budget is 20s (a doomed fetch used to sit for ~67s). blocked_rate opens a service-wide circuit (cacheScope=service, blockedRateConsecutive) so further downloads wait out the cooldown instead of deepening a YouTube block. When a published caption track exists, suggestedEndpoint=/v1/youtube/transcript — suggest, never substitute STT with captions. Response always includes source: "asr", asrProvider, languageIsDetected, numeric segments[{text,startMs,endMs}], text, durationSeconds, creditsUsed, estimatedCredits. Cache hits still bill — the cache is our margin.

Docs: https://captapi.com/apis/youtube-audio-transcript

get/v1/youtube/audio-transcript

Request

  • Base URL: https://api.captapi.com
  • URL: https://api.captapi.com/v1/youtube/audio-transcript
  • Auth: one of:
    • HTTP bearer
    • API key in header X-API-Key

Query parameters

urlstring required

Public YouTube video URL, e.g. https://youtube.com/watch?v=ID. Not a TikTok/Instagram/Facebook URL. The URL platform must match this endpoint's platform. Do not pass cross-platform URLs, e.g. YouTube to TikTok, Instagram to Facebook, LinkedIn to X/Twitter, or Pinterest to Rumble.

languagestring

Preferred caption language as an ISO code, e.g. "en". Defaults to auto-detect.

maxCreditsinteger

Refuse before STT when estimatedCredits would exceed this (400 cost_exceeds_max, 0 credits). The estimate is on every success and, when the extract miss is retryable, as estimatedCreditsIfRetried.

cacheboolean

Set true to serve from the 24h response cache (0 credits on hit). Default false — always fetch fresh.

Response

Success. The data object for this endpoint.

successunknown required

Changes

No recorded changes to this operation across all 3 revisions of this API.