N8N Tools - X (Twitter) Enhanced icon

N8N Tools - X (Twitter) Enhanced

Comprehensive X (Twitter) API v2 integration for N8N workflows

Overview

The node provides enhanced integration with the X (formerly Twitter) API v2, enabling users to perform a wide range of operations related to tweets, users, timelines, media, spaces, lists, bookmarks, direct messages, analytics, and compliance. Specifically, for the Analytics resource and the Get Engagement Analysis operation, the node fetches engagement-related analytical data over a specified time period.

This node is beneficial for social media managers, marketers, and analysts who want to automate the retrieval of detailed engagement metrics from X (Twitter) to monitor performance, optimize content strategy, or generate reports.

Practical example:
A user can configure this node to retrieve engagement analysis data for their account or specific tweets over the last 7 days to understand how audiences interact with their content, such as likes, retweets, replies, and other engagement metrics.

Properties

Name Meaning
Period Time period for analysis. Options: "1 Day", "7 Days", "30 Days", "90 Days". Determines the range over which engagement data is aggregated.

Output

  • The output is an array of JSON objects, each representing the engagement analysis data retrieved from the X (Twitter) API.
  • Each JSON object contains detailed engagement metrics corresponding to the requested period.
  • The exact structure depends on the API response but typically includes counts and statistics about interactions such as likes, retweets, replies, and possibly other engagement types.
  • No binary data output is produced by this operation.

Dependencies

  • Requires an active subscription and a valid API key credential for the external service referred to as "N8N Tools API" to validate usage before making requests.
  • Requires OAuth2 or API key credentials for authenticating with the X (Twitter) API v2.
  • The node uses an internal helper class to communicate with the X (Twitter) API.
  • Proper configuration of these credentials in n8n is necessary for successful execution.

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 for the external service is correctly configured and active.

  • API rate limits or permission errors:
    The X (Twitter) API may enforce rate limits or require elevated access for certain metrics. Ensure the connected Twitter API credentials have the necessary permissions.

  • Network or connectivity issues:
    Failures in HTTP requests might be due to network problems; check connectivity and proxy settings if applicable.

  • Incorrect property values:
    Providing unsupported periods or malformed input parameters may cause errors. Use only the supported options for the "Period" property.

Links and References

Discussion