apyhub
FILE CONVERSION · SMART GENERATION

Translate Documents API

What it does

Document Translator translates uploaded documents or documents fetched from a URL into a target language you choose. Send a file and a language code, or provide a url and language, and get translated text back along with the target language that was used.

Use the /file endpoint when you already have the document in hand. It accepts a binary file, a target language code such as fr or de, and optional file_type and transliteration query values. Use /url when the document is already hosted elsewhere; it accepts a url, a target language, and optional perform_transliteration, file_type, and transliteration values.

The response includes translation and translated_language as required fields. When language detection is available, you also get detected_language with a language code and confidence score. If transliteration is requested and supported, the response may also include transliteration.

Document Translator fits workflows such as localizing uploaded PDFs, translating reference docs from a public URL, or routing translated content into review and publishing systems without adding manual copy-paste steps.

▣ ENDPOINT 01 / 02
POST
Translate uploaded document
https://api.eu.apyverse.com/apyhub/translate-document-text/file

QUICKSTART

GUIDE

Quickstart

Translate a document file to a target language by uploading the file and the language code.

curl -X POST "https://api.eu.apyverse.com/apyhub/translate-document-text/file" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/document.pdf" \
  -F "language=fr"

What you'll get back

Returns a JSON object with required translation and translated_language string fields. It may also include optional transliteration and detected_language fields.

{
  "translation": "Translated document text.",
  "translated_language": "de"
}
TRY ITLIVE · 150 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
Document file to translate.
Azure target language code (e.g. fr, de).

About this endpoint

What it does

Translates an uploaded document from the file you send in the request body and returns the translated text plus the translated language. It can also return detected language details and transliteration output when present in the response schema.

Query Parameter(s)

AttributeTypeMandatoryDescription
file_typeStringNoDocument file type, e.g. pdf.
transliterationStringNoWhether transliteration is requested, e.g. true.

Request Body

ParameterTypeMandatoryDescription
fileStringYesDocument file to translate. Binary file upload.
languageStringYesAzure target language code, e.g. fr, de.

Response

Returns a JSON object with required translation and translated_language string fields. It may also include transliteration as a string, and detected_language as an object containing score and language.

ParameterTypeMandatoryDescription
translationStringYesTranslated document text.
transliterationStringNoPresent when transliteration was requested and supported.
detected_languageObjectNoDetected language details. Contains score and language when present.
detected_language.scoreNumberNoDetection confidence score as a float.
detected_language.languageStringNoDetected language code, e.g. en.
translated_languageStringYesTranslated language code, e.g. de.

Query parameters

Name
Type
Description
file_typeOPTIONAL
string
transliterationOPTIONAL
string

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 02 / 02
POST
Translate document from URL
https://api.eu.apyverse.com/apyhub/translate-document-text/url

QUICKSTART

GUIDE

Quickstart

Translate a document from a URL into the target language.

curl -X POST "https://api.eu.apyverse.com/apyhub/translate-document-text/url?file_type=pdf" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://assets.apyhub.com/samples/sample.pdf",
    "language": "de"
  }'

What you'll get back

Returns a JSON object with translation and translated_language fields, plus optional transliteration and detected_language data when available.

{
  "translation": "Translated document text.",
  "translated_language": "de"
}
TRY ITLIVE · 150 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*

About this endpoint

What it does

Translates a document fetched from a URL into the requested language. It takes the source document URL and target language in the request body, with optional query parameters that can influence file type handling and transliteration behavior.

Query Parameter(s)

AttributeTypeMandatoryDescription
file_typeStringNoFile type of the document, for example pdf.
transliterationStringNoTransliteration setting, for example true.

Request Body

ParameterTypeMandatoryDescription
urlStringYesSource document URL. Must be a URI.
languageStringYesTarget language code, for example de.
perform_transliterationBooleanNoWhether transliteration should be performed.

Response

Returns a JSON object with required translation and translated_language string fields. It may also include a transliteration string field and a detected_language object with score and language fields.

ParameterTypeMandatoryDescription
translationStringYesTranslated document text.
transliterationStringNoPresent when transliteration was requested and supported.
detected_languageObjectNoDetected source language information. Contains score and language when present.
detected_language.scoreNumberNoConfidence score for the detected language.
detected_language.languageStringNoDetected language code, for example en.
translated_languageStringYesTarget language code, for example de.

Query parameters

Name
Type
Description
file_typeOPTIONAL
string
transliterationOPTIONAL
string

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.