N8N Tools - X (Twitter) Enhanced icon

N8N Tools - X (Twitter) Enhanced

Comprehensive X (Twitter) API v2 integration for N8N workflows

Overview

The node provides integration with the X (formerly Twitter) API v2, enabling workflows to interact with various Twitter resources. Specifically for the Tweets resource and the Get Tweet Counts operation, it allows users to retrieve aggregated counts of tweets matching a specified search query over a given time range.

This operation is useful for analyzing tweet volume trends related to keywords, hashtags, or topics. For example, marketers can track how often a brand or campaign hashtag is mentioned over time, or researchers can monitor tweet activity around events.

Practical examples:

  • Get daily counts of tweets mentioning a product name in the last month.
  • Retrieve hourly tweet counts for a breaking news keyword during a specific day.
  • Analyze minute-level tweet volume spikes for a trending hashtag.

Properties

Name Meaning
Search Query The search query string to filter tweets (e.g., keywords, hashtags).
Start Time ISO 8601 formatted start datetime for the search window.
End Time ISO 8601 formatted end datetime for the search window.
Since ID Return results with tweet IDs greater than this value (for incremental queries).
Until ID Return results with tweet IDs less than this value.
Next Token Pagination token to fetch the next page of results.
Granularity Time granularity for counts; options are: Minute, Hour, Day.

Output

The output JSON contains aggregated tweet count data matching the search query, segmented by the specified granularity (minute, hour, or day). Each item typically includes:

  • A timestamp or time interval representing the bucket.
  • The count of tweets within that time bucket.

This structured count data enables time series analysis of tweet volumes.

The node does not output binary data for this operation.

Dependencies

  • Requires an active subscription and valid API key for the "N8N Tools API" service used for validation.
  • Requires OAuth2 or API credentials configured for accessing the Twitter API v2.
  • The node uses an internal Twitter API client wrapper to perform requests.

Troubleshooting

  • Invalid subscription or API key error: If you receive errors about invalid subscription or API key, verify your N8N Tools API credentials and ensure your subscription is active.
  • Rate limits: Twitter API enforces rate limits; excessive requests may result in throttling. Use pagination tokens to manage large datasets.
  • Date format issues: Ensure Start Time and End Time are in correct ISO 8601 format to avoid request failures.
  • Empty results: If no counts are returned, check the search query validity and time range correctness.
  • Pagination tokens: Incorrect or expired tokens will cause errors; use tokens as provided by previous responses.

Links and References

Discussion