Extract Twitter/X data with the Anysite Twitter node for n8n workflows
The Anysite Twitter node enables you to extract Twitter (X) data within your n8n workflows. Search tweets, analyze user profiles, monitor hashtags, and track social media conversations.
Select your Anysite API credentials from the dropdown or create new ones.
Search for Twitter users by username, bio, or other criteria.
Parameters:
Example Output:
{
"users": [
{
"id": "twitter123",
"username": "johnsmith_dev",
"displayName": "John Smith",
"bio": "Senior Software Engineer | Python enthusiast",
"followers": 15000,
"following": 800,
"verified": false,
"location": "San Francisco, CA",
"profileImageUrl": "https://pbs.twimg.com/profile_images/..."
}
]
}
Extract tweets and posts from a specific Twitter user.
Parameters:
Example Output:
{
"tweets": [
{
"id": "tweet456",
"text": "Just shipped a new feature! Excited to see how users respond 🚀",
"createdAt": "2024-08-26T14:30:00Z",
"engagement": {
"likes": 125,
"retweets": 32,
"replies": 18,
"views": 2500
},
"mediaUrls": [],
"hashtags": ["#ProductLaunch", "#TechStartup"]
}
]
}
Search for tweets by keywords, hashtags, or phrases.
Parameters:
Example Output:
{
"tweets": [
{
"id": "search789",
"text": "The future of AI development is looking incredible! #AI #MachineLearning",
"author": {
"username": "ai_researcher",
"displayName": "Dr. Sarah Wilson"
},
"createdAt": "2024-08-26T12:00:00Z",
"engagement": {
"likes": 89,
"retweets": 24,
"replies": 12
}
}
]
}
Get detailed information about a specific tweet.
Parameters:
Example Output:
{
"tweet": {
"id": "tweet123",
"text": "Thread about building scalable APIs: 1/8",
"author": {
"username": "backend_expert",
"followers": 25000
},
"engagement": {
"likes": 245,
"retweets": 89,
"replies": 34
},
"threadTweets": [
{
"id": "tweet124",
"text": "First, consider your data architecture..."
}
]
}
}
Search for tweets mentioning your brand, product, or competitors.
Use AI nodes to analyze sentiment and categorize mentions as positive, negative, or neutral.
Find high-engagement users mentioning your brand and assess their influence.
Send notifications to your social media team for important mentions or negative sentiment.
Example Workflow:
{
"nodes": [
{
"name": "Monitor Brand",
"type": "@horizondatawave/n8n-nodes-anysite.Twitter",
"operation": "searchTweets",
"parameters": {
"query": "YourBrand OR @YourHandle OR #YourHashtag",
"resultType": "recent",
"limit": 100
}
},
{
"name": "Sentiment Analysis",
"type": "n8n-nodes-base.openAi",
"parameters": {
"operation": "analyze",
"prompt": "Analyze sentiment: {{ $json.text }}"
}
},
{
"name": "Filter Negative",
"type": "n8n-nodes-base.filter",
"parameters": {
"conditions": [
{
"field": "sentiment",
"operation": "equal",
"value": "negative"
}
]
}
},
{
"name": "Alert Team",
"type": "n8n-nodes-base.slack",
"parameters": {
"channel": "#social-media",
"text": "🚨 Negative mention detected: {{ $json.text }}"
}
}
]
}
Find and analyze potential influencer partners:
Track trending topics and hashtags:
Use Twitter's advanced search operators:
// Exact phrase search
{
"query": "\"artificial intelligence\""
}
// Exclude retweets
{
"query": "machine learning -RT"
}
// From specific user
{
"query": "from:elonmusk"
}
// Mentions of user
{
"query": "@openai"
}
// Multiple hashtags
{
"query": "#AI #MachineLearning"
}
// Location-based
{
"query": "startup near:\"San Francisco\""
}
// Date range
{
"query": "product launch since:2024-08-01 until:2024-08-31"
}
Filter by engagement metrics:
{
"name": "High Engagement Filter",
"type": "n8n-nodes-base.filter",
"parameters": {
"conditions": [
{
"field": "engagement.likes",
"operation": "greaterThan",
"value": 100
},
{
"field": "engagement.retweets",
"operation": "greaterThan",
"value": 20
}
]
}
}
Error: 429 - Too Many Requests
Solution:
Error: 404 - Tweet not found
Solution:
Error: 403 - User account suspended
Solution:
{
"name": "Twitter with Retry",
"type": "@horizondatawave/n8n-nodes-anysite.Twitter",
"retryOnFail": true,
"maxTries": 3,
"waitBetweenTries": 5000,
"parameters": {
"operation": "searchTweets",
"query": "your search query"
}
}
Extract insights from tweet data:
// Calculate engagement rate
{
"engagementRate": "={{ ($json.engagement.likes + $json.engagement.retweets + $json.engagement.replies) / $json.engagement.views * 100 }}"
}
// Extract hashtags
{
"hashtags": "={{ $json.text.match(/#\w+/g) }}"
}
// Check if verified user
{
"isInfluencer": "={{ $json.author.verified || $json.author.followers > 10000 }}"
}
Use AI to categorize tweets:
{
"name": "Classify Content",
"type": "n8n-nodes-base.openAi",
"parameters": {
"operation": "classify",
"prompt": "Classify this tweet into categories (Product, Marketing, Support, Other): {{ $json.text }}"
}
}
Export tweet data to spreadsheets:
{
"name": "Export to Sheets",
"type": "n8n-nodes-base.googleSheets",
"parameters": {
"operation": "append",
"sheetId": "your-sheet-id",
"values": [
"={{ $json.author.username }}",
"={{ $json.text }}",
"={{ $json.createdAt }}",
"={{ $json.engagement.likes }}",
"={{ $json.engagement.retweets }}"
]
}
}
Send real-time alerts:
{
"name": "Webhook Alert",
"type": "n8n-nodes-base.webhook",
"parameters": {
"httpMethod": "POST",
"responseMode": "onReceived",
"options": {
"data": {
"tweet": "={{ $json.text }}",
"author": "={{ $json.author.username }}",
"engagement": "={{ $json.engagement.likes }}"
}
}
}
}
Process large datasets efficiently:
{
"name": "Process in Batches",
"type": "n8n-nodes-base.splitInBatches",
"parameters": {
"batchSize": 25
}
}
Cache frequently accessed data:
// Store user data in memory
{
"name": "Cache User Data",
"type": "n8n-nodes-base.set",
"parameters": {
"values": {
"userCache.{{ $json.username }}": "={{ $json }}"
}
}
}