Welcome to the Translation API service. This API allows you to translate text between multiple languages.
POST /translate
Translate plain text from one language to another.
{
"text": "Hello World",
"from_code": "en",
"to_code": "es"
}
{
"status": "success",
"original_text": "Hello World",
"translated_text": "Hola Mundo",
"from_language": "en",
"to_language": "es"
}
POST /translate_html
Translate HTML content while preserving the structure.
{
"html": "<div><p>Hello World</p></div>",
"from_code": "en",
"to_code": "es"
}
{
"status": "success",
"original_html": "<div><p>Hello World</p></div>",
"translated_html": "<div><p>Hola Mundo</p></div>",
"from_language": "en",
"to_language": "es"
}
GET /languages
Get a list of supported language codes.
{
"supported_languages": [
{"code": "en", "name": "English"},
{"code": "es", "name": "Spanish"},
{"code": "pt", "name": "Portogese"}
]
}
GET /health
Check if the service is running.
{
"status": "healthy"
}
| Code | Language |
|---|---|
| en | English |
| es | Spanish |
| pt | Portogese |
curl -X POST https://translate.codeflamme.com/translate -H 'Content-Type: application/json' -d '{
"text": "I want to hire a developer",
"from_code": "en",
"to_code": "es"
}'
import requests
url = "https://translate.codeflamme.com/translate"
data = {
"text": "Hello World",
"from_code": "en",
"to_code": "es"
}
response = requests.post(url, json=data)
print(response.json())
Currently no rate limits are enforced, but please use the API responsibly.
All error responses will include an "error" field with a description of the issue.
Common HTTP status codes: