# X (Twitter) Transcript Extractor (`scriptbase/x-twitter-transcript-extractor`) Actor

🐦 Convert any X (Twitter) video or recorded Space to text. Extract transcripts with timestamps. Outputs JSON, SRT, or plain text. Supports Spaces up to 1 hour. Speech-to-text powered. 14+ languages. No login needed.

- **URL**: https://apify.com/scriptbase/x-twitter-transcript-extractor.md
- **Developed by:** [Scriptbase](https://apify.com/scriptbase) (community)
- **Categories:** AI, Automation, Social media
- **Stats:** 101 total users, 6 monthly users, 25.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## X (Twitter) Transcript Extractor

Extract transcripts from any X (Twitter) video or recorded Space. Paste a URL, get back timestamped text -- ready for repurposing, analysis, or translation.

Works with any public video. No login required.

### What it does

1. You provide an X video or Space URL.
2. The actor extracts the transcript.
3. You get back structured text with timestamps -- in JSON, plain text, SRT, or VTT.

### Key features

- **Multi-language** -- see [supported languages](#supported-languages) below.
- **4 output formats** -- JSON with timestamps, plain text, SRT subtitles, or WebVTT.
- **Timestamped segments** -- every line with precise start/end times, plus video duration and full text.
- **X Spaces** -- transcribe recorded Spaces (up to 1 hour).
- **Fast on repeat lookups** -- recently extracted videos return from cache in milliseconds.
- **No login required.**

### Supported languages

| Code | Language |
|------|----------|
| `en` | English |
| `es` | Spanish |
| `fr` | French |
| `de` | German |
| `pt` | Portuguese |
| `it` | Italian |
| `nl` | Dutch |
| `ja` | Japanese |
| `ko` | Korean |
| `zh` | Chinese |
| `ar` | Arabic |
| `ru` | Russian |
| `tr` | Turkish |
| `hi` | Hindi |

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `url` | string | *(required)* | X (Twitter) video or Space URL |
| `language` | string | `"auto"` | Preferred language ([ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)) or `"auto"` |
| `format` | string | `"json"` | `"json"`, `"text"`, `"srt"`, or `"vtt"` |

#### Supported URLs

```
https://x.com/user/status/1234567890
https://twitter.com/user/status/1234567890
https://x.com/i/spaces/1eaKbNZvYQbKX
```

### Output example

When `format` is `json`, the dataset row looks like this:

```json
{
    "url": "https://x.com/user/status/1234567890",
    "platform": "twitter",
    "language": "en",
    "duration_sec": 120,
    "segments": [
        { "start": 0.0, "end": 3.5, "text": "..." },
        { "start": 3.5, "end": 7.2, "text": "..." }
    ],
    "full_text": "..."
}
```

When `format` is `text`, `srt`, or `vtt`, the formatted transcript is written to the actor's key-value store under the `OUTPUT` key.

When extraction fails, you get a clear error in the dataset:

```json
{
    "error": "NOT_FOUND",
    "message": "No transcript available for this video."
}
```

### Error codes

| Code | Meaning |
|------|---------|
| `INVALID_FORMAT` | `format` was not one of json/text/srt/vtt |
| `BAD_REQUEST` | The URL was malformed or rejected by the transcript operation |
| `UNSUPPORTED_PLATFORM` | No transcript operation serves this URL's platform |
| `UNAUTHORIZED` | The actor's ScriptBase key is missing, invalid, or revoked |
| `INSUFFICIENT_CREDITS` | The ScriptBase account behind this actor is out of credits |
| `NOT_FOUND` | The video is private, removed, or has no extractable transcript |
| `UPSTREAM_FAILED` | Every transcript source failed -- retry shortly |
| `RATE_LIMITED` | Too many requests -- retry after a short delay |
| `TIMEOUT` | Extraction took longer than the actor's poll budget |
| `INTERNAL_ERROR` | Unexpected error during extraction |

### Use cases

- **Content repurposing** -- turn X videos and Spaces into blog posts, newsletters, or social media captions.
- **Accessibility** -- generate subtitles for videos that don't have them.
- **Research & analysis** -- analyze what creators, journalists, and brands are saying.
- **Podcast transcription** -- transcribe recorded X Spaces for archival or distribution.
- **Translation** -- get text for translating X content into other languages.
- **Dataset building** -- collect transcripts for training, analysis, or archival.

### Integrations

Use this actor with the [Apify API](https://docs.apify.com/api/v2) or connect it to your workflow:

- **Python** -- `apify_client.actor("your-actor-id").call(run_input={"url": "..."})`
- **JavaScript** -- `await client.actor("your-actor-id").call({url: "..."})`
- **Zapier / Make / n8n** -- trigger on new videos and get transcripts automatically.
- **Webhooks** -- get notified when a transcript is ready.

### FAQ

**Does this need an X account?**
No. Works with any public video or recorded Space, no login needed.

**Does it work with X Spaces?**
Yes. Recorded Spaces (up to 1 hour) are supported. Use the Space URL format: `https://x.com/i/spaces/[spaceId]`.

**Which languages work?**
See the [supported languages](#supported-languages) table above.

**Can I process multiple videos?**
Yes. Call the actor via the Apify API or use integrations (Zapier, Make, n8n) to process videos in a loop.

**What does it cost?**
Pricing is per transcribed minute (1 minute = 1 charge unit, minimum 1), so you pay only for the audio actually processed — and failed extractions cost nothing. The exact per-minute price is shown on this actor's Apify Store page.

# Actor input Schema

## `url` (type: `string`):

URL of an X (Twitter) video or recorded Space.

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

Preferred transcript language as an ISO 639-1 code (e.g. en, es, fr, de, ja).

## `format` (type: `string`):

Choose how the transcript is returned. JSON includes timestamps per segment. Text returns the full transcript as a plain string. SRT and VTT are subtitle file formats.

## Actor input object example

```json
{
  "url": "https://x.com/i/status/1234567890",
  "language": "en",
  "format": "json"
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `segments` (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 = {
    "url": "https://x.com/i/status/1234567890",
    "language": "en",
    "format": "json"
};

// Run the Actor and wait for it to finish
const run = await client.actor("scriptbase/x-twitter-transcript-extractor").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 = {
    "url": "https://x.com/i/status/1234567890",
    "language": "en",
    "format": "json",
}

# Run the Actor and wait for it to finish
run = client.actor("scriptbase/x-twitter-transcript-extractor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "url": "https://x.com/i/status/1234567890",
  "language": "en",
  "format": "json"
}' |
apify call scriptbase/x-twitter-transcript-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scriptbase/x-twitter-transcript-extractor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/5bjeBqiPXhxtGwpts/builds/zMLLOF4B82H1p8Q3d/openapi.json
