n8ntools-twitter

Enhanced X (Twitter) API v2 node for N8N with comprehensive social media integration

Package Information

Downloads: 5 weeklyย /ย 43 monthly
Latest Version: 1.0.3

Documentation

N8N Tools - Twitter Enhanced

npm version
npm downloads
License: MIT

Complete Twitter integration with 45+ operations covering the full Twitter API v2 ecosystem. This N8N community node provides comprehensive access to Tweets, Users, Spaces, Lists, Media uploads, and Advanced search capabilities that are missing from the official Twitter node.

โœจ Features

  • ๐Ÿฆ Advanced Tweet Management: Post, schedule, edit, and delete tweets with rich media support
  • ๐Ÿ” Powerful Search: Advanced search with filters, operators, and real-time monitoring
  • ๐Ÿ‘ฅ User Management: Follow, unfollow, block, and manage user relationships
  • ๐Ÿ“ฑ Twitter Spaces: Create, manage, and monitor live audio conversations
  • ๐Ÿ“‹ List Operations: Create, manage, and curate Twitter lists with members
  • ๐Ÿ“Š Analytics & Metrics: Detailed tweet analytics, impressions, and engagement data
  • ๐Ÿ“Ž Media Handling: Upload images, videos, and GIFs up to 512MB
  • ๐Ÿ”” Real-time Monitoring: Track mentions, hashtags, and keyword streams
  • ๐Ÿ’ฌ Thread Management: Create and manage tweet threads seamlessly
  • ๐Ÿ”’ Secure API: Powered by N8N Tools platform with usage tracking and validation

๐Ÿš€ Quick Start

Installation

Install this node in your N8N instance:

Via Community Nodes (Recommended)

  1. Go to Settings > Community Nodes in your N8N interface
  2. Click Install a community node
  3. Enter n8n-nodes-n8ntools-twitter-enhanced
  4. Click Install

Via npm

npm install n8n-nodes-n8ntools-twitter-enhanced

Setup Credentials

  1. Sign up at N8N Tools and get your API key
  2. In N8N, create new N8N Tools API credentials
  3. Enter your API URL: https://api.n8ntools.io
  4. Enter your API key

๐Ÿ“‹ Available Resources

๐Ÿฆ Tweets (12 Operations)

Advanced tweet management beyond the official node:

Operation Description Official Node Enhanced
Post Tweet Create new tweets โœ… Basic โœ… Full API
Get Tweet Retrieve tweet details โœ… Basic โœ… Full API
Delete Tweet Remove tweets โŒ โœ…
Like Tweet Like/unlike tweets โŒ โœ…
Retweet Retweet/unretweet โŒ โœ…
Reply to Tweet Reply to specific tweets โŒ โœ…
Quote Tweet Quote tweet with comments โŒ โœ…
Get Tweet Metrics Detailed analytics โŒ โœ…
Hide Reply Hide/unhide replies โŒ โœ…
Bookmark Tweet Add/remove bookmarks โŒ โœ…
Create Thread Multi-tweet threads โŒ โœ…
Schedule Tweet Schedule tweets for later โŒ โœ…

๐Ÿ” Search (8 Operations)

Comprehensive search capabilities:

  • Search Tweets: Advanced tweet search with filters
  • Search Users: Find users by criteria
  • Search Recent: Recent tweets with real-time results
  • Search Archive: Historical tweet search
  • Monitor Keywords: Real-time keyword tracking
  • Trending Topics: Get trending hashtags and topics
  • Get Mentions: Track mentions of specific users
  • Search Filters: Advanced filtering and operators

๐Ÿ‘ฅ Users (10 Operations)

Complete user management system:

  • Get User: Retrieve user profile information
  • Follow User: Follow/unfollow users
  • Block User: Block/unblock users
  • Mute User: Mute/unmute users
  • Get Followers: List user followers
  • Get Following: List users being followed
  • Get User Tweets: Retrieve user's tweets
  • Get User Likes: Get user's liked tweets
  • Update Profile: Modify profile information
  • Get User Metrics: User analytics and stats

๐Ÿ“‹ Lists (8 Operations)

Twitter lists management:

  • Create List: Create new Twitter lists
  • Get List: Retrieve list information
  • Update List: Modify list settings
  • Delete List: Remove lists
  • Add List Member: Add users to lists
  • Remove List Member: Remove users from lists
  • Get List Members: View list membership
  • Get List Tweets: Retrieve tweets from list

๐Ÿ“ฑ Spaces (6 Operations)

Twitter Spaces audio management:

  • Create Space: Create live audio spaces
  • Get Space: Retrieve space information
  • Update Space: Modify space settings
  • End Space: Terminate live spaces
  • Get Space Participants: List space participants
  • Search Spaces: Find live and scheduled spaces

๐Ÿ“Ž Media (5 Operations)

Media upload and management:

  • Upload Media: Upload images, videos, GIFs
  • Get Media: Retrieve media information
  • Alt Text: Add accessibility descriptions
  • Media Metadata: Manage media tags and info
  • Chunked Upload: Large file upload support

๐Ÿ“Š Analytics (4 Operations)

Advanced analytics and metrics:

  • Tweet Analytics: Detailed tweet performance
  • User Analytics: User engagement metrics
  • Audience Insights: Follower demographics
  • Trend Analysis: Hashtag and topic trends

๐Ÿ’ก Usage Examples

Post Tweet with Media and Poll

// Configuration
Resource: "Tweets"
Operation: "Post Tweet"
Request Body: {
  "text": "What's your favorite programming language? ๐Ÿค”",
  "media": {
    "media_ids": ["1234567890123456789"]
  },
  "poll": {
    "options": ["JavaScript", "Python", "TypeScript", "Go"],
    "duration_minutes": 1440
  },
  "reply_settings": "mentionedUsers"
}

// Output
{
  "resource": "tweets",
  "operation": "postTweet",
  "success": true,
  "data": {
    "id": "1567890123456789012",
    "text": "What's your favorite programming language? ๐Ÿค”",
    "public_metrics": {
      "retweet_count": 0,
      "like_count": 0,
      "reply_count": 0,
      "quote_count": 0
    }
  },
  "creditsUsed": 1,
  "creditsRemaining": 99
}

Create Tweet Thread

// Create Thread
Resource: "Tweets"
Operation: "Create Thread"
Request Body: {
  "tweets": [
    {
      "text": "๐Ÿงต Thread about N8N automation best practices (1/4)"
    },
    {
      "text": "First, always plan your workflow before building. Map out all the steps, data transformations, and error handling scenarios. (2/4)"
    },
    {
      "text": "Second, use descriptive node names and add notes to your workflows. Future you (and your team) will thank you. (3/4)"
    },
    {
      "text": "Finally, test with small datasets first, then scale up. Monitor your workflows and set up proper error notifications. (4/4) #N8N #Automation"
    }
  ]
}

// Returns array of tweet IDs for the thread

Advanced Tweet Search

// Search with Advanced Filters
Resource: "Search"
Operation: "Search Tweets"
Request Body: {
  "query": "(#n8n OR @n8n_io) -is:retweet has:media lang:en",
  "tweet.fields": ["public_metrics", "created_at", "author_id"],
  "user.fields": ["username", "public_metrics"],
  "expansions": ["author_id", "attachments.media_keys"],
  "max_results": 50,
  "start_time": "2024-01-01T00:00:00Z"
}

// Monitor Keywords in Real-time
Resource: "Search"
Operation: "Monitor Keywords"
Request Body: {
  "track": ["n8n", "automation", "workflow"],
  "follow": ["1234567890"],
  "locations": ["-74,40,-73,41"],
  "filter_level": "medium"
}

Manage User Relationships

// Follow User with Notifications
Resource: "Users"
Operation: "Follow User"
User ID: "783214"
Request Body: {
  "target_user_id": "783214",
  "notifications": true
}

// Get Follower Analytics
Resource: "Users"
Operation: "Get User Metrics"
User ID: "783214"
Request Body: {
  "user.fields": ["public_metrics", "created_at", "verified"],
  "metrics": ["followers_count", "following_count", "tweet_count"]
}

// Block User with Reason
Resource: "Users"
Operation: "Block User"
User ID: "spam_account_123"
Request Body: {
  "target_user_id": "spam_account_123",
  "block_reason": "spam"
}

Create and Manage Twitter Lists

// Create Curated List
Resource: "Lists"
Operation: "Create List"
Request Body: {
  "name": "AI & Automation Experts",
  "description": "Thought leaders in AI and workflow automation",
  "private": false
}

// Add Multiple Members
Resource: "Lists"
Operation: "Add List Member"
List ID: "list_id_from_creation"
Request Body: {
  "user_ids": ["783214", "987654321", "456789123"]
}

// Get List Tweet Feed
Resource: "Lists"
Operation: "Get List Tweets"
List ID: "list_id"
Request Body: {
  "max_results": 100,
  "tweet.fields": ["public_metrics", "created_at"],
  "expansions": ["author_id"]
}

Twitter Spaces Management

// Create Live Audio Space
Resource: "Spaces"
Operation: "Create Space"
Request Body: {
  "title": "Live: Building N8N Workflows",
  "scheduled_start": "2024-01-15T19:00:00Z",
  "topic_ids": ["131", "142"],
  "is_ticketed": false
}

// Update Space Settings
Resource: "Spaces"
Operation: "Update Space"
Space ID: "space_id_from_creation"
Request Body: {
  "title": "Live: Advanced N8N Automation",
  "description": "Deep dive into complex workflow patterns"
}

โš™๏ธ Configuration Options

Tweet Settings

  • Reply Settings: Control who can reply
  • Media Settings: Alt text and sensitivity
  • Poll Options: Duration and choices
  • Geo Location: Location tagging
  • Super Follows: Subscriber-only content

Search Parameters

  • Query Operators: Advanced search syntax
  • Time Filters: Date range filtering
  • Result Types: Recent, popular, mixed
  • Language: Language filtering
  • Location: Geographic filtering

Advanced Request Options

  • Request Body: JSON payload for operations
  • User ID: Target user identifier
  • Tweet ID: Target tweet identifier
  • Additional Options: Pagination, expansions, and field selection

๐Ÿ› ๏ธ Example Workflows

Social Media Management

[Content Calendar] โ†’ [Twitter Enhanced: Schedule Tweet] โ†’ [Monitor Engagement] โ†’ [Analytics Report]

Brand Monitoring

[Twitter Enhanced: Monitor Keywords] โ†’ [Sentiment Analysis] โ†’ [Alert System] โ†’ [Response Management]

Influencer Outreach

[Twitter Enhanced: Search Users] โ†’ [Analyze Metrics] โ†’ [Create Lists] โ†’ [Engagement Tracking]

Customer Support

[Twitter Enhanced: Monitor Mentions] โ†’ [Classify Intent] โ†’ [Auto-Response] โ†’ [Escalation Workflow]

๐Ÿ“Š Comparison with Official Twitter Node

Feature Category Official Node Twitter Enhanced Improvement
Tweets 2 operations 12 operations +500%
Search 1 operation 8 operations +700%
Users 0 operations 10 operations โˆž (new)
Lists 0 operations 8 operations โˆž (new)
Spaces 0 operations 6 operations โˆž (new)
Media 0 operations 5 operations โˆž (new)
Analytics 0 operations 4 operations โˆž (new)
Total Operations 3 operations 53 operations +1667%

๐Ÿ”ง API Endpoints

All operations are routed through N8N Tools API for consistent authentication and usage tracking:

Resource Base Endpoint
Tweets /api/v1/twitter-enhanced/tweets/
Search /api/v1/twitter-enhanced/search/
Users /api/v1/twitter-enhanced/users/
Lists /api/v1/twitter-enhanced/lists/
Spaces /api/v1/twitter-enhanced/spaces/
Media /api/v1/twitter-enhanced/media/
Analytics /api/v1/twitter-enhanced/analytics/

๐Ÿšจ Error Handling

The node provides comprehensive error handling with detailed messages:

{
  "error": "TWEET_NOT_FOUND",
  "success": false,
  "resource": "tweets",
  "operation": "getTweet",
  "details": {
    "issue": "The specified tweet ID does not exist or was deleted",
    "field": "tweet_id",
    "value": "INVALID_TWEET_ID",
    "error_code": 404
  }
}

๐Ÿ’ธ Pricing & Limits

  • Standard Operations: 1 credit per API call
  • Complex Operations: 2-3 credits (media uploads, thread creation)
  • Search Operations: 1 credit per 100 results
  • Monthly Quotas: Based on your N8N Tools subscription plan
  • Rate Limits: Based on your subscription tier
  • Usage Tracking: Real-time credit monitoring

๐Ÿ”ง Troubleshooting

Common Issues

Authentication Errors

  • Verify N8N Tools API key is valid and active
  • Check API URL is set to https://api.n8ntools.io
  • Ensure sufficient credits in your account

Twitter API Limits

  • Twitter enforces strict rate limits
  • Implement delays between bulk operations
  • Monitor your API usage dashboard

Tweet Posting Errors

  • Check character limits (280 for regular tweets)
  • Verify media formats are supported
  • Ensure compliance with Twitter policies

Search Limitations

  • Some searches require higher API access levels
  • Historical search has limited timeframes
  • Complex queries may time out

๐Ÿ“ˆ Performance Tips

  1. Batch Operations: Group related operations together
  2. Smart Caching: Cache user data and tweet metrics
  3. Rate Limit Management: Respect Twitter's rate limits
  4. Error Handling: Implement retry logic for temporary failures
  5. Media Optimization: Compress images and videos before upload

๐Ÿ†˜ Support

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with โค๏ธ by N8N Tools

Discussion