# YouTube Transcript Extractor - Timestamped Segments & Full Text (`samer-samaha/yt-transcript-tool`) Actor

Extract YouTube video transcripts as timestamped segments and combined plain text. Accepts video URLs, Shorts links, embed links or bare video IDs.

- **URL**: https://apify.com/samer-samaha/yt-transcript-tool.md
- **Developed by:** [Sam S](https://apify.com/samer-samaha) (community)
- **Categories:** Videos, AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 item processeds

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 Extractor - Timestamped Segments & Full Text

Extract YouTube video transcripts as timestamped segments and combined plain text. Accepts video URLs, Shorts links, embed links or bare video IDs.

### What you get

Every row contains:

- `input`
- `videoId`
- `language`
- `segmentCount`
- `timestamp`
- `transcript`
- `text`

```json
{
  "input": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "videoId": "jNQXAC9IVRw",
  "language": "en",
  "segmentCount": 6,
  "timestamp": "2026-08-25T12:08:28.018Z",
  "transcript": [
    {
      "text": "All right, so here we are, in front of the\nelephants",
      "start": 1200,
      "duration": 2160
    },
    {
      "text": "the cool thing about these guys is that they\nhave really...",
      "start": 5318,
      "duration": 2656
    },
    {
      "text": "really really long trunks",
      "start": 7974,
      "duration": 4642
    },
    {
      "text": "and that's cool",
      "start": 12616,
      "duration": 1751
    },
    {
      "text": "(baaaaaaaaaaahhh!!)",
      "start": 14421,
      "duration": 1312
    },
    {
      "text": "and that's pretty much all there is to\nsay",
      "start": 16881,
      "duration": 2000
    }
  ],
  "text": "All right, so here we are, in front of the\nelephants the cool thing about these guys is that they\nhave really... really really long trunks and that's cool (baaaaaaaaaaahhh!!) and that's pretty much all there is to\nsay"
}
```

### Input

| Field | Type | Required | Description |
|---|---|---|---|
| `videoUrl` | array | yes | YouTube videos to transcribe. Accepts watch URLs, youtu.be links, /shorts/ links, /embed/ links or bare 11-character video IDs. Default: `["https://www.youtube.com/watch?v=jNQXAC9IVRw"]`. |
| `language` | string | no | Language code of the captions to fetch, e.g. 'en' for English, 'es' for Spanish. If the requested language isn't available, the tool falls back to the video's default captions. Default: `"en"`. |
| `includeTimestamps` | boolean | no | When on, the result includes each caption line with its start time and duration, not just the plain text. Default: `true`. |
| `combineIntoText` | boolean | no | When on, the result also includes a single 'text' field with the entire transcript joined together, handy for pasting into other tools. Default: `true`. |
| `proxyConfiguration` | object | no | Requests go out through this proxy. YouTube refuses its caption endpoint to datacenter IPs. Default: `{"useApifyProxy":true,"apifyProxyGroups":["RESIDENTIAL"]}`. |

### Use cases

- Feeding video content into an LLM or RAG pipeline as clean text.
- Building searchable archives of a channel without watching anything.
- Repurposing talks and interviews into articles, show notes or social posts.

### Pricing

$5.00 per 1,000 results. You are charged once per record written to the dataset, and never for a result you do not receive — validation failures and duplicates are dropped before billing.

**The first 10 items of every run are free**, so you can check that the output has the fields you need before paying for any of it.

### Notes

- Accepts full watch URLs, youtu.be links, /shorts/ links, /embed/ links, or a bare 11-character video ID.
- Returns both `transcript` (segments with start and duration in milliseconds) and `text` (everything joined).
- Uses YouTube's public caption endpoint — no API key, no login, no quota to manage.
- A video with captions disabled returns an error for that item and does not stop the run.

### Support

Open an issue on this Actor if a field stops populating or a run returns nothing. Selector drift is a bug, not a fact of life — these parsers are re-tested weekly against the live site.

# Actor input Schema

## `videoUrl` (type: `array`):

YouTube videos to transcribe. Accepts watch URLs, youtu.be links, /shorts/ links, /embed/ links or bare 11-character video IDs.

## `language` (type: `string`):

Language code of the captions to fetch, e.g. 'en' for English, 'es' for Spanish. If the requested language isn't available, the tool falls back to the video's default captions.

## `includeTimestamps` (type: `boolean`):

When on, the result includes each caption line with its start time and duration, not just the plain text.

## `combineIntoText` (type: `boolean`):

When on, the result also includes a single 'text' field with the entire transcript joined together, handy for pasting into other tools.

## `proxyConfiguration` (type: `object`):

Requests go out through this proxy. YouTube refuses its caption endpoint to datacenter IPs.

## Actor input object example

```json
{
  "videoUrl": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "language": "en",
  "includeTimestamps": true,
  "combineIntoText": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

All records found in this run.

# 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 = {
    "videoUrl": [
        "https://www.youtube.com/watch?v=jNQXAC9IVRw"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("samer-samaha/yt-transcript-tool").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 = {
    "videoUrl": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("samer-samaha/yt-transcript-tool").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 '{
  "videoUrl": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call samer-samaha/yt-transcript-tool --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,samer-samaha/yt-transcript-tool"
        }
    }
}

```

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/S7OzSGlJoaddJCWK7/builds/TMtemlilWBOos6fWb/openapi.json
