π Shipping the TweetScraper Tool
Abir Dutta
Published on Wednesday, Jul 16, 2025
Shipped Something New π
Okkayyy so shipped a new component in Agentgenesis after a looooong time πβ¨
This time itβs the TweetScraper Tool β a handy little tool you can use to scrape tweets from accounts and also extract text from specific tweets. π¦π€
Internally, Iβve used some magical Apify actors for this. And if youβre wondering...
What Even Is Apify?
So Apify is basically a marketplace of services (called actors) where people upload scrapers and automation tools, and you can use them β some are paid, some are freemium.
Now after some digging, I figured out two π₯ actors that:
can extract tweets from user accounts,
extract text from individual tweets,
and... theyβve been working consistently for a long time, super stable,
cheap af β you can probably do most of your scraping with just the free $5 monthly credits you get.
Isnβt This Just a Wrapper?
Yeah, technically this is a wrapper around those Apify actors... BUT here's why itβs more than that:
You donβt need to spend hours figuring out which actor to use.
You donβt need to learn how to plug in and integrate with Apify.
You donβt even need to worry about stability or pricing.
All that headache is gone. Wrapped up nicely inside this TweetScraperTool class. Itβs expandable, time-saving, and makes your life easier. So yeah β a wrapper, but one that actually slaps. π₯
How To Use π οΈ
Read the docs once on how to set it up:
π Installation Docs
Scraping Single Tweet Text
You can scrape a tweet using the tweet ID:
const singleTweetData = await tweetScraper.scrapeTweetText({
tweetId: "1944299394032882148",
});
Or with the tweet URL:
const singleTweetData = await tweetScraper.scrapeTweetText({
tweetUrl: "https://x.com/kirat_tw/status/1943192256497762309",
});
Both options work fine β whether you provide the ID or full URL. π
Scraping Multiple Latest Tweets from an Account
If you wanna scrape recent tweets from a user:
const latestTweets = await tweetScraper.scrapeTweets("https://x.com/mannupaaji", 5);
Parameters:
accountUrlβ URL of the Twitter accountcountβ (optional) how many tweets to fetch (defaults to 10)sinceDateβ (optional) start date to fetch tweets from (defaults to2024-03-05)
Wanna try the sinceDate param in action? Let's say you want to scrape 5 tweets from 2 days ago, you can do:
const twoDaysAgo = new Date();
twoDaysAgo.setDate(twoDaysAgo.getDate() - 2);
const tweets = await tweetScraper.scrapeTweets("https://x.com/mannupaaji", 5, twoDaysAgo);
This will start fetching tweets posted from 2 days earlier β super handy when youβre working with fresh timelines or filtering recent buzz. π
So Thatβs It π
Copy-paste, experiment, extend the code... go build something cool.
And hey β
Happy Tweet Scraping!
By Abir!