# YouTube transcripts for RAG and LLM pipelines

**Use case:** 

Turn a YouTube channel into a text corpus for retrieval-augmented generation (RAG), embeddings or LLM fine-tuning. Each row holds the full transcript plus timed segments (start time, duration, text), so every chunk can cite the exact moment in the video. Output as JSON, CSV or Excel. Example input: the Lex Fridman Podcast, 20 latest videos.

## Input

```json
{
  "inputs": [
    "https://www.youtube.com/@lexfridman"
  ],
  "maxResultsPerSource": 20,
  "channelTabs": [
    "videos"
  ],
  "publishedWithinDays": 0,
  "durationMinSeconds": 0,
  "durationMaxSeconds": 0,
  "includeLikes": false,
  "includeTranscript": true,
  "transcriptLanguages": [
    "en"
  ],
  "strictTranscriptLanguage": false,
  "includeTranscriptSegments": true,
  "includeComments": false,
  "maxCommentsPerVideo": 20,
  "maxRepliesPerComment": 0,
  "maxAgeHours": 24,
  "resetFingerprintBaseline": false,
  "concurrency": 8,
  "language": "en",
  "region": "US",
  "maxItems": 0,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "site": "youtube"
}
```

## Output

```json
{
  "title": {
    "label": "Title"
  },
  "video_type": {
    "label": "Video type"
  },
  "views": {
    "label": "Views (exact)"
  },
  "likes": {
    "label": "Likes"
  },
  "published_at": {
    "label": "Published (RFC-3339)"
  },
  "duration_s": {
    "label": "Duration (s)"
  },
  "transcript_status": {
    "label": "Transcript status"
  },
  "category": {
    "label": "Category"
  },
  "video_id": {
    "label": "Video ID"
  },
  "channel": {
    "label": "Channel"
  },
  "subscriber_count": {
    "label": "Subscribers (approx.)"
  },
  "keywords": {
    "label": "Keywords"
  },
  "thumbnail": {
    "label": "Thumbnail",
    "format": "image"
  },
  "description": {
    "label": "Description"
  },
  "transcript": {
    "label": "Transcript"
  },
  "transcript_language": {
    "label": "Transcript language"
  },
  "transcript_language_matched": {
    "label": "Transcript language matched",
    "format": "boolean"
  },
  "transcript_is_generated": {
    "label": "Auto-generated"
  },
  "transcript_cue_count": {
    "label": "Transcript cues"
  },
  "transcript_segments": {
    "label": "Transcript segments"
  },
  "channel_id": {
    "label": "Channel ID"
  },
  "channel_description": {
    "label": "Channel description"
  },
  "is_live": {
    "label": "Live"
  },
  "is_private": {
    "label": "Private"
  },
  "is_crawlable": {
    "label": "Crawlable"
  },
  "_source_url": {
    "label": "Source URL",
    "format": "link"
  },
  "_cached": {
    "label": "From cache"
  },
  "_cached_at": {
    "label": "Cached at"
  },
  "_input": {
    "label": "Input"
  },
  "_site": {
    "label": "Site"
  },
  "_error_kind": {
    "label": "Error kind"
  },
  "_error": {
    "label": "Error"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The YouTube Transcript API: Any Video, Channel or Playlist Actor is ready to run with the inputs already set for "YouTube transcripts for RAG and LLM pipelines". [Sign up or log in](https://console.apify.com/create-task-from-example/jeU6xbRJ42l0fh4U0) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "YouTube transcripts for RAG and LLM pipelines" task

The YouTube Transcript API: Any Video, Channel or Playlist Actor will start running based on the input automatically. You can also change all the input fields, like channels, playlists, videos or search terms, max videos per channel, playlist or search, and more, to match your specific use case.

### 3. Receive the "YouTube transcripts for RAG and LLM pipelines" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as title, video type, views (exact), and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "YouTube transcripts for RAG and LLM pipelines" task via API](https://apify.com/aquixlabs/youtube-channel-scraper.md).

## About this Actor

This example demonstrates how to use [YouTube Transcript API: Any Video, Channel or Playlist](https://apify.com/aquixlabs/youtube-channel-scraper.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/aquixlabs/youtube-channel-scraper.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/aquixlabs/youtube-channel-scraper.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
