Extract Subtitles

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

Returns video metadata plus every available subtitle track (manual and auto-generated, all languages), each with direct download URLs in seven formats: srt, vtt, ttml, json3, srv1, srv2, srv3. Currently supports YouTube.

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 / published_at / thumbnail_url: video metadata
  • subtitles: one entry per language track — 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. The URLs are signed and expire, so fetch them promptly rather than storing them.

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 already has — instant, 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.