YouTube Transcript to RAG Dataset avatar

YouTube Transcript to RAG Dataset

Pricing

from $0.80 / 1,000 page processeds

Go to Apify Store
YouTube Transcript to RAG Dataset

YouTube Transcript to RAG Dataset

Extract YouTube transcripts and convert them into RAG-ready chunks with timestamps, metadata, and content hashes.

Pricing

from $0.80 / 1,000 page processeds

Rating

0.0

(0)

Developer

GhostGrid

GhostGrid

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a day ago

Last modified

Share

Extract YouTube video transcripts and convert them into structured, RAG-ready chunks with timestamps, metadata, and content hashes. No API key required.

What does this Actor do?

This Actor takes YouTube video URLs, fetches their transcripts using the YouTube transcript API, and splits them into chunks optimized for Retrieval-Augmented Generation (RAG) pipelines. Each chunk includes precise timestamps, stable IDs, content hashes, and token estimates. It also outputs the raw transcript alongside the chunks.

Why use it?

  • Build knowledge bases from YouTube content without manual transcription
  • Feed video transcripts into vector databases, search systems, or LLM context windows
  • Get stable, deterministic chunk IDs so re-runs produce the same identifiers
  • No YouTube Data API key needed for basic metadata (uses oEmbed)
  • Choose from three chunking strategies to fit your embedding model's context window

Data Fields

Chunk Records

FieldTypeDescription
typestringAlways "chunk"
chunk_idstringStable UUID based on video ID and start time
video_idstringYouTube video ID
video_urlstringFull YouTube URL
video_titlestringVideo title from oEmbed
channel_namestringChannel name from oEmbed
duration_secondsfloatTotal video duration
languagestringTranscript language code
start_timefloatChunk start time in seconds
end_timefloatChunk end time in seconds
textstringChunk text content
source_urlstringYouTube URL with timestamp parameter
content_hashstringSHA-256 hash of chunk text
token_estimateintEstimated token count (chars / 4)
chunk_indexintZero-based index of this chunk
total_chunksintTotal chunks for this video
crawled_atstringISO timestamp of when data was fetched

Transcript Records

FieldTypeDescription
typestringAlways "transcript"
video_idstringYouTube video ID
video_urlstringFull YouTube URL
video_titlestringVideo title
channel_namestringChannel name
duration_secondsfloatVideo duration
languagestringLanguage code
transcript_textstringFull concatenated transcript
segmentsarrayList of {text, start, duration} objects
word_countintTotal word count
token_estimateintEstimated token count
crawled_atstringISO timestamp

How to Use

  1. Go to the Actor page on Apify
  2. Click "Start" or configure input
  3. Add YouTube video URLs to the video_urls array
  4. Choose your chunk strategy (timestamp, fixed_size, or sentence)
  5. Set chunk duration or token limit depending on strategy
  6. Run the Actor
  7. Download results from the Dataset tab as JSON, CSV, or Excel

Pricing

This Actor uses the Apify platform pricing model. Costs are based on:

  • Compute: ~0.5 CU per video processed (simple API calls, no browser)
  • Transcript charges: 1 platform event per video processed via Actor.charge()
  • Dataset storage: Standard Apify dataset storage rates apply

A typical run processing 50 videos costs well under 1 CU total.

Input Parameters

ParameterTypeDefaultRequiredDescription
video_urlsarray-YesYouTube video URLs
languagesarray["en"]NoPreferred transcript languages (ISO codes)
chunk_strategystring"timestamp"NoChunking method: timestamp, fixed_size, sentence
chunk_duration_secondsinteger60NoSeconds per chunk (timestamp strategy)
chunk_token_limitinteger512NoMax tokens per chunk (fixed_size strategy)
include_raw_transcriptbooleantrueNoInclude full raw transcript in output
max_videosinteger50NoMaximum videos to process (1-500)

Output Example

Chunk record:

{
"type": "chunk",
"chunk_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"video_id": "dQw4w9WgXcQ",
"video_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"video_title": "Rick Astley - Never Gonna Give You Up",
"channel_name": "Rick Astley",
"duration_seconds": 214,
"language": "en",
"start_time": 0.0,
"end_time": 60.5,
"text": "This is an example transcript chunk.",
"source_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&t=0",
"content_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"token_estimate": 150,
"chunk_index": 0,
"total_chunks": 4,
"crawled_at": "2026-07-04T12:00:00+00:00"
}

Transcript record:

{
"type": "transcript",
"video_id": "dQw4w9WgXcQ",
"video_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"video_title": "Rick Astley - Never Gonna Give You Up",
"channel_name": "Rick Astley",
"duration_seconds": 214,
"language": "en",
"transcript_text": "This is an example transcript.",
"segments": [{"text": "This is an example transcript.", "start": 0.0, "duration": 2.5}],
"word_count": 1500,
"token_estimate": 375,
"crawled_at": "2026-07-04T12:00:00+00:00"
}

FAQ

Q: Does this require a YouTube API key? A: No. Transcripts are fetched via the youtube-transcript-api library and metadata comes from the oEmbed endpoint, both of which work without API keys.

Q: What languages are supported? A: Any language that has subtitles/captions on the YouTube video. Set the languages parameter with ISO codes in order of preference.

Q: How are chunk IDs generated? A: Chunk IDs are deterministic UUID5 values based on the video ID, start time, and chunk index. Re-running the same video produces the same chunk IDs.

Q: Can I process playlists? A: No. This Actor accepts individual video URLs only. Playlist expansion requires the YouTube Data API which needs an API key.

Q: What happens if a video has no transcript? A: The Actor logs a warning and skips that video. Processing continues with the remaining URLs.

Disclaimer

This Actor relies on the youtube-transcript-api library and YouTube's oEmbed endpoint. YouTube may change access behavior or rate limit requests at any time. This Actor is not affiliated with YouTube or Google. Use responsibly and respect YouTube's Terms of Service.