# Language Detection via Trigram Statistics (franc-min)

> Language Detection via Trigram Statistics (franc-min) is a paid API for AI agents from agent-data-tools.revmesh2074.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-30).

Detects the language of a given text using trigram statistics, returning the top language with ISO 639-1/639-3 codes and ranked candidate languages with confidence scores.

## Facts

- Endpoint: GET https://agent-data-tools.revmesh2074.workers.dev/text/language?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Provider: agent-data-tools.revmesh2074.workers.dev
- Website: https://agent-data-tools.revmesh2074.workers.dev
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-data-tools-revmesh2074-workers-dev-language-detection-via-992573b8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xcL3AhTGsNt6vJi5y45c2

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agent-data-tools-revmesh2074-workers-dev-language-detection-via-992573b8
```

Example prompt: What language is this text written in: 'Bonjour, comment puis-je vous aider aujourd'hui?' — give me the language name, its ISO codes, and how confident you are.

## When to prefer this

Choose this endpoint when you need fast, local language detection with no external API dependency, covering 82 major languages with ISO code output. It is ideal for routing, filtering, or translation-target selection pipelines where sub-cent cost per call matters. Prefer alternatives if you need support for rare or minority languages beyond the 82 franc-min covers, or if extremely short (under 20 character) inputs are common.

## Known failure modes

- Very short text (under ~20 characters) returns 'und' (undetermined) with low confidence
- Mixed-language text may produce an incorrect or undetermined result
- Rare or minority languages not among the 82 supported may be misidentified
- Missing required 'text' parameter returns an error
- Text over 10,000 characters may be rejected or truncated

## How this service works

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.

## Output

Returns a JSON object with the most likely language (name, ISO 639-1 code, ISO 639-3 code), a boolean confidence flag, an array of next-best candidate languages each with their name, ISO 639-3 code, and relative score, and the character count of the input. Short or ambiguous text may return 'und' (undetermined) as the language code.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "text"
 ],
 "properties": {
  "text": {
   "type": "string",
   "description": "The text (up to 10,000 characters)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "language": {
   "type": "object",
   "properties": {
    "name": {
     "type": "string"
    },
    "iso6391": {
     "type": "string"
    },
    "iso6393": {
     "type": "string"
    }
   }
  },
  "confident": {
   "type": "boolean"
  },
  "candidates": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "score": {
      "type": "number"
     },
     "iso6393": {
      "type": "string"
     }
    }
   }
  },
  "characters": {
   "type": "number"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-data-tools-revmesh2074-workers-dev-language-detection-via-992573b8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-data-tools.revmesh2074.workers.dev](https://www.zero.xyz/host/agent-data-tools.revmesh2074.workers.dev/llms.txt)
