---
title: Translate Documents API
slug: translate-documents
url: https://apyhub.com/apyhub/service/translate-documents
provider: ApyHub
categories: [Model Kit, Document Intelligence Kit]
tags: [document-translation, language-detection, transliteration, file-translation, url-translation]
auth: api_key
version: 1.0.0
service_type: sync
endpoints: 2
atoms: 150
mcp: true
alias: text-translator
---

# Translate Documents API

Translate uploaded documents or document URLs into a target language. Returns translated text, the target language, and optional detected language.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/apyhub/translate-documents/file` | What it does Uploads a document file and translates its text into the requested target language. Yo… | 150 |
| POST | `https://api.eu.apyhub.com/apyhub/translate-documents/url` | What it does Translates a document fetched from a URL into the target language you provide, and ret… | 150 |

## Endpoint reference

### Translate uploaded document

`POST https://api.eu.apyhub.com/apyhub/translate-documents/file` · 150 atoms · accepts `multipart/form-data` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `file` | body | string (binary) | yes | Document file to translate. |
| `language` | body | string | yes | Azure target language code (e.g. fr, de). Example: `fr`. |
| `file_type` | query | string | no | Example: `pdf`. |
| `transliteration` | query | string | no | Example: `true`. |

#### Quickstart

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

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/translate-documents/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 `transliteration` as a string, and `detected_language` as an object with `score` and `language`.

```json
{
  "translation": "Translated document text.",
  "translated_language": "de",
  "detected_language": {
    "score": 1,
    "language": "en"
  }
}
```

### Translate document from URL

`POST https://api.eu.apyhub.com/apyhub/translate-documents/url` · 150 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `url` | body | string (uri) | yes | Example: `https://assets.apyhub.com/samples/sample.pdf`. |
| `language` | body | string | yes | Example: `de`. |
| `perform_transliteration` | body | boolean | no | Example: `false`. |
| `file_type` | query | string | no | Example: `pdf`. |
| `transliteration` | query | string | no | Example: `true`. |

#### Quickstart

Translate a document from a file URL into the target language.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/translate-documents/url" \
  -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 required `translation` and `translated_language` string fields. The response may also include `transliteration` and `detected_language`.

```json
{
  "translation": "Translated document text.",
  "translated_language": "de"
}
```

## About

## What it does
Document Translation translates uploaded documents or documents fetched from a URL into a target language. Send a file or a document URL, choose an Azure language code, and get translated text back with the translated language in the response.

Use the `/file` endpoint when you already have the document bytes, or `/url` when the source document is hosted elsewhere. Both endpoints accept a `file_type` query parameter, and the file-based endpoint also accepts `transliteration` in the query string. The URL-based endpoint lets you request transliteration with `perform_transliteration` in the body.

The response includes `translation` and `translated_language`, which are required. When available, it can also return `detected_language` with a score and language code, plus `transliteration` when transliteration is requested and supported. That makes it useful for workflows where you need the translated document text for review, indexing, or downstream language-specific processing.

Use Document Translation when you need to localize uploaded PDFs and other document files, extract translated content from a hosted document, or route content based on detected language without building your own translation pipeline.

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/apyhub/service/translate-documents
