# Translate X (Twitter) Videos — Subtitles & Transcription (`hgservices/translate-x-videos`) Actor

Transcribe and translate any X (Twitter) video. Get an SRT subtitle file, a captioned MP4, or both. Supports 26 languages — Spanish, French, Arabic, Japanese, and more. Speech-to-text and auto-translate in one step.

- **URL**: https://apify.com/hgservices/translate-x-videos.md
- **Developed by:** [Harish Garg](https://apify.com/hgservices) (community)
- **Categories:** Videos, Social media, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.90 / 1,000 video seconds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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

## Translate X (Twitter) Videos — Subtitles & Transcription

Transcribe, translate, and caption any **X (Twitter) video** automatically. Paste one or more post links and get back translated subtitles in SRT format — plus a captioned MP4 with the subtitles on screen.

Translate Twitter videos into English, Spanish, French, German, Arabic, Japanese, Chinese, Korean, and 18 more languages. The speech-to-text engine extracts the audio, and the auto-translate step delivers a ready-to-use subtitle file in seconds.

### Who is this for

- **Journalists and researchers** — understand foreign-language videos from X without manual transcription.
- **Marketers and social-media teams** — repurpose multilingual video content with accurate captions.
- **Developers and data teams** — automate video translation at scale through the Apify API.
- **Content creators** — add subtitles to downloaded Twitter videos for accessibility and reach.

### What it does

- **Transcribes the video's speech** — speech-to-text produces a clean, time-synced subtitle file (`.srt`).
- **Auto-translates the transcript** into your target language.
- **Burns captions onto the video** (optional, on by default) so you get a ready-to-share `.mp4`.
- **Detects the spoken language** automatically, or you can set it for a faster and more accurate result.
- **Processes a batch** of post URLs in a single run.

### Input

| Field | Description |
|---|---|
| **X post URLs** | One or more links to single X posts that contain a video. Profile, search, and timeline links do not work. |
| **Translate into** | The language you want the subtitles in (English, Spanish, French, Arabic, Japanese, and more). The audio of the video does not change. |
| **Spoken language of the video** | Pick the language spoken in the video for the fastest and most accurate result. **Detect automatically** makes the run slower. |
| **How to deliver the subtitles** | **Burn into the video** (drawn on the picture, the default), **Add as a selectable track** (faster and cheaper), or **Subtitle file only** (no video). |

#### Example input

```json
{
  "startUrls": [
    { "url": "https://x.com/lagranjavipmx/status/2085212317520679339" }
  ],
  "targetLanguage": "EN-US",
  "sourceLanguage": "auto",
  "videoOutput": "burned"
}
```

### Output

For every video the Actor adds one row to the dataset and saves the files to the run's storage:

- **Translated subtitles** — a downloadable `.srt` file.
- **Subtitled video** — an `.mp4` with the translated subtitles, either drawn on screen or as a selectable track (when a video output is chosen).
- **Post metadata** — a `.json` snapshot of the post's details.
- **The translated text** and a line-by-line breakdown with timings.

Each dataset record includes:

| Field | Description |
|---|---|
| `url` | The X post that was processed. |
| `duration` | Length of the source video in seconds. |
| `sourceLanguage` | The language spoken in the video. |
| `targetLanguage` | The language it was translated into. |
| `segmentCount` | Number of subtitle lines. |
| `subtitlesUrl` | Link to the translated `.srt` file. |
| `subtitledVideoUrl` | Link to the subtitled video (when a video output is chosen). |
| `metadataUrl` | Link to the post metadata snapshot (`.json`). |
| `sourceText` | The full transcript in the original language. |
| `translatedText` | The full translated transcript. |
| `segments` | Each line with its start/end time, original text, and translation. |

### Notes

- Give the Actor a direct link to a **post that contains a video**.
- If the post already has a caption track, the Actor translates that track instead of listening to the audio. The **Spoken language** setting then has no effect.
- Videos come back at up to **720p**.
- A **selectable track** does not show everywhere. VLC, QuickTime, and Apple devices show it, but the Chrome player does not, and X removes the track if you upload the file again. Choose **Burn into the video** when the subtitles must always be visible.
- Very long videos take longer and cost more to process.
- If a video has no clear speech (music-only or silent), that item is skipped and the run continues with the next URL.

### Frequently asked questions

**Can I translate a Twitter video to English automatically?**
Yes. Paste the post link, set the target language to English, and run the Actor. It transcribes the speech and translates it in one step.

**What subtitle format does this tool produce?**
The Actor produces standard `.srt` (SubRip) files. You can open them in VLC, Premiere Pro, Final Cut, or any editor that supports SRT subtitles.

**Can I use the Apify API to automate video translation?**
Yes. Call the Actor through the [Apify API](https://docs.apify.com/api/v2) or the JavaScript / Python client. This lets you translate X videos at scale from your own application.

**Does this download the X video too?**
When you choose a video output mode (burned or selectable track), the Actor returns a captioned `.mp4` file you can download. The subtitle-only mode returns the `.srt` file without a video.

# Actor input Schema

## `startUrls` (type: `array`):

Links to single X posts that contain a video. Profile links, search links, and timeline links do not work. The Actor processes and translates each post separately.

## `targetLanguage` (type: `string`):

The language of the subtitles that you get back. The audio of the video does not change.

## `sourceLanguage` (type: `string`):

Select the language spoken in the video for the fastest and most accurate result. 'Detect automatically' makes the run slower. This setting has no effect when the post already has a caption track.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://x.com/Nibberloo/status/2089991614567694380"
    }
  ],
  "targetLanguage": "EN-US",
  "sourceLanguage": "auto"
}
```

# Actor output Schema

## `dataset` (type: `string`):

One record per video with the translated text and file links.

## `files` (type: `string`):

Subtitle files and subtitled video copies.

# 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 = {
    "startUrls": [
        {
            "url": "https://x.com/Nibberloo/status/2089991614567694380"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("hgservices/translate-x-videos").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 = { "startUrls": [{ "url": "https://x.com/Nibberloo/status/2089991614567694380" }] }

# Run the Actor and wait for it to finish
run = client.actor("hgservices/translate-x-videos").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 '{
  "startUrls": [
    {
      "url": "https://x.com/Nibberloo/status/2089991614567694380"
    }
  ]
}' |
apify call hgservices/translate-x-videos --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hgservices/translate-x-videos"
        }
    }
}

```

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/kuDcqpf7cqobFRFFG/builds/FqI2ebLzC5FN0wFKp/openapi.json
