Serverless AI Language Detection

AI powered language detection service that accurately identifies the language of any given text. It returns the language name, ISO code, and confidence score for precise language identification.

Endpoint

Detect the language of provided text

POSThttps://api.xtartapp.com/text/language-detection

*Authentication

You must use a Bearer token provided by the dashboard to use for authentication. Add the token to the Authorization header.

Request body

NameTypeRequiredMaxDescription
textstringYes2500The text to detect the language of

Response

NameTypeDescription
dataobjectThe data of the language detection
data.languagestringThe full name of the detected language (e.g., 'English', 'French')
data.codestringThe ISO 639-1 language code (2 letters, e.g., 'en', 'fr')
data.confidencenumberThe confidence score for the language detection (0-1)
metadataobjectMetadata about the language detection process
metadata.costnumberThe cost of the language detection request

Errors

{
   "error": "string", 
   "code": "string"
}
HTTP StatusError CodeMessage
400INVALID_PAYLOADOccurs when the payload is invalid.
400INVALID_REQUESTEx.: The request is invalid.
400TEXT_LANGUAGE_DETECTION_ERROREx: could not detect the language of the text | parsing error
400HARM_CONTENTEx.: The content is harmful and cannot be processed.
400INSUFFICIENT_BALANCEThe user has insufficient balance
401UNAUTHORIZEDEx.: The token is invalid.
429TOO_MANY_REQUESTSEx.: The request limit has been reached.