Developers

LangCapture API

Capture sentences, translate pages, and integrate LangCapture into your own tools with a personal API token.

Authentication

All API requests authenticate with a personal bearer token. Create one on the API tokens page (Settings → API tokens), then send it in the Authorization header:

Authorization: Bearer <YOUR_TOKEN>

The base URL is https://www.langcapture.com. Tokens are shown once at creation — store them securely and never commit them to source control.

Capture a sentence

POST /api/sentences saves a sentence and translates it into your account's native language. Set your target and native languages once under Settings → Language before the first call.

curl -X POST https://www.langcapture.com/api/sentences \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"original_text": "Could you take a look at this PR when you get a chance?"}'

Pass ?mode=async with the header X-LangCapture-Async: 1 to enqueue translation in the background and return immediately (HTTP 202) — useful for batch uploads from a CLI or agent.

curl -X POST "https://www.langcapture.com/api/sentences?mode=async" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "X-LangCapture-Async: 1" \
  -H "Content-Type: application/json" \
  -d '{"original_text": "Let's take that offline."}'

Status codes:

  • 200 / 202 — saved (202 for async)
  • 402 — out of credits
  • 409 — duplicate sentence
  • 428 — language setup required (Settings → Language)

List your sentences

curl "https://www.langcapture.com/api/sentences?page=1&pageSize=20" \
  -H "Authorization: Bearer <YOUR_TOKEN>"

Batch translate (immersive)

POST /api/immersive-translate translates many short segments at once — the endpoint behind the browser extension's page-translation feature. Up to 40 items and 12,000 characters per request.

curl -X POST https://www.langcapture.com/api/immersive-translate \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "request_id": "batch-1",
    "target_language": "Chinese",
    "source_language": "auto",
    "items": [{ "id": "1", "text": "Ship it." }]
  }'

Credits

Translation and the first TTS generation consume credits based on usage; replaying already-generated audio is free. Check your balance under Settings → Credits, or upgrade on the pricing page when you need more.

Build with LangCapture

Create a token and start capturing real sentences from your tools.

Get an API token