Language detection: detect the language of a text
Detect which language a text is written in: the most likely language with its ISO 639-3 and 639-1 codes and English name, plus the next candidates with relative scores, using trigram statistics for 82 major languages (franc-min). Works best above about 20 characters; very short or mixed text returns und (undetermined). Local, no outside service. Use to route messages, pick a translation target or filter content by language.
Inputs
| Name | Type | Description |
|---|---|---|
text (required) | string | The text (up to 10,000 characters) |
Request
Over HTTP, with a card key from /credits:
curl -H "Authorization: Bearer adt_…" "https://agent-data-tools.revmesh2074.workers.dev/text/language?text=Det%20h%C3%A4r%20%C3%A4r%20en%20mening%20skriven%20p%C3%A5%20svenska%20om%20v%C3%A4der%20och%20resor."
Or one of your 25 free calls, no key:
curl "https://agent-data-tools.revmesh2074.workers.dev/text/language?text=Det%20h%C3%A4r%20%C3%A4r%20en%20mening%20skriven%20p%C3%A5%20svenska%20om%20v%C3%A4der%20och%20resor.&trial=1"
Without a key, the same URL answers 402 Payment Required with x402 and MPP terms, so an agent with a wallet pays per call in USDC (Base, Polygon, Arbitrum or Solana over x402; Base or Tempo over MPP) and retries.
Example result
{
"language": {
"iso6393": "swe",
"iso6391": "sv",
"name": "Swedish"
},
"confident": true,
"candidates": [
{
"iso6393": "swe",
"name": "Swedish",
"score": 1
},
{
"iso6393": "nld",
"name": "Dutch",
"score": 0.726
}
],
"characters": 59
}
From an AI agent (MCP)
Add the MCP server to Claude, Cursor or any MCP client. This tool is text_language, and the first 25 successful calls are free:
https://agent-data-tools.revmesh2074.workers.dev/mcp