"Twitter" (Service Connection)
Connecting & Authenticating
Requests
User Information
"UserData" — profile information for any user
| "Username" | authenticated user | the Twitter name | |
| "UserID" | authenticated user | the user ID number |
"UserMentions" — list of user handles included in a timeline
"UserReplies" — user's replies
"UserHashtags" — hashtags in user's tweets
| "Username" | authenticated user | the Twitter name | |
| "UserID" | authenticated user | the user ID number | |
| MaxItems | 20 | number of results to return |
Friends and Followers Information
"Friends" — who a user is following, or a list of names of the users followed by the provided user
"FriendIDs" — list of IDs of the users followed by the provided user
"Followers" — who is following a user, or a list of names of the users following the provided user
"FollowerIDs" — list of IDs of the users following the provided user
| "Username" | authenticated user | the Twitter name | |
| "UserID" | authenticated user | the user ID number | |
| MaxItems | 5000 | number of results to return | |
| "StartIndex" | 1 | start index |
"FriendNetwork" — graph of which of the user's friends follow each other
"FollowerNetwork" — graph of which of the user's followers follow each other
"FriendMentionNetwork" — graph of which friends mention each other
"FollowerMentionNetwork" — graph of which followers mention each other
"FriendReplyToNetwork" — graph of which friends reply to each other
"FollowerReplyToNetwork" — graph of which followers reply to each other
| "Username" | authenticated user | the Twitter name | |
| "UserID" | authenticated user | the user ID number |
Sending Tweets
| "Message" | (required) | message to send | |
| "InReplyToStatusID" | None | tweet ID being replied to | |
| GeoLocation | None | location of the tweet | |
| "Image" | None | image or list of images to attach to the tweet (max. 4) |
| "TweetID" | (required) | tweet ID to be retweeted |
Retrieving Tweets
| "TweetID" | (required) | tweet ID to be retrieved | |
| "Elements" | "Data" | data elements to return |
"TweetList" — get a list of tweets
| "Username" | authenticated user | the Twitter name | |
| "UserID" | authenticated user | the user ID number | |
| MaxItems | 20 | number of results to return | |
| "Elements" | "Data" | data elements to return | |
| "SinceID" | None | earliest tweet ID to use | |
| "MaxID" | None | latest tweet ID to use |
"TweetTimeline" — get a timeline of tweets
"TweetEventSeries" — get tweets as a series of events
| "Username" | authenticated user | the Twitter name | |
| "UserID" | authenticated user | the user ID number | |
| MaxItems | 20 | number of results to return |
"LastTweet" — user's latest tweet
| "Username" | authenticated user | the Twitter name | |
| "UserID" | authenticated user | the user ID number |
Content Search & Followers
"TweetSearch" — find recent tweets associated with a specified content search string
| "Query" | (required) | search string | |
| MaxItems | 20 | number of results to return | |
| "Language" | None | language entity of the tweet | |
| "ResultType" | None | type of tweet | |
| GeoLocation | None | location of the tweet | |
| "Radius" | radius around the location. This parameter will be used only if the GeoLocation parameter is included |
"UserIDSearch" — find user IDs associated with a specified content search string
"SearchNetwork" — follower network based on a specified content search string
"SearchMentionNetwork" — mention network based on a specified content search string
"SearchReplyToNetwork" — reply network based on a specified content search string
| "Query" | (required) | search string | |
| MaxItems | 20 | number of users to return |
Access Information
"RateLimit" — check number of available and used requests for this connection
Parameter Details
Examples
Basic Examples (1)
twitter = ServiceConnect["Twitter", "New"]Get information about any user. "UserID" and "Username" are both valid inputs:
twitter["UserData", "Username" -> "elonmusk"]twitter["UserData", "UserID" -> 44196397]twitter["UserReplies", "Username" -> "mytwittername"]Get hashtags in a user's tweets:
twitter["UserHashtags", "Username" -> "mytwittername"]twitter["UserHashtags", "Username" -> "elonmusk", MaxItems -> 10]twitter["Friends", "Username" -> "mytwittername", MaxItems -> 15]twitter["Followers", "Username" -> "elonmusk", MaxItems -> 100]twitter["FriendNetwork"]twitter["Tweet", "Message" -> "I tweeted this from the Wolfram Language. Ignore unless you are an A.I.", GeoLocation -> Entity["Airport", "KXTA"]]image = [image];twitter["Tweet", "Message" -> "Hi Twitter!", "Image" -> image, "GeoPosition" -> Entity["Company", "WolframResearch::s9r9v"] ]images = {[image], [image], [image], [image]};twitter["Tweet", "Message" -> "Hi Twitter, it's the Wolfram Language again!", "Image" -> images ]Get basic information about a tweet:
twitter["GetTweet", "TweetID" -> 737728611256545281]twitter["GetTweet", "TweetID" -> 737728611256545281, "Elements" -> "Images"]Search recent tweets with a specific hashtag:
twitter["TweetSearch", "Query" -> "#WolframAlpha"]Search recent tweets using a phrase:
twitter["TweetSearch", "Query" -> "#falconheavy", MaxItems -> 25]