Post Transcript
A video's captions as text.
GET
apiKeyheader
AuthorizationBearer <token>An API key from the dashboard: Authorization: Bearer sapi_….
url?stringThe video's link.
id?stringThe video's id, instead of url.
language?stringA language code (en, de, pt-BR): its captions when the video has them, else
those in the language spoken.
maxAge?integerHow old a cached answer may be, in seconds; 0 always fetches. Default and most: the endpoint's cache lifetime.
Format
int64Range
0 <= valueThe answer.
application/json- response
One item, as every single-item endpoint answers: { "data": … }.
data*A video's captions as text.
import { SocialAPI } from "@socialapihq/sdk";const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });const { data } = await client.youtube.postTranscript({ url: "https://www.youtube.com/watch?v=Ip5EiqbuBpE", language: "en" });Example Response
{ "data": { "postId": "Ip5EiqbuBpE", "language": "en", "generated": true, "languages": [ "en" ], "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…", "cues": [ { "startSeconds": 0, "endSeconds": 7.1, "text": "Did you know that you can play any game," }, { "startSeconds": 1.8, "endSeconds": 7.1, "text": "even PC games, on Mac for free?" }, { "startSeconds": 7.8, "endSeconds": 12.5, "text": "Well, okay, not any game. And you still" } ] }}