N8N Tools - X (Twitter) Enhanced icon

N8N Tools - X (Twitter) Enhanced

Comprehensive X (Twitter) API v2 integration for N8N workflows

Overview

The "Get Mentions Timeline" operation of the Timelines resource in this node fetches tweets that mention a specified user on X (formerly Twitter). This allows users to retrieve recent mentions directed at a particular user, which is useful for monitoring engagement, brand mentions, or social interactions.

Common scenarios include:

  • Social media managers tracking mentions of their brand or client.
  • Customer support teams monitoring tweets mentioning their support handle.
  • Influencers or public figures keeping track of conversations involving them.

For example, you can use this node to get the latest 10 tweets mentioning a specific user ID or username within a certain time frame, optionally including private metrics or custom fields.

Properties

Name Meaning
User ID The target user's ID or @username whose mentions timeline you want to retrieve.
Max Results Maximum number of mention tweets to return (1 to 100).
Start Time ISO 8601 formatted start time to filter mentions from (optional).
End Time ISO 8601 formatted end time to filter mentions until (optional).
Since ID Return results with tweet IDs greater than this value (optional).
Until ID Return results with tweet IDs less than this value (optional).
Pagination Token Token to paginate through results (optional).
Include Private Metrics Boolean flag to include private metrics in the response; requires elevated API access.
Custom Fields Comma-separated list of additional custom fields to include in the response (optional).
Custom Expansions Comma-separated list of expansions to include in the response (optional).

Output

The node outputs an array of JSON objects representing tweets that mention the specified user. Each item contains the raw tweet data as returned by the X (Twitter) API v2, potentially enriched with requested custom fields and expansions.

If private metrics are included, the output will also contain additional engagement statistics not normally available.

No binary data is output by this operation.

Dependencies

  • Requires valid credentials for the X (Twitter) API v2, provided via OAuth2 or API key authentication.
  • Requires a subscription and valid API key for the external N8N Tools API service used for validation.
  • Elevated API access is needed to include private metrics in the response.

Troubleshooting

  • Invalid subscription or API key error: If the node throws an error about invalid subscription or API key, verify that your N8N Tools API credentials are correct and active.
  • Permission errors when including private metrics: Ensure your Twitter API credentials have elevated access permissions if you enable the "Include Private Metrics" option.
  • Pagination issues: If you receive incomplete results, use the pagination token property to fetch subsequent pages.
  • Date format errors: Make sure "Start Time" and "End Time" are in proper ISO 8601 format to avoid request failures.

Links and References

Discussion