# Youtube Video Transcript Translator (`chrisdev_6278/youtube-video-transcript-translator`) Actor

YouTube Video Transcript Translator extracts subtitles from YouTube videos and translates them into any supported language using lingo.dev. Ideal for learners, educators, and platforms that need multilingual access to video content at scale.

- **URL**: https://apify.com/chrisdev_6278/youtube-video-transcript-translator.md
- **Developed by:** [Christian Obi](https://apify.com/chrisdev_6278) (community)
- **Categories:** AI, Social media, Other
- **Security:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.10 / 1,000 results

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 Video Transcript Translator

Extracts YouTube transcripts and translates them using **lingo.dev**. Built with Crawlee + Cheerio for fast transcript extraction and the `lingo.dev` SDK for high-quality translations. Ideal for educators, learners, and platforms needing multilingual subtitles at scale.

### Features

- Extracts available YouTube captions (public videos).
- Translates each subtitle line using lingo.dev (BCP-47 locales).
- Batch processing via Request List UI.
- Outputs full translated transcript to an Apify dataset (JSON).
- Lightweight, scalable, and suitable for automation.

### Quick start

1. Install:

```bash
npm install
```

2. Prepare input: `storage/key_value_stores/default/INPUT.json` (example below).
3. Set API key (recommended):

- PowerShell:

```powershell
$env:LINGODOTDEV_API_KEY="sk-XXX"
apify run
```

4. Run:

```bash
apify run
```

### Input example

```json
{
  "youtubeVideoUrls":[{"url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ"}],
  "maxRequestsPerCrawl":100,
  "sourcelocale":null,
  "targetLocale":"es",
  "LINGODOTDEV_API_KEY":"YOUR_KEY"
}
```

### Output

Saved to dataset per video:

- `videoUrl`, `videoId`, `sourceLocale`, `targetLocale`
- `transcript` (array of {start, duration, text, lang})
- `transcriptPreview` (string)
- `transcriptLength` (string)

### How it works

1. Reads input list of YouTube URLs.
2. Extracts video ID and captions via a transcript library.
3. Translates lines using lingo.dev SDK.
4. Saves results to the Apify dataset.

### Limitations & notes

- Only public/accessible captions supported.
- Lingo.dev may not support every locale—custom locales may fail.
- Respect YouTube ToS; avoid excessive crawling.
- For protected content consider authenticated/workflow alternatives.

### Contact

Christian Obi — obiemeriachristian@gmail.com\
GitHub: https://github.com/gus-host/\
Portfolio: https://my-portfolio-pi-six-91.vercel.app/

License: MIT

# Actor input Schema

## `youtubeVideoUrls` (type: `array`):

Add one or more YouTube video URLs. Use the request list UI to add URLs. Each item is an object with a single `url` field.

## `maxRequestsPerCrawl` (type: `integer`):

Maximum number of requests the crawler will make during the run. Use a lower number for quick tests and a higher number for production runs.

## `sourcelocale` (type: `string`):

The language code of the video transcript (BCP-47). Leave blank (null) to let the Actor attempt to use the video's caption language or allow Lingo.dev to auto-detect. You can either pick from the list (searchable) or enter a custom BCP-47 locale (e.g. `en`, `en-GB`, `pt-BR`). If you enter a custom locale that Lingo.dev does not support, translation will fail — your run will receive a clear error.

## `targetLocale` (type: `string`):

The target language (BCP-47) you want the transcript translated to. Choose from the searchable list or enter a custom BCP-47 locale. This field is required.eg. 'es', 'pt-BR', 'fr'

## `LINGODOTDEV_API_KEY` (type: `string`):

Your Lingo.dev API key. This is a secret and will be hidden in the UI. eg. api_xxxxxx

## Actor input object example

```json
{
  "youtubeVideoUrls": [
    {
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    }
  ],
  "maxRequestsPerCrawl": 100,
  "targetLocale": "en"
}
```

# Actor output Schema

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

No description

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

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

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

```

## MCP server setup

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

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/gVYcr6BYJBFU4j76A/builds/o3c5FnbQCaT1dJs0U/openapi.json
