Detect language: which language a text is
No account. Pay by card from $1 and your key appears right after payment. Get a key by card
Detect language of a text: the language as an ISO 639-1 and 639-3 code with its English name, from 82 languages (franc), offline and fast. Use to route a message to the right translator, model or support team, or to tag content by language.
$0.001 per call with prepaid credits: $1 by card pays for 1,000 calls, with no account and no subscription.
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://glyphtools.com/language/detect?text=Det%20h%C3%A4r%20%C3%A4r%20en%20mening%20skriven%20p%C3%A5%20svenska%20om%20v%C3%A4der%20och%20resor."
Node.js
const r = await fetch("https://glyphtools.com/language/detect?text=Det%20h%C3%A4r%20%C3%A4r%20en%20mening%20skriven%20p%C3%A5%20svenska%20om%20v%C3%A4der%20och%20resor.", {
headers: { Authorization: "Bearer adt_…" },
});
const data = await r.json(); // 402 until the key is in the header
Python
import requests
r = requests.get("https://glyphtools.com/language/detect?text=Det%20h%C3%A4r%20%C3%A4r%20en%20mening%20skriven%20p%C3%A5%20svenska%20om%20v%C3%A4der%20och%20resor.", headers={"Authorization": "Bearer adt_…"}, timeout=60)
data = r.json()
Or one of your 3 free calls, no key — the same request with &trial=1 on the end:
curl "https://glyphtools.com/language/detect?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 language_detect, and the first 10 successful calls are free:
https://glyphtools.com/mcp