用户发布帖子

通过 Rest ID 检索 X (Twitter) 用户发布的帖子,使用游标分页。用于浏览已知账号的时间线或继续获取其公开帖子历史。

接口 ID
GET /v1/twitter/get_user_posts_v1
接口 ID
twitter.get_user_posts_v1
价格
$0.02 / 次成功调用 · 失败不收费

参数

参数 必填 类型 说明 示例 可选值
rest_id 必填 string X 用户的唯一数字标识符(Rest ID)。 11348282 —
cursor 可选 string 用于浏览长时线内容的分页游标。 — —

代码示例

curl -G "https://api.mofa-ai.com/v1/twitter/get_user_posts_v1" \
  -H "Authorization: Bearer $MOFA_API_KEY" \
  --data-urlencode 'rest_id=11348282'

在线试用

登录后可以在这里直接调用此接口,按价格从余额扣费,失败不收费。新账户赠送 $0.50 试用额度。

登录后试用

响应示例

采集于 2026-11-08,耗时 3526 ms · 请求参数 {"rest_id": "11348282"}

JSON
{
  "success": true,
  "code": 0,
  "message": "success",
  "request_id": "req_5f1c2a9be04d7c3a81f6e2d0",
  "endpoint": "twitter.get_user_posts_v1",
  "cost_usd": 0.02,
  "data": {
    "code": 0,
    "data": {
      "user": {
        "id": "11348282",
        "desc": null,
        "name": "NASA",
        "avatar": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_normal.jpg",
        "friends": null,
        "profile": "NASA",
        "location": "Pale Blue Dot",
        "protected": false,
        "sub_count": null,
        "affiliates": [],
        "created_at": "Wed Dec 19 20:20:32 +0000 2007",
        "media_count": null,
        "header_image": null,
        "blue_verified": true,
        "statuses_count": null
      },
      "pinned": {
        "lang": "en",
        "text": "LIVE: @NASAAdmin and agency leaders are sharing our latest updates on the Moon Base, humanity's first lunar outpost. https://t.co/UN6JuBhFcr",
        "media": [],
        "views": "233111",
        "author": {
          "name": "NASA",
          "avatar": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_normal.jpg",
          "rest_id": "11348282",
          "screen_name": "NASA",
          "blue_verified": true,
          "followers_count": 92275568
        },
        "quotes": 15,
        "source": null,
        "replies": 86,
        "retweets": 154,
        "tweet_id": "2119188276049228152",
        "bookmarks": 77,
        "favorites": 785,
        "sensitive": false,
        "created_at": "Sat Nov 07 22:00:32 +0000 2026",
        "conversation_id": "2119188276049228152"
      },
      "status": "ok",
      "timeline": [
        {
          "lang": "en",
          "text": "RT @NASAMoonBase: New awards. New mission updates. More progress toward a Moon Base.\n\nWe're advancing commercial lunar deliveries, a nuclea…",
          "media": [],
          "views": "32835",
          "author": {
            "name": "NASA",
            "avatar": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_normal.jpg",
            "rest_id": "11348282",
            "screen_name": "NASA",
            "blue_verified": true,
            "followers_count": 92275568
          },
          "quotes": 0,
          "source": "<a href=\"https://mobile.twitter.com\" rel=\"nofollow\">Twitter Web App</a>",
          "replies": 0,
          "entities": {
            "user_mentions": [
              {
                "name": "NASA Moon Base",
                "id_str": "2031457713868386305",
                "screen_name": "NASAMoonBase"
              }
            ]
          },
          "retweets": 138,
          "tweet_id": "2119201242320904516",
          "bookmarks": 0,
          "favorites": 0,
          "retweeted": {
            "id": "2119200929719472530"
          },
          "sensitive": null,
          "created_at": "Sat Nov 07 22:52:03 +0000 2026",
          "conversation_id": "2119201242320904516",
          "retweeted_tweet": {
            "lang": "en",
            "text": "New awards. New mission updates. More progress toward a Moon Base.\n\nWe're advancing commercial lunar deliveries, a nuclear-powered rover, launch and orbital transfer services, and infrastructure to su…",
            "media": [],
            "views": "83254",
            "author": {
              "name": "NASA Moon Base",
              "avatar": "https://pbs.twimg.com/profile_images/2090513058099494912/dBwj4x3V_normal.jpg",
              "rest_id": "2031457713868386305",
              "screen_name": "NASAMoonBase",
              "blue_verified": true
            },
            "quotes": 23,
            "replies": 22,
            "entities": {
              "urls": [
                {
                  "url": "https://t.co/Yt7oqpvLk5",
                  "indices": [
                    246,
                    269
                  ],
                  "display_url": "nasa.gov/news-release/n…",
                  "expanded_url": "https://www.nasa.gov/news-release/nasa-awards-moon-base-transportation-technology-science-projects/"
                }
              ]
            },
            "retweets": 138,
            "tweet_id": "2119200929719472530",
            "bookmarks": 60,
            "favorites": 774,
            "sensitive": false,
            "created_at": "Sat Nov 07 22:50:49 +0000 2026",
            "conversation_id": "2119200929719472530"
          }
        },
        {
          "lang": "en",
          "text": "Do you want to be an astronaut?\n\nApplications are now open to join NASA's astronaut corps. Join us as we expand the frontiers of discovery in low Earth orbit, on the Moon, and beyond — apply by Dec. 3…",
          "media": {
            "video": [
              {
                "id": "2119136507600531456",
                "duration": 63463,
                "variants": [
                  {
                    "url": "https://video.twimg.com/amplify_video/2119136507600531456/pl/8NB31njy-D7yFExo.m3u8?tag=16&v=f45",
                    "content_type": "application/x-mpegURL"
                  },
                  {
                    "url": "https://video.twimg.com/amplify_video/2119136507600531456/vid/avc1/320x568/gGTh1w80J_mIIY7P.mp4?tag=16",
                    "bitrate": 632000,
                    "content_type": "video/mp4"
                  },
                  "… +3"
                ],
                "aspect_ratio": [
                  9,
                  16
                ],
                "original_info": {
                  "width": 1080,
                  "height": 1920,
                  "focus_rects": []
                },
                "media_url_https": "https://pbs.twimg.com/media/HWivgtWW8AEKfEF.jpg"
              }
            ]
          },
          "views": "251212",
          "author": {
            "name": "NASA",
            "avatar": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_normal.jpg",
            "rest_id": "11348282",
            "screen_name": "NASA",
            "blue_verified": true,
            "followers_count": 92275568
          },
          "quotes": 74,
          "source": null,
          "replies": 177,
          "entities": {
            "urls": [
              {
                "url": "https://t.co/laY2ExWiGO",
                "display_url": "go.nasa.gov/4iGqLqu",
                "expanded_url": "https://go.nasa.gov/4iGqLqu"
              }
            ]
          },
          "retweets": 342,
          "tweet_id": "2119136607009734978",
          "bookmarks": 185,
          "favorites": 1588,
          "sensitive": false,
          "created_at": "Sat Nov 07 18:35:13 +0000 2026",
          "conversation_id": "2119136607009734978"
        },
        "… +13"
      ],
      "next_cursor": "DAAHCgABHWj56Pu___ELAAIAAAATMjExODM3ODg3OTA1MjEyMDM1OQgAAwAAAAIAAA",
      "prev_cursor": "DAAHCgABHWj56PvAJxELAAIAAAATMjExOTIwMTI0MjMyMDkwNDUxNggAAwAAAAEAAA"
    },
    "message": null,
  …

示例较长,此处截断显示。