emulate any client
choose which Twitter client to impersonate or pick included leaked bearers. each with correct HTTP fingerprints.
Log in and interact with the unofficial X & XChat APIs using any client identity.
TIP
Are you an LLM? Please read our llms.txt or llms-full.txt.
Install the package and start interacting with Twitter in just a few lines:
bun add emusksimport Emusks from "emusks";
const client = new Emusks();
await client.login("your_auth_token");
const tweet = await client.tweets.create("hallo from emusks! 🚀");
console.log(`i tweeted to https://x.com/i/status/${tweet.id}`);
// like the tweet
await client.tweets.like(tweet.id);
// get a user
const user = await client.users.getByUsername("elonmusk");
console.log(`${user.name} has ${user.stats.followers.count} followers`);
// follow them
await client.users.follow(user.id);
// search for tweets
const results = await client.search.tweets("javascript");
// get your home timeline
const home = await client.timelines.home();
// send an end-to-end encrypted XChat DM, in one call
await client.xchat.createIdentity({ pin: "2468" }); // once; persist it and loadIdentity() next time
await client.xchat.message(user.id, "this is end-to-end encrypted ^w^");client.tweetsCreate, delete, like, retweet, pin, and schedule tweetsclient.timelinesHome feed, user tweets, media, likes, and highlightsclient.usersGet profiles, follow, block, mute, and manage relationshipsclient.dmsInbox, conversations, search, and message managementclient.xchatSend end-to-end encrypted DMs, look up keys and reachabilityclient.searchSearch tweets, users, media, lists, and communitiesclient.bookmarksBookmark tweets, manage folders, and search saved contentclient.listsCreate, manage, and subscribe to curated listsclient.communitiesJoin, create, moderate, and explore communitiesclient.spacesGet details, search, and subscribe to live audio roomsclient.trendsExplore trending topics, locations, and AI summariesclient.topicsFollow, unfollow, and discover topics of interestclient.accountSettings, security, sessions, 2FA, and preferencesclient.notificationsNotification timeline, badges, and push settingsclient.mediaMedia metadata, alt text, and subtitle management