Overview
Sift includes language detection plus workspace, auth, and admin API routes. /api/v1/detect runs the on-server detector only. /api/v2/detect first tries remote language inference and falls back to the same local detector if that fails. The full route reference is in /docs/endpoints.
Start in 3 minutes
- Sign in, create a workspace, and generate a workspace API key.
- Call any detect endpoint with your key in `Authorization` or `X-Api-Key`.
- Read `language`, `certainty`, and `distribution` from the JSON response.
Production app surfaces are split by host: account pages on https://sift.nu, and Pro/Business workspace dashboards on https://workspace.sift.nu.
Base URL
In production, requests are made to your deployed host, for example https://sift.nu. Paths are always /api/v1/detect and /api/v2/detect (no trailing slash required).
Choosing v1 or v2
| v1 | v2 | |
|---|---|---|
| Engine | Wordlist and phrase heuristics (no outbound translation). | Network translation step; on failure, same wordlist engine as v1 (meta.fallback: true). |
| Latency | Typically very low; work is done on the server. | Usually higher; depends on the translation path and network. |
| Scores | Multiple candidates with scores and distribution. | Often a single top language; see meta.confidence when set. |
| Empty input | Treated like missing text (400). | Whitespace-only body returns 400 “Text is empty”. |
Quick start
Replace YOUR_TEAM_API_KEY and host as needed. See Authentication for how workspace keys work.
curl -sS -H "Authorization: Bearer YOUR_TEAM_API_KEY" \ "https://sift.nu/api/v1/detect?text=Hello%20world"
curl -sS -X POST "https://sift.nu/api/v2/detect" \
-H "Authorization: Bearer YOUR_TEAM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Bonjour le monde"}'// Node.js (native fetch)
const res = await fetch("https://sift.nu/api/v1/detect?text=Hola%20mundo", {
headers: { Authorization: "Bearer YOUR_TEAM_API_KEY" },
});
const json = await res.json();What you get back
Successful JSON bodies include language (tag), label, flag, certainty, scores, distribution, meta, and responseTimeMs. Error responses are JSON objects with error (string) and responseTimeMs. Details and examples: Endpoints, Common errors.
Production checklist
- Do not expose workspace API keys in browser code. Call from your backend when possible.
- Handle
429by backing off and honoringretryAfterMs. - Guard for
400(missing/empty text),401, and413. - Use ETags for repeated texts and send
If-None-Matchto get304.
Legal
Terms of Service and Privacy Policy.
Next: Authentication → Requests → Limits → Endpoints.