GET
/
v1
/
languages
curl -X GET "https://api.submagic.co/v1/languages" \
  -H "x-api-key: sk-your-api-key-here"
{
  "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

x-api-key
string
required
Your Submagic API key starting with sk-

Response

languages
array
Array of supported language objects
curl -X GET "https://api.submagic.co/v1/languages" \
  -H "x-api-key: sk-your-api-key-here"
{
  "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"
    }
  ]
}
Here are some of the most commonly used language codes:

English

Code: en Most widely supported with highest accuracy

Spanish

Code: es Excellent support for Latin American and European Spanish

French

Code: fr High accuracy for both European and Canadian French

German

Code: de Great support for German language nuances

Italian

Code: it Optimized for Italian pronunciation patterns

Portuguese

Code: pt Supports both Brazilian and European Portuguese

Using 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

401 Unauthorized
object
{
  "error": "UNAUTHORIZED",
  "message": "Invalid or missing API key"
}
429 Rate Limited
object
{
  "error": "RATE_LIMIT_EXCEEDED",
  "message": "Too many requests",
  "retryAfter": 30
}
500 Server Error
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.