Skip to main content
GET
https://api.scriptbase.app
/
api
/
v1
/
transcript
/
{videoId}
/
translate
curl "https://api.scriptbase.app/api/v1/transcript/dQw4w9WgXcQ/translate?targetLang=es" \
  -H "X-API-Key: sk_your_key_here"
{
  "success": true,
  "data": {
    "videoId": "dQw4w9WgXcQ",
    "targetLanguage": "es",
    "format": "json",
    "segments": [
      {
        "text": "No somos extraños al amor",
        "offset": 0,
        "duration": 2500
      },
      {
        "text": "Conoces las reglas y yo también",
        "offset": 2500,
        "duration": 3000
      }
    ]
  },
  "meta": {
    "creditsUsed": 3,
    "creditsRemaining": 997,
    "rateLimit": {
      "limit": 60,
      "remaining": 59,
      "resetAt": 1704326400
    }
  }
}

Overview

Retrieve a YouTube video’s transcript translated to a different language. Uses YouTube’s built-in translation capabilities when available.

Authentication

X-API-Key
string
required
Your API key

Path Parameters

videoId
string
required
YouTube video ID (11 characters)

Query Parameters

targetLang
string
required
Target language code for translation (ISO 639-1, e.g., ‘es’, ‘fr’, ‘de’, ‘ja’)
format
string
default:"json"
Output format: json or text

Credits

  • Cost: 3 credits per request

Response

success
boolean
Whether the request was successful
data
object
meta
object
curl "https://api.scriptbase.app/api/v1/transcript/dQw4w9WgXcQ/translate?targetLang=es" \
  -H "X-API-Key: sk_your_key_here"
{
  "success": true,
  "data": {
    "videoId": "dQw4w9WgXcQ",
    "targetLanguage": "es",
    "format": "json",
    "segments": [
      {
        "text": "No somos extraños al amor",
        "offset": 0,
        "duration": 2500
      },
      {
        "text": "Conoces las reglas y yo también",
        "offset": 2500,
        "duration": 3000
      }
    ]
  },
  "meta": {
    "creditsUsed": 3,
    "creditsRemaining": 997,
    "rateLimit": {
      "limit": 60,
      "remaining": 59,
      "resetAt": 1704326400
    }
  }
}

Supported Languages

Common language codes:
CodeLanguage
enEnglish
esSpanish
frFrench
deGerman
itItalian
ptPortuguese
jaJapanese
koKorean
zhChinese
arArabic
hiHindi
ruRussian

Error Codes

StatusCodeDescription
400INVALID_INPUTInvalid video ID or target language
401INVALID_API_KEYAPI key is missing or invalid
404TRANSCRIPT_UNAVAILABLETranscript not available in target language
429QUOTA_EXCEEDEDMonthly quota exhausted
429RATE_LIMIT_EXCEEDEDToo many requests
  • Translation availability depends on YouTube’s translation capabilities for the video.
  • Not all videos support translation to all languages.
  • Timestamps are preserved from the original transcript.