Skip to content

Timed subtitles

GET/v1/media/subtitles1 credit

A video post's speech as timed cues, as JSON or as an SRT or WebVTT file, from YouTube, TikTok, Instagram, X, Facebook, LinkedIn, Twitch and Kick clips, Reddit and Rumble. When the platform has its own caption track with timing (YouTube, TikTok, Reddit, Rumble, LinkedIn's and Facebook's caption files) that track is used (`origin: source`); otherwise the audio is transcribed by speech recognition with cue times (`origin: asr`). Our own route: ScrapeCreators has no subtitles contract.

01Query parameters

NameTypeDescription
urlrequiredstringThe video post URL, e.g. `https://www.youtube.com/watch?v=dQw4w9WgXcQ`, a TikTok video, an Instagram reel or post, an X status, a Facebook video or reel, a LinkedIn post, a Twitch or Kick clip, a Reddit post or a Rumble video.
formatoptionalstring`json` answers the envelope with the cues; `srt` and `vtt` answer the file itself (`application/x-subrip`, `text/vtt`, as an attachment).Default: jsonAccepted values:jsonsrtvtt
languageoptionalstringTwo-letter code of the caption track to prefer (YouTube, TikTok, Reddit).
allow_long_transcriptionoptionalboolean`true` allows speech recognition of videos over 120 s, at 10 credits per started minute.Default: false
indexoptionalintegerInstagram only: which video of a carousel (1 = the first).Default: 1

02Pricing

The platform's transcript price: a caption track 1 credit; speech recognition 1 credit up to 120 s, a longer video is a free 400 unless `allow_long_transcription=true` (10 credits per started minute); no speech or no track 0; every error free. For `srt` and `vtt` the credits are in the `X-Credits-Charged` and `X-Credits-Remaining` headers.

03Request

curl "https://api.scrapesocial.ai/v1/media/subtitles?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdQw4w9WgXcQ&format=srt" \
  -H "x-api-key: $SCRAPESOCIAL_KEY"

04Responses

Real answers from the API. Lists are shortened to 2 items.

GET /v1/media/subtitles?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdQw4w9WgXcQ

{
  "success": true,
  "credits_remaining": 4980,
  "credits_charged": 1,
  "platform": "youtube",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "origin": "source",
  "language": "en",
  "duration_seconds": null,
  "segments": [
    {
      "index": 1,
      "start": 18.8,
      "end": 21.8,
      "text": "We're no strangers to"
    },
    {
      "index": 2,
      "start": 21.8,
      "end": 25.96,
      "text": "love. You know the rules and so do"
    }
  ]
}

Common to every endpoint

Any route can answer these: a missing or wrong key, no credits left, the platform not answering, or a failure on our side. None of them costs credits.

GET /v1/cosmos/profile?handle=design

{
  "success": false,
  "message": "Invalid API key"
}

05Notes

The JSON answer is `platform, url, origin` (`source`, `asr`, or null when nothing was found), `language` (ISO 639-1 when known), `duration_seconds` (null when the source does not say), `segments[{index, start, end, text}]` with times in seconds (3 decimals). In the files cues are numbered from 1 and times are rounded to the millisecond; WebVTT text is escaped (`&`, `<`, `>`). Speech recognition cuts long audio into pieces and shifts each piece's cues by the piece's start, so a cue can break at a piece boundary. A video without captions or speech answers an empty list (or an empty file) for 0 credits. An unsupported host is a free 400 `unsupported_platform`.

06Errors & credits

Every error has success: false, a real HTTP status and costs no credits.

  • 400missing_parameter

    A required parameter is missing or invalid.

  • 403private_account

    The account is private or age-restricted.

  • 404not_found

    No such account.

  • 503upstream_error

    The platform did not answer; retry shortly.