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.
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.
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. Being signed out is reported as a normal answer (loggedIn false), not an error, 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.
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.
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.
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.
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.
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.
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.
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.
X (Twitter) search unofficial API: search tweets, no API key
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.
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.
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.
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.
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.
X (Twitter) posts unofficial API: export a user's tweets and stats
An unofficial X (Twitter) API for a user's posts: export an account's latest tweets with their views, likes, reposts, replies, quotes and bookmarks as data, in one call, without the X API. For the owner-only analytics of each post (impressions, engagements), run get_post_analytics on its id. Get a user's latest posts by handle (x.com/<handle>, the Posts tab), newest first: their own tweets and self-threads, without replies (see get_user_replies) or reposts (see get_user_reposts). Works signed in or signed out. Signed in, it reads the full Posts tab up to count. Signed out, X only shows visitors its few most recent posts, so it returns that short preview and fewer than count is expected; each post's source field says which one you got. Returns per tweet: id, url, text, created_at, lang, likes, retweets, replies, quotes, views, bookmarks, is_retweet, is_quote, source.
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.
Edit your X (Twitter) profile: name, bio, location, website
Update the signed-in X (Twitter) account's own display name (50 characters at most), bio (160), location (30) and website link (100). Omit a field to leave it unchanged; an empty string clears the bio, the location or the website. Returns the profile's name, bio, location and url after the edit.
Post an X (Twitter) thread from an AI agent
Post a thread (tweetstorm) of N linked tweets in one go via the native multi-post composer. Returns the posted tweets in order with their ids/urls and the thread's root url.
