# Bulk Text Translator – Translate CSV, Datasets & Texts Offline (`gazidev/bulk-text-translator`) Actor

Translate texts, CSV columns and Apify dataset fields between English, German, French and Spanish with open OPUS-MT models run offline (no Google, no API key, no LLM). Auto language detection; other fields kept. $1.20 per million characters.

- **URL**: https://apify.com/gazidev/bulk-text-translator.md
- **Developed by:** [Cemal Atakli](https://apify.com/gazidev) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 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 – Translate CSV, Datasets & Texts Offline

Translate thousands of **reviews, product titles, job ads or any text column** between **English, German, French and Spanish** in one run, for **$1.20 per million characters**. Paste texts, point it at an Apify dataset (for example the output of a review or product scraper), a CSV file or a JSON list, and get every row back with a new translated field next to the original.

Translation runs **offline inside the Actor** with the open **OPUS-MT** neural models from the University of Helsinki (Marian transformer, run with CTranslate2 int8). There is **no Google Translate scraping, no DeepL/Google API key and no LLM**: your text is not sent to any third-party service, results are the same every time, and the price does not depend on anyone else's API.

### What this listing does that our other Actors do not

- [Bulk AI Dataset Enricher](https://apify.com/gazidev/bulk-ai-dataset-enricher) can translate into *any* language with an LLM, but you pay the LLM tokens too and it is slower. This Actor is a **fixed, very cheap, deterministic** machine-translation step for the four languages above, with no API key.
- [Dataset Filter & Transform](https://apify.com/gazidev/dataset-filter-transform) and [JSON to CSV Converter](https://apify.com/gazidev/json-to-csv-converter) reshape and export rows; run them after this Actor to filter or export the translated dataset.

### Use cases

- **Translate scraped reviews** (Amazon, Trustpilot, Google Maps, App Store) into English before sentiment analysis or reporting.
- **Localise product catalogues:** product titles and descriptions from a Shopify/WooCommerce scrape into German, French or Spanish.
- **Job ads and listings:** read German, French and Spanish job posts or real-estate listings in English.
- **Pipelines:** call it from an Apify integration/webhook with `{{resource.defaultDatasetId}}` so every scraper run is translated automatically.

### Supported languages (honest list)

| | → English | → German | → French | → Spanish |
|---|---|---|---|---|
| **English** | – | direct | direct | direct |
| **German** | direct | – | via English | via English |
| **French** | direct | via English | – | via English |
| **Spanish** | direct | via English | via English | – |

- 6 direct models are built into the Actor: en↔de, en↔fr, en↔es. German/French/Spanish to each other are translated **through English** (two models), which loses a little quality.
- Other languages (Italian, Portuguese, Dutch, Turkish, Chinese...) are **not supported** in this version. Texts detected in another language are returned with `status: "unsupported_language"` and are **not charged**.
- Texts already in the target language are copied unchanged and **not charged**.

### Input

| Field | Default | Notes |
|---|---|---|
| `texts` | 8 sample texts (reviews, job ads, a listing) | One text per line. Ignored automatically if it is still the sample and you also give a dataset, CSV or items. |
| `targetLanguage` | `en` | `en`, `de`, `fr` or `es`. |
| `sourceLanguage` | `auto` | Auto-detect per text, or force `en`/`de`/`fr`/`es`. |
| `datasetId` | – | An Apify dataset to translate. All fields are kept. |
| `csvUrls` | – | Public CSV/TSV URLs with a header row (Google Sheets, Drive, Dropbox links work). Max 50 MB each. |
| `items` | – | JSON array of objects. |
| `fields` | – | Fields / columns to translate (required with a dataset, CSV or items). |
| `outputFieldSuffix` | `_<target>` | Translation goes into e.g. `title_en`. |
| `overwrite` | `false` | Replace the original field instead. |
| `maxItems` | `0` (no limit) | Cap on texts/rows. |
| `beamSize` | `2` | 1 = fastest, 4 = slightly better wording. Same price. |

#### Example: translate a review dataset into English

```json
{ "datasetId": "YOUR_DATASET_ID", "fields": ["title", "reviewText"], "targetLanguage": "en" }
```

### Output

Texts mode, one row per text:

```json
{
  "text": "La calidad es excelente, pero el envío tardó dos semanas en llegar.",
  "translation": "The quality is excellent, but the shipment took two weeks to arrive.",
  "sourceLanguage": "es",
  "languageConfidence": 1.0,
  "targetLanguage": "en",
  "route": "es>en",
  "characters": 67,
  "status": "translated",
  "error": null
}
```

Dataset / CSV / JSON mode: your record with all its fields, plus `<field>_<target>`, `translationStatus` (`translated`, `partial`, `unchanged`, `not_translated`), `translatedCharacters` and `translationDetails` (status and detected language per field).

The run summary (characters, languages found, free rows) is saved as `OUTPUT` in the key-value store.

### Pricing

Pay per event: **`characters-1k` = $0.0012 per 1,000 source characters** (= $1.20 per million), plus a tiny Actor start fee. Characters are **summed over the whole run** and rounded up once at the end, so 1,000 short product titles of 50 characters cost 50 × $0.0012 = **$0.06**, not 1,000 × $0.0012. Only translated text is counted; empty values, texts already in the target language, unsupported languages and errors are free.

| Service | Price per 1 million characters | Notes |
|---|---|---|
| **This Actor** | **$1.20** | offline OPUS-MT, 4 languages |
| Google Cloud Translation API | $20 | API key, 100+ languages |
| DeepL API Pro | $25 + monthly fee | API key, best quality |
| Google Translate scraper Actors | $0.015 per item ≈ $150+ for short texts | scrape the free web UI |

### Quality and limits (please read)

- OPUS-MT is a solid, **mid-size neural MT model** trained on public parallel corpora (OPUS). It is good for reviews, product data, support messages and job ads, and clearly **below DeepL or Google for marketing copy, idioms and slang**. Do not use it for legal or medical documents without a human check.
- Long texts are split into sentences and translated sentence by sentence (line breaks are kept), so very long sentences without punctuation are cut into chunks.
- Language detection (py3langid) can be wrong on very short texts (one or two words). Set `sourceLanguage` if all your texts are in one language.
- Names, brands and HTML are not specially protected; send plain text.
- One value can be up to 50,000 characters; longer values are skipped for free.

### Use with AI agents (Apify MCP)

Add the Actor to your agent through the [Apify MCP server](https://mcp.apify.com) as `gazidev/bulk-text-translator`. The `items` + `fields` input lets an agent translate a JSON list in one call and read the translated rows back. It is cheaper and more predictable than asking the LLM itself to translate thousands of rows.

### FAQ

**Is my text sent to Google, DeepL or OpenAI?** No. The models run inside the Actor container; the only network access is reading your dataset or CSV.

**Why only four languages?** Each language pair is a separate model; we bundle the most-requested pairs to keep runs fast and cheap. Tell us in the Issues tab which pair you need next.

**Can it translate HTML or Markdown?** It treats everything as plain text. Tags usually survive but are not guaranteed.

**Will my other fields be kept?** Yes. Every field of every record is passed through; only new translated fields are added (or the original is replaced with `overwrite`).

### Model licence and attribution

Translation models: **OPUS-MT** by Jörg Tiedemann and the Language Technology Research Group, University of Helsinki ([Helsinki-NLP/Opus-MT](https://github.com/Helsinki-NLP/Opus-MT)), trained on [OPUS](https://opus.nlpl.eu) data. Used checkpoints: `Helsinki-NLP/opus-mt-en-de` (CC-BY 4.0), `opus-mt-de-en`, `opus-mt-en-fr`, `opus-mt-fr-en`, `opus-mt-en-es`, `opus-mt-es-en` (Apache-2.0 on their Hugging Face model cards; the original OPUS-MT releases are CC-BY 4.0). Change made: converted to CTranslate2 format with int8 weight quantization; the pinned revisions are listed in `/opt/opus-mt/NOTICE.json` inside the image. Citation: Tiedemann & Thottingal (2020), *OPUS-MT – Building open translation services for the World*, EAMT 2020. Runtime: [CTranslate2](https://github.com/OpenNMT/CTranslate2) (MIT), SentencePiece (Apache-2.0), py3langid (BSD-3-Clause).

# Actor input Schema

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

One text per line (reviews, product titles, job ads, messages...). Line breaks inside a text are kept when you pass texts through the API. The sample texts are ignored automatically when you also give a dataset, CSV or JSON items.

## `targetLanguage` (type: `string`):

Target language. Supported: English, German, French, Spanish (all 12 directions; German/French/Spanish to each other go through English).

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

Auto-detect per text (default) or force one language. Texts already in the target language are copied unchanged and not charged; texts detected in an unsupported language are skipped for free.

## `datasetId` (type: `string`):

Optional: an Apify dataset (e.g. the output of a review or product scraper). Every item is kept with all its fields; translations are added as new fields. Set 'Fields to translate' below.

## `csvUrls` (type: `array`):

Optional: public URLs of CSV/TSV files with a header row (Google Sheets 'anyone with the link', Google Drive and Dropbox share links work). Max 50 MB per file.

## `items` (type: `array`):

Optional: a JSON array of objects to translate directly (handy for API calls and AI agents).

## `fields` (type: `array`):

Names of the dataset fields, CSV columns or JSON keys to translate, e.g. title, reviewText. Required when you give a dataset, CSV or items. Other fields are kept as they are.

## `outputFieldSuffix` (type: `string`):

Translated values go into '<field><suffix>'. Empty = '\_' + target language, e.g. title_en.

## `overwrite` (type: `boolean`):

Replace the original text instead of adding a new field.

## `maxItems` (type: `integer`):

Stop after this many texts or records (0 = no limit). Useful for a cheap first test.

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

1 = fastest (greedy), 2 = default, 4 = slightly better wording. The price per character is the same.

## Actor input object example

```json
{
  "texts": [
    "The delivery was fast and the headphones sound great. The battery easily lasts a full working day, but the ear cushions get warm after an hour.",
    "La calidad es excelente, pero el envío tardó dos semanas en llegar. El vendedor respondió rápido cuando pregunté por el seguimiento del paquete.",
    "Le produit est arrivé cassé et le service client n'a jamais répondu à mes messages. J'ai dû ouvrir un litige pour être remboursé.",
    "Sehr gutes Preis-Leistungs-Verhältnis. Die Einrichtung dauerte nur fünf Minuten, allerdings ist die Akkulaufzeit kürzer als angegeben.",
    "Buscamos un desarrollador backend con experiencia en Python y bases de datos SQL. Trabajo remoto, contrato indefinido y horario flexible.",
    "Appartement lumineux de deux pièces au troisième étage, proche du métro. Cuisine équipée, balcon et cave. Disponible à partir du 1er janvier.",
    "Wir suchen eine erfahrene Buchhalterin in Teilzeit für unser Büro in Hamburg. Gute Deutsch- und Englischkenntnisse sind erforderlich.",
    "Producto muy recomendable: funciona tal como se describe, la batería dura varios días y el tamaño es perfecto para llevarlo en el bolso."
  ],
  "targetLanguage": "en",
  "sourceLanguage": "auto",
  "overwrite": false,
  "maxItems": 0,
  "beamSize": 2
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

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

No description

## `summary` (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": [
        "The delivery was fast and the headphones sound great. The battery easily lasts a full working day, but the ear cushions get warm after an hour.",
        "La calidad es excelente, pero el envío tardó dos semanas en llegar. El vendedor respondió rápido cuando pregunté por el seguimiento del paquete.",
        "Le produit est arrivé cassé et le service client n'a jamais répondu à mes messages. J'ai dû ouvrir un litige pour être remboursé.",
        "Sehr gutes Preis-Leistungs-Verhältnis. Die Einrichtung dauerte nur fünf Minuten, allerdings ist die Akkulaufzeit kürzer als angegeben.",
        "Buscamos un desarrollador backend con experiencia en Python y bases de datos SQL. Trabajo remoto, contrato indefinido y horario flexible.",
        "Appartement lumineux de deux pièces au troisième étage, proche du métro. Cuisine équipée, balcon et cave. Disponible à partir du 1er janvier.",
        "Wir suchen eine erfahrene Buchhalterin in Teilzeit für unser Büro in Hamburg. Gute Deutsch- und Englischkenntnisse sind erforderlich.",
        "Producto muy recomendable: funciona tal como se describe, la batería dura varios días y el tamaño es perfecto para llevarlo en el bolso."
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("gazidev/bulk-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": [
        "The delivery was fast and the headphones sound great. The battery easily lasts a full working day, but the ear cushions get warm after an hour.",
        "La calidad es excelente, pero el envío tardó dos semanas en llegar. El vendedor respondió rápido cuando pregunté por el seguimiento del paquete.",
        "Le produit est arrivé cassé et le service client n'a jamais répondu à mes messages. J'ai dû ouvrir un litige pour être remboursé.",
        "Sehr gutes Preis-Leistungs-Verhältnis. Die Einrichtung dauerte nur fünf Minuten, allerdings ist die Akkulaufzeit kürzer als angegeben.",
        "Buscamos un desarrollador backend con experiencia en Python y bases de datos SQL. Trabajo remoto, contrato indefinido y horario flexible.",
        "Appartement lumineux de deux pièces au troisième étage, proche du métro. Cuisine équipée, balcon et cave. Disponible à partir du 1er janvier.",
        "Wir suchen eine erfahrene Buchhalterin in Teilzeit für unser Büro in Hamburg. Gute Deutsch- und Englischkenntnisse sind erforderlich.",
        "Producto muy recomendable: funciona tal como se describe, la batería dura varios días y el tamaño es perfecto para llevarlo en el bolso.",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("gazidev/bulk-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": [
    "The delivery was fast and the headphones sound great. The battery easily lasts a full working day, but the ear cushions get warm after an hour.",
    "La calidad es excelente, pero el envío tardó dos semanas en llegar. El vendedor respondió rápido cuando pregunté por el seguimiento del paquete.",
    "Le produit est arrivé cassé et le service client n'\''a jamais répondu à mes messages. J'\''ai dû ouvrir un litige pour être remboursé.",
    "Sehr gutes Preis-Leistungs-Verhältnis. Die Einrichtung dauerte nur fünf Minuten, allerdings ist die Akkulaufzeit kürzer als angegeben.",
    "Buscamos un desarrollador backend con experiencia en Python y bases de datos SQL. Trabajo remoto, contrato indefinido y horario flexible.",
    "Appartement lumineux de deux pièces au troisième étage, proche du métro. Cuisine équipée, balcon et cave. Disponible à partir du 1er janvier.",
    "Wir suchen eine erfahrene Buchhalterin in Teilzeit für unser Büro in Hamburg. Gute Deutsch- und Englischkenntnisse sind erforderlich.",
    "Producto muy recomendable: funciona tal como se describe, la batería dura varios días y el tamaño es perfecto para llevarlo en el bolso."
  ]
}' |
apify call gazidev/bulk-text-translator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gazidev/bulk-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/bkfNJRV5cBuqzN67I/builds/5YXGwI6B5ZawEvjaW/openapi.json
