Text API - Translation, Correction & Processing

Professional text processing API: language detection, translation, grammar correction, summarization, and more.

What can you do?
Smart Translation

AI-powered translation to 50+ languages with context awareness.

Grammar & Spelling

Fix errors automatically while preserving meaning and tone.

Text Processing

Summarize, explain, rephrase — all in one unified API.

99.9 % Uptime
Response
5 req/s
0.001 Credits / request

Available Languages

Get a complete list of supported languages and variants.

POST https://api.yeb.to/v1/text/languages
Parameter Type Req. Description
api_key string yes Authentication key

Request Examples

{
  "api_key": "YOUR_KEY"
}

API Integrations

curl -X POST https://api.yeb.to/v1/text/languages \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_KEY" \
  -d '{}'
$response = Http::withHeaders([
    'X-API-Key' => 'YOUR_KEY'
])->post('https://api.yeb.to/v1/text/languages');

$languages = $response->json()['languages'];
fetch('https://api.yeb.to/v1/text/languages', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': 'YOUR_KEY'
  },
  body: JSON.stringify({})
})
.then(r => r.json())
.then(data => console.log(data.languages));
import requests

response = requests.post(
    'https://api.yeb.to/v1/text/languages',
    headers={'X-API-Key': 'YOUR_KEY'},
    json={}
)
languages = response.json()['languages']

Response Example

{
  "languages": [
    {
      "id": 21,
      "name": "English",
      "code": "en",
      "variants": [
        {
          "id": 1,
          "name": "American English",
          "tone": "regional"
        },
        {
          "id": 2,
          "name": "British English",
          "tone": "regional"
        }
      ]
    },
    {
      "id": 11,
      "name": "Bulgarian",
      "code": "bg",
      "variants": []
    },
    {
      "id": 87,
      "name": "Spanish",
      "code": "es",
      "variants": [
        {
          "id": 5,
          "name": "Castilian Spanish",
          "tone": "regional"
        },
        {
          "id": 6,
          "name": "Latin American Spanish",
          "tone": "regional"
        }
      ]
    }
  ],
  "response_code": 200,
  "response_time_ms": 8
}

Response Codes

CodeDescription
200 SuccessRequest processed OK.
400 Bad RequestInput validation failed.
401 UnauthorizedMissing / wrong API key.
403 ForbiddenKey inactive or not allowed.
429 Rate LimitToo many requests.
500 Server ErrorUnexpected failure.

Fetch Languages

text/languages 0.0010 credits

Parameters

No parameters for this endpoint.

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Language Detection

Automatically identify languages in text with confidence scores.

POST https://api.yeb.to/v1/text/detect-language
Parameter Type Req. Description
api_key string yes Authentication key
text string yes Text to analyze for language detection

Request Examples

{
  "api_key": "YOUR_KEY",
  "text": "Hello world! Bonjour le monde!"
}

API Integrations

curl -X POST https://api.yeb.to/v1/text/detect-language \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_KEY" \
  -d '{"text": "Hello world! Bonjour!"}'
$response = Http::withHeaders([
    'X-API-Key' => 'YOUR_KEY'
])->post('https://api.yeb.to/v1/text/detect-language', [
    'text' => 'Hello world! Bonjour!'
]);

$detections = $response->json()['detections'];
fetch('https://api.yeb.to/v1/text/detect-language', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': 'YOUR_KEY'
  },
  body: JSON.stringify({
    text: 'Hello world! Bonjour!'
  })
})
.then(r => r.json())
.then(data => console.log(data.detections));
import requests

response = requests.post(
    'https://api.yeb.to/v1/text/detect-language',
    headers={'X-API-Key': 'YOUR_KEY'},
    json={'text': 'Hello world! Bonjour!'}
)
detections = response.json()['detections']

Response Example

{
  "detections": [
    {
      "code": "en",
      "confidence": 0.95
    },
    {
      "code": "fr",
      "confidence": 0.92
    }
  ],
  "languages": [
    {
      "id": 21,
      "name": "English",
      "code": "en"
    },
    {
      "id": 26,
      "name": "French",
      "code": "fr"
    }
  ],
  "response_code": 200,
  "response_time_ms": 523
}
{
  "error": "text is required",
  "code": 422,
  "response_code": 422,
  "response_time_ms": 8
}

Response Codes

CodeDescription
200 SuccessRequest processed OK.
400 Bad RequestInput validation failed.
401 UnauthorizedMissing / wrong API key.
403 ForbiddenKey inactive or not allowed.
429 Rate LimitToo many requests.
500 Server ErrorUnexpected failure.

text/detect

text/detect 0.0090 credits

Parameters

No parameters for this endpoint.

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Translate Text

Professional translation with context and variant support.

POST https://api.yeb.to/v1/text/translate
Parameter Type Req. Description
api_key string yes Authentication key
text string yes Text to translate
target_language object yes Target language: {"type":"language|variant", "id":123}
Example: {"type":"language","id":26} for French
Or: {"type":"variant","id":1} for American English
source_languages array opt Array of source language objects for mixed/ambiguous text
Format: [{"type":"language","id":76}, {"type":"language","id":11}]
Helps with: Multilingual text, cognates, technical terms
Example: Russian (76) + Bulgarian (11) mixed text
context string opt Context text (max 100 chars): tone, voice, perspective
Example: "Medical doctor, formal" or "Feminine, casual"

Request Examples

Example 1: Basic translation to language
{
  "api_key": "YOUR_KEY",
  "text": "Hello, how are you?",
  "target_language": {
    "type": "language",
    "id": 26
  }
}
Example 2: Translation to variant with context
{
  "api_key": "YOUR_KEY",
  "text": "The patient has a fever",
  "target_language": {
    "type": "variant",
    "id": 7
  },
  "context": "Medical doctor, formal terminology"
}
Example 3: Multilingual text with source_languages
{
  "api_key": "YOUR_KEY",
  "text": "Привет! Как си? Я хочу кафе.",
  "target_language": {
    "type": "language",
    "id": 21
  },
  "source_languages": [
    {"type": "language", "id": 76},
    {"type": "language", "id": 11}
  ]
}
Example 4: All parameters combined
{
  "api_key": "YOUR_KEY",
  "text": "Hello! Je voudrais annuler mon compte.",
  "target_language": {
    "type": "variant",
    "id": 1
  },
  "source_languages": [
    {"type": "language", "id": 21},
    {"type": "language", "id": 26}
  ],
  "context": "Customer support, polite and professional"
}

API Integrations

curl -X POST https://api.yeb.to/v1/text/translate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_KEY" \
  -d '{
    "text": "Привет! Как си?",
    "target_language": {"type":"language","id":21},
    "source_languages": [
      {"type":"language","id":76},
      {"type":"language","id":11}
    ]
  }'
$response = Http::withHeaders([
    'X-API-Key' => 'YOUR_KEY'
])->post('https://api.yeb.to/v1/text/translate', [
    'text' => 'Hello! Je voudrais aide.',
    'target_language' => [
        'type' => 'language',
        'id' => 21
    ],
    'source_languages' => [
        ['type' => 'language', 'id' => 21],
        ['type' => 'language', 'id' => 26]
    ],
    'context' => 'Customer support, polite'
]);

$translated = $response->json()['translated_text'];
fetch('https://api.yeb.to/v1/text/translate', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': 'YOUR_KEY'
  },
  body: JSON.stringify({
    text: 'Привет! Как си?',
    target_language: {type:'language',id:21},
    source_languages: [
      {type:'language',id:76},
      {type:'language',id:11}
    ],
    context: 'Casual conversation'
  })
})
.then(r => r.json())
.then(data => console.log(data.translated_text));
import requests

response = requests.post(
    'https://api.yeb.to/v1/text/translate',
    headers={'X-API-Key': 'YOUR_KEY'},
    json={
        'text': 'Hello! Bonjour!',
        'target_language': {'type':'language','id':11},
        'source_languages': [
            {'type':'language','id':21},
            {'type':'language','id':26}
        ],
        'context': 'Formal business'
    }
)
translated = response.json()['translated_text']

Response Example

{
  "translated_text": "Bonjour, comment allez-vous?",
  "target_language": {
    "type": "language",
    "id": 26,
    "code": "fr",
    "name": "French",
    "label": "French"
  },
  "response_code": 200,
  "response_time_ms": 842
}
{
  "error": "target_language is required",
  "code": 422,
  "response_code": 422,
  "response_time_ms": 8
}

Response Codes

CodeDescription
200 SuccessRequest processed OK.
400 Bad RequestInput validation failed.
401 UnauthorizedMissing / wrong API key.
403 ForbiddenKey inactive or not allowed.
429 Rate LimitToo many requests.
500 Server ErrorUnexpected failure.
Language ID Reference
Popular Languages:
  • 21 - English (4 variants)
  • 11 - Bulgarian
  • 26 - French (2 variants)
  • 87 - Spanish (2 variants)
  • 30 - German (3 variants)
  • 76 - Russian
  • 73 - Portuguese (2 variants)
Example Variants:
  • 1 - American English
  • 2 - British English
  • 5 - Castilian Spanish
  • 6 - Latin American Spanish
  • 7 - Brazilian Portuguese
  • 8 - European Portuguese

Get all 105 languages: POST /v1/text/languages

Translate

text/translate 0.0200 credits

Parameters

No parameters for this endpoint.

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Rephrase Text

Rewrite text to be clearer and more natural.

POST https://api.yeb.to/v1/text/rephrase
ParameterTypeRequiredDescription
api_key string Yes Authentication key
text string Yes Text to rephrase
context_id int Optional User context preferences

Request Example

{
  "api_key": "YOUR_KEY",
  "text": "The thing that I want to say is that this is really good."
}

Integration

curl -X POST https://api.yeb.to/v1/text/rephrase \
  -H "X-API-Key: YOUR_KEY" \
  -d '{"text":"Your text here"}'
$response = Http::withHeaders(['X-API-Key'=>'YOUR_KEY'])
    ->post('https://api.yeb.to/v1/text/rephrase', ['text'=>'Your text']);
$rephrased = $response->json()['rephrased_text'];
fetch('https://api.yeb.to/v1/text/rephrase',{
  method:'POST',
  headers:{'X-API-Key':'YOUR_KEY'},
  body:JSON.stringify({text:'Your text'})
}).then(r=>r.json());

Response

{
  "rephrased_text": "I want to emphasize that this is excellent.",
  "response_code": 200,
  "response_time_ms": 756
}

Response Codes

CodeDescription
200 SuccessRequest processed OK.
400 Bad RequestInput validation failed.
401 UnauthorizedMissing / wrong API key.
403 ForbiddenKey inactive or not allowed.
429 Rate LimitToo many requests.
500 Server ErrorUnexpected failure.

text-rephrase

text-rephrase 0.0200 credits

Parameters

No parameters for this endpoint.

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Grammar Correction

Fix spelling, grammar, and punctuation errors.

POST https://api.yeb.to/v1/text/correct
ParameterTypeRequiredDescription
api_key string Yes Authentication key
text string Yes Text to correct
context_id int Optional User context preferences

Request Example

{
  "api_key": "YOUR_KEY",
  "text": "Their going too the store tommorow."
}

Integration

curl -X POST https://api.yeb.to/v1/text/correct \
  -H "X-API-Key: YOUR_KEY" \
  -d '{"text":"Their going too the store"}'
$response = Http::withHeaders(['X-API-Key'=>'YOUR_KEY'])
    ->post('https://api.yeb.to/v1/text/correct', ['text'=>'Their going too']);
$corrected = $response->json()['corrected_text'];
fetch('https://api.yeb.to/v1/text/correct',{
  method:'POST',
  headers:{'X-API-Key':'YOUR_KEY'},
  body:JSON.stringify({text:'Their going too'})
}).then(r=>r.json());

Response

{
  "corrected_text": "They're going to the store tomorrow.",
  "response_code": 200,
  "response_time_ms": 634
}

Response Codes

CodeDescription
200 SuccessRequest processed OK.
400 Bad RequestInput validation failed.
401 UnauthorizedMissing / wrong API key.
403 ForbiddenKey inactive or not allowed.
429 Rate LimitToo many requests.
500 Server ErrorUnexpected failure.

text-correct

text-correct 0.0200 credits

Parameters

No parameters for this endpoint.

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Summarize Text

Create concise summaries of long content.

POST https://api.yeb.to/v1/text/summarize
ParameterTypeRequiredDescription
api_key string Yes Authentication key
text string Yes Text to summarize
max_sentences int Optional Max sentences in summary (default: 5)
context_id int Optional User context preferences

Request Example

{
  "api_key": "YOUR_KEY",
  "text": "Long article text here...",
  "max_sentences": 3
}

Integration

curl -X POST https://api.yeb.to/v1/text/summarize \
  -H "X-API-Key: YOUR_KEY" \
  -d '{"text":"Long text...","max_sentences":3}'
$response = Http::withHeaders(['X-API-Key'=>'YOUR_KEY'])
    ->post('https://api.yeb.to/v1/text/summarize', [
        'text'=>'Long text...',
        'max_sentences'=>3
    ]);
$summary = $response->json()['summary_text'];
fetch('https://api.yeb.to/v1/text/summarize',{
  method:'POST',
  headers:{'X-API-Key':'YOUR_KEY'},
  body:JSON.stringify({text:'Long...',max_sentences:3})
}).then(r=>r.json());

Response

{
  "summary_text": "The article discusses three main points. First, it covers historical context. Finally, it provides modern applications.",
  "response_code": 200,
  "response_time_ms": 891
}

Response Codes

CodeDescription
200 SuccessRequest processed OK.
400 Bad RequestInput validation failed.
401 UnauthorizedMissing / wrong API key.
403 ForbiddenKey inactive or not allowed.
429 Rate LimitToo many requests.
500 Server ErrorUnexpected failure.

text-summarize

text-summarize 0.0200 credits

Parameters

No parameters for this endpoint.

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Explain Text

Explain complex text in simple, easy-to-understand terms.

POST https://api.yeb.to/v1/text/explain
ParameterTypeRequiredDescription
api_key string Yes Authentication key
text string Yes Text to explain
explanation_language string Optional Language for explanation: en|de|es|fr|tr|bg (default: bg)
context_id int Optional User context preferences

Request Example

{
  "api_key": "YOUR_KEY",
  "text": "Quantum entanglement is a physical phenomenon...",
  "explanation_language": "en"
}

Integration

curl -X POST https://api.yeb.to/v1/text/explain \
  -H "X-API-Key: YOUR_KEY" \
  -d '{"text":"Complex text...","explanation_language":"en"}'
$response = Http::withHeaders(['X-API-Key'=>'YOUR_KEY'])
    ->post('https://api.yeb.to/v1/text/explain', [
        'text'=>'Complex text...',
        'explanation_language'=>'en'
    ]);
$explanation = $response->json()['explanation_text'];
fetch('https://api.yeb.to/v1/text/explain',{
  method:'POST',
  headers:{'X-API-Key':'YOUR_KEY'},
  body:JSON.stringify({text:'Complex...',explanation_language:'en'})
}).then(r=>r.json());

Response

{
  "explanation_text": "Quantum entanglement is when two particles become connected. When you measure one particle, it instantly affects the other...",
  "response_code": 200,
  "response_time_ms": 1023
}

Response Codes

CodeDescription
200 SuccessRequest processed OK.
400 Bad RequestInput validation failed.
401 UnauthorizedMissing / wrong API key.
403 ForbiddenKey inactive or not allowed.
429 Rate LimitToo many requests.
500 Server ErrorUnexpected failure.

Explain

text/explain 0.0200 credits

Parameters

No parameters for this endpoint.

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Grammar Correction

Fix spelling, grammar, and punctuation errors.

POST https://api.yeb.to/v1/text/correct
ParameterTypeRequiredDescription
api_key string Yes Authentication key
text string Yes Text to correct
context_id int Optional User context preferences

Request Example

{
  "api_key": "YOUR_KEY",
  "text": "Their going too the store tommorow."
}

Integration

curl -X POST https://api.yeb.to/v1/text/correct \
  -H "X-API-Key: YOUR_KEY" \
  -d '{"text":"Their going too the store"}'
$response = Http::withHeaders(['X-API-Key'=>'YOUR_KEY'])
    ->post('https://api.yeb.to/v1/text/correct', ['text'=>'Their going too']);
$corrected = $response->json()['corrected_text'];
fetch('https://api.yeb.to/v1/text/correct',{
  method:'POST',
  headers:{'X-API-Key':'YOUR_KEY'},
  body:JSON.stringify({text:'Their going too'})
}).then(r=>r.json());

Response

{
  "corrected_text": "They're going to the store tomorrow.",
  "response_code": 200,
  "response_time_ms": 634
}

Response Codes

CodeDescription
200 SuccessRequest processed OK.
400 Bad RequestInput validation failed.
401 UnauthorizedMissing / wrong API key.
403 ForbiddenKey inactive or not allowed.
429 Rate LimitToo many requests.
500 Server ErrorUnexpected failure.

Correct

text/correct 0.0200 credits

Parameters

No parameters for this endpoint.

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Summarize Text

Create concise summaries of long content.

POST https://api.yeb.to/v1/text/summarize
ParameterTypeRequiredDescription
api_key string Yes Authentication key
text string Yes Text to summarize
max_sentences int Optional Max sentences in summary (default: 5)
context_id int Optional User context preferences

Request Example

{
  "api_key": "YOUR_KEY",
  "text": "Long article text here...",
  "max_sentences": 3
}

Integration

curl -X POST https://api.yeb.to/v1/text/summarize \
  -H "X-API-Key: YOUR_KEY" \
  -d '{"text":"Long text...","max_sentences":3}'
$response = Http::withHeaders(['X-API-Key'=>'YOUR_KEY'])
    ->post('https://api.yeb.to/v1/text/summarize', [
        'text'=>'Long text...',
        'max_sentences'=>3
    ]);
$summary = $response->json()['summary_text'];
fetch('https://api.yeb.to/v1/text/summarize',{
  method:'POST',
  headers:{'X-API-Key':'YOUR_KEY'},
  body:JSON.stringify({text:'Long...',max_sentences:3})
}).then(r=>r.json());

Response

{
  "summary_text": "The article discusses three main points. First, it covers historical context. Finally, it provides modern applications.",
  "response_code": 200,
  "response_time_ms": 891
}

Response Codes

CodeDescription
200 SuccessRequest processed OK.
400 Bad RequestInput validation failed.
401 UnauthorizedMissing / wrong API key.
403 ForbiddenKey inactive or not allowed.
429 Rate LimitToo many requests.
500 Server ErrorUnexpected failure.

Summarize

text/summarize 0.0200 credits

Parameters

No parameters for this endpoint.

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Explain Text

Explain complex text in simple, easy-to-understand terms.

POST https://api.yeb.to/v1/text/explain
ParameterTypeRequiredDescription
api_key string Yes Authentication key
text string Yes Text to explain
explanation_language string Optional Language for explanation: en|de|es|fr|tr|bg (default: bg)
context_id int Optional User context preferences

Request Example

{
  "api_key": "YOUR_KEY",
  "text": "Quantum entanglement is a physical phenomenon...",
  "explanation_language": "en"
}

Integration

curl -X POST https://api.yeb.to/v1/text/explain \
  -H "X-API-Key: YOUR_KEY" \
  -d '{"text":"Complex text...","explanation_language":"en"}'
$response = Http::withHeaders(['X-API-Key'=>'YOUR_KEY'])
    ->post('https://api.yeb.to/v1/text/explain', [
        'text'=>'Complex text...',
        'explanation_language'=>'en'
    ]);
$explanation = $response->json()['explanation_text'];
fetch('https://api.yeb.to/v1/text/explain',{
  method:'POST',
  headers:{'X-API-Key':'YOUR_KEY'},
  body:JSON.stringify({text:'Complex...',explanation_language:'en'})
}).then(r=>r.json());

Response

{
  "explanation_text": "Quantum entanglement is when two particles become connected. When you measure one particle, it instantly affects the other...",
  "response_code": 200,
  "response_time_ms": 1023
}

Response Codes

CodeDescription
200 SuccessRequest processed OK.
400 Bad RequestInput validation failed.
401 UnauthorizedMissing / wrong API key.
403 ForbiddenKey inactive or not allowed.
429 Rate LimitToo many requests.
500 Server ErrorUnexpected failure.

Explain

text/explain 0.0200 credits

Parameters

No parameters for this endpoint.

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Text API - Translation, Correction & Processing — Practical Guide

A comprehensive guide to the Text API: language detection, professional translation, grammar correction, text summarization, explanation, and rephrasing. Learn which endpoint to use when, how parameters work in practice, and how to build AI-powered text processing into your apps.

#What Text API solves

The Text API provides 7 specialized endpoints for professional text processing: detect languages automatically, translate with context awareness, fix grammar and spelling, rephrase for clarity, summarize long content, and explain complex text in simple terms. Perfect for multilingual apps, content platforms, customer support, and educational tools. All powered by config-based languages with zero database dependencies.

#Available endpoints

#POST /v1/text/languages

  • Best for: Getting the complete list of 105 supported languages and their variants
  • Source: Static config file (fast, no database)
  • Use case: Populate language dropdowns, validate language IDs before translation

#POST /v1/text/detect-language

  • Best for: Automatically identifying the language(s) in user-submitted text
  • Returns: Language codes with confidence scores (0-1)
  • Use case: Auto-routing support tickets, content moderation, multilingual search indexing

#POST /v1/text/translate

  • Best for: Professional translation with context preservation
  • Supports: 105 languages, 23 regional variants (American English, Brazilian Portuguese, etc.)
  • Context: Simple text parameter (max 100 chars) for tone/style preferences
  • Use case: E-commerce localization, multilingual customer communication, content publishing

#POST /v1/text/rephrase

  • Best for: Rewriting text to be clearer, more natural, or more concise
  • Keeps: Same language, same meaning, improved readability
  • Context support: Apply custom voice/tone (masculine, feminine, formal, casual)
  • Use case: Content optimization, email polish, documentation improvement

#POST /v1/text/correct

  • Best for: Fixing grammar, spelling, and punctuation errors
  • Preserves: Original meaning and voice, corrects only mistakes
  • Context support: Maintain specific style/voice during correction
  • Use case: User-generated content cleanup, automated proofreading, form validation

#POST /v1/text/summarize

  • Best for: Creating concise summaries of long documents or articles
  • Control: Set max_sentences (default: 5) for summary length
  • Context support: Summary style/audience preferences
  • Use case: News digests, document previews, meeting notes, research abstracts

#POST /v1/text/explain

  • Best for: Explaining complex text in simple, easy-to-understand terms
  • Languages: Explain in EN, DE, ES, FR, TR, or BG (default: BG)
  • Context support: Audience level (for children, academic, etc.)
  • Use case: Educational platforms, customer FAQs, technical documentation simplified

#Quick start

# Get all 105 languages
curl -X POST "https://api.yeb.to/v1/text/languages" \
  -H "X-API-Key: YOUR_KEY"
# Translate to French (language ID 26)
curl -X POST "https://api.yeb.to/v1/text/translate" \
  -H "X-API-Key: YOUR_KEY" \
  -d '{
    "text": "Hello, how are you?",
    "target_language": {"type":"language","id":26}
  }'
# Translate with context
curl -X POST "https://api.yeb.to/v1/text/translate" \
  -H "X-API-Key: YOUR_KEY" \
  -d '{
    "text": "The patient has a fever",
    "target_language": {"type":"language","id":26},
    "context": "Medical doctor, formal terminology"
  }'

#Key parameters explained

ParamUsed inWhat to passWhy it matters
api_key All Via header (X-API-Key) or body param Authentication & rate limiting
text All except languages Text to process (string) Primary content for operation
target_language translate {"type":"language|variant","id":123} Specifies translation target and tone
source_languages translate Array: [{"type":"language","id":76}] Hint for multilingual/ambiguous source text
context All text operations Simple text (max 100 chars) Apply custom preferences (tone, voice, style, audience)
max_sentences summarize Integer (default: 5) Control summary length
explanation_language explain en|de|es|fr|tr|bg (default: bg) Language for simplified explanation

#Understanding Languages & Variants

The API supports 105 languages with 23 regional/tonal variants:

  • Language ID 21 (English) → Variants: American (ID 1), British (ID 2), Australian (ID 3), Canadian (ID 4)
  • Language ID 87 (Spanish) → Variants: Castilian (ID 5), Latin American (ID 6)
  • Language ID 73 (Portuguese) → Variants: Brazilian (ID 7), European (ID 8)
  • Language ID 26 (French) → Variants: Metropolitan (ID 9), Canadian (ID 10)
  • Language ID 30 (German) → Variants: Standard (ID 11), Swiss (ID 12), Austrian (ID 13)

Fetch the complete list with /v1/text/languages. All language/variant IDs are documented and stable.

#Using context parameter

The context parameter accepts simple text (max 100 chars) to guide the AI:

  • Voice/Gender: "Masculine", "Feminine", "Neutral gender"
  • Tone: "Formal business", "Casual friendly", "Technical documentation"
  • Perspective: "Doctor's point of view", "Patient-friendly language"
  • Industry: "Legal terminology", "Medical context", "Software development"
  • Audience: "For children under 10", "Academic audience", "B2B executives"
{
  "text": "The patient presents with fever",
  "target_language": {"type":"language","id":26},
  "context": "Medical doctor, formal terminology"
}

#Reading & handling responses

#Success responses

// Translation to language
{
  "translated_text": "Bonjour, comment allez-vous?",
  "target_language": {
    "type": "language",
    "id": 26,
    "code": "fr",
    "name": "French",
    "label": "French"
  },
  "response_code": 200,
  "response_time_ms": 842
}
// Translation to variant (British English)
{
  "translated_text": "Good morning, how are you today?",
  "target_language": {
    "type": "variant",
    "id": 2,
    "code": "en",
    "name": "English",
    "label": "English – British English",
    "tone": "regional",
    "variant_id": 2
  },
  "response_code": 200,
  "response_time_ms": 765
}
// Language detection
{
  "detections": [
    {"code": "en", "confidence": 0.95},
    {"code": "fr", "confidence": 0.92}
  ],
  "languages": [
    {"id": 21, "name": "English", "code": "en"},
    {"id": 26, "name": "French", "code": "fr"}
  ],
  "response_code": 200,
  "response_time_ms": 523
}

#Error responses

{ "error": "text is required", "code": 422, "response_code": 422 }
{ "error": "Invalid API key", "code": 401, "response_code": 401 }
  • 401: Invalid or missing API key
  • 422: Missing required parameters or invalid format
  • 429: Rate limit exceeded (10 req/s)
  • 402: Insufficient credits
  • 500: Server error (retry with exponential backoff)

#Real-world use cases

#E-commerce localization

Challenge: Translate product descriptions to 10+ languages
Solution: Use translate with variants for regional preferences

// Translate to Brazilian Portuguese (variant ID 7)
POST /v1/text/translate
{
  "text": "Premium leather wallet with RFID protection",
  "target_language": {"type":"variant","id":7},
  "context": "E-commerce product, professional tone"
}

#Customer support automation

Challenge: Handle multilingual support tickets
Solution: detect-languagetranslate with source_languages

// 1. Detect languages in ticket
POST /v1/text/detect-language {"text":"Hello! Je voudrais aide..."}
// Returns: languages [21, 26]

// 2. Translate with source hint
POST /v1/text/translate {
  "text":"Hello! Je voudrais aide avec mon compte.",
  "target_language":{"type":"language","id":21},
  "source_languages":[
    {"type":"language","id":21},
    {"type":"language","id":26}
  ],
  "context":"Customer support, polite"
}

// 3. Summarize for quick triage
POST /v1/text/summarize {
  "text":"...",
  "max_sentences":2,
  "context":"Support ticket summary, highlight urgency"
}

#Content platform with voice preferences

Challenge: User-generated content needs correction while maintaining voice
Solution: Use context to preserve gender/tone

// Correct while maintaining feminine voice
POST /v1/text/correct {
  "text":"Their going too the store",
  "context":"Feminine voice, casual tone"
}
// → "She's going to the store"

// Rephrase with masculine, formal context
POST /v1/text/rephrase {
  "text":"I wanna say that...",
  "context":"Masculine, formal business communication"
}
// → "I would like to state that..."

#Best practices

  1. Cache language lists: /languages returns config data — cache for 24h or longer
  2. Use language IDs consistently: Document which IDs your app uses (e.g., English=21, Spanish=87)
  3. Leverage variants: Use American English (ID 1) vs British (ID 2) for regional accuracy
  4. Keep contexts concise: 100 char limit — focus on key preferences like "Formal medical" not "The user wants..."
  5. Combine operations: detect → translate → correct for multilingual content pipelines
  6. Handle rate limits: Implement exponential backoff for 429 responses
  7. Monitor response times: Use response_time_ms to track API performance

#Technical architecture

Text API uses a config-based architecture with zero database dependencies:

  • Languages: Static config file with 105 languages + 23 variants
  • Contexts: Simple text parameters (no database storage)
  • Logging: Handled by ApiBase (existing api_requests tables)
  • Performance: ~5-10ms for /languages, no database queries for language lookups

#API Changelog

2025-01-09
v1.0 Launch: Complete rebranding from Popnie API to Text API. New RESTful structure with dedicated endpoints. Config-based languages (105 languages, 23 variants). Simple context system (max 100 chars). Zero database dependencies for languages and contexts. Improved language variant system with regional/tonal support.

Frequently Asked Questions

We support 50+ languages for translation, with language detection working for all major world languages including Cyrillic, Latin, Asian, and Middle Eastern scripts.

Our AI-powered translation maintains context and nuance, achieving professional-grade quality. For critical documents, we recommend human review.

Contexts let you define preferences like tone (formal/casual), industry terminology, and style guides that apply to all your text processing requests.

Yes! We preserve paragraphs, line breaks, and list structures. Complex formatting like tables may require special handling.

Yes. Every request, even those resulting in errors, consumes credits. This is because your credits are tied to the number of requests, regardless of success or failure. If the error is clearly due to a platform problem on our end, we will restore the affected credits (no cash refunds).

Contact us at [email protected]. We take feedback seriously—if your bug report or feature request is meaningful, we can fix or improve the API quickly and grant you 50 free credits as a thank you.

It depends on the API and sometimes even on the endpoint. Some endpoints use data from external sources, which may have stricter limits. We also enforce limits to prevent abuse and keep our platform stable. Check the docs for the specific rate limit for each endpoint.

We operate on a credit system. Credits are prepaid, non-refundable units you spend on API calls and tools. Credits are consumed FIFO (oldest first) and are valid for 12 months from the purchase date. The dashboard shows each purchase date and its expiry.

Yes. All purchased credits (including fractional balances) are valid for 12 months from purchase. Unused credits automatically expire and are permanently deleted at the end of the validity period. Expired credits cannot be restored or converted to cash or other value. Transitional rule: credits bought before 22 Sep 2025 are treated as purchased on 22 Sep 2025 and expire on 22 Sep 2026 (unless an earlier expiry was stated at purchase).

Yes—within their validity window. Unused credits remain available and roll over month-to-month until they expire 12 months after purchase.

Credits are non-refundable. Only buy what you need—you can always top up later. If a platform-side error causes a failed charge, we may restore the affected credits after investigation. No cash refunds.

Prices are set in credits, not dollars. Each endpoint lists its own cost—see the “Credits / request” badge above. You’ll always know exactly what you’re spending.
← Back to APIs