# Youtube

The **YouTube Node** allows you to extract the transcript (captions) from a YouTube video, which is useful for summarization, analysis, or further AI processing.

***

### Available Actions

#### Extract YouTube Transcript

This action retrieves the transcript (captions) from a specified YouTube video in your chosen language. It returns both a structured array of transcript segments and a plain text version.

#### Input Parameters

* **video\_url\_or\_id** (required):\
  The YouTube video URL (e.g., `https://www.youtube.com/watch?v=dQw4w9WgXcQ`) or just the video ID (e.g., `dQw4w9WgXcQ`).
* **language** (required):\
  The language code for the transcript you want to extract (ISO 639-1 format, e.g., `en` for English, `es` for Spanish, etc.).

Supported languages include: en, es, de, fr, it, pt, ru, ja, zh, ar, hi, bn, ur, ko, nl, sv, no, da, fi, pl, el, tr, cs, hu, th, vi.

#### Output

* **status**: Indicates if the extraction was successful ("success") or failed ("error").
* **message**: A human-readable message about the result.
* **transcript**: An array of transcript segments (each with text, start time, and duration).
* **transcript\_text**: The full transcript as a single plain text string.
* **video\_id**: The YouTube video ID.
* **video\_url**: The YouTube video URL.

***

### Example Usage

Suppose you want to extract the English transcript from a YouTube video:

* **video\_url\_or\_id**: `https://www.youtube.com/watch?v=dQw4w9WgXcQ`
* **language**: `en`

The node will return:

* The transcript as an array (with timing and text for each segment).
* The full transcript as plain text.
* Status and message fields for error handling.

***

### How to Connect and Use in a Workflow

1. **Add the YouTube node to your workflow.**
2. **Set the required inputs** (video URL/ID and language).
3. **Connect the output** to downstream nodes (e.g., an LLM node for summarization, or an Output node to display the transcript).

**Example node reference in a prompt:**\
If your YouTube node is `action-0`, you can reference the plain text transcript as `{action-0.transcript_text}` in downstream nodes to get the full text from the video.

***

### Summary Table

| Field              | Description                         |
| ------------------ | ----------------------------------- |
| video\_url\_or\_id | YouTube video URL or ID (required)  |
| language           | Transcript language code (required) |
| transcript         | Array of transcript segments        |
| transcript\_text   | Full transcript as plain text       |
| status             | "success" or "error"                |
| message            | Human-readable result message       |
| video\_id          | The YouTube video ID                |
| video\_url         | The YouTube video URL               |

***

**Tip:**\
If you want to process or summarize the transcript, connect the YouTube node’s output to an LLM node and reference it in your prompt.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.stackai.com/workflow-builder/apps/youtube.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
