# Bulk Text Translator (50 Languages, No API Key, Private) (`mrlarryjohnson/offline-text-translator`) Actor

Translate thousands of texts into 50 languages with open-source neural machine translation (Argos Translate / OPUS models) running inside the Actor. No third-party API key, no per-character API bill, texts never leave the run. Translate one text into many languages at once.

- **URL**: https://apify.com/mrlarryjohnson/offline-text-translator.md
- **Developed by:** [Larry Johnson](https://apify.com/mrlarryjohnson) (community)
- **Categories:** AI, Developer tools, Automation
- **Security:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.60 / 1,000 1,000 characters translateds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Bulk Text Translator (50 Languages, No API Key, Private)

Translate thousands of product descriptions, support replies, reviews, UI strings or documents into **50 languages**, and into **several target languages in one run**, at a fraction of the cost of commercial translation APIs.

It runs open-source neural machine translation (**Argos Translate packages of OPUS-MT models**, via CTranslate2) **inside the Actor**. You don't need a Google or DeepL key, and your texts are never sent to a third-party service.

### Highlights

- 50 languages: Arabic, Chinese (simplified and traditional), Dutch, French, German, Hindi, Indonesian, Italian, Japanese, Korean, Polish, Portuguese (PT and BR), Russian, Spanish, Turkish, Ukrainian, Vietnamese and more
- Any-to-any: pairs without a direct model are routed through English (shown as `pivot: "en"`)
- Keeps line breaks and paragraphs; long texts (up to 20k characters) are split by sentence
- One text into many languages per run (`targetLanguages: ["es","de","fr","ja"]`)
- **~$0.60 per million characters**, compared with ~$20/M for typical cloud translation APIs

### Input

| Field | Default | Notes |
|---|---|---|
| `texts` | — | Up to 5,000 texts, 20,000 characters each |
| `sourceLanguage` | `en` | |
| `targetLanguages` | `["es"]` | One or more |
| `beamSize` | `2` | 1–4 (higher is a bit better and slower) |

### Output (one row per text × target language)

```json
{
  "index": 0, "sourceLanguage": "en", "targetLanguage": "es",
  "sourceText": "Hello! Your order has shipped and should arrive on Tuesday.",
  "translatedText": "¡Hola! Su pedido ha enviado y debe llegar el martes.",
  "characters": 59, "billedUnits": 1, "pivot": null, "error": null
}
```

### Pricing (pay per event)

- **$0.0006 per started 1,000 source characters, per target language** (`translated-1k-chars`). That's $0.60 per million characters.
- A 300-character text into 3 languages = 3 units = $0.0018.
- Empty or too-long texts and unavailable pairs are returned free. The Actor stops before going over your run's maximum cost.

### Quality: be realistic

This is good machine translation, suitable for gist, internal use, catalogs, user-generated content and first drafts. For legal, medical or marketing copy, have a human review it. Quality is best for pairs with English and lower for pivoted pairs.

### Credits and licenses

Models: OPUS-MT by Jörg Tiedemann and Santhosh Thottingal, University of Helsinki (CC-BY 4.0), packaged by the Argos Translate project (MIT). Runtime: CTranslate2 (MIT), SentencePiece (Apache-2.0), sacremoses (MIT), subword-nmt (MIT).

***

*Actively maintained. Issues answered within 24 hours on the Issues tab.*

# Actor input Schema

## `texts` (type: `array`):

Texts to translate, one item per text (up to 20,000 characters each, 5,000 texts per run). Line breaks inside a text are preserved.

## `sourceLanguage` (type: `string`):

Language the texts are written in.

## `targetLanguages` (type: `array`):

One or more languages to translate into. Each text x each target language is a separate result.

## `beamSize` (type: `integer`):

Higher = slightly better wording, slower. 1-4.

## Actor input object example

```json
{
  "texts": [
    "Hello! Your order has shipped and should arrive on Tuesday.",
    "Please reply to this email if you have any questions."
  ],
  "sourceLanguage": "en",
  "targetLanguages": [
    "es",
    "de"
  ],
  "beamSize": 2
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "texts": [
        "Hello! Your order has shipped and should arrive on Tuesday.",
        "Please reply to this email if you have any questions."
    ],
    "targetLanguages": [
        "es",
        "de"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mrlarryjohnson/offline-text-translator").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 = {
    "texts": [
        "Hello! Your order has shipped and should arrive on Tuesday.",
        "Please reply to this email if you have any questions.",
    ],
    "targetLanguages": [
        "es",
        "de",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("mrlarryjohnson/offline-text-translator").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 '{
  "texts": [
    "Hello! Your order has shipped and should arrive on Tuesday.",
    "Please reply to this email if you have any questions."
  ],
  "targetLanguages": [
    "es",
    "de"
  ]
}' |
apify call mrlarryjohnson/offline-text-translator --silent --output-dataset

```

## MCP server setup

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

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/BH9Ed4sxxihU0gy6p/builds/b23MuPYk4kQctJti7/openapi.json
