User Published Posts
Retrieves posts published by an X (Twitter) user identified by Rest ID, with cursor pagination. Use it to browse a known account's timeline or continue through its public post history.
Parameters
| Name | Required | Type | Description | Example | Allowed values |
|---|---|---|---|---|---|
rest_id |
Required | string | The unique numeric identifier (Rest ID) for the X user. | 11348282 |
— |
cursor |
Optional | string | Pagination cursor for navigating through long timelines. | — | — |
Code samples
curl -G "https://api.mofa-ai.com/v1/twitter/get_user_posts_v1" \
-H "Authorization: Bearer $MOFA_API_KEY" \
--data-urlencode 'rest_id=11348282'
import os
import requests
resp = requests.get(
"https://api.mofa-ai.com/v1/twitter/get_user_posts_v1",
headers={"Authorization": f"Bearer {os.environ['MOFA_API_KEY']}"},
params={
"rest_id": "11348282",
},
timeout=60,
)
body = resp.json()
if body["success"]:
print(body["cost_usd"], body["data"])
else:
print(body["error"], body["message"])
const url = new URL("https://api.mofa-ai.com/v1/twitter/get_user_posts_v1");
url.search = new URLSearchParams({
rest_id: "11348282",
});
const resp = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.MOFA_API_KEY}` },
});
const body = await resp.json();
if (body.success) console.log(body.cost_usd, body.data);
else console.error(body.error, body.message);
Try it
Sign in to call this endpoint from this page. Successful calls are billed to your balance, failed calls are free, and new accounts get $0.50 of trial credit.
Example response
Captured 2026-11-08, took 3526 ms · Request parameters {"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,
…
Truncated for display; the full response is longer.