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, allowing users to perform a wide range of operations related to Twitter users, tweets, timelines, media, spaces, lists, bookmarks, direct messages, analytics, and compliance jobs. Specifically for the Users resource with the Get Users operation, it fetches detailed information about multiple Twitter users by their user IDs or usernames.
Common scenarios where this node is beneficial include:
- Retrieving profile details for multiple users in bulk.
- Enriching workflows with user metadata such as follower counts, profile descriptions, or custom fields.
- Integrating Twitter user data into CRM systems, marketing dashboards, or social listening tools.
Practical example:
- Given a list of Twitter user IDs or @usernames, the node fetches their public profile information along with optional private metrics and custom expansions, enabling further analysis or reporting within an automated workflow.
Properties
| Name | Meaning |
|---|---|
| User IDs | Comma-separated list of Twitter User IDs or @usernames to retrieve information for. |
| Include Private Metrics | Boolean flag to include private user metrics in the response (requires elevated API access). |
| Custom Fields | Comma-separated list of additional user fields to include in the response. |
| Custom Expansions | Comma-separated list of expansions to include, which can add related objects or metadata. |
Output
The node outputs an array of JSON objects, each representing the data returned from the Twitter API for the requested users. The structure includes standard user profile fields and any requested custom fields or expansions. Each output item corresponds to one input item.
If private metrics are included, additional sensitive data fields related to user engagement and activity may be present.
No binary data output is produced by this operation.
Example output snippet (simplified):
[
{
"id": "123456789",
"name": "John Doe",
"username": "johndoe",
"description": "Sample user description",
"public_metrics": {
"followers_count": 1000,
"following_count": 150,
"tweet_count": 5000
},
"private_metrics": { /* if requested and authorized */ },
"custom_field_1": "...",
"custom_expansion_data": { ... }
}
]
Dependencies
- Requires an active subscription and valid API key for the external service referred to as "N8N Tools API" for validation.
- Requires Twitter API credentials configured in n8n (OAuth2 or API key).
- The node uses an internal Twitter API client wrapper to interact with Twitter endpoints.
- Elevated Twitter API access is needed to retrieve private metrics.
Troubleshooting
- Invalid subscription or API key error: If the node throws an error indicating invalid subscription or API key, verify that the API key credential is correctly set up and has an active subscription.
- Permission errors when requesting private metrics: Ensure your Twitter API credentials have the necessary elevated access to retrieve private metrics.
- Malformed User IDs input: Provide a properly formatted comma-separated string of user IDs or usernames without extra spaces or invalid characters.
- API rate limits: Twitter API enforces rate limits; hitting these may cause errors or delays. Consider adding retry logic or reducing request frequency.
- Unhandled exceptions: If the node encounters unexpected errors, enabling "Continue On Fail" will allow the workflow to proceed while logging errors per item.