Translate Documents API
150 atoms
Base tier
About
This Utility API translates documents into specified languages. With support for a variety of file formats including PDF, DOC, and image files, it's a versatile tool that can handle a wide range of translation tasks.
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 utility offers a transliteration feature to Latin script, aiding in the pronunciation of non-Latin scripts.
This API is a practical and smart choice for software engineers looking to expedite language translation tasks in their projects.
Supported Formats:
pdf
, doc
, docx
, png
, jpg
, jpeg
, tiff
, bmp
, xlsx
, pptx
, html
, and xml
Supported Languages for Transliteration
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
Endpoint Selector
Input
API Playground
Documentation
Translate Text File
POST
https://api.apyhub.com/translate/file
Request example
Method:
POST
Content Type:
multipart/form-data
Query Parameter(s)
Attribute | Type | Mandatory | Description |
---|---|---|---|
transliteration | Boolean | No | Set to true if you wish to have the text transliterated to Latin script. Defaults to false . |
file_type | String | No | provide 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
Attribute | Type | Mandatory | Description |
---|---|---|---|
file | File | Yes | File containing text. Supported file formats are pdf , doc , docx , png , jpg , jpeg , tiff , bmp , xlsx , pptx , html , and xml |
language | String | Yes | Desired translation language. Should be specified in ISO 639-1 format. |
Response
Attribute | Type | Description |
---|---|---|
detected_language.language | String | Language of the text extracted from the document. |
detected_language.score | Decimal | Score indicating the proportion of text in the detected language, ranging from 0 to 1. |
translated_language | String | Language to which the text has been translated. |
translation | String | Translation of the extracted text in the specified language. |
transliteration | String | Transliteration 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
HTTP Response Codes
The method may return one of the following HTTP status codes:
Status Code | Description |
---|---|
200 | The request was successful. |
401 | Required authentication information is either missing or not valid for the resource. |
400 | Invalid input |
500 | If any unexpected error occurs while processing the request |
Authentication
All 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 workspace settings (on the left side of the navbar) and go to applications.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
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.