Image translation API: send an image, get a translated image back
The TranslateMyImage API translates the text inside an image and returns a new image, not a list of strings. You send one image and one target language to a single endpoint; the JSON response contains a URL to the translated image, generated to keep the original layout. This page shows what the API does, request examples in curl, Python and Node.js, how to handle errors, and when building your own OCR pipeline makes more sense. The full reference is in the API documentation.
In short
- One endpoint:
POST https://translatemyimage.com/api/translatewith anX-API-Keyheader and a multipart body containing the image andtarget_lang. - One request = one image into one language = one credit when it completes. Target languages: en, fr, es, de, it, pt, ja, ko, zh.
- API access starts with the Pro plan (Pro, Premium or Enterprise). Review generated images before you publish them.
Request fields
The body is multipart/form-data, which your HTTP client sets for you.
| Field | Required | Accepted values |
|---|---|---|
file | Yes | A JPG, PNG or WEBP image, up to 10 MB and 25 megapixels |
target_lang | Yes | en, fr, es, de, it, pt, ja, ko or zh |
source_lang | No | One of the nine codes above; omit it or send auto to auto-detect |
quality | No | basic (default) or ultra |
business_type | No | default, marketing, edition (the Manga/Comics mode) or technical documentation |
custom_prompt | No | Instructions for the model, up to 1,000 characters (Pro plan and above) |
Response
A successful call returns this shape (example from the reference):
{
"success": true,
"translation": {
"id": "clxb1234567890",
"originalUrl": "https://storage.com/original.jpg",
"translatedUrl": "https://storage.com/translated.jpg",
"sourceLang": "fr",
"targetLang": "en",
"status": "completed",
"createdAt": "2026-09-21T15:27:39.000Z",
"metadata": { "quality": "basic", "model": "muse-image" }
}
}
sourceLang is null when you omit source_lang or send auto. Errors return JSON with success: false, an error message and, once the key is accepted, a stable code such as insufficient_credits.
Quick start
Create a key on the dashboard's API Keys page. It is shown only once, so store it in an environment variable or a secret manager right away.
curl
curl -X POST https://translatemyimage.com/api/translate \
-H "X-API-Key: $TMI_API_KEY" \
-F "file=@product-front.jpg" \
-F "target_lang=es" \
-F "source_lang=auto" \
-F "business_type=marketing"
Python (requests), with a retry when the image service is rate limited and polling when the API answers 202:
import os
import time
import requests
API_URL = "https://translatemyimage.com/api/translate"
API_KEY = os.environ["TMI_API_KEY"]
HEADERS = {"X-API-Key": API_KEY}
def wait_for_result(translation_id, interval=15, max_wait=900):
# 202: a second model is finishing the image, so poll until it is done
deadline = time.monotonic() + max_wait
while time.monotonic() < deadline:
time.sleep(interval)
response = requests.get(
API_URL, headers=HEADERS, params={"id": translation_id}, timeout=30
)
response.raise_for_status()
translation = response.json()["translations"][0]
if translation["status"] == "completed":
return translation
if translation["status"] == "failed":
failure = (translation.get("metadata") or {}).get("failureCode")
raise RuntimeError(f"Translation failed: {failure}")
raise RuntimeError(f"{translation_id} still processing after {max_wait} s")
def translate_image(path, target_lang, business_type="default", max_attempts=5):
for attempt in range(max_attempts):
with open(path, "rb") as image:
response = requests.post(
API_URL,
headers=HEADERS,
files={"file": image},
data={
"target_lang": target_lang,
"source_lang": "auto",
"business_type": business_type,
},
timeout=900, # generation can take minutes: keep this generous
)
if response.status_code == 429:
time.sleep(2 ** attempt) # exponential backoff, then retry
continue
payload = response.json()
if response.status_code == 202:
return wait_for_result(payload["translation"]["id"])
if response.status_code != 200 or not payload.get("success"):
raise RuntimeError(f"{response.status_code}: {payload.get('error')}")
return payload["translation"]
raise RuntimeError(f"Still rate limited after {max_attempts} attempts")
for lang in ["es", "fr", "de"]:
result = translate_image("product-front.jpg", lang, "marketing")
print(lang, result["translatedUrl"])
Node.js (18 or later, as an ES module, with the built-in fetch and FormData):
import { readFile } from "node:fs/promises";
const API_URL = "https://translatemyimage.com/api/translate";
const headers = { "X-API-Key": process.env.TMI_API_KEY };
const form = new FormData();
const image = new Blob([await readFile("product-front.jpg")], { type: "image/jpeg" });
form.append("file", image, "product-front.jpg");
form.append("target_lang", "ja");
const response = await fetch(API_URL, { method: "POST", headers, body: form });
const payload = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${payload.error}`);
let translation = payload.translation;
// 202: a second model is finishing the image, so poll until it is done
for (let i = 0; i < 60 && translation.status === "processing"; i++) {
await new Promise((resolve) => setTimeout(resolve, 15_000));
const poll = await fetch(`${API_URL}?id=${translation.id}`, { headers });
if (!poll.ok) throw new Error(`${poll.status}: could not read the translation`);
translation = (await poll.json()).translations[0];
}
if (translation.status !== "completed") {
throw new Error(`${translation.status}: ${translation.metadata?.failureCode ?? "no result yet"}`);
}
console.log(translation.translatedUrl);
One target_lang per request: to translate an image into five languages, send five requests.
Handle every status code
| Status | Meaning (from the reference) | What your code should do |
|---|---|---|
| 200 | Translation completed; one credit consumed | Download and store the translated image |
| 202 | A second model is finishing the image, which takes a few minutes; translation.status is processing | Poll GET /api/translate?id= with translation.id and the same X-API-Key until translations[0].status is completed (one credit consumed) or failed (metadata.failureCode gives the reason) |
| 400 | Invalid input, unsupported format or missing file | Do not retry. Validate type, size (10 MB), resolution (25 MP) and language code before sending |
| 401 | Missing, invalid or revoked API key | Do not retry. Check the key and how it is loaded |
| 403 | The account that owns the key is not on the Pro plan or above, which API access requires | Do not retry. Check the plan of the account that created the key |
| 429 | The image service is rate limited | Retry later with exponential backoff |
| 500 | Processing failed | Check code first: insufficient_credits means the account needs credits, so a retry will not help. Otherwise retry once or twice, then log the file for manual handling |
The reference documents these seven statuses. The endpoint can also return others, for example 422 when no image could be generated (code: generation_failed) or 503 when the image service is unavailable (service_unavailable), so branch on code rather than on the status alone.
Google Translate API vs DeepL API for translating text in images
Neither the Google Cloud Translation API nor the DeepL API returns your image with the translated text redrawn in its original layout, according to their documentation checked on 2026-10-27. Both translate text very well; the difference is what they accept and what they give back.
| Google Cloud Translation API | DeepL API | TranslateMyImage API | |
|---|---|---|---|
| Accepts an image file | No: text, HTML and documents (DOC, DOCX, PDF, PPT, PPTX, XLS, XLSX) per the supported formats | JPEG and PNG on the document endpoint, labelled beta | JPG, PNG or WEBP, up to 10 MB |
| Documented path for text in a photo | Cloud Vision OCR, then Translation on the extracted text | Upload the image, poll the document status, download the result | One request per image and target language |
| What you get back | Translated text (you redraw it yourself) | A translated file in the input format; the reference does not describe how the text is rendered on images | A URL to the translated image |
| Target languages | See Google's language list | See DeepL's language list | 9 |
Choose Google or DeepL when you need the translated text as data, a large language list or glossaries, and you are ready to build the rendering step described below. Choose an image-to-image API when the deliverable is the finished visual.
Image translation APIs that return a translated image
Several APIs take an image and send back the image with its text translated. Their documentation, checked on 3 November 2026, describes them as follows:
| API | What it returns | Request | Languages and limits | Published price |
|---|---|---|---|---|
| TranslateMyImage | A URL to the translated image | POST /api/translate, multipart file and target_lang, X-API-Key header; 202 then poll GET ?id= when a second model is needed | 9 target languages; JPG, PNG or WebP up to 10 MB and 25 megapixels | 1 credit per completed translation; API from Pro, $9.90 a month for 100 credits |
| PixLab Image Text Translation | The translated image as base64 in JSON, or raw binary | POST https://api.pixlab.io/imgtranslate, multipart file with source and target language, optional font hints | Lists common source and target codes; JPG, PNG and WebP recommended; size limit not stated | Plans from $20 a month on its pricing page; the endpoint page does not say which quota it uses |
| Alibaba Cloud Image Translation (Standard Edition) | A URL to the translated image | POST /rest/ai/image/translation, JSON with a public image URL, signed Alibaba Cloud request, synchronous | 156 languages, 400+ pairs; PNG, JPEG, BMP or WebP up to 4,000 px and 10 MB; options for product areas and brand text | $0.003 per image |
| Lara Translate | A translated image (overlay, inpainting or generative mode), or the text only | Through its SDKs | Locale list in its documentation; size limit not stated | Per image on its pricing page: $0.15 overlay, $0.20 inpainting, $0.50 generative; a subscription is required |
| Naver Cloud Papago Image Translation | The rendered image as base64, plus the text blocks with coordinates | POST https://papago.apigw.ntruss.com/image-to-image/v1/translate, multipart image with source and target | 13 target languages; JPG, PNG or TIFF | Billed per translated character; no unit price on the page |
How to choose between them:
- Lowest published price per image at catalog scale: Alibaba Cloud's Standard Edition, if your images can sit at a public URL and you can sign Alibaba Cloud requests.
- The translated text and its coordinates as well as the image: Naver Papago, for its 13 target languages.
- Several rendering modes and an edit step before rendering: Lara Translate.
- A plain multipart request with an API key, the same results as the web uploader and batch translation in the same account: TranslateMyImage. Test your hardest images in the web uploader before you integrate.
Whatever API you pick, run a sample of your own images through it first: small print, dense infographics and curved text on packaging are where outputs differ.
Build it yourself or call an image-to-image API?
Instead of an image-to-image API, you can assemble a pipeline: an OCR service to find the text (Google Cloud Vision, for example, returns the extracted text with the bounding box of each word, per its OCR documentation), a text translation API, then code that erases the original text and typesets the translation in the same boxes with a matching font.
| OCR + text translation + your own rendering | TranslateMyImage API | |
|---|---|---|
| What you get | Text strings with coordinates, then whatever you render | A URL to a finished translated image |
| Control | Full: fonts, enforced glossaries, editable layers | Mode (business_type) and custom_prompt |
| Engineering effort | Several services plus rendering code to build and maintain | One HTTP request per image and language |
| Target languages | Whatever your translation service supports | 9 |
| Translated text as data | Yes | No, the API returns an image |
| Pixels outside the text | Untouched | Regenerated with the image: digits, small text and logos can change |
Build it yourself when you need the translated text as data (alt text, search), strict terminology enforcement, editable layers, more languages, or pixels outside the text that must stay identical. Call the API when you want finished visuals in a few languages and can review them before use.
Best image translation API for an e-commerce platform: what to check
The best image translation API for an e-commerce platform is the one that returns finished product images your catalog can store as localized variants, at a cost you can predict per SKU and language. Text translation APIs return strings; for product photos, infographics and A+ Content modules you then still have to typeset the text back into each image. Check these points against your catalog before you integrate any API:
| What to check | Why it matters for a catalog | TranslateMyImage API |
|---|---|---|
| Output | An image goes straight to the listing; text needs a rendering step | A URL to the translated image, generated to keep the original layout |
| Input formats and size | Product photos come from suppliers, studios and marketplaces | JPG, PNG or WebP, up to 10 MB and 25 megapixels |
| Target languages | Must cover your marketplaces | 9: en, fr, es, de, it, pt, ja, ko, zh |
| Cost model | Budget per SKU × language | One credit per completed translation; failed requests use no credit |
| Volume | Catalog launches come in bursts | One request per image and language, queue on your side and back off on 429 |
| Terminology and brand rules | Product names, units and claims must stay consistent | custom_prompt, up to 1,000 characters, for terms to keep or avoid |
| Review step | Prices, specifications and legal text cannot be wrong | Your workflow marks each output "to review" before publishing |
| Commercial use | Listings are commercial use | API access and commercial use from the Pro plan |
Run a sample of real listing images, including the hardest ones (small print, dense infographics, packaging), through the web uploader first, then wire the API into your catalog as described below.
Automate product image translation in a PIM or CMS
To automate translating product images in a PIM, DAM or CMS, connect its "asset created or updated" event to a small worker that calls the API once per image and target language, then writes each translated image back as a localized variant of the same asset. The API has no webhook: your worker waits for the response, and polls GET /api/translate?id= when it gets a 202. The steps:
- Validate locally before sending: file type, 10 MB, 25 megapixels, a supported
target_lang. - Queue one job per image and language, and back off on 429.
- Copy the result to your own storage or DAM with the source ID, target language,
translation.idandcreatedAt. Neither the reference nor the privacy policy promises how longtranslatedUrlstays available, so do not rely on it as permanent hosting. It is an unsigned storage link: treat it as public. - Mark every output "to review". A person who reads the target language checks prices, specifications and legal text first, then headlines. The batch translation page has a review-by-risk table you can reuse.
- Publish only reviewed images, for example to your Amazon listing images.
Before writing code, run a few representative images through the web uploader with the mode you plan to use. For occasional jobs without code, batch translation in the dashboard is simpler: up to 10 images and 50 translated outputs per batch.
Plans and credits
API access is included from the Pro plan up: Pro comes with 100 credits a month and Premium with 300 (pricing). Each completed translation consumes one credit. Pay-as-you-go packs add 1 credit for $2, 30 for $10 or 100 for $20; they do not give access to the API on their own. Every plan with API access also includes Ultra quality and custom_prompt.
Read the API reference
Endpoint, headers, parameters, status and error codes, an example response and calls in cURL, Python and Node.js.
Frequently asked questions
Is there an API that translates the text inside an image and returns the translated image?
Yes. The TranslateMyImage API takes an image and a target language and returns a URL to a new image with the text translated, generated to keep the original layout. With a text translation API, you would first extract the text from the image with OCR and then draw the translation back yourself. Other APIs that return a translated image include PixLab Image Text Translation, Alibaba Cloud Image Translation, Lara Translate and Naver Cloud Papago Image Translation; this page compares them from their documentation, checked on 3 November 2026.
Google Translate API vs DeepL API for translating text in images: which one returns a translated image?
Neither returns an image with the translated text redrawn in its layout, according to their documentation checked on 2026-10-27. Google Cloud Translation accepts text and documents (DOC, DOCX, PDF, PPT, PPTX, XLS, XLSX), not images: Google's documented path for a photo is Cloud Vision OCR, then Translation on the extracted text. The DeepL API accepts JPEG and PNG on its document endpoint, labelled beta, and returns a translated file; its reference does not describe how the text is rendered back. Both fit when you want translated text; an image-to-image API such as TranslateMyImage fits when you want the finished image.
How to automate translating product images in a PIM or CMS?
Trigger a job when an image is added or changed in the PIM, DAM or CMS, send one request per image and target language to POST /api/translate, poll GET /api/translate?id= when the answer is 202, then save the translated image back as a localized variant of the same asset (SKU, language, source image ID) with the status "to review". Publish it to the channel only after a person who reads the language has checked it.
What is the best image translation API for an e-commerce platform?
One that returns finished product images you can store as localized variants, with a predictable cost per SKU and language. Text translation APIs return strings that you must typeset back into each image. The TranslateMyImage API takes a JPG, PNG or WebP product image (up to 10 MB) and a target language among 9, returns a URL to the translated image in the original layout, uses one credit per completed translation and is available from the Pro plan. Test it on your hardest listing images and review every output before publishing.
Does the API return the translated text?
No. The response contains the translation's ID, the original and translated image URLs, the languages, a status, a timestamp and metadata. If you need the translated text itself, for alt text or search, run an OCR service on the translated image.
Can I translate one image into several languages in one request?
No. Each request has one target_lang. To get five languages, send five requests with the same file; each completed translation uses one credit.
How much does the image translation API cost?
Each completed translation consumes one credit. API access is included from the Pro plan up: Pro costs $9.90 a month with 100 credits, Premium $19.90 a month with 300 credits. Pay-as-you-go packs add credits (1 for $2, 30 for $10 or 100 for $20) but do not give access to the API on their own.
Is there a Python or JavaScript SDK?
The reference documents plain HTTP calls, with examples in cURL, Python (requests) and Node.js (axios). Any HTTP client that can send multipart/form-data with a custom header works.