Docs/Text Utils/POST /v1/language-detect

POST /v1/language-detectDetect language from text

Text Utils lf-text-utils

Works out which language a piece of text is written in. Detects the natural language of input text using character n-gram frequency analysis. Supports 20+ languages.

Query Parameters

ParameterTypeRequiredDescription
inputstringNoText to analyze

Request Body

Content-Type: application/json

FieldTypeRequiredDescription
inputstringYesText to analyze

Response Schema

success (boolean): Operation success
language (string): Detected language
code (string): ISO language code
confidence (number): Detection confidence

cURL Example

curl -X POST 'https://lf-text-utils.laminarforge.dev/v1/language-detect' -H 'Authorization: Bearer lf_YourApiKey' -H 'Content-Type: text/plain' -d 'Bonjour le monde'

Python Example

import requests
url = 'https://lf-text-utils.laminarforge.dev/v1/language-detect'
headers = {'Authorization': 'Bearer lf_YourApiKey'}
data = 'Bonjour le monde'
response = requests.post(url, headers=headers, data=data)
print(response.json())