# x402node Language Detection

> x402node Language Detection is a paid API for AI agents from api.x402node.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-13).

Detects the language of input text using rule-based unicode-script analysis and Latin stopword matching, returning ISO 639-1 code, detection method, and confidence score.

## Facts

- Endpoint: GET https://api.x402node.dev/nlp/detect
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-x402node-dev-9b2fed34
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__3L0gGbMkcFUJwJ-cGDrR

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 api-x402node-dev-9b2fed34
```

Example prompt: What language is this text written in: 'Bonjour le monde, comment ça va?' — give me the ISO 639-1 code and your confidence level.

## When to prefer this

Choose this endpoint when you need lightweight, fast language detection without relying on a third-party ML API, especially for AI agent pipelines that need to route text by language, enforce language policies, or preprocess multilingual input. It is well-suited for high-volume analytics use cases given its low per-call cost and rule-based determinism.

## Known failure modes

- Empty or whitespace-only text input returns no detectable language
- Very short text (single word) may yield low confidence score
- Mixed-language text may produce ambiguous or incorrect language code
- Unsupported or rare scripts may fall back to low-confidence guess
- Network timeout or payment validation failure returns error response

## How this service works

Detect text language with rule-based unicode-script + Latin stopword matching. Returns ISO 639-1 code, detection method, confidence. Use ?text=Bonjour+le+monde. Built for AI agents routing inputs by language, content moderation, and analytics. Accepts payment on Base or Solana — either network works.

## Output

Returns a JSON object with the detected ISO 639-1 language code (e.g. 'fr'), the detection method used (unicode-script or Latin stopword matching), and a confidence score indicating how certain the detection is.

## Example request

```json
{
 "text": "Hello world"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "text"
     ],
     "properties": {
      "text": {
       "type": "string",
       "description": "Input text (required)"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-x402node-dev-9b2fed34/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.x402node.dev](https://www.zero.xyz/host/api.x402node.dev/llms.txt)
