Trending
What is trending in a country, about 20 videos.
GET
apiKeyheader
AuthorizationBearer <token>An API key from the dashboard: Authorization: Bearer sapi_….
country?stringThe country, as a two-letter code (us, the default).
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.youtube.trending({ country: "us" });Example Response
{ "data": [ { "id": "1lOvAvBlzSM", "url": "https://www.youtube.com/watch?v=1lOvAvBlzSM", "text": null, "createdAt": null, "author": { "id": "UCRI7hheejBbWS6etTNwMT0g", "username": "", "displayName": "Anuel AA", "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/channel/UCRI7hheejBbWS6etTNwMT0g" }, "stats": { "views": 14000000, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/1lOvAvBlzSM/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLC9aaDpdo1563UzBwONSm_s8Imb1w", "width": null, "height": null, "durationSeconds": 265 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Anuel AA | SE TOCO EL T*TITO CON MI GL*CK (Video Oficial)", "durationSeconds": 265, "publishedText": "4 days ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } }, { "id": "LJC7mgjp5FQ", "url": "https://www.youtube.com/watch?v=LJC7mgjp5FQ", "text": null, "createdAt": null, "author": { "id": "UCqECaJ8Gagnn7YCbPEzWH6g", "username": "", "displayName": "Taylor Swift and CMA", "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/channel/UCqECaJ8Gagnn7YCbPEzWH6g" }, "stats": { "views": 6700000, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/LJC7mgjp5FQ/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLDBhBILu6Abo1lHBzCtxXDoZTFkgQ", "width": null, "height": null, "durationSeconds": 189 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Taylor Swift - I Knew It, I Knew You x Our Song (Live From The 60th CMA Awards)", "durationSeconds": 189, "publishedText": "6 days ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } } ], "pagination": { "nextCursor": null, "hasMore": false }}