Overview
This node performs a search for tweets on Twitter based on a user-defined search query and optional parameters. It is useful for scenarios where you want to retrieve tweets matching specific keywords, hashtags, or other criteria, such as monitoring brand mentions, tracking trending topics, or gathering data for sentiment analysis. For example, you can search for recent tweets containing a particular hashtag or filter tweets by language or location.
Use Case Examples
- Search for tweets containing the hashtag #n8n and return up to 100 results.
- Retrieve all tweets mentioning a specific keyword in English.
- Find popular tweets from users located within a 10 km radius of a given latitude and longitude.
Properties
| Name | Meaning |
|---|---|
| Search Text | The UTF-8, URL-encoded search query string to find matching tweets, supporting up to 500 characters and various operators. |
| Return All | Whether to return all matching tweets or limit the number of results. |
| Limit | The maximum number of tweets to return when 'Return All' is false. |
| Additional Fields | Optional parameters to refine the search, including whether to include entities, language restriction, location-based filtering, result type preference, tweet mode, and date limit. |
Output
JSON
statuses- An array of tweet objects matching the search criteria, each containing tweet details such as text, user info, and metadata.
Dependencies
- Requires Twitter API credentials with OAuth1 authentication to access Twitter's search endpoints.
Troubleshooting
- Ensure the Twitter API credentials are correctly configured and have the necessary permissions to perform tweet searches.
- If the search query is invalid or too complex, the Twitter API may return an error; simplify the query or check the Twitter search operators documentation.
- Rate limits imposed by Twitter API may restrict the number of requests; handle rate limiting by implementing retries or delays.
- If no tweets are returned, verify the search parameters such as language, location, and date filters to ensure they match available tweets.
Links
- Twitter Search Operators Guide - Documentation on how to construct search queries for Twitter's search API.