GET
/translate/file
Requires Auth
Translate file from URL (Synchronous)
Translates a file from URL synchronously. Returns HTML page by default or JSON if format=json. Use this for small files (< 10MB). Supports bilingual mode to keep original text alongside translation.
Parameters
file
* required
(query)
string
query
URL of the file to translate (must be publicly accessible)
target
(query)
string
query
Target language code (ISO 639-1). Default: en
format
(query)
string
query
Response format
async
(query)
string
query
Enable asynchronous processing. Use 'true' for large files to avoid timeouts.
bilingual
(query)
string
query
Enable bilingual mode. When true, original text is kept and translation is added below it. Also accepts: keep_original, dual_language, show_original as aliases.
Code Examples
curl -X GET \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
'https://nexus-api.dhurgham.dev/api/file-translation-api/translate/file?file=https%3A%2F%2Fexample.com%2Fdocument.pdf&target=ar&format=html&async=false&bilingual=false'
Request Information
Example cURL Request
curl -X GET \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
'https://nexus-api.dhurgham.dev/api/file-translation-api/translate/file?file=https%3A%2F%2Fexample.com%2Fdocument.pdf&target=ar&format=html&async=false&bilingual=false'
Request Schema
Query Parameters
-
filestring required query - URL of the file to translate (must be publicly accessible)
-
Example:
https://example.com/document.pdf -
targetstring Optional query - Target language code (ISO 639-1). Default: en
-
Default:
en -
Example:
ar -
Allowed values:
en, ar, fr, es, de, zh, ja, ru, pt, it, ko, hi, tr, fa -
formatstring Optional query - Response format
-
Default:
html -
Example:
html -
Allowed values:
html, json -
asyncstring Optional query - Enable asynchronous processing. Use 'true' for large files to avoid timeouts.
-
Default:
false -
Example:
false -
Allowed values:
true, false -
bilingualstring Optional query - Enable bilingual mode. When true, original text is kept and translation is added below it. Also accepts: keep_original, dual_language, show_original as aliases.
-
Default:
false -
Example:
false -
Allowed values:
true, false, keep_original, dual_language, show_original
Responses
200
Success
{
"success": true,
"download_url": "https://nexus-api.dhurgham.dev/api/file-translation-api/dl/abc123",
"message": "Translation completed successfully"
}
Response Schema
-
successboolean -
Example:
1 -
download_urlstring -
Example:
https://nexus-api.dhurgham.dev/api/file-translation-api/dl/abc123 -
messagestring -
Example:
Translation completed successfully
Subscription Plans
Basic
Basic plan
$5,000.00/month
- 1,000 requests/month
- 100 requests/hour
- 20 requests/minute