Language detection: detect the language of a text

$0.01 per call · failed calls are never charged · no account or API key needed

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.

Run it free (25 free calls) Buy credits by card (from $5) Example result (JSON)

Try it with your own inputs

The text (up to 10,000 characters)

Uses one of your 25 free calls. Nothing is charged, and a call that fails is not counted.

Inputs

NameTypeDescription
text (required)stringThe 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

Related tools