Get Recent Posts from a Public Account
View all X (Twitter) Public Data API endpoints →Pass required screenname to read an account's recent timeline. Optional rest_id overrides the handle selection but does not remove the schema requirement for screenname. Leave cursor empty on the first request, then use the returned next_cursor unchanged for later pages. The observed response has status=ok, timeline, user, next_cursor and prev_cursor. Timeline entries include tweet_id, text, created_at, favorites, retweets, replies, quotes, bookmarks, views, entities, author and media. Reposts can include retweeted and retweeted_tweet; author fields can be null, and views may be a numeric string. Verify author.rest_id against the target, preserve IDs as strings and deduplicate tweet_id across pages. Stop on a missing, empty or repeated next_cursor. Returned page sizes and available history vary; this is not a complete historical archive or a streaming feed.
API Features
Live API Demo
🔒 Sign in to try it live
Log in to call this API with your own API key. New accounts get 100 free credits — no card required.
Log in / Sign upNo active API key found. Create one in your Dashboard, then reload this page. Dashboard →
/api/project/twitter/user-timeline API Response (JSON)
{} curl -X GET 'https://api.opendata-api.com/api/project/twitter/user-timeline?key=<API_KEY>&screenname=NASA'
Query Result
Use Cases
- Build a Python collector for recent institutional posts using screenname, next_cursor and tweet_id deduplication.
- Compare observed posting cadence over equivalent captured windows, checking author IDs and distinguishing repost activity.
- Maintain a timestamped local record of a public announcement account without presenting it as the account's complete history.
- Join account timeline entries to campaign references and schedule selective tweet-info refreshes for changing engagement counters.
Frequently asked questions
How do I paginate an account timeline with next_cursor?
Send required screenname without cursor for the first page, then pass next_cursor unchanged as cursor for the same account. Stop on a missing, empty or repeated cursor and deduplicate tweet_id. Optional rest_id overrides account selection but does not remove required screenname.
Does this endpoint return every historical tweet by the account?
No complete-history or streaming guarantee is established. Returned page sizes and available history vary. Check author.rest_id against the resolved target and distinguish repost activity, embedded retweeted_tweet content and null authors when building an authored-post dataset.