N8N Tools - X (Twitter) Enhanced icon

N8N Tools - X (Twitter) Enhanced

Comprehensive X (Twitter) API v2 integration for N8N workflows

Overview

This node integrates with the X (Twitter) API v2 to perform various operations related to Twitter timelines, tweets, users, media, spaces, lists, bookmarks, direct messages, analytics, and compliance. Specifically for the Timelines resource and the Get Liking Users operation, it retrieves a list of users who have liked a specified tweet.

This functionality is useful when you want to analyze engagement on a particular tweet by identifying which users liked it. For example, marketers can use this to understand their audience better, or developers can automate responses or further processing based on liking users.

Properties

Name Meaning
Tweet ID The unique identifier of the tweet for which to retrieve the liking users.
Max Results Maximum number of liking users 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 in the response for richer data.

Output

The output is a JSON array where each item corresponds to the response from the Twitter API for the liking users of the specified tweet. The structure includes user details as returned by the Twitter API, potentially enriched with requested custom fields and expansions.

If pagination is involved, the output may include tokens to fetch subsequent pages.

No binary data is output 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 for authenticating with the Twitter API v2.
  • The node uses an internal helper class to interact with the Twitter API 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 active.
  • Permission errors: Including private metrics requires elevated access; if you get permission denied errors, check your Twitter developer account permissions.
  • Pagination issues: If you request more results than allowed or misuse pagination tokens, the API may return errors or incomplete data. Use the pagination token properly to navigate through pages.
  • Malformed Tweet ID: Ensure the Tweet ID provided is valid and exists; otherwise, the API will return an error.

Links and References

Discussion