Language

Get information about world languages including ISO 639 codes and native names

Overview

This endpoint provides access to world language data based on the ISO 639 standard. You can retrieve a complete list of available language codes or get detailed information about a specific language.

The endpoint returns:

  • ISO 639-2/T 3-letter language codes
  • Full language names in English
  • Native language names
  • Detailed language metadata

Pricing

📊 1 Credit per Request

Each request costs 1 data credit and counts as a billable request.

Endpoint

GET /language
GET /language?lang={language_code}

Query Parameters

ParameterTypeRequiredDescription
langstringNoISO 639-2/T 3-letter language code (e.g., "eng", "spa", "fra"). If not provided, returns a list of all available language codes

Response Format

All Languages (no lang parameter)

{
  "list": ["eng", "spa", "fra", "deu", "ita", "por", "rus", "zho", "jpn", "kor"]
}

Specific Language (with lang parameter)

{
  "code": "eng",
  "name": "English",
  "nativeName": "English"
}

Response Fields

List Response

FieldTypeDescription
liststring[]Array of ISO 639-2/T 3-letter language codes

Detail Response

FieldTypeDescription
codestringISO 639-2/T 3-letter language code
namestringFull language name in English
nativeNamestringLanguage name in the native script

Example Requests

Get All Language Codes

curl -X GET "https://api.boxapi.com/language" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Get Language Details

curl -X GET "https://api.boxapi.com/language?lang=fra" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Usage Examples

JavaScript/Node.js

// Get all language codes
const response = await fetch('https://api.boxapi.com/language', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
});

const data = await response.json();
console.log(`Available languages: ${data.list.length}`);

// Get specific language details
const langResponse = await fetch('https://api.boxapi.com/language?lang=spa', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
});

const langData = await langResponse.json();
console.log(`${langData.name} (${langData.nativeName})`);

Python

import requests

headers = {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
}

# Get all language codes
response = requests.get('https://api.boxapi.com/language', headers=headers)
data = response.json()
print(f"Available languages: {len(data['list'])}")

# Get specific language details
lang_response = requests.get('https://api.boxapi.com/language?lang=deu', headers=headers)
lang_data = lang_response.json()
print(f"{lang_data['name']} ({lang_data['nativeName']})")

PHP

<?php
$apiKey = 'YOUR_API_KEY';

// Get all language codes
$ch = curl_init('https://api.boxapi.com/language');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $apiKey,
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$data = json_decode($response, true);

echo "Available languages: " . count($data['list']) . "\n";

// Get specific language details
$ch = curl_init('https://api.boxapi.com/language?lang=jpn');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $apiKey,
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$langData = json_decode($response, true);

echo "{$langData['name']} ({$langData['nativeName']})\n";
?>

Error Responses

Authentication Error

{
  "error": "Unauthorized"
}

HTTP Status: 401 Unauthorized

Rate Limit Exceeded

{
  "error": "IP blocked",
  "statusCode": 429
}

HTTP Status: 429 Too Many Requests

Internal Server Error

{
  "error": "Internal server error"
}

HTTP Status: 500 Internal Server Error

Rate Limits

The following rate limits apply per IP address:

  • 10,000 requests per minute for successful responses (2xx status codes)
  • 60 requests per minute for client errors (4xx status codes)
  • 60 requests per minute for server errors (5xx status codes)

⚠️ If you exceed these limits, your IP will be temporarily blocked and you'll receive a 429 status code.

Use Cases

The Language API is ideal for:

  • 🌐 Localization systems providing language selection dropdowns
  • 📝 Content management supporting multilingual content
  • 🗂️ Data enrichment adding language metadata to datasets
  • 🔍 Search engines filtering content by language