社区

获取社区帖子

GET /v1/communities/{community_id}/tweets reads 2 额度

社区中的帖子,按相关性排序或最新在前。

查询参数

查询参数类型含义
countint 1–100 = 40请求的页大小;X 仅作参考
cursorstring来自上一页的 next_cursor;无法解码的游标返回 400
rankingRelevance | Recency = RelevanceRelevance 取热门帖子,Recency 取最新帖子

响应

社区 id、一页帖子,以及下一页的游标(到底时为 null)。未知或不可用的社区返回 404。

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

请求
curl https://api.xsignalfeed.com/v1/communities/1493446837214187523/tweets?count=20&ranking=Recency \
  -H "Authorization: Bearer xsf_your_key"
响应 · 200 / 400
{
  "community_id": "1493446837214187523",
  "tweets": [
    {
      "id": 2097713756054704513,
      "created_ms": 1788968907737,
      "user_id": 2729705040,
      "user": "buildinpublic",
      "name": "Build in Public",
      "text": "today we're launching DEALS 🎁✨ …",
      "lang": "en",
      "reply_to": null,
      "reply_to_status_id": null,
      "reply_to_user_id": null,
      "conversation_id": "2097713756054704513",
      "is_rt": false,
      "rt_of": null,
      "is_quote": false,
      "quoted": null,
      "media": [
        "https://pbs.twimg.com/media/….jpg"
      ],
      "media_items": [
        {
          "type": "photo",
          "url": "https://pbs.twimg.com/media/….jpg",
          "expanded_url": "https://x.com/buildinpublic/status/2097713756054704513/photo/1",
          "width": 1600,
          "height": 900
        }
      ],
      "urls": [
        "https://…"
      ],
      "views": "18422",
      "counts": {
        "reply": 41,
        "rt": 12,
        "like": 210,
        "quote": 3,
        "bookmark": 55
      },
      "source": "<a href=\"https://mobile.twitter.com\" rel=\"nofollow\">Twitter Web App</a>"
    },
    {
      "…": "…"
    }
  ],
  "next_cursor": "DAABCgABHSYyKLN__-kKAAIdJidkM5rByQgAAwAAAAIAAA"
}