Transcriptly API v2 extracts video metadata, retrieves existing closed captions, and generates AI-powered transcripts across YouTube, TikTok, Instagram, and X.
Last updated: December 2, 2026
All requests are sent over HTTPS with standard JSON payloads. Authenticate every call using the X-API-Key header.
https://transcriptly.org/api/v2X-API-Key: your_api_key_hereX-RateLimit-* headers. GET /ai-transcripts/:id is exempt.To achieve the lowest latency and minimize credit consumption, we recommend the following fallback pattern:
POST /transcripts. If the creator or platform already provided captions, you receive them instantly for just 1 credit.durationSeconds and estimatedCredits.POST /ai-transcripts with the video URL.GET /ai-transcripts/:id until completed./mediaExtracts video metadata including title, author, thumbnail, duration, and whether caption tracks were detected in the source data.
youtube.com/watch?v=..., youtu.be/...tiktok.com/@username/video/.../reel/, /reels/, /tv/, /p/)x.com/.../status/..., twitter.com/...){
"url": "https://www.youtube.com/watch?v=VIDEO_ID"
}| Field | Type | Requirement | Description |
|---|---|---|---|
| url | string | Required | Video URL from any supported platform. |
{
"code": 200,
"message": "success",
"data": {
"platform": "youtube",
"title": "Introduction to AI",
"description": "A quick overview of artificial intelligence.",
"author": "Tech Channel",
"authorUsername": "techchannel",
"thumbnailUrl": "https://img.youtube.com/vi/VIDEO_ID/maxresdefault.jpg",
"durationSeconds": 180,
"publishedAt": "2024-01-15T10:30:00Z",
"availableLanguages": [
{ "code": "en", "name": "English" }
],
"hasCaptions": true
}
}| Field | Type | Description |
|---|---|---|
| data.platform | string | Identified platform: youtube, tiktok, instagram, or x. |
| data.title | string | Video title or headline. |
| data.description | string | null | Post description or caption text, if available. |
| data.author | string | Channel or account display name. |
| data.authorUsername | string | null | Handle or username without @, if available. |
| data.thumbnailUrl | string | Thumbnail image URL. |
| data.publishedAt | string | null | Publication timestamp in ISO 8601 format. |
| data.durationSeconds | number | Total video duration in seconds. Useful for estimating AI credit usage. |
| data.availableLanguages | array | Caption languages listed in platform metadata. Hint only — an empty list does not mean captions are missing. |
| data.hasCaptions | true | null | true if metadata lists caption languages. null means inconclusive. Call /transcripts to confirm. |
Metadata language hints are not authoritative. To confirm whether captions exist, call POST /transcripts. A definitive "no captions" result is HTTP 404 with body code 404 (and usually includes estimatedCredits for AI fallback).
/transcriptsRetrieves published closed captions from the platform. This is fast and costs 1 credit. It does not perform AI speech recognition.
{
"url": "https://www.youtube.com/watch?v=VIDEO_ID",
"language": "en"
}| Field | Type | Requirement | Description |
|---|---|---|---|
| url | string | Required | Video URL from any supported platform. |
| language | string | Optional | Optional ISO language code (e.g. en, es). If omitted, the default or first available caption track is returned. |
{
"code": 200,
"message": "success",
"data": {
"platform": "youtube",
"language": "en",
"languageName": "English",
"segments": [
{
"id": 0,
"text": "Welcome to the video.",
"startMs": 0,
"endMs": 1200,
"startTimeText": "0:00"
}
],
"availableLanguages": [
{ "code": "en", "name": "English", "isGenerated": false }
]
}
}| Field | Type | Description |
|---|---|---|
| data.platform | string | Source platform identifier. |
| data.language | string | Language code of the returned captions. |
| data.languageName | string | Readable name of the language. |
| data.segments[].text | string | Transcript line content. |
| data.segments[].startMs | number | Start time offset in milliseconds. |
| data.segments[].endMs | number | End time offset in milliseconds. |
| data.segments[].startTimeText | string | Formatted timestamp string (e.g. '0:00'). |
| data.availableLanguages | array | List of other available caption tracks. |
This is the definitive "no captions" signal: HTTP 404 with body code 404. The response includes duration and an AI cost estimate. Do not treat an empty availableLanguages list from /media as proof that captions are missing. A missing video instead returns body code 4007 and does not consume credits.
{
"code": 404,
"message": "This video has no captions.",
"data": {
"platform": "tiktok",
"durationSeconds": 42,
"estimatedCredits": 2,
"availableLanguages": []
}
}Transcribe the spoken audio of any supported video when closed captions are missing or incomplete.
/ai-transcriptsInitiates AI audio transcription. Charged at 2 credits per minute of video duration upon completion.
{
"url": "https://www.tiktok.com/@user/video/7123456789012345678"
}| Field | Type | Requirement | Description |
|---|---|---|---|
| url | string | Required | Video URL from any supported platform. |
Returned when transcription runs asynchronously. Save the id and poll GET /ai-transcripts/:id.
{
"code": 202,
"message": "AI transcription is processing",
"data": {
"id": "job_id_here",
"status": "processing",
"estimatedCredits": 2
}
}Short videos may finish in the same request and return the full transcript payload immediately.
{
"code": 200,
"message": "success",
"data": {
"id": "job_id_here",
"status": "completed",
"platform": "youtube",
"language": "en",
"languageName": "English",
"segments": [
{
"id": 0,
"text": "Here is the spoken audio transcribed by AI.",
"startMs": 0,
"endMs": 2400,
"startTimeText": "0:00"
}
],
"estimatedCredits": 2
}
}/ai-transcripts/:idPolls the status of an asynchronous transcription job. This request is free and is not counted against your hourly rate limit.
{
"code": 200,
"message": "AI transcription is processing",
"data": {
"id": "job_id_here",
"status": "processing",
"estimatedCredits": 2
}
}{
"code": 200,
"message": "success",
"data": {
"id": "job_id_here",
"status": "completed",
"platform": "tiktok",
"language": "en",
"languageName": "English",
"segments": [
{
"id": 0,
"text": "Here is the spoken audio transcribed by AI.",
"startMs": 0,
"endMs": 2400,
"startTimeText": "0:00"
}
],
"estimatedCredits": 2
}
}| Field | Type | Description |
|---|---|---|
| data.id | string | Unique transcription job identifier. |
| data.status | string | Current job status: processing, completed, or failed. |
| data.platform | string | Source platform identifier. |
| data.language | string | Language code of the transcribed audio. |
| data.languageName | string | Readable name of the transcribed language. |
| data.segments | array | Timestamped transcript segments (present when status is completed). |
| data.estimatedCredits | number | Actual credits consumed for this transcription. |
# 1. Try fetching existing captions (1 credit)
curl -X POST https://transcriptly.org/api/v2/transcripts \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{"url":"https://www.youtube.com/watch?v=VIDEO_ID"}'
# 2. Fall back to AI transcription if no captions exist (2 credits/min)
curl -X POST https://transcriptly.org/api/v2/ai-transcripts \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{"url":"https://www.tiktok.com/@user/video/VIDEO_ID"}'
# 3. Poll job status if a job ID was returned (Free, no rate limit impact)
curl https://transcriptly.org/api/v2/ai-transcripts/job_id_here \
-H "X-API-Key: your_api_key_here"const API_KEY = "your_api_key_here"
const VIDEO_URL = "https://www.tiktok.com/@user/video/7123456789012345678"
async function getOrGenerateTranscript(url) {
// Step 1: Check for existing captions (1 credit)
const res = await fetch("https://transcriptly.org/api/v2/transcripts", {
method: "POST",
headers: { "Content-Type": "application/json", "X-API-Key": API_KEY },
body: JSON.stringify({ url }),
})
const json = await res.json()
if (res.ok) {
return json.data.segments
}
// Step 2: If no captions (body code 404), request AI transcription (2 credits/min)
if (res.status === 404 && json.code === 404) {
console.log(`No captions found. Estimated credits: ${json.data.estimatedCredits}`)
const aiRes = await fetch("https://transcriptly.org/api/v2/ai-transcripts", {
method: "POST",
headers: { "Content-Type": "application/json", "X-API-Key": API_KEY },
body: JSON.stringify({ url }),
})
const aiJson = await aiRes.json()
// Completed immediately (synchronous short video)
if (aiRes.ok && aiJson.data.status === "completed") {
return aiJson.data.segments
}
// Processing asynchronously -> poll until ready
if (aiRes.status === 202) {
const jobId = aiJson.data.id
return await pollJob(jobId)
}
}
throw new Error(json.message || "Failed to fetch transcript")
}
async function pollJob(jobId) {
while (true) {
await new Promise((resolve) => setTimeout(resolve, 3000))
const res = await fetch(`https://transcriptly.org/api/v2/ai-transcripts/${jobId}`, {
headers: { "X-API-Key": API_KEY },
})
const json = await res.json()
if (json.data.status === "completed") {
return json.data.segments
}
if (json.data.status === "failed") {
throw new Error("AI transcription failed")
}
}
}import time
import requests
API_KEY = "your_api_key_here"
HEADERS = {"X-API-Key": API_KEY, "Content-Type": "application/json"}
URL = "https://www.tiktok.com/@user/video/7123456789012345678"
# 1. Attempt to fetch pre-existing captions (1 credit)
res = requests.post(
"https://transcriptly.org/api/v2/transcripts",
headers=HEADERS,
json={"url": URL},
)
payload = res.json()
if res.status_code == 200:
segments = payload["data"]["segments"]
print("Found existing captions:", segments)
elif res.status_code == 404 and payload.get("code") == 404:
# 2. No captions available -> fall back to AI transcription (2 credits/min)
ai_res = requests.post(
"https://transcriptly.org/api/v2/ai-transcripts",
headers=HEADERS,
json={"url": URL},
)
job_data = ai_res.json()["data"]
if job_data.get("status") == "completed":
segments = job_data["segments"]
elif ai_res.status_code == 202:
job_id = job_data["id"]
# 3. Poll job status until complete (free, does not consume rate limit)
while True:
time.sleep(3)
poll_res = requests.get(
f"https://transcriptly.org/api/v2/ai-transcripts/{job_id}",
headers={"X-API-Key": API_KEY},
)
poll_data = poll_res.json()["data"]
if poll_data["status"] == "completed":
segments = poll_data["segments"]
break
if poll_data["status"] == "failed":
raise RuntimeError("AI transcription failed")
else:
raise RuntimeError(ai_res.json().get("message", "AI transcription failed"))
print("AI Transcript segments:", segments)
else:
raise RuntimeError(payload.get("message", "Failed to fetch transcript"))All error responses return a standardized JSON envelope with an HTTP status code, an application error code, and a descriptive message.
| HTTP | Body code | Meaning |
|---|---|---|
| 400 | 400 | Invalid JSON body, missing URL, or unable to determine video duration. |
| 400 | 4001 | Unsupported URL or media link contains no playable video. No credits consumed. |
| 401 | 401 | Missing or invalid API key in X-API-Key header. |
| 402 | 4005 | Free plan accounts cannot fetch YouTube captions for videos exceeding 60 minutes. No credits consumed. |
| 403 | 4003 | Insufficient account credits to complete the request. The response includes required credits. |
| 404 | 404 | Video has no closed captions. 1 credit consumed; response includes AI cost estimate. |
| 404 | 4007 | Video was deleted, private, or not found. No credits consumed. |
| 429 | 429 | Hourly rate limit exceeded (120 requests/hour). Inspect Retry-After header. |
| 500 | 5001 | Upstream platform extraction failed. No credits consumed. |