Twitter Search
Overview
The Twitter Search macro returns data about tweets matching a specified query, subject to limits set by Twitter:
The data from up to 100 tweets can be returned.
Up to 450 queries can be executed per 15 minute period.
Twitter's search service is not meant to be an exhaustive source of Tweets. Not all Tweets will be indexed or made available via the search interface.
To use the Twitter Search macro, you must have a Twitter account and register a Twitter app.
Twitter Search configuration parameters
The Twitter Search macro has a single set of configuration parameters in addition to the standard execution options.
Parameter | Description |
---|---|
All of these words | Words which must be present in the returned tweets, separated by spaces. To return only tweets with a positive attitude, include :) as one of the words. To return only tweets with a negative attitude, include :( as one of the words. |
The exact phrase | Exact phrase which must be present in the returned tweets. |
Any of these words | Space-separated list of words, one or more of which must be present in the returned tweets. |
None of these words | Space-separated list of words, none of which may be present in the returned tweets. |
These hashtags | Space-separated list of hashtags, one or more of which must be present in the returned tweets. Omit the # "hashtag" character. |
From these accounts | Space-separated list of Twitter IDs, from which any of the returned tweets were sent. Omit the @ "at" character. |
To these accounts | Space-separated list of Twitter IDs, to which any of the returned tweets were sent. Omit the @ "at" character. |
Mentioning these accounts | Space-separated list of Twitter IDs, any of which were mentioned in the returned tweets. Omit the @ "at" character. |
Near this place (lat,lon) | Location (latitude/longitude) and radius from which the returned tweets either originated (because they were tagged with the location) or were sent by a user whose profile location is within that area. |
Since ID | Requests tweets with an ID greater than (that is, more recent than) to Since ID. If this number exceeds Twitter's tweet limit, Since ID will be replaced with the oldest ID available. |
Max ID | Requests tweets with an ID less than (that is, older than) or equal to Max ID. |
API key | Validation codes generated on the Twitter Developers' web site. See Configuring the Twitter Search macro. |
Configure the Twitter Search macro
Visit the Twitter Developers' web site and enter your Twitter user name and password.
Select Create New App and enter Application details:
Enter application Name.
Enter application Description.
Enter application Website. This must be a valid URL, including the http prefix.
Select the API Keys tab on your app's Twitter page, and then copy the API key and API secret.
Select the Twitter Search macro.
Go to the Configuration tab on the Properties pane.
Enter your Search query as in the table below.
Query | Description |
---|---|
All of these words | Words which must be present in the returned tweets, separated by spaces. To return only tweets with a positive attitude, include :) as one of the words. To return only tweets with a negative attitude, include :( as one of the words. |
The exact phrase | Exact phrase which must be present in the returned tweets. |
Any of these words | Space-separated list of words, one or more of which must be present in the returned tweets. |
None of these words | Space-separated list of words, none of which may be present in the returned tweets. |
These hashtags | Space-separated list of hashtags, one or more of which must be present in the returned tweets. Omit the # "hashtag" character. |
From these accounts | Space-separated list of Twitter IDs, from which any of the returned tweets were sent. Omit the @ "at" character. |
To these accounts | Space-separated list of Twitter ID, to which any of the returned tweets were sent. Omit the @ "at" character. |
Mentioning these accounts | Space-separated list of Twitter IDs, any of which were mentioned in the returned tweets. Omit the @ "at" character. |
Near this place (lat,lon) | Location (latitude/longitude) and radius from which the returned tweets either originated (because they were tagged with the location) or were sent by a user whose profile location is within that area. |
Since ID | Requests tweets with an ID greater than (that is, more recent than) to Since ID. If this number exceeds Twitter's tweet limit, Since ID will be replaced with the oldest ID available. |
Max ID | Requests tweets with an ID less than (that is, older than) or equal to Max ID. |
Optionally, go to the Execution tab, and then set Web service options.
Twitter Search output fields
The following are the output streams and fields for the Twitter Search macro.
Coordinates (C)
Field | Description |
---|---|
| Index of the result generated by the project. Integer. |
| Longitude of the tweet indicated by results_id. Decimal. |
| Latitude of the tweet indicated by results_id. Decimal. |
Hashtags (H)
Field | Description |
---|---|
| Index of the hashtag generated by the project. Integer. |
| Index of the result generated by the project. Integer. |
| Hashtag with preceding hash character # omitted. Unicode string. |
Results (R)
Field | Description |
---|---|
| Index of the result generated by the project. Integer. |
| Index of the query generated by the project. Integer. |
| Creation timestamp of the tweet. DateTime. |
| Twitter ID of the tweet sender. Unicode string. |
| Numerical Twitter ID of the tweet sender. Integer. |
| Display name of the tweet sender. Unicode string. |
| Numerical ID of the tweet. Integer. |
| ISO language code of the tweet. TextVar string. |
| Should always be recent, indicating that the most recent results have been requested. TextVar string. |
| URL of the tweet sender's profile image. Unicode string. |
| HTTPS URL of the tweet sender's profile image. Unicode string. |
| Tweet source (URL). Unicode string. |
| Text of the tweet. Unicode string. |
| Twitter ID to which the tweet is responding. Unicode string. |
| Numerical Twitter ID to which the tweet is responding. Integer. |
| Numerical ID of the tweet to which the tweet is responding. Integer. |
Root (R1)
Field | Description |
---|---|
| Index of the query generated by the project. Integer. |
| Length of time (in seconds) the query took. Decimal. |
| Maximum ID of the tweets returned. Integers. |
| Query string that was transmitted to Twitter. Unicode string. |
| Query string with the same search terms that could be transmitted if the tweets subsequent to the ones returned were desired. Contains since_id value, which can be used in subsequent requests. Unicode string. |
| Number of tweets returned. Integer. |
| since_id requested. If no since_id was specified, returns 0. Integers. |
URLs (U)
Field | Description |
---|---|
| Index of the URL generated by the project. Integer. |
| Index of the result generated by the project. Integer. |
| Expanded target URL as displayed by Twitter. Unicode string. |
| Expanded target URL. Unicode string. |
| Twitter-shortened URL. Unicode string. |
UserMentions (U1)
Field | Description |
---|---|
| Index of the Twitter user mention generated by the project. Integer. |
| Index of the result generated by the project. Integer. |
| Numerical Twitter ID of the user mentioned. Integer. |
| User name of the Twitter user mentioned. Unicode string. |
| Twitter ID of the user mentioned. Unicode string. |