X Scraper Trigger icon

X Scraper Trigger

Triggers when new tweets, mentions, or DMs are received

Overview

The X Scraper Trigger node is designed to monitor Twitter (rebranded as "X") for new tweets based on specific criteria and trigger workflows when matching content appears. It supports three main scenarios:

  • New Tweets From Search: Triggers when new tweets match a user-defined search query.
  • New Mentions: Triggers when the specified username is mentioned in tweets.
  • New Timeline Updates: Triggers when new tweets appear on the timeline of a specified user.

This node is beneficial for automating responses, monitoring brand mentions, tracking topics of interest, or aggregating content from specific users or searches.

Practical Examples

  • Automatically collect and process tweets containing a hashtag or keyword relevant to your business.
  • Monitor mentions of your company’s Twitter handle to respond promptly.
  • Track updates from a competitor’s timeline to analyze their activity.

Properties

Name Meaning
Trigger On The event type to trigger on. Options:
- New Tweets From Search
- New Mentions
- New Timeline Updates
Search Query The search terms to monitor for new tweets. Only shown if "Trigger On" is "New Tweets From Search".
Username The Twitter username (without @) to monitor for mentions or timeline updates. Shown if "Trigger On" is "New Mentions" or "New Timeline Updates".
Poll Interval How often (in seconds) the node checks for new content.
Max Results Maximum number of results to return per check.

Output

The node outputs JSON data representing tweets that match the selected trigger condition. Each output item corresponds to one tweet object retrieved from the Twitter API wrapper, including all standard tweet fields such as id, text, user, created_at, etc.

If an error occurs during execution (e.g., missing parameters or API issues), the node outputs a JSON object with an error message and a timestamp.

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential for accessing the Twitter scraping service (via the bundled rettiwt-api library).
  • The node uses this API key to authenticate requests to fetch tweets, user details, and timelines.
  • No additional environment variables are required beyond the configured API key credential.

Troubleshooting

  • Missing Required Parameters:

    • If "New Tweets From Search" is selected but no search query is provided, the node throws an error indicating the search query is required.
    • If "New Mentions" or "New Timeline Updates" is selected but no username is provided, the node throws an error indicating the username is required.
  • User Not Found:
    When fetching timeline updates, if the specified username does not exist, an error is thrown stating "User not found".

  • API Errors or Rate Limits:
    Errors from the external Twitter scraping API will be logged and emitted as error messages in the output JSON. Ensure the API key is valid and has sufficient quota.

  • Polling Issues:
    The node polls at the interval specified by "Poll Interval". Setting this too low may cause rate limiting or excessive API calls; setting it too high may delay triggers.

Links and References

Discussion