# YouTube Transcript API (`getyoutubetranscript/youtube-transcript-api`) Actor

Get YouTube transcripts with timestamps, in one request per video, from any cloud server. Uses your GetYouTubeTranscript API key (free tier, no card).

- **URL**: https://apify.com/getyoutubetranscript/youtube-transcript-api.md
- **Developed by:** [Deepak Pant](https://apify.com/getyoutubetranscript) (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

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

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 examples already wired to this Actor's own input schema, see the [API](#api) section below.

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`).

# README

## YouTube Transcript API

Get the transcript of any YouTube video, with per-line timestamps, as structured data. Paste video URLs or IDs, run, and download the results as JSON, CSV or Excel, or pull them through the Apify API.

It calls the [GetYouTubeTranscript](https://getyoutubetranscript.com) API, which fetches captions server-side. That means it keeps working from cloud servers that YouTube blocks for direct scraping, and each video comes back in a single request (no job polling), typically in around 800 ms.

### What you need

A GetYouTubeTranscript API key. Create one at [getyoutubetranscript.com/developers](https://getyoutubetranscript.com/developers): the free tier needs no card. Each successful transcript uses 1 credit, and failed requests are not charged. Paid plans start at $5 per 1,000 requests.

The actor itself only makes one HTTP call per video, so Apify compute usage is tiny.

### Input

| Field | Required | Description |
|---|---|---|
| `videos` | Yes | YouTube URLs (`watch`, `youtu.be`, `shorts`) or 11-character video IDs |
| `apiKey` | Yes | Your GetYouTubeTranscript API key (stored as a secret) |
| `language` | No | Language code such as `en`, `es`, `de`. Defaults to `en` |
| `timestamps` | No | Add `segments` with `start` and `duration` in seconds. Default `true` |

```json
{
  "videos": ["https://www.youtube.com/watch?v=jNQXAC9IVRw", "dQw4w9WgXcQ"],
  "apiKey": "sk_live_...",
  "language": "en",
  "timestamps": true
}
```

### Output

One dataset item per video:

```json
{
  "input": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "videoId": "jNQXAC9IVRw",
  "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "title": "Me at the zoo",
  "author": "jawed",
  "language": "en",
  "requestedLanguage": "en",
  "captionType": "manual",
  "fetchedAt": "2026-08-25T04:47:39.930Z",
  "wordCount": 39,
  "transcript": "All right, so here we are, in front of the elephants...",
  "segments": [
    { "start": 1.2, "duration": 2.16, "text": "All right, so here we are, in front of the elephants" }
  ]
}
```

`language` is the caption track actually returned; when it differs from `requestedLanguage`, the video didn't have the language you asked for. `captionType` is `manual` (uploaded by the creator), `auto` (YouTube speech recognition, so names may be misheard) or `null` if unknown.

If a video has no captions, or the requested language isn't available, the item has `error` (for example `TRANSCRIPT_NOT_FOUND` or `LANGUAGE_NOT_AVAILABLE`) and `message` instead, and the run continues with the next video. An invalid key or an empty credit balance stops the run right away.

### Use cases

- Summarize or analyze videos with an LLM
- Build a searchable knowledge base from a channel or playlist
- Quote the exact moment something was said, using `segments` timestamps
- Feed transcripts to RAG pipelines, n8n, Make or Zapier through Apify integrations

### More than transcripts

The same API key also covers video search, channel uploads, channel search and playlists. See the [API docs](https://getyoutubetranscript.com/docs), the [MCP server](https://getyoutubetranscript.com/api/mcp) for Claude and other AI agents, and SDKs for Python (`pip install getyoutubetranscript`) and Node (`npm install @tubeagentkit/getyoutubetranscript`).

Questions or issues: open an issue on this actor or contact us via [getyoutubetranscript.com](https://getyoutubetranscript.com).

# Actor input Schema

## `videos` (type: `array`):

YouTube video URLs (watch, youtu.be, shorts) or 11-character video IDs.

## `apiKey` (type: `string`):

Required. Your API key from https://getyoutubetranscript.com/developers (free tier, no card). Each successful transcript uses 1 credit; failed requests are not charged.

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

Transcript language code, for example en, es, de. Defaults to English.

## `timestamps` (type: `boolean`):

Add per-line segments with start and duration in seconds.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "language": "en",
  "timestamps": true
}
```

# Actor output Schema

## `transcripts` (type: `string`):

One item per video: transcript text, segments with timestamps, or an error code.

# 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 = {
    "videos": [
        "https://www.youtube.com/watch?v=jNQXAC9IVRw"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("getyoutubetranscript/youtube-transcript-api").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 = { "videos": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"] }

# Run the Actor and wait for it to finish
run = client.actor("getyoutubetranscript/youtube-transcript-api").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 '{
  "videos": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ]
}' |
apify call getyoutubetranscript/youtube-transcript-api --silent --output-dataset

```

## MCP server setup

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

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/yqn7TCJceCge1eLDc/builds/iNcj3n956MCgy8SF5/openapi.json
