Language Detection API Documentation
Complete reference for the Language Detection API
Authentication
Authorization: Bearer sk_live_your_key_here
GET POST /v1/language/detect
Parameters
| Field | Type | Description |
|---|---|---|
text | string | Text to analyze (required, max 10,000 chars) |
top | integer | Number of top candidates to return (1-10, default 3) |
Response Fields
| Field | Description |
|---|---|
detected_language | Top detected language name |
confidence | Confidence score (0-1) |
is_reliable | Whether confidence >= 0.5 |
details | Array of candidate languages with codes and scores |
scripts | Detected writing scripts with percentages |
Example
curl -X POST "https://snapapis.com/api/v1/language/detect" \ -d "api_key=KEY&text=Bonjour le monde, comment allez-vous?"