Translation Lite API

This Translation API allows users to upload documents and convert their content into the desired target language. It supports multilingual translation while preserving the original document structure, making it suitable for translating reports, agreements, and other text-based files quickly and efficiently.

API Details

Request URL

POST
https://g99.in/api/pdf/translationlite
Copied!

Request Body Parameters

Type Name Optional Description
File file Required Upload the PDF document required for translation.
String language Required Target translation language Name. refer to Translation Languages API.

Request Header Parameters

Type Name Value / Description Optional
String Content-Type multipart/form-data Required

Sample Code

request.php
Copied!
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://g99.in/api/pdf/translationlite',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('file'=> new CURLFILE('  --Uploaded File Path--  '),'language' => 'English'),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
request.py
Copied!
import requests

url = "https://g99.in/api/pdf/translationlite"

payload = {'language': 'English'}
files=[
  ('file',('english story.docx',open('  --Uploaded File Path--  ','rb'),'  --Uploaded File MIME Type--  '))
]
headers = {}

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

print(response.text)
request.cs
Copied!
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://g99.in/api/pdf/translationlite");
var content = new MultipartFormDataContent();
content.Add(new StreamContent(File.OpenRead("  --Uploaded File Path--  ")), "file", "  --Uploaded File Path--  ");
content.Add(new StringContent("English"), "language");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

Response

HTTP status code 200

Key Type Description
Response String Translated output of the given document in the targeted language.

Sample Response

Sample response for valid document

response.json
Copied!
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Error Response

Parameter Type Description
status Number Unique error codes for different errors. Always available.
message String Error message describing the error. Always Available.
error Boolean True / False for different errors. Always available.

Error Codes

HTTP Status Error Code Error Message
400 400 Malformed data or missing required parameter values.
415 415 Only PDF files are allowed.
413 413 Please upload a file smaller than 50MB.
422 422 Unable to extract data from the PDF file.
503 503 Document processing service is currently unavailable. Please try again later.

Sample Error Response

response.json
Copied!
{
  "message": "Malformed data or missing required parameter values.",
  "status": 400,
  "error": True
}