Twitter Hashtag Tweet Scraper
by deepanshusharm
Scrape tweets by hashtag with full metadata. This tool handles rate limits automatically, delivering clean, structured data for analysis.
Opens on Apify.com
About Twitter Hashtag Tweet Scraper
Need to pull tweets by hashtag for research, marketing, or a project? This scraper is built to handle exactly that. It goes beyond just grabbing the tweet text. You'll get the full picture: user details, engagement metrics like retweets and likes, timestamps, and media links. What makes it reliable is how it deals with Twitter's limits. It automatically paces requests to avoid getting blocked, so your data runs smoothly without you having to babysit it. I've used it to track campaign hashtags and gather public sentiment for analysis, and it just works. It's perfect for anyone who needs structured Twitter data without the headache of building and maintaining their own scraper. You set your hashtags, configure your run, and get clean JSON or CSV output ready for your database or spreadsheet. It's a straightforward solution for developers, researchers, and marketers who need actionable social data.
What does this actor do?
Twitter Hashtag Tweet Scraper is a web scraping and automation tool available on the Apify platform. It's designed to help you extract data and automate tasks efficiently in the cloud.
Key Features
- Cloud-based execution - no local setup required
- Scalable infrastructure for large-scale operations
- API access for integration with your applications
- Built-in proxy rotation and anti-blocking measures
- Scheduled runs and webhooks for automation
How to Use
- Click "Try This Actor" to open it on Apify
- Create a free Apify account if you don't have one
- Configure the input parameters as needed
- Run the actor and download your results
Documentation
Twitter Hashtag Tweet Scraper
Scrapes tweets based on hashtags using an authenticated Twitter/X session. It handles rate limits automatically and outputs structured tweet data to an Apify dataset.
Key Features
- Multi-hashtag scraping: Collect tweets from multiple hashtags in one run.
- Rate limit handling: Automatically pauses when Twitter/X limits are hit and uses smart delays between requests.
- Deduplication: Avoids duplicate tweets using unique tweet IDs.
- Comprehensive data: Extracts full tweet text, author info, engagement metrics (likes, retweets, replies), and metadata.
- Time filtering: Limits tweets by age using the
max_age_hint_minutesparameter. - Real-time streaming: Pushes data to the dataset in batches as it's collected.
How to Use
Required Input
You must provide two parameters:
1. hashtags: An array of hashtags to search (e.g., ["AI", "MachineLearning"]). Do not include the # symbol.
2. cookies: An array of Twitter/X session cookies for authentication. You must be logged in.
Getting Your Cookies
- Log into Twitter/X in your browser.
- Open Developer Tools (F12).
- Go to the Application or Storage tab and find Cookies for
x.comortwitter.com. - Copy the
auth_tokenandct0cookies. Thetwidcookie is optional but recommended. - Format them for the actor input:
json "cookies": [ { "name": "auth_token", "value": "YOUR_TOKEN", "domain": ".x.com" }, { "name": "ct0", "value": "YOUR_CT0_TOKEN", "domain": ".x.com" } ]
Input Example
{
"hashtags": ["AI", "DataScience"],
"max_tweets": 3000,
"max_age_hint_minutes": 720,
"cookies": [
{ "name": "auth_token", "value": "your_auth_token", "domain": ".x.com" },
{ "name": "ct0", "value": "your_ct0_token", "domain": ".x.com" }
]
}
Optional Parameters
max_tweets: (Default: 5000) The maximum total number of tweets to collect across all hashtags.max_age_hint_minutes: (Default: 1440 / 24 hours) The maximum age of tweets to collect, in minutes.
Output
The actor stores tweets as individual items in the Apify dataset. Each item contains this structure:
{
"id": "1234567890123456789",
"text": "This is a sample tweet with #hashtag",
"author": "John Doe",
"username": "johndoe",
"created_at": "2024-01-15T10:30:00Z",
"retweet_count": 42,
"like_count": 156,
"reply_count": 23,
"quote_count": 8,
"url": "https://twitter.com/johndoe/status/1234567890123456789",
"hashtags": ["hashtag"],
"mentions": ["mention1"],
"is_retweet": false,
"language": "en",
"user_followers": 1500,
"user_verified": false,
"search_hashtag": "AI",
"scraped_at": "2024-01-15T11:00:00Z"
}
Key Output Fields
id: Unique tweet ID.text: Full content of the tweet.author/username: Display name and Twitter handle.created_at: When the tweet was posted (ISO timestamp).retweet_count/like_count/reply_count/quote_count: Engagement metrics.url: Direct link to the tweet.hashtags/mentions: Arrays extracted from the tweet text.user_followers/user_verified: Author profile info.search_hashtag: Which input hashtag found this tweet.scraped_at: When the actor collected this data.
Performance Notes
- The actor distributes the
max_tweetslimit evenly across the provided hashtags. - It processes data in batches for efficiency and streams it to the dataset continuously.
- All rate limiting is handled automatically; the actor will pause and resume as needed.
Categories
Common Use Cases
Market Research
Gather competitive intelligence and market data
Lead Generation
Extract contact information for sales outreach
Price Monitoring
Track competitor pricing and product changes
Content Aggregation
Collect and organize content from multiple sources
Ready to Get Started?
Try Twitter Hashtag Tweet Scraper now on Apify. Free tier available with no credit card required.
Start Free TrialActor Information
- Developer
- deepanshusharm
- Pricing
- Paid
- Total Runs
- 8
- Active Users
- 2
Related Actors
Web Scraper
by apify
Cheerio Scraper
by apify
Website Content Crawler
by apify
Legacy PhantomJS Crawler
by apify
Apify provides a cloud platform for web scraping, data extraction, and automation. Build and run web scrapers in the cloud.
Learn more about ApifyNeed Professional Help?
Couldn't solve your problem? Hire a verified specialist on Fiverr to get it done quickly and professionally.
Trusted by millions | Money-back guarantee | 24/7 Support