Skip to Content

Post Transcript

A video post's captions as text.

GET
/v1/x/post/transcript

Authorization

apiKey
headerAuthorizationBearer <token>

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

Query Parameters

url?string

The post's link (https://x.com/NASA/status/2125641758432284978).

id?string

The post's id, instead of url.

maxAge?integer

How old a cached answer may be, in seconds; 0 always fetches. Default and most: the endpoint's cache lifetime.

Formatint64
Range0 <= value

Response Body

The answer.

application/json
  1. response

One item, as every single-item endpoint answers: { "data": … }.

data*

A video's captions as text.

Example Request
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,"      }    ]  }}