curl -X GET "https://api.submagic.co/v1/languages" \
-H "x-api-key: sk-your-api-key-here"
const response = await fetch("https://api.submagic.co/v1/languages", {
headers: {
"x-api-key": "sk-your-api-key-here",
},
});
const data = await response.json();
console.log(data.languages);
import requests
headers = {
'x-api-key': 'sk-your-api-key-here'
}
response = requests.get('https://api.submagic.co/v1/languages', headers=headers)
data = response.json()
for language in data['languages']:
print(f"{language['name']}: {language['code']}")
{
"languages": [
{
"name": "English",
"code": "en"
},
{
"name": "Spanish",
"code": "es"
},
{
"name": "French",
"code": "fr"
},
{
"name": "German",
"code": "de"
},
{
"name": "Italian",
"code": "it"
},
{
"name": "Portuguese",
"code": "pt"
},
{
"name": "Dutch",
"code": "nl"
},
{
"name": "Russian",
"code": "ru"
},
{
"name": "Chinese (Simplified)",
"code": "zh"
},
{
"name": "Japanese",
"code": "ja"
},
{
"name": "Korean",
"code": "ko"
},
{
"name": "Arabic",
"code": "ar"
},
{
"name": "Hindi",
"code": "hi"
}
]
}
API Reference
Get Languages
Retrieve a list of all supported languages for video transcription
GET
/
v1
/
languages
curl -X GET "https://api.submagic.co/v1/languages" \
-H "x-api-key: sk-your-api-key-here"
const response = await fetch("https://api.submagic.co/v1/languages", {
headers: {
"x-api-key": "sk-your-api-key-here",
},
});
const data = await response.json();
console.log(data.languages);
import requests
headers = {
'x-api-key': 'sk-your-api-key-here'
}
response = requests.get('https://api.submagic.co/v1/languages', headers=headers)
data = response.json()
for language in data['languages']:
print(f"{language['name']}: {language['code']}")
{
"languages": [
{
"name": "English",
"code": "en"
},
{
"name": "Spanish",
"code": "es"
},
{
"name": "French",
"code": "fr"
},
{
"name": "German",
"code": "de"
},
{
"name": "Italian",
"code": "it"
},
{
"name": "Portuguese",
"code": "pt"
},
{
"name": "Dutch",
"code": "nl"
},
{
"name": "Russian",
"code": "ru"
},
{
"name": "Chinese (Simplified)",
"code": "zh"
},
{
"name": "Japanese",
"code": "ja"
},
{
"name": "Korean",
"code": "ko"
},
{
"name": "Arabic",
"code": "ar"
},
{
"name": "Hindi",
"code": "hi"
}
]
}
Get Languages
Retrieve a comprehensive list of all supported languages for video transcription and caption generation. This endpoint returns language codes and names that can be used when creating projects.This endpoint requires authentication and has a rate limit of 100 requests per
minute.
Authentication
string
required
Your Submagic API key starting with
sk-Response
array
curl -X GET "https://api.submagic.co/v1/languages" \
-H "x-api-key: sk-your-api-key-here"
const response = await fetch("https://api.submagic.co/v1/languages", {
headers: {
"x-api-key": "sk-your-api-key-here",
},
});
const data = await response.json();
console.log(data.languages);
import requests
headers = {
'x-api-key': 'sk-your-api-key-here'
}
response = requests.get('https://api.submagic.co/v1/languages', headers=headers)
data = response.json()
for language in data['languages']:
print(f"{language['name']}: {language['code']}")
{
"languages": [
{
"name": "English",
"code": "en"
},
{
"name": "Spanish",
"code": "es"
},
{
"name": "French",
"code": "fr"
},
{
"name": "German",
"code": "de"
},
{
"name": "Italian",
"code": "it"
},
{
"name": "Portuguese",
"code": "pt"
},
{
"name": "Dutch",
"code": "nl"
},
{
"name": "Russian",
"code": "ru"
},
{
"name": "Chinese (Simplified)",
"code": "zh"
},
{
"name": "Japanese",
"code": "ja"
},
{
"name": "Korean",
"code": "ko"
},
{
"name": "Arabic",
"code": "ar"
},
{
"name": "Hindi",
"code": "hi"
}
]
}
Popular Languages
Here are some of the most commonly used language codes:English
Code:
en Most widely supported with highest accuracySpanish
Code:
es Excellent support for Latin American and European SpanishFrench
Code:
fr High accuracy for both European and Canadian FrenchGerman
Code:
de Great support for German language nuancesItalian
Code:
it Optimized for Italian pronunciation patternsPortuguese
Code:
pt Supports both Brazilian and European PortugueseUsing Language Codes
Once you have the language codes, you can use them when creating projects:{
"title": "My Spanish Video",
"language": "es",
"videoUrl": "https://example.com/spanish-video.mp4"
}
Best Practices
Caching Language Data
Since the list of supported languages doesn’t change frequently, consider caching the response:class LanguageCache {
constructor() {
this.cache = null;
this.lastFetch = null;
this.cacheDuration = 24 * 60 * 60 * 1000; // 24 hours
}
async getLanguages() {
const now = Date.now();
if (
this.cache &&
this.lastFetch &&
now - this.lastFetch < this.cacheDuration
) {
return this.cache;
}
const response = await fetch("https://api.submagic.co/v1/languages", {
headers: { "x-api-key": process.env.SUBMAGIC_API_KEY },
});
this.cache = await response.json();
this.lastFetch = now;
return this.cache;
}
}
Building Language Selectors
Create user-friendly language selection interfaces:const buildLanguageSelector = (languages) => {
return languages
.sort((a, b) => a.name.localeCompare(b.name))
.map((lang) => ({
value: lang.code,
label: lang.name,
flag: getFlagEmoji(lang.code), // Helper function for flag emojis
}));
};
Error Responses
object
{
"error": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
object
{
"error": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests",
"retryAfter": 30
}
object
{
"error": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred"
}
The language list is updated periodically as we add support for new languages.
We recommend fetching this list dynamically rather than hard-coding language
options in your application.

