Official scripts
Explore our curated collection of scripts
Log in to X (Twitter) with Google
Log into X (Twitter) with Continue with Google, picking the given Google account in Google's sign-in window, and land on the X home timeline. Returns straight away if already signed in, and reports the X handle that is signed in. Needs a browser that is already signed in to that Google account.
Bookmark a tweet on X (Twitter)
Bookmark a tweet given its URL. Already-bookmarked tweets are reported rather than re-bookmarked. Returns tweet_id, bookmarked, was_bookmarked.
Read an X (Twitter) Article
Read a long-form X (Twitter) Article from its link: title, author, publish date, cover image, engagement counts, and the full body in reading order, with its headings, lists, quotes, links, images, videos and code blocks. Links of the form x.com/<handle>/article/<id> open signed in or out; signed out, X shows no engagement counts, so those come back empty. Links of the form x.com/i/article/<id> open only for a signed-in account.
Check which X (Twitter) account is signed in
Report which X (Twitter) account this browser is signed in as: the @handle, display name and numeric user id. When the browser is signed out of X, the run fails with a message asking you to sign in to x.com, so it can be used to check a session before running other X scripts.
Create an X (Twitter) List
Create an X (Twitter) List with a name (25 characters at most), an optional description (100) and public or private visibility. Returns the new list_id, its url, the name, the description and whether it is private. Add accounts to it with add_to_list.
Unblock an account on X (Twitter)
Unblock an X user by handle. Accounts that aren't blocked are reported rather than erroring. Returns handle, blocked, was_blocked.
List your X (Twitter) DM inbox
List the conversations in your X chat inbox, in the order X shows them. Returns per conversation: conversation_id, name, handle, last_message, time, sent_by_me (null in a group conversation) and unread. An empty inbox returns an empty list. If X asks for your chat passcode on this browser, pass the 4-digit passcode as pin; without it the run fails with an error asking for it. When the browser is signed out of X, the run fails with a signed-out error asking you to sign in to x.com.
Get the members of an X (Twitter) List
List the accounts that belong to an X list, given the list's URL or id. Returns per account: user_id, handle, name, followers, following, tweets, verified, location, website, bio.
Read an X (Twitter) Community's posts
Read the posts of an X (Twitter) Community, by its numeric id (x.com/i/communities/<id>), from its Top tab (default) or its Latest tab. Returns the community_id, the tab, the count, and per post: id, url, author handle and name, text, created_at, has_media, and reply, retweet and like counts. Needs a signed-in account: signed out, X shows no feed.
Block an account on X (Twitter)
Block an X user by handle. Already-blocked accounts are reported rather than re-blocked. Returns handle, blocked, was_blocked.
Add an account to an X (Twitter) List
Add an account to one of your X (Twitter) Lists, by its exact handle and the List's id (from x.com/i/lists/<id>, or from create_list). An account already in the List is reported, not added twice. Returns list_id, handle, already_member, and the List's member count before and after.
X (Twitter) trends: read trending topics on Explore
Read X's Explore trends for a given tab (trending, news, sports, entertainment or for-you), with each trend's rank, name, context line and post count where shown. Results are personalised to the logged-in account's location and interests, not a global chart.
Search X (Twitter) users by keyword, with bio and follower counts
Search X for accounts by keyword (the People tab). Returns per account: user_id, handle, name, followers, following, tweets, verified, location, website, bio.
Read an X (Twitter) List's timeline
Read the timeline of an X list — the tweets from its member accounts, newest first, given the list's URL or id. 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.
Undo a retweet (repost) on X (Twitter)
Undo your repost of a tweet given its URL. Tweets that aren't currently reposted are reported rather than causing an error. Returns tweet_id, retweeted, was_retweeted.
Get X (Twitter) user profile
Look up an X (Twitter) user's profile by handle. Returns handle, user_id, name, bio, location, website, joined, followers_count, following_count, is_verified, is_self, is_following, follows_you. Counts are exact integers. bio and website carry the real destination URLs, with X's shortlinks resolved. is_following is null on your own profile. Any of is_self, is_following, follows_you and is_verified is null when X does not say. Requires being signed in to X; a missing or suspended account is an error that says which.
Unpin a tweet from your X (Twitter) profile
Unpin your own tweet from the top of your profile, given its URL. Tweets that aren't currently pinned are reported rather than erroring. Returns tweet_id, pinned, was_pinned, and account_used. X can briefly serve a stale pinned-state right after a preceding pin/unpin on the account — if you just changed the pin state, allow a few seconds before calling this again for a reliable was_pinned reading.
Retweet (repost) a tweet on X (Twitter) from an AI agent
Repost (retweet) a tweet given its URL. Safe to repeat: an already-reposted tweet is reported rather than reposted again. Returns tweet_id, retweeted, was_retweeted, and the repost's id.
Read your X (Twitter) For You timeline
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 quoted_tweet/in_reply_to (each {id, author_handle}, null when N/A). For a repost, the tweet is the reposted original as X shows it: id, author, text and counts are the original's, is_retweet is true, and reposted_by/reposted_at say who reposted it and when. in_reply_to != null is the reply test. Count is capped by how far the feed paginates before throttling. When the browser is signed out of X, the run fails with a signed-out error asking you to sign in to x.com.
See who reposted (retweeted) a post on X (Twitter)
List the accounts that reposted (retweeted) an X post, by post URL. Returns per account: user_id, handle, name, followers, following, tweets, verified, location, website, bio. X returns a sample of reposters, not the full set: high-repost posts cap out a few hundred deep.
Search X (Twitter) posts
Search X (Twitter) for tweets with every X search operator, from the Top tab (a ranked sample, the default) or the Latest tab (chronological), picked by the tab arg. 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.
Like a tweet on X (Twitter) from an AI agent
Like a tweet given its URL. Safe to repeat: an already-liked tweet is reported, not re-liked. Returns tweet_id, liked, was_liked.
Export an X (Twitter) account's followers or following
List a user's followers or the accounts they follow, by handle — selected by the direction arg ('followers', the default, or 'following'). Returns per account: user_id, handle, name, followers, following, tweets, verified, location, website, bio. Scrolls until count is met or the list dries up.
X (Twitter) mentions unofficial API: read tweets that mention you
List recent tweets mentioning the logged-in account (the Notifications > Mentions tab). 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, and in_reply_to {id, author_handle} (null unless the mention is a reply). Scrolls until count is met or the list dries up.
Delete a tweet on X (Twitter) from an AI agent
Delete one of your own tweets given its URL. Returns the deleted tweet id and a deleted flag.
