# agentsvc.io Language Detection API

> agentsvc.io Language Detection API is a paid API for AI agents from agentsvc.io, paid per call via x402, $0.0025/call, status unknown (last checked 2026-10-10).

Detects the natural language of a text snippet and returns ranked candidate languages with ISO 639 codes and confidence scores

## Facts

- Endpoint: POST https://agentsvc.io/api/v1/proxy/language-detect?utm_source=zero.xyz
- Price: $0.0025/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentsvc-io-language-detection-api-9447b1a3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_C27G6Cu_-cV-ZNv5YA1Pj

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 agentsvc-io-language-detection-api-9447b1a3 -d '<json body>'
```

Example prompt: What language is this text written in — 'Bonjour, comment allez-vous aujourd'hui?' — and give me the top 3 candidate languages with their confidence scores.

## When to prefer this

Choose this endpoint when you need lightweight, pay-per-call language identification with ISO 639 codes and ranked candidates without managing API keys or subscriptions. It is ideal for agent pipelines that need to route, filter, or preprocess text by language. Prefer it over heavier NLP platforms when you only need language detection and want micro-payment billing via USDC on Base.

## Known failure modes

- Text too short or ambiguous — low confidence score with reliable:false returned
- Unsupported or rare language — detection falls back to closest relative with lower score
- Empty or missing text field — likely 400 Bad Request
- Top parameter exceeds maximum of 10 — validation error
- Payment failure via x402 — 402 Payment Required response before processing

## How this service works

86 APIs for AI agents: web scraping and crawling to Markdown, AI summaries, data extraction and cited answers, screenshots and PDF, PDF, OCR and document conversion, news, paper and developer search and more, paid per call with USDC on Base, Solana, Polygon or Arbitrum via x402. No account, no API key, free sample on every service.

## Output

A JSON object containing the top detected language name, its ISO 639-1 and ISO 639-3 codes, a reliability boolean, a confidence score between 0 and 1, the character count of the input, and an ordered list of up to N candidate languages each with their own name, score, and ISO codes.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "top": {
   "type": "integer",
   "default": 3,
   "maximum": 10,
   "minimum": 1
  },
  "text": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "iso639_1": "fr",
   "iso639_3": "fra",
   "language": "French",
   "reliable": true,
   "candidates": [
    {
     "name": "French",
     "score": 1,
     "iso639_1": "fr",
     "iso639_3": "fra"
    },
    {
     "name": "Spanish",
     "score": 0.622,
     "iso639_1": "es",
     "iso639_3": "spa"
    }
   ],
   "characters": 68,
   "confidence": 0.878
  },
  "success": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentsvc-io-language-detection-api-9447b1a3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agentsvc.io](https://www.zero.xyz/host/agentsvc.io/llms.txt)
