# DeepL (AI translation) Actor (`tkapler/deepl-actor`) Actor

Receive high-quality translations from/to 24 languages using the DeepL API. It uses a proprietary algorithm with convolutional neural networks (CNNs) and translate far better than e.g. Google Translate. Free Tier is available.

- **URL**: https://apify.com/tkapler/deepl-actor.md
- **Developed by:** [Tomas Kapler](https://apify.com/tkapler) (community)
- **Categories:** Automation, Developer tools, Open source
- **Stats:** 29 total users, 0 monthly users, 0.0% runs succeeded, 4 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## DeepL (AI translation) Actor

Receive high-quality translations from/to 24 languages using the [DeepL](https://www.deepl.com).

This Apify Actor use [DeepL API](https://www.deepl.com/docs-api/introduction/)
to provide you high-quality translations based on advanced ML.

\*You must have the DeepL Authentication Key.
You can [Sign up for free](https://www.deepl.com/pro-api?cta=header-pro)
and recieve free credit for 500,000 characters limit a month.
The key you will then find in your [Account Summary page](https://www.deepl.com/pro-account/summary)

### Input properties

There are 3 key input properties

- auth\_key - Authentication Key (see above)
- text - text to be translated
- target language - one of 24 languages + 2 variants

Details about the other properties you can find under the (?) help icon, in INPUT\_SCHEMA.json and
in [DeepL API Docs request section](https://www.deepl.com/docs-api/translating-text/request/).

# Actor input Schema

## `auth_key` (type: `string`):

Authentication Key for DeepL API. You can find it here https://www.deepl.com/pro-account/summary

## `text` (type: `string`):

Text you want to translate

## `target_lang` (type: `string`):

The language (and variant) into which the text should be translated

## `source_lang` (type: `string`):

Language of the text to be translated. Default is automatic detection.

## `split_sentences` (type: `string`):

Sets whether the translation engine should first split the input into sentences. This is enabled by default.<br />For applications that send one sentence per text parameter, it is advisable to set split\_sentences=0, in order to prevent the engine from splitting the sentence unintentionally.

## `preserve_formatting` (type: `string`):

Sets whether the translation engine should respect the original formatting, even if it would usually correct some aspects. <br />The formatting aspects affected by this setting include:<br />-Punctuation at the beginning and end of the sentence<br />-Upper/lower case at the beginning of the sentence

## `formality` (type: `string`):

Sets whether the translated text should lean towards formal or informal language. This feature currently only works for target languages 'DE' (German), 'FR' (French), 'IT' (Italian), 'ES' (Spanish), 'NL' (Dutch), 'PL' (Polish), 'PT-PT', 'PT-BR' (Portuguese) and 'RU' (Russian).

## `glossary_id` (type: `string`):

Specify the glossary to use for the translation. Important: This requires the source\_lang parameter to be set and the language pair of the glossary has to match the language pair of the request.

## Actor input object example

```json
{
  "target_lang": "EN-GB",
  "source_lang": "",
  "split_sentences": "1",
  "preserve_formatting": "0",
  "formality": "default"
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("tkapler/deepl-actor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("tkapler/deepl-actor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call tkapler/deepl-actor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tkapler/deepl-actor"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/1uZpa1bl5QIbPrPPe/builds/iyx174N0OXkPhjUMV/openapi.json
