API reference

The complete HTTP contract for retrieving native YouTube captions and generating transcripts when captions are unavailable.

Base URL

All public API endpoints use HTTPS and the following production origin.

Base URL
https://capslane.com

Authentication

Send a workspace key in the x-api-key request header. Keep production keys in server-side environment variables.

Header
x-api-key: vxl_live_...
GET

/v1/transcript

Return an existing transcript immediately or create an asynchronous generation job.

Query parameters

ParameterTypeDefaultDescription
urlstringRequiredPublic YouTube URL, Shorts URL or 11-character video ID.
langstringSource languagePreferred ISO language code such as en or fr-FR.
modeenumautonative, auto or generate.
textbooleanfalseReturn one string instead of timestamped segments.
chunkSizeintegerNative segmentsGroup content into chunks from 50 to 10,000 characters.
cURL
curl --get 'https://capslane.com/v1/transcript' \
  --data-urlencode 'url=dQw4w9WgXcQ' \
  --data-urlencode 'lang=en' \
  --data-urlencode 'mode=auto' \
  -H 'x-api-key: YOUR_API_KEY'

200 response

A native, generated or cached transcript is ready. Offsets and durations are expressed in milliseconds.

JSON
{
  "content": [
    {
      "text": "Example segment",
      "offset": 8150,
      "duration": 1200,
      "lang": "en"
    }
  ],
  "lang": "en",
  "availableLangs": ["en", "fr"],
  "source": "native",
  "cached": false,
  "requestId": "req_..."
}

202 response

A generated transcript was accepted. Poll the returned job URL with the same API key.

JSON
{
  "jobId": "job_550e8400-e29b-41d4-a716-446655440000",
  "status": "queued",
  "progress": 5,
  "requestId": "req_..."
}
GET

/v1/transcript/:jobId

Read the current state of an asynchronous transcript. The job belongs to the workspace that created it.

cURL
curl 'https://capslane.com/v1/transcript/job_550e8400-e29b-41d4-a716-446655440000' \
  -H 'x-api-key: YOUR_API_KEY'

Job states

queued, downloading, processing, persisting, completed, failed or cancelled.

JSON
{
  "jobId": "job_550e8400-e29b-41d4-a716-446655440000",
  "status": "processing",
  "progress": 35,
  "requestId": "req_..."
}

Errors

Every error is JSON and includes a request ID for log correlation.

JSON
{
  "error": "invalid_video_id",
  "message": "The YouTube video ID is invalid",
  "requestId": "req_..."
}
StatusCommon codeMeaning
400invalid_requestThe query does not match the API contract.
401invalid_api_keyThe key is missing, invalid, expired or revoked.
404transcript_unavailableNo caption is available in native mode.
404job_not_foundThe job does not exist in this workspace.
429monthly_limit_exceededThe workspace reached its monthly request limit.
502upstream_unavailableThe source could not be reached safely.

Limits

The API accepts up to 120 requests per minute per client. One accepted transcript request reserves one monthly unit. Polling an existing job does not reserve another unit.