n8n-nodes-twitter-x-scraper
v0.0.3
Published
This is an n8n community node that integrates with the [Apify X.com Twitter API Scraper](https://apify.com/). It provides a powerful and efficient way to scrape data from Twitter (now X) directly within your n8n workflows.
Maintainers
Readme
n8n Node - X.com Twitter API Scraper
This is an n8n community node that integrates with the Apify X.com Twitter API Scraper. It provides a powerful and efficient way to scrape data from Twitter (now X) directly within your n8n workflows.
It allows you to extract tweets based on various criteria, making it ideal for researchers, entrepreneurs, data analysts, and anyone needing to gather Twitter data for analysis. It's designed for fetching historical data, not real-time monitoring.
🚀 Installation
Follow the standard procedure to install a community node in n8n:
- Go to Settings > Community Nodes.
- Select Install.
- Enter the package name:
n8n-nodes-x-twitter-scraper(update this with your actual npm package name). - Click Install.
Alternatively, if you are running n8n locally, you can install it via npm:
npm install n8n-nodes-x-twitter-scraper
🔑 Credentials
To use this node, you need an Apify API token.
- Create an account on Apify.
- Go to Settings > Integrations in the Apify Console.
- Copy your API token.
- In n8n, add a new Apify Api credential and paste your token.
✨ Key Features
Multiple Input Methods: Get the data you need, how you need it by passing Start URLs, Search Terms (with advanced search operators), or Twitter Handles.
Powerful Filtering: Refine your results using node parameters:
Maximum Items: Control the number of tweets you retrieve.
Sorting: Get results sorted by "Top" or "Latest".
Language: Filter by language using ISO 639-1 codes.
User Verification: Target tweets from verified users or Twitter Blue subscribers.
Media Type: Extract only tweets containing images, videos, or quotes.
Date Range: Specify a start and end date.
Lightning-Fast Performance: Scrape tweets with incredible speed (advertised as 30-80 tweets per second via Apify).
Cost-Effective: Competitive pricing (approx. $0.50 per 1,000 tweets via the Apify platform).
💡 Use Cases
- Market Research: Analyze trends, sentiment, and brand perception in your automated workflows.
- Academic Research: Gather data and pipe it directly to databases or spreadsheets for social media studies.
- Competitive Analysis: Track competitors' activities and public engagement.
- Data Journalism: Uncover insights and patterns within Twitter data.
🛠 Usage Guidelines (Important!)
- Historical Data Focus: This node is designed for retrieving historical data. Avoid using it in loop nodes or cron triggers for very frequent, real-time monitoring.
- Concurrency Limits: There are limits on concurrent runs (maximum 1, with up to 5 batched queries).
- Minimum Tweets Per Query: Aim to fetch at least 50 tweets per query (handle, keyword, etc.).
- Single Tweet Fetching Restrictions: Fetching a single tweet by URL is generally prohibited without explicit permission. Allow a few minutes interval time minimum between workflow executions.
- Respect Twitter's Terms of Service: Always use this tool ethically and responsibly.
🛡 Ethical Use and Data Practices
This underlying Apify actor operates without logging in to X.com. This means it does not implicitly accept any Terms of Service (ToS) that require a login, as it only processes data that is publicly displayed and accessible to everyone without authentication.
All data collected explicitly excludes sensitive personal information or non-public data. Operations are designed to be compliant with relevant EU data protection regulations, including GDPR, where applicable.
📄 Output Example
When the node executes successfully, it outputs structured JSON data for each tweet, which you can easily map to other n8n nodes:
[
{
"id": "1630332507265589248",
"url": "[https://x.com/NASA/status/1630332507265589248](https://x.com/NASA/status/1630332507265589248)",
"twitterUrl": "[https://twitter.com/NASA/status/1630332507265589248](https://twitter.com/NASA/status/1630332507265589248)",
"full_text": "@yalhunzai We have internships open to international students...",
"favorite_count": 14,
"retweet_count": 9,
"reply_count": 0,
"author": {
"id_str": "11348282",
"screen_name": "NASA",
"name": "NASA",
"followers_count": 85752559,
"verified": false,
"verified_type": "Government"
},
"created_at": "Tue Feb 28 20:28:53 +0000 2023",
"lang": "en"
}
]
❓ Troubleshooting
If you encounter issues like too few results, no results, or incomplete tweet collection, check the node's input parameters. Common causes include overly restrictive filters (e.g., conflicting date ranges) or exceeding your Apify account's rate limits.
For advanced tutorials, check out the Tutorial: Scrape Twitter Data with Apify's Tweet X.com Scraper.
