Extract Subtitles

POST/openapi/v1/extract/subtitles — 1 credit per call.

Returns video metadata and existing subtitle tracks, including manual and auto-generated tracks. YouTube supplies srt, vtt, ttml, json3, srv1, srv2 and srv3. Bilibili supplies native BCC json. Convert it to SRT/VTT or other formats as needed.

Bilibili supports BV/av video links, a selected part (?p=2), individual episodes (ep836876) and b23.tv short links. It does not extract comments or create subtitles for videos without them. The international site bilibili.tv is not currently supported by this endpoint.

curl -X POST https://api.snapany.com/openapi/v1/extract/subtitles \
  -H "Authorization: Bearer sk_snapany_xxx" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://www.youtube.com/watch?v=jNQXAC9IVRw"}'

The response contains:

  • id / title / text / duration / created_at / thumbnail_url: video metadata. created_at is the video's publish time: UTC ISO 8601 when the exact time is known (for example, 2005-04-24T03:31:52.000Z), the original text when only a relative time is available, or absent when unavailable.
  • subtitles: one entry per track (not necessarily one per language) — language_name (display name; auto-generated tracks are labeled, e.g. English (auto-generated)), language_tag (BCP 47 style), and urls with a direct download link per format

Download the URL of the format you need — srt/vtt for players and editors, json3 for programmatic processing with per-cue timestamps.

Bilibili BCC JSON

Each track provides one download URL with format: "json". The BCC body is an array of subtitle cues, each with from and to timestamps in seconds and a content text field.

Multiple tracks can share language_tag. Keep each track as a distinct entry, using its original index in addition to the tag. language_name marks automatic tracks with (auto-generated); it does not distinguish automatic translation from speech recognition.

A video with no subtitles fails with code no_subtitles (HTTP 404) and is not charged — catch that code and fall back to Transcription.

Full schema and a real-shaped response example: API Reference.

Subtitles vs. Transcription

  • This endpoint returns the subtitles YouTube or Bilibili already has — 1 credit, but only for videos that have them.
  • Transcription runs Whisper large-v3 on the audio — works on any video (including those without subtitles) and supports speaker diarization, at 4 credits per minute.

A common pipeline: try /extract/subtitles first; on a no_subtitles error, fall back to /transcriptions.

Billing

1 credit per successful call, deducted after the extraction succeeds. Failed calls (invalid URL, unsupported site, no subtitles) are never charged. See Credits & Billing.