Skip to Content

Batch Transcripts

Up to 20 videos' captions at once, by their ids.

GET
/v1/youtube/batch/transcripts

Authorization

apiKey
headerAuthorizationBearer <token>

An API key from the dashboard: Authorization: Bearer sapi_….

Query Parameters

ids*string

Up to 20 video ids, comma-separated.

language?string

A language code (en, de): its captions when a video has them, else those in the language spoken.

Response Body

The answer.

application/json
  1. response

A page of a list, as every list endpoint answers: { "data": [...], "pagination": … }.

data*array<>
pagination*
Example Request
import { SocialAPI } from "@socialapihq/sdk";const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });const { data, pagination } = await client.youtube.batchTranscripts({ ids: "Ip5EiqbuBpE" });
Example Response
{  "data": [    {      "cues": [        {          "endSeconds": 7.1,          "startSeconds": 0,          "text": "Did you know that you can play any game,"        },        {          "endSeconds": 7.1,          "startSeconds": 1.8,          "text": "even PC games, on Mac for free?"        },        {          "endSeconds": 12.5,          "startSeconds": 7.8,          "text": "Well, okay, not any game. And you still"        }      ],      "generated": true,      "language": "en",      "languages": [        "en"      ],      "postId": "Ip5EiqbuBpE",      "text": "Did you know that you can play any game,\neven PC games, on Mac for free?\nWell, okay, not any game. And you still\nhave to buy the software,\nnot to mention a Mac. But thanks to a\nnew open source program called FX Steam\nLauncher, you can now run Steam OS on\nApple Silicon, unlocking buckets of\ngames that were previously impossible to\nrun, either due to macOS not supporting\n32-bit apps anymore or devel…"    }  ],  "pagination": {    "nextCursor": null,    "hasMore": false  }}