Actions74
- Lists Actions
- Tweets Actions
- Users Actions
- Timelines Actions
- Media Actions
- Spaces Actions
- Direct Messages Actions
- Analytics Actions
- Compliance Actions
Overview
This node provides an enhanced integration with the X (formerly Twitter) API v2, enabling comprehensive interaction with various Twitter resources such as Tweets, Users, Timelines, Media, Spaces, Lists, Bookmarks, Direct Messages, Analytics, and Compliance features. Specifically for the Users resource and the Get Following operation, it retrieves a list of users that a specified user is following.
Common scenarios where this node is beneficial include:
- Social media monitoring: Fetching the accounts followed by a user to analyze their interests or network.
- Audience research: Understanding who a user follows to tailor marketing or engagement strategies.
- Automation workflows: Automatically retrieving and processing the "following" list for further actions like messaging or data enrichment.
Practical example:
- You want to get the list of accounts followed by a specific user (by user ID or username) to analyze their social graph or to trigger notifications when they follow new accounts.
Properties
| Name | Meaning |
|---|---|
| User ID | The user identifier or @username whose following list you want to retrieve. |
| Max Results | Maximum number of 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 custom fields to include in the response. |
| Custom Expansions | Comma-separated list of expansions to include additional related objects in the response. |
Output
The output is a JSON array where each item corresponds to a user that the specified user is following. Each item contains detailed user information as returned by the Twitter API, potentially including expanded fields and private metrics if requested and permitted.
The structure typically includes:
- User identifiers and usernames
- Profile details (name, description, profile image URL, etc.)
- Public and optionally private metrics (followers count, tweet count, etc.)
- Any additional custom fields or expansions specified
No binary data output is produced by this operation.
Dependencies
- Requires an active subscription and valid API key for the external N8N Tools API service, which validates usage before forwarding requests to Twitter.
- Requires OAuth2 or API key credentials configured in n8n for authenticating with the Twitter API.
- The node uses the bundled
twitter-apihelper class to interact with Twitter's endpoints.
Troubleshooting
- Invalid subscription or API key error: If the node throws an error about invalid subscription or API key, verify that your API key credential is correct and has the necessary permissions.
- Rate limits: Twitter API enforces rate limits; exceeding these may cause errors or incomplete data. Consider handling pagination tokens to fetch data incrementally.
- Missing or incorrect User ID: Ensure the User ID or username provided is valid and exists on Twitter.
- Private metrics access denied: Requesting private metrics without elevated access will result in errors; disable this option unless you have the required permissions.
- Pagination issues: If you receive partial data, use the Pagination Token property to fetch subsequent pages.
Links and References
- Twitter API v2 Documentation - Users
- Twitter API v2 - Pagination
- n8n Documentation - Creating Custom Nodes
- N8N Tools API Service (for subscription and API key management)