YouTube Captions API
Pricing
from $0.29 / 1,000 transcripts
YouTube Captions API
YouTube captions API and YouTube captions scraper: captions from video, channel, playlist or search inputs as timed segments and full text, manual or auto, any language or translated, as JSON, CSV or SRT. $0.39 per 1,000 transcripts on Starter, 6x cheaper than the most-used rival. 100% run success.
Pricing
from $0.29 / 1,000 transcripts
Rating
0.0
(0)
Developer
Preternix
Maintained by CommunityActor stats
0
Bookmarked
9
Total users
5
Monthly active users
2 days ago
Last modified
Categories
Features
Share
Use this bulk YouTube transcript scraper to collect captions from video links, playlists, channels or search results. Get full text and timed segments, or use the YouTube transcript n8n workflow below to send captions into your next step.
Key features
- Get one transcript per video when captions are available. Pick human-made captions, auto-generated captions or either.
- Choose one or more preferred languages. If a track is missing, you can use translation or keep the original language.
- Read timed segments in JSON, get plain text, or request SRT or WebVTT files.
Quick start
Paste this JSON into the Apify input form or send it as the Actor input from code.
{"urls": ["https://www.youtube.com/watch?v=-Kv_5EUjGaE","https://www.youtube.com/watch?v=Zsc9B3-1kTI"],"languages": ["en"],"translation": "none","outputFormat": "segments","maxVideos": 2}
Input parameters
| Parameter | Type | Default or when omitted | What it does |
|---|---|---|---|
urls | List | @TED example if no searches are supplied | Video links or IDs, Shorts links, channel links or handles, and playlist links. For channels, append /shorts or /streams for that tab. |
maxVideos | Integer | 20 | Maximum videos read per channel, playlist or search. A direct video link is one video. Range: 1 to 10,000. |
languages | List | Unset | Language codes in preference order. When empty, the Actor prefers a track in the original spoken language and may use another available caption track if the original is unavailable. |
outputFormat | Text | "segments" | Text is included in every transcript row. Choose segments, plain text, SRT or WebVTT. Choices: segments, text, srt, vtt. |
searchQueries | List | Unset | One YouTube search phrase per entry. Use links, searches or both. |
translation | Text | "machine" | How to handle a missing requested language: use machine translation, request YouTube translation, or keep the original captions. Choices: machine, youtube, none. |
captionType | Text | "any" | Use either kind (human-made first), human-made only or automatic only. Choices: any, manual, auto. |
searchShortsOnly | Boolean | false | Search for Shorts. Applies to searchQueries. |
publishedAfter | Text | Unset | Date or relative period for videos found through channels, playlists or searches. Direct video links are read either way. |
publishedBefore | Text | Unset | Latest publication date, inclusive through that day, or minimum age such as 30 days. Does not filter direct video links. |
includeEngagement | Boolean | true | Add available likes, comments, publication date and extra channel details. |
includeWordTimings | Boolean | false | Add word start times inside timed segments for auto-generated captions where available. |
maxConcurrency | Integer | 32 | Maximum number of videos read at the same time. Range: 1 to 32. |
proxyConfiguration | Object | {"useApifyProxy": true} | Leave at the Apify Proxy default for a typical run. |
If you submit no links or searches, the Actor returns no transcripts and does not charge you. If you submit the example channel shown in the Console, normal rates apply to any transcripts delivered.
Real JSON output
Selected fields from a real TED transcript. Only the first timed segment is shown; times are in seconds.
{"videoId": "-Kv_5EUjGaE","videoUrl": "https://www.youtube.com/watch?v=-Kv_5EUjGaE","title": "How Fossil Fuel Companies Keep Your Energy Costs High | Jon Powers | TED","channelName": "TED","languageCode": "en","isAutoGenerated": false,"segmentCount": 196,"transcript": [{"start": 7.145,"end": 9.548,"duration": 2.403,"text": "When I started in the clean-energy industry,"}]}
Pricing
Each delivered transcript is charged once per video per run. Videos without a transcript do not incur a transcript charge. There is no start fee or extra charge for a different output format or translation.
Prices in USD per 1,000 of each billed event:
| Event | Free | Starter | Scale | Business and above |
|---|---|---|---|---|
| Transcript rows | $0.49 | $0.39 | $0.35 | $0.29 |
Run from code
Set APIFY_TOKEN to your Apify API token. Install the SDK for your language with pip install apify-client or npm install apify-client.
Python
This example uses apify-client 3.x.
import osfrom apify_client import ApifyClientclient = ApifyClient(os.environ["APIFY_TOKEN"])run_input = {"urls": ["https://www.youtube.com/watch?v=-Kv_5EUjGaE","https://www.youtube.com/watch?v=Zsc9B3-1kTI"],"languages": ["en"],"translation": "none","outputFormat": "segments","maxVideos": 2}run = client.actor("deepmine/youtube-captions-api").call(run_input=run_input)if run is None or run.status != "SUCCEEDED":raise RuntimeError("The Actor run did not succeed")for item in client.dataset(run.default_dataset_id).iterate_items():print(item)
Node.js
Run this script as an ES module, for example from a .mjs file.
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: process.env.APIFY_TOKEN });const input = {"urls": ["https://www.youtube.com/watch?v=-Kv_5EUjGaE","https://www.youtube.com/watch?v=Zsc9B3-1kTI"],"languages": ["en"],"translation": "none","outputFormat": "segments","maxVideos": 2};const run = await client.actor('deepmine/youtube-captions-api').call(input);if (run?.status !== 'SUCCEEDED') throw new Error('The Actor run did not succeed');const dataset = client.dataset(run.defaultDatasetId);const limit = 1000;for (let offset = 0; ; offset += limit) {const { items } = await dataset.listItems({ limit, offset });for (const item of items) console.log(item);if (items.length < limit) break;}
Integrations: Apify MCP and n8n
Apify MCP: Add this remote server to your MCP client and sign in to Apify. Choose the Actor tool and use the JSON from Quick start. See the Apify MCP setup guide.
https://mcp.apify.com?tools=deepmine/youtube-captions-api
n8n: Use HTTP Request nodes with your Apify token stored in a Bearer Auth credential. Send the Quick start JSON in the first request. Use a Wait node between status requests and route on data.status: read the dataset on SUCCEEDED, stop on other terminal states, and wait again while the run is active. For large datasets, page with limit and offset.
POST https://api.apify.com/v2/acts/deepmine~youtube-captions-api/runsGET https://api.apify.com/v2/actor-runs/{{ $json.data.id }}GET https://api.apify.com/v2/datasets/{{ $json.data.defaultDatasetId }}/items
To find the optional separate dataset, read GET https://api.apify.com/v2/key-value-stores/{defaultKeyValueStoreId}/records/OUTPUT and follow noTranscriptDataset.itemsUrl if present. The run response provides data.defaultKeyValueStoreId.
In the next node, map transcriptText to your text field and videoUrl to your source link.
Frequently asked questions
Where do videos without captions go?
They do not appear as transcripts in the main dataset. When available, the run summary links to a separate No transcript dataset that explains why a video had no transcript.
Can I force human-made captions?
Yes. Set captionType to manual. Use auto for automatic captions only, or leave it at any to try human-made captions first.
Where do I get subtitle files?
Set outputFormat to srt or vtt. Look for fileName and fileUrl on the row. If a file could not be saved, fileUrl may be empty.
What happens if translation fails?
A row can fall back to the original captions. Check languageCode and translationStatus before sending the text to a language-specific workflow.
See the full input reference or the Actor API.