Transcript API for Social Media Video

The Transcript24 API lets you fetch transcripts from public social media URLs in a single request. You can choose standard JSON responses or stream results via Server-Sent Events (SSE).

Base URL

https://api.transcript24.com

Authentication

Send your API key in the Authorization header.

Authorization: Bearer <API_KEY>

Create a Transcript

Use a single POST /transcribe request to generate a transcript from a public URL.

Supported Platforms

Endpoint

POST /transcribe

Headers

Content-Type: application/json
Authorization: Bearer <API_KEY>
Accept: text/event-stream   // optional for SSE streaming

Body

{
  "url": "https://www.youtube.com/watch?v=..."
}

Only url is required.

Standard JSON Response

If you do not provide Accept: text/event-stream, the API will return a single JSON response when the transcript is ready.

{
  "ok": true,
  "taskCredits": 3,
  "caption": [
    {
      "start_time": "00:00:00.000",
      "end_time": "00:00:03.200",
      "text": "..."
    }
  ]
}

SSE Streaming Response

If you set Accept: text/event-stream, the API will stream events and finish with a done event.

Example event types:

event: progress
data: {"stage":"download","pct":0}

event: final
data: {"ok":true,"taskCredits":3,"caption":[...]}

event: done
data: {"ok":true}

Examples

JavaScript (Non-SSE)

const res = await fetch("https://api.transcript24.com/transcribe", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer <API_KEY>",
  },
  body: JSON.stringify({
    url: "https://www.youtube.com/watch?v=...",
  }),
});

const data = await res.json();
console.log(data.caption);

JavaScript (SSE)

const res = await fetch("https://api.transcript24.com/transcribe", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Accept: "text/event-stream",
    Authorization: "Bearer <API_KEY>",
  },
  body: JSON.stringify({
    url: "https://www.instagram.com/p/...",
  }),
});

const reader = res.body.getReader();
const decoder = new TextDecoder();
let buffer = "";

while (true) {
  const { value, done } = await reader.read();
  if (done) break;
  buffer += decoder.decode(value, { stream: true });

  const events = buffer.split("\\n\\n");
  buffer = events.pop() || "";

  for (const evt of events) {
    if (!evt.includes("event:")) continue;
    const lines = evt.split("\\n");
    const event = lines.find((l) => l.startsWith("event:"))?.slice(6).trim();
    const dataLine = lines.find((l) => l.startsWith("data:"))?.slice(5).trim();
    if (event === "final" && dataLine) {
      const payload = JSON.parse(dataLine);
      console.log(payload.caption);
    }
  }
}

Python (Non-SSE)

import requests

res = requests.post(
    "https://api.transcript24.com/transcribe",
    headers={
        "Authorization": "Bearer <API_KEY>",
        "Content-Type": "application/json",
    },
    json={"url": "https://www.youtube.com/watch?v=..."},
)

data = res.json()
print(data["caption"])

Python (SSE)

import json
import requests

res = requests.post(
    "https://api.transcript24.com/transcribe",
    headers={
        "Authorization": "Bearer <API_KEY>",
        "Accept": "text/event-stream",
        "Content-Type": "application/json",
    },
    json={"url": "https://www.tiktok.com/@user/video/..."},
    stream=True,
)

event = None
for line in res.iter_lines(decode_unicode=True):
    if not line:
        continue
    if line.startswith("event:"):
        event = line.replace("event:", "").strip()
        continue
    if line.startswith("data:") and event == "final":
        payload = json.loads(line.replace("data:", "").strip())
        print(payload["caption"])

Error Responses

{
  "error": "Invalid API key"
}

Common error messages:

Credits

For transcript requests, billing uses 1 credit per minute (rounded up) (ceil(duration_seconds / 60)). Examples:

Failed jobs are not charged. Each successful response includes taskCredits for the current transcription task.

Support

If you have questions, please contact support with the URL you tested and the timestamp of your request.