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 data within n8n workflows. Specifically for the Users resource and the Get User operation, it fetches detailed information about a specified user by their user ID or username.
Common scenarios where this node is beneficial include:
- Retrieving profile details of a Twitter user for analytics or reporting.
- Enriching datasets with user metadata such as follower counts, bio, or other public profile fields.
- Automating social media monitoring workflows that require user information.
Practical example:
- You want to get detailed information about a specific Twitter user by their username to analyze their profile metrics and use that data downstream in your workflow.
Properties
| Name | Meaning |
|---|---|
| User ID | The Twitter user ID or @username of the user to retrieve information for. |
| Include Private Metrics | Boolean flag to include private 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 to the response. |
Output
The output is a JSON object containing the detailed user information retrieved from the Twitter API. This includes standard user profile fields such as name, username, description, follower count, and optionally private metrics and expanded related data depending on the input parameters.
If multiple items are processed, the output is an array of such JSON objects, each corresponding to one input item.
No binary data output is produced by this operation.
Dependencies
- Requires an API key credential for the "N8N Tools API" service to validate subscription and usage.
- Requires OAuth2 or API credentials configured for accessing the Twitter API v2.
- The node internally uses a helper class to interact with Twitter's API endpoints.
Troubleshooting
- Invalid subscription or API key error: If you receive an error indicating invalid subscription or API key, verify that your API key credential for the external validation service is correct and active.
- Permission errors when including private metrics: Including private metrics requires elevated access to the Twitter API. Ensure your Twitter API credentials have the necessary permissions.
- User not found or invalid user ID: Make sure the provided User ID or username is valid and exists on Twitter.
- Rate limiting: Twitter API enforces rate limits; if you hit these, consider adding delays or handling retries in your workflow.