# YouTube Transcript to RAG JSON Extractor

**Use case:** 

Extract clean, timestamped YouTube subtitles split into semantic time windows with citation links, formatted directly for LangChain, LlamaIndex, and RAG vector databases.

## Input

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "languages": [
    "es",
    "en"
  ],
  "targetChunkSeconds": 45,
  "chunkOverlapSeconds": 10,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

## Output

```json
{
  "videoTitle": {
    "label": "Video title"
  },
  "videoId": {
    "label": "Video id"
  },
  "status": {
    "label": "Status"
  },
  "language": {
    "label": "Language"
  },
  "stats": {
    "label": "Stats"
  }
}
```

## How it works

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

The YouTube Transcript to RAG JSON Extractor Actor is ready to run with the inputs already set for "YouTube Transcript to RAG JSON Extractor". [Sign up or log in](https://console.apify.com/create-task-from-example/pSKW09wDDYaxlgPGa) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "YouTube Transcript to RAG JSON Extractor" task

The YouTube Transcript to RAG JSON Extractor Actor will start running based on the input automatically. You can also change all the input fields, like youtube video urls or ids, preferred languages (iso codes), and more, to match your specific use case.

### 3. Receive the "YouTube Transcript to RAG JSON Extractor" 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 video title, video id, status, 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 Transcript to RAG JSON Extractor" task via API](https://apify.com/almarjim1417/youtube-transcript-to-rag-json-extractor.md).

## FAQ

### What data fields does this task return?

The YouTube Transcript to RAG JSON Extractor returns videoId, status, language, and stats, including total duration, total words, and total chunks.

### How are subtitles grouped in the output?

The task extracts subtitles and groups them into customizable time windows defined by the targetChunkSeconds parameter.

### What is included in each semantic chunk?

Each semantic chunk contains the start and end time, duration, citation URL, and the corresponding text for easy referencing.

### Can I run this task automatically?

This task can be scheduled to run automatically in the Apify Console.

### Does this task require specific languages for transcripts?

The task can fetch subtitles in specified languages, with the option to set a priority order and an automatic fallback.

### What is the purpose of the citation URLs in the output?

The citation URLs allow users to verify the source of each chunk by linking directly to the timestamp in the YouTube video.

## About this Actor

This example demonstrates how to use [YouTube Transcript to RAG JSON Extractor](https://apify.com/almarjim1417/youtube-transcript-to-rag-json-extractor.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/almarjim1417/youtube-transcript-to-rag-json-extractor.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/almarjim1417/youtube-transcript-to-rag-json-extractor.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`).
