apyhub-logo
50 atoms
Base tier

About

This Utility API allows you to detect the language from the provided text.
This API can help automate data processing tasks by identifying the language of large volumes of text data. This can be especially useful in industries such as social media monitoring or online advertising, where understanding the language of user-generated content is essential. This can also help to prevent security breaches by detecting text that is written in an unauthorized language. This can be especially useful in the financial or legal industries, where compliance regulations require the use of specific languages.
Currently we support more than 50 languages.
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, Africaans

API Playground

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 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

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.