# YouTube Transcript & Metadata (`avanturismo/youtube-transcript-metadata`) Actor

Fetch a YouTube video's timed transcript + metadata as clean JSON.

- **URL**: https://apify.com/avanturismo/youtube-transcript-metadata.md
- **Developed by:** [Avanturismo](https://apify.com/avanturismo) (community)
- **Categories:** Videos, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 video transcribeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## YouTube Transcript & Metadata

Get a **YouTube video's full timed transcript** and **metadata** as clean, structured JSON — no scraping stack, no browser automation, no cookies to manage. Paste one or more video URLs, get back captions plus title, channel, duration, chapters and available caption tracks.

### What it does

For each YouTube URL you pass, this Actor returns:

- **Transcript** — timed segments (`start`, `dur`, `text`), or plain text, or an `.srt` subtitle file. Prefers the human-written caption track and falls back to auto-generated captions.
- **Metadata** *(optional)* — `title`, `channel`, `duration_s`, `upload_date`, `view_count`, `like_count`, `thumbnail`, `chapters`, and the list of `available_captions`.

Results land in the dataset, one row per video — ready to export as JSON, CSV, or Excel, or pull via the API.

### Input

| Field | Type | Description |
|---|---|---|
| `videoUrls` | array | One or more YouTube URLs (`watch?v=…` or `youtu.be/…`). **Required.** |
| `lang` | string | Preferred caption language (e.g. `en`, `es`, `de`). Default `en`. |
| `format` | string | `json` (timed segments), `text` (plain), or `srt` (subtitles). Default `json`. |
| `includeMetadata` | boolean | Also fetch title/channel/duration/chapters. Default `true`. |

#### Example input

```json
{
  "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
  "lang": "en",
  "format": "json",
  "includeMetadata": true
}
```

### Example output (one dataset row)

```json
{
  "input_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "video_id": "dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Video)",
  "channel": "Rick Astley",
  "duration_s": 213,
  "lang": "en",
  "source": "manual",
  "text": "We're no strangers to love ...",
  "segments": [{ "start": 0.0, "dur": 3.1, "text": "We're no strangers to love" }],
  "chapters": [],
  "available_captions": ["en", "es", "fr"]
}
```

### Use cases

- Feed video content into **RAG pipelines** and LLM summarizers
- Build **searchable archives** of a channel's talks or lectures
- Generate **subtitles / show notes / blog drafts** from video
- **Content analysis** at scale — keywords, topics, sentiment over transcripts

### Pricing

Pay-per-result: you're charged once per video successfully processed. No monthly minimum, no idle cost.

### Notes

- Videos without any captions (manual or auto) return a row flagged `transcript_error: "no_captions"` with metadata still included.
- The Actor calls a dedicated backend that only reads caption + metadata — it never downloads or redistributes video/audio streams.

### Who runs this

Built and operated by **[CyberWareX](https://cyberwarex.com)** — a suite of pay-per-call data and AI
APIs for autonomous agents. Every result row carries `provider` / `provider_url` fields so the data's
origin stays traceable wherever it travels. Full service directory and machine-readable docs:
[cyberwarex.com](https://cyberwarex.com) · daily correctness proofs: [cyberwarex.com/trust](https://cyberwarex.com/trust).

# Actor input Schema

## `videoUrls` (type: `array`):

One or more YouTube video URLs (watch?v=… or youtu.be/…).

## `lang` (type: `string`):

Preferred caption language code (e.g. en, es, de). Falls back to auto-generated captions if no manual track exists.

## `format` (type: `string`):

json = timed segments, text = plain text, srt = subtitle file.

## `includeMetadata` (type: `boolean`):

Also fetch title, channel, duration, chapters and available caption tracks.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "lang": "en",
  "format": "json",
  "includeMetadata": true
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset items with transcript + metadata per video URL.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("avanturismo/youtube-transcript-metadata").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"] }

# Run the Actor and wait for it to finish
run = client.actor("avanturismo/youtube-transcript-metadata").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ]
}' |
apify call avanturismo/youtube-transcript-metadata --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,avanturismo/youtube-transcript-metadata"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/kjxxshfCKvMWnZHKA/builds/BcVk2NITFTcpZX3ep/openapi.json
