Language Detector

Detect the language(s) of text. $0.01 per request.

What it does

Send any text, get back its primary language as an ISO 639-1 code, confidence, and whether the text meaningfully mixes multiple languages.

Endpoint

MethodPOST
Path/detect
Content-Typeapplication/json

Fields

fieldrequireddescription
textyesThe text to detect, max 10,000 characters

Example

curl -X POST https://language-detector.pdfextractapi.workers.dev/detect \
  -H "Content-Type: application/json" \
  -d '{"text": "Bonjour, comment allez-vous?"}'

Example response

{
  "language_code": "fr",
  "language_name": "French",
  "confidence": 0.98,
  "is_multilingual": false,
  "other_languages": []
}

Errors

Errors return a non-200 status with { "error": { "code": "...", "message": "..." } }. Common codes: missing_text, text_too_large.

Payment

This endpoint is paid per-request via the x402 protocol (HTTP 402 + USDC). Unpaid requests receive a 402 response with payment instructions.

Try it in your browser