N8N Tools - X (Twitter) Enhanced icon

N8N Tools - X (Twitter) Enhanced

Comprehensive X (Twitter) API v2 integration for N8N workflows

Overview

This node provides an enhanced integration with the X (formerly Twitter) API v2, enabling users to perform a wide range of operations on Twitter data within n8n workflows. Specifically for the Users resource and the Search Users operation, it allows searching for Twitter users based on a query string. This is useful for scenarios such as finding relevant users by name, username, or keywords in their profile, discovering influencers, or filtering users for marketing campaigns.

Practical examples:

  • Searching for users related to a specific topic or brand.
  • Finding potential collaborators or customers by keyword.
  • Automating user discovery for social media monitoring.

Properties

Name Meaning
Search Query The search query string used to find users matching keywords or phrases.
Max Results Maximum number of user results to return (1 to 100).
Pagination Token Token used for paginating through large result sets.
Include Private Metrics Whether to include private metrics in the response (requires elevated access).
Custom Fields Comma-separated list of additional user fields to include in the response.
Custom Expansions Comma-separated list of expansions to include additional related objects in the response.

Output

The output JSON contains the search results returned by the Twitter API for users matching the query. It includes user details such as usernames, IDs, profile information, and optionally expanded fields and private metrics if requested.

If multiple pages of results are retrieved, each page's data is included as separate items in the output array.

No binary data is produced by this operation.

Dependencies

  • Requires an active subscription and valid API key for the external "N8N Tools API" service that validates usage.
  • Requires OAuth2 or API key credentials configured in n8n for authenticating with the Twitter API.
  • The node uses the bundled twitter-api helper class to interact with Twitter endpoints.

Troubleshooting

  • Invalid subscription or API key error: If you receive an error about invalid subscription or API key, verify your credentials and subscription status for the external API service.
  • Rate limits: Twitter API enforces rate limits; exceeding them will cause errors. Consider handling pagination tokens and limiting max results accordingly.
  • Missing required parameters: Ensure the "Search Query" property is provided and not empty.
  • Private metrics access: Requesting private metrics without elevated access will likely fail; disable this option unless you have proper permissions.

Links and References

Discussion