Post Transcript
A video post's captions as text.
GET
apiKeyheader
AuthorizationBearer <token>An API key from the dashboard: Authorization: Bearer sapi_….
url?stringThe post's link (https://x.com/NASA/status/2125641758432284978).
id?stringThe post's id, instead of url.
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.x.postTranscript({ url: "https://x.com/NASA/status/2125641758432284978" });Example Response
{ "data": { "postId": "2125641758432284978", "language": "en", "generated": false, "text": "NASA needs people from a\nwide variety of backgrounds.\nPhysical science,\nengineering,\nmedicine,\nmilitary,\nfighter pilot,\noperations,\nindustry\nand flight test.\nCome join us!", "cues": [ { "startSeconds": 0.3, "endSeconds": 1.401, "text": "NASA needs people from a" }, { "startSeconds": 1.401, "endSeconds": 2.869, "text": "wide variety of backgrounds." }, { "startSeconds": 2.869, "endSeconds": 3.77, "text": "Physical science," } ] }}