趋势

获取趋势

GET /v1/trends reads 2 额度

X 探索页面上的热门趋势,以排名列表返回:总体的“趋势”列表,或“新闻”、“体育”、“娱乐”标签页。

查询参数

查询参数类型含义
categorytrending | news | sport | entertainment = trendingtrending、news、sport 或 entertainment(不区分大小写;也接受 sports)。“体育”标签页经常为空。
limitint 1–100 = 30最多返回的趋势数量

响应

类别、X 在列表上方显示的标题(没有时为 null),以及按排名排列的趋势——每条趋势含名称、X 附加的上下文标签、X 显示时的帖子数或摘要行、相关的分组趋势和一个搜索 URL。列表只有一页;若某个标签页 X 当前没有任何内容,列表可能为空,空列表不计费。

状态: 200, 400, 422, 429, 502

请求
curl https://api.xsignalfeed.com/v1/trends?category=trending&limit=20 \
  -H "Authorization: Bearer xsf_your_key"
响应 · 200 / 400
{
  "category": "trending",
  "title": "United States trends",
  "trends": [
    {
      "rank": 1,
      "name": "#dwts",
      "description": null,
      "posts": null,
      "domain": "Movies & TV · Trending",
      "url": "https://x.com/search?q=%23dwts&src=trend_click&vertical=trends",
      "related": [
        "Maura",
        "Amber"
      ]
    },
    {
      "rank": 2,
      "name": "#AEWDynamite",
      "description": null,
      "posts": null,
      "domain": "Wrestling · Trending",
      "url": "https://x.com/search?q=%23AEWDynamite&src=trend_click&vertical=trends",
      "related": [
        "All Out",
        "Lena Kross"
      ]
    }
  ]
}