Get X For You feed
Get tweets from your personal For You home feed — the timeline as shown: top-level posts plus the replies and quote-tweets X threads in. Returns per tweet: id, url, author {id, handle, name}, text, created_at, lang, likes, retweets, replies, quotes, bookmarks, views, is_retweet, is_quote, plus ref objects retweeted_tweet/quoted_tweet/in_reply_to (each {id, author_handle}, null when N/A). For a retweet the id is the wrapper, not the original — join via retweeted_tweet.id; in_reply_to != null is the reply test. Count is capped by how far the feed paginates before throttling.
Input
count optionalMax tweets to collect. The feed loads ~20-35 per fetch; the script scrolls to accumulate pages until count is met or the feed stops yielding new tweets.
Default: 20Output
tweets requiredGet X tweet
Fetch a tweet by URL — the focal post plus the surrounding conversation. Returns `tweet` (the focal post; null if deleted/tombstoned) and `replies[]`, which holds every other tweet on the conversation page: both the focal's ancestors (the thread above it, present when the focal is itself a reply; each has `in_reply_to` null or pointing above the focal) and the replies below it (`in_reply_to` points at the focal or a sibling reply). Use `in_reply_to` to tell ancestors from replies and rebuild the thread — the array is not filtered to descendants of the focal. Each entry is a canonical tweet record: id, url, author {id, handle, name}, text, created_at, lang, likes, retweets, replies, quotes, bookmarks, views, is_retweet, is_quote, in_reply_to {id, author_handle}. Scrolls the main thread until `count` is met (then complete=false — more may exist) or it drains (complete=true). Replies behind a "Show more replies"/hidden/probable-spam cursor are not expanded, so even complete=true is a floor, not a guarantee every nested reply was seen.
Delete tweet
Delete one of your own tweets given its URL. Returns the deleted tweet id and a deleted flag.
Search X tweets
Search X for tweets, supporting all X search operators; the tab arg picks 'top' (ranked sample, default) or 'latest' (chronological). Returns per tweet a canonical record: id, url, author {id, handle, name}, text, created_at, lang, likes, retweets, replies, quotes, bookmarks, views, is_retweet, is_quote, plus followers (the author's follower count, a search-only enrichment), and the top-level query and count. Top is a ranked sample, not exhaustive.
