FetchFox
Get started

YouTube transcript API with timestamps

Retrieve a YouTube video or Short transcript for search, citations, and your own summarization pipeline. The response includes full text and timestamped segments when the source transcript is available.

Make a request

GET /youtube/transcript accepts query parameters. POST /youtube/transcript accepts the same inputs as JSON. Send your project key in the x-access-key header; keep it on your server.

Credits: 1 credit per successful video transcript.

curl request example
curl
curl --fail-with-body --get 'https://api.fetchfox.net/youtube/transcript' \
  -H 'x-access-key: YOUR_KEY' \
  --data-urlencode 'url=https://www.youtube.com/watch?v=VIDEO_ID'
JavaScript request example
JavaScript
// Run on your server with FETCHFOX_API_KEY set.
const url = new URL('https://api.fetchfox.net/youtube/transcript');
url.searchParams.set('url', 'https://www.youtube.com/watch?v=VIDEO_ID');
const response = await fetch(url, {
  headers: { 'x-access-key': process.env.FETCHFOX_API_KEY },
  signal: AbortSignal.timeout(130000)
});
if (!response.ok) throw new Error('HTTP ' + response.status);
const result = await response.json();
if (!result.success) throw new Error('Request unsuccessful');
console.log(result.data);
Python request example
Python
import json, os
from urllib.parse import urlencode
from urllib.request import Request, urlopen

query = urlencode({"url":"https://www.youtube.com/watch?v=VIDEO_ID"})
request = Request('https://api.fetchfox.net/youtube/transcript?' + query,
    headers={'x-access-key': os.environ['FETCHFOX_API_KEY']})
with urlopen(request, timeout=130) as response:
    result = json.load(response)
if not result.get('success'):
    raise RuntimeError('Request unsuccessful')
print(result['data'])

Replace placeholder source IDs with real public URLs. See limits and retries before automating calls.

Read text and timestamps

Read data.transcript for full text and data.transcriptSegments for individual cues. Each segment has text, start, and duration; time values are seconds. Preserve the source URL when you store the transcript. The short excerpt below was retrieved from https://www.youtube.com/watch?v=jNQXAC9IVRw on October 11, 2026. Full-response word and segment counts are retained; only the first text segment is shown.

Captured transcript excerpt — 11 Oct 2026
{
  "success": true,
  "data": {
    "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "transcript": "All right, so here we are, in front of the elephants",
    "transcriptSegments": [
      {
        "text": "All right, so here we are, in front of the elephants",
        "start": 1.2,
        "duration": 4.118
      }
    ],
    "wordCount": 39,
    "segments": 6
  }
}

Choose a useful output

For retrieval-augmented generation (RAG), keep each chunk’s starting timestamp alongside its text so an answer can link back to the video. For subtitles or spreadsheets, convert segments with the free transcript formatter. FetchFox returns JSON; SRT, VTT and CSV conversion happens in that formatter or in your own code.

Unavailable captions and freshness

Private, removed, restricted, or captionless videos can fail. Do not assume that every public video has a usable transcript. Failed processing consumes no credits, but authenticated attempts count toward request limits.

Free-tier transcript responses can be cached for five minutes. Optional no_cache=true bypasses extraction/result caches. Check HTTP status before reading data; use bounded retries for transient failures and respect Retry-After. This endpoint does not select a language or generate an AI summary.

Frequently asked questions

Can I try the transcript API for free?

20 free credits per calendar month (UTC). No credit card required. A successful YouTube transcript request costs one credit.

Are timestamps included?

Yes. Successful transcript responses include timestamped segments with text, start, and duration in seconds. Preserve those values for citations or subtitle conversion.

Continue building