SocialToAI免费开始控制台

trending

POST /v1/trending 是“热榜”动作:现在什么在火。目前在 8 个平台上开放(X、Reddit、小红书、抖音、微博、B 站 等),平台是请求里的一个参数。每次调用 2 到 12 积分,因平台而异;失败的调用不扣。

POSThttps://api.socialtoai.com/v1/trending

请求

请求体是 JSON。下面这几项每个动作都一样,其余的参数因平台而异,见后文。

名称类型位置必填说明
platformstring请求体是要读的平台,取这个动作已开放的平台之一。
max_cost_creditsinteger请求体否这次调用最多花多少积分。超出时免费拒绝,并在返回里给出报价。
Idempotency-Keystring请求头否1 到 255 个可见 ASCII 字符。同一个键加同样的参数会返回第一次的结果,不会重复扣费。

平台与积分

每个平台收的参数不同。平台自己的页面上有完整的参数表、字段表和可以改的请求。

平台价格键积分必填可选每页
Xx.trending6–board、region30
Redditreddit.trending2–board25
小红书xiaohongshu.trending12–board20
抖音douyin.trending2–board51
微博weibo.trending2–board51
B 站bilibili.trending2–board50
知乎zhihu.trending2–board50
快手kuaishou.trending2––60

有些平台的这个动作还有另一种取值,由某个参数选中,单独计价:

平台价格键积分由什么选中
Redditreddit.trending:trends2type=trends
抖音douyin.trending:videos2type=videos
B 站bilibili.trending:videos2type=videos

参数

名称类型说明哪些平台收
boardstring选哪个榜:现在只有趋势榜取值因平台而异:trends、popular、searches、inspiration、hot_search、rising、topics、music …X、Reddit、小红书、抖音、微博、B 站和知乎
regionstring取哪个国家的趋势,两个字母的代码:US、GB、CA、AU、IN、JP、DE、FR、BR、MX;不写是全球X

示例

X:现在的热榜:标题、名次和热度。

curl https://api.socialtoai.com/v1/trending \  -H "Authorization: Bearer $SOCIALTOAI_KEY" \  -H "Content-Type: application/json" \  -d '{    "platform": "x"  }'
import osimport requestsresponse = requests.post(    "https://api.socialtoai.com/v1/trending",    headers={"Authorization": f"Bearer {os.environ['SOCIALTOAI_KEY']}"},    json={        "platform": "x",    },)print(response.json())
返回200 OK6 积分
{  "request_id": "req_00000000-0000-4000-8000-000000000001",  "schema_version": "v1",  "fetched_at": "2026-10-13T03:29:53.000Z",  "action": "trending",  "platform": "x",  "status": "ok",  "items": [    {      "platform": "x",      "id": null,      "ref": null,      "approx": [],      "type": "entry",      "entry_type": "trend",      "title": "…",      "url": null,      "rank": 1,      "heat": null,      "fields": {}    }  ],  "unavailable": ["id", "heat", "url"],  "page": {    "has_more": false  },  "warnings": [],  "applied_params": {},  "cost_credits": 6,  "billing": {    "cost_credits": 6,    "balance_credits": 94,    "today_spend_credits": 6,    "daily_limit_credits": null,    "daily_remaining_credits": null,    "display": "本次 6 积分,余额 94 积分"  },  "replayed": false}

示例数据:名字、链接和正文已换成占位符。

返回什么

返回外层结构,items 里是 entry:trend、content 对象。一次调用返回一页,最多 30 条;每一页是一次调用。cursor 最长 30 分钟内有效。

失败的调用是 0 积分,并说明原因,见错误。

最近更新: