# YouTube Transcript Scraper - bulk videos, channels, search (`vhsgreed/youtube-transcript-fresh`) Actor

Download YouTube transcripts in bulk for videos, Shorts, channels, playlists or search results. Keyless, with timestamped output and optional AI transcription fallback for videos without captions.

- **URL**: https://apify.com/vhsgreed/youtube-transcript-fresh.md
- **Developed by:** [Karl Sundström](https://apify.com/vhsgreed) (community)
- **Categories:** Automation, Developer tools, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 transcript founds

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?

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 Scraper (fresh)

Bulk YouTube transcripts — **keyless, HTTP-only, no proxies**. Video URLs/IDs, Shorts, channels, playlists and **search keywords** in one run. One of the only transcript actors that combines every input type.

### What you get

- **Timestamped segments** (`start`, `dur`, `text`, per-word timing on auto-captions)
- **Output formats**: `json` segments, flat `text`, `srt`, `vtt`, and `llm` — LLM-ready ~1000-char chunks with second offsets for RAG pipelines
- **Metadata**: title, channel, channelId, duration, views, keywords, thumbnail, description, isLive
- **Languages**: fallback-ordered list; optional translation via YouTube's built-in `tlang`; manual vs auto caption choice
- **AI fallback** (off by default): Whisper transcription for caption-less videos using **your own OpenAI key**, capped by minutes, with `dryRun` cost preview
- **Paid per successful transcript only** — videos without captions or failed lookups are never charged

### Fair-use limits

Search/channel/playlist discovery respects `maxVideosPerSource` (default 20). AI fallback is capped (`maxMinutes`, `maxVideosForAi`).

### Run success

We publish our own success rate in run logs (`done: {...} (success rate N/M)`). As of the 2026-09-25 build: 30/30 video lookups OK from datacenter IPs; transcripts fail only when a video genuinely has no captions.

### Cost

`actor-start` $0.001 + **$0.50 per 1,000 transcripts** (Apify plan discounts apply) + optional AI at $0.006/min (at-cost Whisper API rate, ~half of comparable actors). OpenAI key stays yours (BYOK) — bring it in `aiFallback.apiKey` or as the `OPENAI_API_KEY` env var.

# Actor input Schema

## `sources` (type: `array`):

Mix any of: watch?v=..., youtu.be/..., youtube.com/shorts/..., bare 11-char video IDs, youtube.com/playlist?list=..., /channel/UC..., /@handle.

## `searchQueries` (type: `array`):

YouTube search terms; transcripts for the top results are fetched. Combine with maxVideosPerSource.

## `maxVideosPerSource` (type: `integer`):

Applies to each channel, playlist and search query (default 20, max 2000).

## `proxy` (type: `string`):

YouTube bot-gates datacenter IPs after a few lookups; residential keeps success rates high. Proxy cost is paid by the run owner as platform usage.

## `languages` (type: `array`):

ISO 639-1 codes, tried in order. Empty = original language of the video.

## `captionSource` (type: `string`):

any = manual preferred; manual = manual captions only; auto = auto-generated only.

## `translateTo` (type: `string`):

Uses YouTube built-in translation (tlang). Empty = no translation.

## `outputFormats` (type: `array`):

Any of: json (timestamped segments, default), text, srt, vtt, llm (LLM-ready ~1000-char chunks).

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

title, channel, channelId, uploadDate, durationSec, viewCount, likeCount, keywords, thumbnails, description, isLive.

## `wordTimestamps` (type: `boolean`):

Auto-generated (ASR) tracks carry per-word timing; included in each segment as 'words'.

## `maxRetries` (type: `integer`):

Retries per YouTube request with exponential backoff (default 3, max 6).

## `maxVideosForAi` (type: `integer`):

Cap on caption-less videos sent to Whisper per run (default 5, max 100).

## `aiEnabled` (type: `boolean`):

Off by default. Uses YOUR OpenAI key (aiApiKey or OPENAI\_API\_KEY env var). Charges ai\_transcription\_minute per started minute.

## `aiApiKey` (type: `string`):

OpenAI key for AI fallback (sk-...). Leave empty to use the OPENAI\_API\_KEY environment variable.

## `aiMaxMinutes` (type: `integer`):

Hard cap on Whisper minutes per run (default 30, max 600).

## `aiMaxVideos` (type: `integer`):

Cap on caption-less videos sent to Whisper per run (default 5, max 100).

## `aiDryRun` (type: `boolean`):

When true, reports estimated AI minutes and cost without transcribing or charging.

## Actor input object example

```json
{
  "sources": [
    "dQw4w9WgXcQ"
  ],
  "maxVideosPerSource": 1,
  "proxy": "apify-residential",
  "captionSource": "any",
  "includeMetadata": true,
  "wordTimestamps": false,
  "maxRetries": 3,
  "maxVideosForAi": 5,
  "aiEnabled": false,
  "aiMaxMinutes": 30,
  "aiMaxVideos": 5,
  "aiDryRun": false
}
```

# Actor output Schema

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

One dataset item per video: videoId, url, language, isAutoCaption, timestamped segments, flat text, optional SRT/VTT/LLM chunks and metadata. Failed videos return {videoId, error} and are not charged.

## `stats` (type: `string`):

Key-value store record STATS: counts of ok / noCaptions / failed videos and AI minutes used.

# 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 = {
    "sources": [
        "dQw4w9WgXcQ"
    ],
    "maxVideosPerSource": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("vhsgreed/youtube-transcript-fresh").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 = {
    "sources": ["dQw4w9WgXcQ"],
    "maxVideosPerSource": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("vhsgreed/youtube-transcript-fresh").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 '{
  "sources": [
    "dQw4w9WgXcQ"
  ],
  "maxVideosPerSource": 1
}' |
apify call vhsgreed/youtube-transcript-fresh --silent --output-dataset

```

## MCP server setup

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

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/GtJ0I8A2Qmypa5WYm/builds/olWJtmwPj2nhrTjyE/openapi.json
