Sift

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

  1. Sign in, create a workspace, and generate a workspace API key.
  2. Call any detect endpoint with your key in `Authorization` or `X-Api-Key`.
  3. 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

v1v2
EngineWordlist and phrase heuristics (no outbound translation).Network translation step; on failure, same wordlist engine as v1 (meta.fallback: true).
LatencyTypically very low; work is done on the server.Usually higher; depends on the translation path and network.
ScoresMultiple candidates with scores and distribution.Often a single top language; see meta.confidence when set.
Empty inputTreated 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 429 by backing off and honoring retryAfterMs.
  • Guard for 400 (missing/empty text), 401, and 413.
  • Use ETags for repeated texts and send If-None-Match to get 304.

Legal

Terms of Service and Privacy Policy.

Next: AuthenticationRequestsLimitsEndpoints.