Image Translator API

Automatically Translate Text Within Any Image Using AI.

hero banner

Code Examples in Popular Languages

Integrate our Image Translator API easily into your apps with comprehensive code examples in popular languages to get started quickly.

CURL Request
curl --location 'https://theonlineconverter.com/api/v1/image-translator' \
--header 'Content-Type: application/json' \
--header 'x-api-key: enter_your_api_key' \
--form 'file=@"/D:/data/Images/jpg/2.jpg"' \
--form 'base_lang="en"' \
--form 'target_lang="ru"'
JavaScript Fetch
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("x-api-key", "enter_your_api_key");

const formdata = new FormData();
formdata.append("file", fileInput.files[0], "/D:/data/Images/jpg/2.jpg");
formdata.append("base_lang", "en");
formdata.append("target_lang", "ru");

const requestOptions = {
  method: "POST",
  headers: myHeaders,
  body: formdata,
  redirect: "follow"
};

fetch("https://theonlineconverter.com/api/v1/image-translator", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
Ruby Net::HTTP
import requests
import json

url = "https://theonlineconverter.com/api/v1/image-translator"

payload = {'base_lang': 'en',
'target_lang': 'ru'}
files=[
  ('file',('2.jpg',open('/D:/data/Images/jpg/2.jpg','rb'),'image/jpeg'))
]
headers = {
  'Content-Type': 'application/json',
  'x-api-key': 'enter_your_api_key'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
Python Requests
import requests
import json

url = "https://theonlineconverter.com/api/v1/image-translator"

payload = {'base_lang': 'en',
'target_lang': 'ru'}
files=[
  ('file',('2.jpg',open('/D:/data/Images/jpg/2.jpg','rb'),'image/jpeg'))
]
headers = {
  'Content-Type': 'application/json',
  'x-api-key': 'enter_your_api_key'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
PHP Guzzle
<?php
$client = new Client();
$headers = [
  'Content-Type' => 'application/json',
  'x-api-key' => 'enter_your_api_key'
];
$options = [
  'multipart' => [
    [
      'name' => 'file',
      'contents' => Utils::tryFopen('/D:/data/Images/jpg/2.jpg', 'r'),
      'filename' => '/D:/data/Images/jpg/2.jpg',
      'headers'  => [
        'Content-Type' => '<Content-type header>'
      ]
    ],
    [
      'name' => 'base_lang',
      'contents' => 'en'
    ],
    [
      'name' => 'target_lang',
      'contents' => 'ru'
    ]
]];
$request = new Request('POST', 'https://theonlineconverter.com/api/v1/image-translator', $headers);
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
Java HttpURLConnection
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("file","/D:/data/Images/jpg/2.jpg",
    RequestBody.create(MediaType.parse("application/octet-stream"),
    new File("/D:/data/Images/jpg/2.jpg")))
  .addFormDataPart("base_lang","en")
  .addFormDataPart("target_lang","ru")
  .build();
Request request = new Request.Builder()
  .url("https://theonlineconverter.com/api/v1/image-translator")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("x-api-key", "enter_your_api_key")
  .build();
Response response = client.newCall(request).execute();
Go net/http
package main

import (
  "fmt"
  "bytes"
  "mime/multipart"
  "os"
  "path/filepath"
  "net/http"
  "io"
)

func main() {

  url := "https://theonlineconverter.com/api/v1/image-translator"
  method := "POST"

  payload := &bytes.Buffer{}
  writer := multipart.NewWriter(payload)
  file, errFile1 := os.Open("/D:/data/Images/jpg/2.jpg")
  defer file.Close()
  part1,
         errFile1 := writer.CreateFormFile("file",filepath.Base("/D:/data/Images/jpg/2.jpg"))
  _, errFile1 = io.Copy(part1, file)
  if errFile1 != nil {
    fmt.Println(errFile1)
    return
  }
  _ = writer.WriteField("base_lang", "en")
  _ = writer.WriteField("target_lang", "ru")
  err := writer.Close()
  if err != nil {
    fmt.Println(err)
    return
  }


  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("x-api-key", "enter_your_api_key")

  req.Header.Set("Content-Type", writer.FormDataContentType())
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
C# HttpClient
var options = new RestClientOptions("https://theonlineconverter.com")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/v1/image-translator", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("x-api-key", "enter_your_api_key");
request.AlwaysMultipartFormData = true;
request.AddFile("file", "/D:/data/Images/jpg/2.jpg");
request.AddParameter("base_lang", "en");
request.AddParameter("target_lang", "ru");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);

Key Features & Capabilities

Our API is a two-part powerhouse, combining text detection and translation to deliver a seamless, ready-to-use translated image.

Simple User Interface

Integrated OCR & Translation

A complete end-to-end solution. The API first uses OCR to accurately detect and read all text on the image, then translates it in a single, streamlined process.

Simple Data Format

In-Image Text Replacement

This is not just text extraction. The API intelligently removes the original text and renders the new translated text in its place, attempting to match the original style.

Time

Automatic Language Detection

Set the source language to "auto" to let our AI automatically detect the language of the text on the image, simplifying your workflow.

Secure Data

Extensive Language Support

Translate text between dozens of languages, enabling you to localize visual content for a global audience with broad coverage.

Universal Access

Context-Aware AI Translation

Powered by a state-of-the-art translation engine that understands context, leading to more accurate and natural-sounding translations than simple word-for-word replacements.

Freedom

Secure & Confidential

All images are processed over encrypted connections. We guarantee confidentiality with a strict data privacy policy and do not store your files.

Frequently Asked Questions

Find answers to common questions about our Image Translator API to understand its capabilities and best use cases.

It's a three-step AI process. First, our OCR engine scans the image to find and read any text. Second, our machine translation engine translates that text to your target language. Finally, our inpainting and rendering engine removes the old text and places the new translated text onto the image.

We use a state-of-the-art machine translation model that provides high accuracy for most common languages and contexts. However, like all machine translation, highly nuanced, idiomatic, or poetic language can be challenging.

The API does its best to match the font style, color, and size of the original text to make the result look as natural as possible. For standard fonts and colors, the results are very seamless.

While auto-detection is very reliable, you can always specify the `source_language` in your API call to ensure the highest accuracy, especially for text with little context or less common languages.

The primary output is a new image file (typically a PNG) with the text translated and replaced directly on it. The API response may also include the raw translated text data for your records.

The API performs best on standard, horizontal text. While it can often handle text with a slight angle, highly stylized, vertical, or curved text may present challenges for the OCR engine.

Absolutely. We use end-to-end TLS encryption for all data transfers. Your images and their content are processed securely and are permanently deleted from our servers immediately after the job is complete.