Trending
The topics trending in a country, or worldwide.
GET
apiKeyheader
AuthorizationBearer <token>An API key from the dashboard: Authorization: Bearer sapi_….
country?stringThe country, as its ISO code (us, gb, tr); worldwide without one.
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
A page of a list, as every list endpoint answers: { "data": [...], "pagination": … }.
data*array<>pagination*import { SocialAPI } from "@socialapihq/sdk";const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });const { data, pagination } = await client.x.trending({ country: "us" });Example Response
{ "data": [ { "name": "Black Friday", "rank": 1, "url": "https://x.com/search?q=%22Black+Friday%22", "query": "\"Black Friday\"", "posts": 410333 }, { "name": "Good Friday", "rank": 2, "url": "https://x.com/search?q=%22Good+Friday%22", "query": "\"Good Friday\"", "posts": 61900 } ], "pagination": { "nextCursor": null, "hasMore": false }}