Scraper Details
Contents
Node.js Setup
Full setup for programmatic scraping:
import { createBrowser, createPage, loginWithCookie, scrapeProfile,
scrapeFollowers, scrapeFollowing, scrapeTweets, searchTweets,
scrapeHashtag, scrapeThread, scrapeMedia, exportToJSON, exportToCSV
} from 'xactions';
const browser = await createBrowser();
const page = await createPage(browser);
await loginWithCookie(page, AUTH_TOKEN);
Always call browser.close() when done.
Return Shapes
| Function | Returns |
|---|---|
scrapeProfile(page, username) |
{ username, displayName, bio, followers, following, tweets, joined, location, website, verified } |
scrapeFollowers(page, username, {limit}) |
[{ username, displayName, bio, followsYou }] |
scrapeFollowing(page, username, {limit}) |
[{ username, displayName, bio, followsYou }] |
scrapeTweets(page, username, {limit}) |
[{ text, likes, retweets, replies, timestamp, url }] |
searchTweets(page, query, {limit}) |
Same as tweets |
scrapeHashtag(page, tag, {limit}) |
Same as tweets |
scrapeThread(page, tweetUrl) |
Array of tweet objects from thread author only |
scrapeMedia(page, username, {limit}) |
Media objects with URLs |
exportToJSON(data, path) / exportToCSV(data, path) |
Writes file |
Video Downloader
File: src/scrapers/videoDownloader.js
Navigate to a tweet containing a video and paste this script. Extracts MP4 URLs for all available qualities and auto-downloads the best quality version.
How to use
- Open the tweet with the video you want to download
- Open DevTools (F12) → Console
- Paste the script → Enter
- Best quality MP4 auto-downloads; all quality URLs logged to console
Bookmark Exporter
File: src/scrapers/bookmarkExporter.js
Exports all your bookmarks including text, engagement metrics, media URLs, and links. Supports both JSON and CSV export formats.
How to use
- Navigate to
x.com/i/bookmarks - Open DevTools (F12) → Console
- Paste the script → Enter
- Scrolls through all bookmarks and exports when done
Thread Unroller
File: src/scrapers/threadUnroller.js
Saves a thread as text, markdown, or JSON. Only captures tweets from the original thread author (filters out replies from others).
How to use
- Navigate to any thread on x.com
- Open DevTools (F12) → Console
- Paste the script → Enter
- Choose export format: text, markdown, or JSON
Viral Tweets Finder
File: src/scrapers/viralTweets.js
Finds a user's top-performing tweets sorted by engagement. Configurable engagement thresholds to filter for truly viral content.
How to use
- Navigate to the user's profile
- Open DevTools (F12) → Console
- Paste the script → Enter
- Results sorted by engagement (likes + retweets + replies)
⚡ Explore XActions
100% free and open-source. No API keys, no fees, no signup.
Browse All Documentation