Translate Text
Translate text from a source language to a target language. Supports 100+ languages with high accuracy and fast response times.
Endpoint
POST /v2/translateRequest Parameters
Body Parameters
text string (required)
: The text to translate (1-5000 characters)
source string (required)
: Source language code (e.g., "en", "fr") or "auto" for auto-detection
target string (required)
: Target language code (e.g., "en", "fr")
Headers
X-API-KEY string (required)
: Your API key for authentication
Content-Type string (required)
: Must be application/json
Example Request
curl https://api.translateplus.io/v2/translate \
-H "X-API-KEY: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"text": "My client speaks only French. Will you translate for me?",
"source": "en",
"target": "fr"
}'Response
Success Response (200 OK)
{
"translations": {
"text": "My client speaks only French. Will you translate for me?",
"translation": "Mon client ne parle que le français. Voulez-vous traduire pour moi ?",
"source": "en",
"target": "fr"
},
"details": {}
}Response Fields
| Field | Type | Description |
|---|---|---|
translations | object | Translation result object |
translations.text | string | Original text that was translated |
translations.translation | string | The translated text |
translations.source | string | Source language code |
translations.target | string | Target language code |
details | object | Additional details (may be empty) |
Error Responses
400 Bad Request
Invalid request parameters:
{
"detail": "Invalid language code 'xx'. Supported codes: en, fr, es..."
}402 Payment Required
Insufficient credits:
{
"detail": "Insufficient credits. You have 0 credit(s) remaining, but this request requires 1 credit(s). Please upgrade your plan to continue using the API."
}403 Forbidden
Invalid or missing API key:
{
"detail": "API key is required. Please provide X-API-KEY header."
}429 Too Many Requests
Rate limit exceeded:
{
"detail": "Rate limit exceeded. You have made 60 requests. Maximum allowed: 60 requests per minute. Please try again after 45 seconds."
}Credits
This endpoint requires 1 credit per request.