Overview
The ETTwitter node's "Tweet" resource with the "Search" operation allows you to search for tweets on Twitter using a variety of filters and options. This node is useful for automating social media monitoring, sentiment analysis, brand tracking, or gathering public opinion by programmatically retrieving tweets that match specific search criteria.
Practical examples:
- Monitor mentions of your brand or product in real time.
- Collect tweets about a trending topic for data analysis.
- Filter tweets by language, location, or popularity for targeted research.
Properties
| Name | Type | Meaning |
|---|---|---|
| Search Text | string | A UTF-8, URL-encoded search query (max 500 characters), including operators. Defines what to search for in tweets. |
| Return All | boolean | Whether to return all matching results (true) or limit the number of results (false). |
| Limit | number | The maximum number of results to return when "Return All" is false. Minimum value is 1. |
| Additional Fields | collection | Optional fields to refine the search: - Include Entities (boolean): Include entities node in response. - Language Name or ID (options): Restrict tweets to a specific language (ISO 639-1 code). - Location (fixedCollection): Filter by latitude, longitude, radius, and distance. - Result Type (options): Choose between mixed, recent, or popular results. - Tweet Mode (options): Select compatibility or extended mode for tweet text. - Until (dateTime): Only return tweets created before this date. |
Output
- The output is an array of JSON objects, each representing a tweet that matches the search criteria.
- Each object contains the standard fields returned by the Twitter API for tweets, such as:
created_at: Date and time the tweet was created.id: Tweet ID.textorfull_text: The tweet content (depending on Tweet Mode).user: Information about the user who posted the tweet.- Other metadata fields as provided by the Twitter API.
- No binary data is produced by this operation.
Dependencies
- External Service: Requires access to the Twitter API.
- Credentials: You must configure Twitter OAuth1 credentials (
twitterOAuth1Api) in n8n. - Environment: Internet access is required for API calls.
Troubleshooting
Common Issues:
- Invalid or expired Twitter credentials: Ensure your Twitter OAuth1 credentials are valid and have the necessary permissions.
- Query too complex or exceeds character limit: The search query must be under 500 characters and not exceed Twitter's complexity limits.
- Rate limiting: Twitter may restrict the number of API requests; if you receive rate limit errors, wait before retrying.
- No results found: Adjust your search parameters (e.g., keywords, language, location) to broaden the search.
Error Messages:
"error": "Bad Authentication data": Check your Twitter credentials."error": "Query is too complex": Simplify your search query."error": "Rate limit exceeded": Wait and try again later.