Back to TikTok Transcript
X / Twitter Transcript API
Extract transcripts from any public X (Twitter) video post
Endpoint
POST
https://api.citoapi.com/api/v1/transcript/twitterExtract a full text transcript from any public X (Twitter) video post. Powered by Whisper AI — supports 50+ languages with auto-detection.
Authentication
Pass your API key in the x-api-key header on every request. Learn more →
Request Body
{
"url": "https://x.com/username/status/1234567890123456789",
"format": "text",
"language": "en"
}| Field | Type | Required | Description |
|---|---|---|---|
url | string | required | Public X/Twitter status URL with a video |
format | string | optional | text (default), verbose, srt, vtt |
language | string | optional | ISO 639-1 code (e.g. en, es, ko). Omit to auto-detect. |
Format Options
| format | Returns |
|---|---|
text | Plain transcript string (default) |
verbose | Transcript + timestamps per segment |
srt | Ready-to-use .srt subtitle file string |
vtt | Ready-to-use .vtt subtitle file string |
Example Request
curl -X POST https://api.citoapi.com/api/v1/transcript/twitter \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"url": "https://x.com/username/status/1234567890123456789",
"format": "text"
}'Responses
format: "text" (default)
{
"success": true,
"data": {
"text": "Oh hey, stay back stay back. Coming to your family you better believe it.",
"language": "en",
"duration": 37.46,
"url": "https://x.com/username/status/1234567890123456789",
"format": "text"
}
}format: "verbose" — includes per-segment timestamps
{
"success": true,
"data": {
"text": "Oh hey, stay back stay back. Coming to your family you better believe it.",
"language": "en",
"duration": 37.46,
"segments": [
{ "start": 0.0, "end": 2.4, "text": "Oh hey, stay back stay back." },
{ "start": 2.4, "end": 5.1, "text": "Coming to your family you better believe it." }
],
"url": "https://x.com/username/status/1234567890123456789",
"format": "verbose"
}
}srt and vtt formats return the same shape with the text field containing the ready-to-use subtitle file string.
Code Examples
JavaScript
const response = await fetch('https://api.citoapi.com/api/v1/transcript/twitter', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
url: 'https://x.com/username/status/1234567890123456789',
format: 'text'
})
});
const { data } = await response.json();
console.log(data.text);Python
import requests
response = requests.post(
'https://api.citoapi.com/api/v1/transcript/twitter',
headers={'x-api-key': 'YOUR_API_KEY'},
json={
'url': 'https://x.com/username/status/1234567890123456789',
'format': 'text'
}
)
print(response.json()['data']['text'])cURL
curl -X POST https://api.citoapi.com/api/v1/transcript/twitter \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{"url": "https://x.com/username/status/1234567890123456789", "format": "text"}'Error Responses
| Status | Meaning |
|---|---|
400 | Invalid URL, no video in post, or unsupported language code |
401 | Missing or invalid API key |