Skip to Content

Trending Posts

The posts trending on X today.

GET
/v1/x/trending/posts

Authorization

apiKey
headerAuthorizationBearer <token>

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

Query Parameters

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

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.x.trendingPosts();
Example Response
{  "data": [    {      "id": "2126009871904473417",      "url": "https://x.com/RealDWMead/status/2126009871904473417",      "text": "Macy's Thanksgiving Day Parade",      "createdAt": "2026-11-26T17:47:07.472Z",      "author": {        "id": "715915536769548288",        "username": "RealDWMead",        "displayName": "Real DW",        "avatarUrl": "https://pbs.twimg.com/profile_images/2117000478143782912/v7yGM6Vs_400x400.jpg",        "verified": true,        "url": "https://x.com/RealDWMead"      },      "stats": {        "views": 5549057,        "likes": 89480,        "comments": 1452,        "shares": 9107,        "saves": 11343,        "engagementRate": 0.018      },      "media": [        {          "kind": "video",          "url": "https://video.twimg.com/amplify_video/2126009852375785472/vid/avc1/1078x926/qkZTf4ZusZxP7o3n.mp4?tag=29",          "thumbnailUrl": "https://pbs.twimg.com/amplify_video_thumb/2126009852375785472/img/mbCcqZJR31PBF9OJ.jpg",          "width": 1078,          "height": 926,          "durationSeconds": 12.942        }      ],      "hashtags": [],      "mentions": [],      "ext": {        "quotes": 771,        "language": "en",        "conversationId": null,        "replyTo": null,        "repost": null,        "quoted": null,        "pinned": false,        "sensitive": false,        "links": [],        "altTexts": [],        "playlists": [          "https://video.twimg.com/amplify_video/2126009852375785472/pl/Xynp5TEl3EIKn_5w.m3u8?tag=29&v=9da"        ]      }    },    {      "id": "2126058835836293262",      "url": "https://x.com/DonaldTDaily/status/2126058835836293262",      "text": "🚨#BREAKING: Mamdani is furious after Patriots in Times Square broke out a full marching band and turned Thanksgiving into a massive American celebration.\n\nKEEP ON ROLLING, AMERICA! πŸ‡ΊπŸ‡Έ",      "createdAt": "2026-11-26T21:01:41.383Z",      "author": {        "id": "869643503323631617",        "username": "DonaldTDaily",        "displayName": "Commentary Donald J. Trump News",        "avatarUrl": "https://pbs.twimg.com/profile_images/2112081298592243713/9sWNKWXK_400x400.jpg",        "verified": true,        "url": "https://x.com/DonaldTDaily"      },      "stats": {        "views": 2420104,        "likes": 118498,        "comments": 3300,        "shares": 20803,        "saves": 4877,        "engagementRate": 0.0589      },      "media": [        {          "kind": "video",          "url": "https://video.twimg.com/amplify_video/2126058339666698240/vid/avc1/968x1178/Q1hdzY-oezRgmqoF.mp4?tag=29",          "thumbnailUrl": "https://pbs.twimg.com/amplify_video_thumb/2126058339666698240/img/m7WkUKcSS3hqVRyW.jpg",          "width": 968,          "height": 1178,          "durationSeconds": 36.633        }      ],      "hashtags": [],      "mentions": [],      "ext": {        "quotes": 836,        "language": "en",        "conversationId": null,        "replyTo": null,        "repost": null,        "quoted": null,        "pinned": false,        "sensitive": false,        "links": [],        "altTexts": [],        "playlists": [          "https://video.twimg.com/amplify_video/2126058339666698240/pl/tZJenG2s02BThvmx.m3u8?tag=29&v=cfc"        ]      }    }  ],  "pagination": {    "nextCursor": null,    "hasMore": false  }}