Skip to main content
POST
Detect language
See the JSON list of language codes and their corresponding names.

Authorizations

Authorization
string
header
required

Use your account ID as the username and your personal access token (PAT) as the password, or pass a Base64-encoded value directly in the Authorization header. For more information, see the personal access tokens guide.

Body

application/json
text
string
required

The text in which languages will be detected.

max_predictions
integer
default:1

The maximum number of predictions to return.

Required range: 1 <= x <= 176
threshold
number
default:0

The minimum probability threshold for predictions.

Required range: 0 <= x <= 1
clean_up_whitespaces
boolean
default:false

If set to true: removes newline characters from text.

Response

Returns the list of detected languages sorted by prediction probability in descending order.

language_code
string
required

The ISO code of the detected language.

Example:

"en"

language_name
string
required

The name of the detected language.

Example:

"English"

probability
number
required

The probability of the language prediction.

Example:

0.958276