apyhub-logo
150 atoms
Base tier

About

This API lets you translate documents into different languages. The API supports a variety of file formats including PDF, DOC, and image files.
The API follows the ISO 639-1 standard for language codes, ensuring accurate and standardized translations, which is crucial in maintaining consistency across multilingual projects. Additionally, the API offers a transliteration feature to Latin script, helping in the pronunciation of non-Latin scripts.
Try out the API in the API playground now and see how this free document translation API can help you easily translate documents, save time, and reduce errors with a simple API call.
Supported Formats: pdf, doc, docx, png, jpg, jpeg, tiff, bmp, xlsx, pptx, html, and xml
Supported Languages for Transliteration Arabic (ar), Assamese (as), Bengali (bn), Belarusian (be), Bulgarian (bg), Chinese (Simplified) (zh-Hans), Chinese (Traditional) (zh-Hant), Greek (el), Gujarati (gu), Hebrew (he), Hindi (hi), Japanese (ja), Kannada (kn), Kazakh (kk), Korean (ko), Kyrgyz (ky), Macedonian (mk), Malayalam (ml), Marathi (mr), Mongolian (mn), Odia (or), Persian (fa), Punjabi (pa), Russian (ru), Serbian (Cyrillic) (sr-Cyrl), Sindhi (sd), Sinhala (si), Tajik (tg), Tamil (ta), Tatar (tt), Telugu (te), Thai (th), Ukrainian (uk), Urdu (ur)
Select API Endpoints
Input

API Playground

API Documentation

Translate Text File
POST
https://api.apyhub.com/translate/file

Request example

1
curl --location --request POST 'https://api.apyhub.com/translate/file?transliteration=true' \
2
--header 'apy-token: {{token}}' \
3
--form 'file= @"sample.pdf"' \
4
--form 'language="ar"'
Method: POST
Content Type: multipart/form-data
Query Parameter(s)
AttributeTypeMandatoryDescription
transliterationBooleanNoSet to true if you wish to have the text transliterated to Latin script. Defaults to false.
file_typeStringNoprovide the file type for faster file detection - accepted values are: pdf, doc, docx, png, jpg, jpeg, tiff, bmp, xlsx, pptx, html, and xml
Request Body
AttributeTypeMandatoryDescription
fileFileYesFile containing text. Supported file formats are pdf, doc, docx, png, jpg, jpeg, tiff, bmp, xlsx, pptx, html, and xml
languageStringYesDesired translation language. Should be specified in ISO 639-1 format.
Response
AttributeTypeDescription
detected_language.languageStringLanguage of the text extracted from the document.
detected_language.scoreDecimalScore indicating the proportion of text in the detected language, ranging from 0 to 1.
translated_languageStringLanguage to which the text has been translated.
translationStringTranslation of the extracted text in the specified language.
transliterationStringTransliteration of the extracted text to Latin script. Supported languages for transliteration are ar, as, bn, be, bg, zh-Hans, zh-Hant, el, gu, he, hi, ja, kn, kk, ko, ky, mk, ml, mr, mn, or, fa, pa, ru, sr-Cyrl, sd, si, tg, ta, tt, te, th, uk and ur
Sample Response
1
{
2
"detected_language": {
3
"language": "ar",
4
"score": 1
5
},
6
"translated_language": "en",
7
"translation": "Hello world!",
8
"transliteration": "marhaba balaalam!"
9
}

HTTP Response Codes

The method may return one of the following HTTP status codes:
Status CodeDescription
200The request was successful.
401Required authentication information is either missing or not valid for the resource.
400Invalid input
500If any unexpected error occurs while processing the request

Authentication

All API requests to ApyHub services need to be authenticated. Currently we support tokens or basic authentication mechanisms. You can generate and view your existing credentials from your workspace settings (on the left side of the navbar) and go to “API Keys".
Points to note:
  • Credential secrets are generated on the fly and are not stored in plain text, so on generating a credential please save the secrets somewhere safe.
  • Use the apy-token as the header parameter to pass the token.
  • Use the Authorization header to send the basic authentication credentials.

Error codes

1
{
2
"error": {
3
"code": 105,
4
"message": "Invalid URL"
5
}
6
}
To search for a specific error code, enter the code in the search box below. Alternatively, you can click on the button to view a complete list of all error codes.