Language Detection API - ApyHub - ApyHub

About

The Detect Language API identifies the language of any text you provide. It currently supports more than 50 languages.
Using this API can help automate text processing and save time when handling large volumes of content. It’s useful in industries like social media, advertising, learning and development, and any scenario where understanding user-generated content is essential.
The API can also help improve security and compliance by detecting text written in unauthorized languages. This is particularly valuable in financial and legal industries, where regulations often require the use of specific languages.
Try it now in our API playground: detect languages easily, reduce errors, and save time with a simple API call.
Supported Languages:
Esperanto, English, Russian, Mandarin, Spanish, Portuguese, Italian, Bengali, French, German, Ukrainian, Georgian, Arabic, Hindi, Japanese, Hebrew, Yiddish, Polish, Javanese, Korean, Bokmal, Danish, Swedish, Finnish, Turkish, Dutch, Hungarian, Czech, Greek, Bulgarian, Belarusian, Marathi, Kannada, Romanian, Slovene, Croatian, Serbian, Macedonian, Lithuanian, Latvian, Estonian, Tamil, Vietnamese, Urdu, Thai, Gujarati, Uzbek, Punjabi, Azerbaijani, Indonesian, Telugu, Persian, Malayalam, Hausa, Oriya, Burmese, Bhojpuri, Maithili, Oromo, Kurdish, Malagasy, Saraiki, Nepali, Sinhalese, Khmer, Turkmen, Somali, Akan, Zulu, Haitian Creole, Uyghur, Afrikaans.

API Playground

API Documentation

detect language
POST
https://api.apyhub.com/detect/language

Request example

1
curl --location --request POST 'https://api.apyhub.com/detect/language' \
2
--header 'apy-token: {{token}}' \
3
--header 'Content-Type: application/json' \
4
--data '{
5
"text":"Não lemos e escrevemos poesia porque é fofo. Lemos e escrevemos poesia porque somos membros da raça humana."
6
}'
Method: POST
Content Type: application/json
Request Body
AttributeTypeMandatoryDescription
textstringYesThe text for which you want to detect the language, minimum 50 characters are required.
Supported Languages
1
Esperanto | English | Russian | Mandarin | Spanish | Portuguese | Italian | Bengali | French | German | Ukrainian | Georgian | Arabic | Hindi | Japanese | Hebrew | Yiddish |
2
Polish | Javanese | Korean | Bokmal | Danish | Swedish | Finnish | Turkish | Dutch | Hungarian | Czech | Greek | Bulgarian | Belarusian | Marathi | Kannada | Romanian | Slovene |
3
Croatian | Serbian | Macedonian | Lithuanian | Latvian | Estonian | Tamil | Vietnamese | Urdu | Thai | Gujarati | Uzbek | Punjabi | Azerbaijani | Indonesian | Telugu | Persian |
4
Malayalam | Hausa | Oriya | Burmese | Bhojpuri | Maithili | Oromo | Kurdish | Malagasy | Saraiki | Nepali | Sinhalese | Khmer | Turkmen | Somali | Akan | Zulu | Haitian Creole |
5
Uyghur | Africaans
Sample Response
A successful request returns the data object with below mentioned attributes if the language is supported as shared in the list given above.
1
{
2
"data": {
3
"code": "por",
4
"iso_code": "pt",
5
"language": "Portuguese",
6
"script": "Latin",
7
"confidence": 0.938
8
}
9
}

HTTP Response Codes

The method may return one of the following HTTP status codes:
Status CodeDescription
200The request was successful.
400Invalid input.
401Required authentication information is either missing or not valid for the resource.
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.
Table of contents
AboutAPI PlaygroundAPI DocumentationAuthenticationError codesRelated Utility APIsRelated Articles