Back to Autogpt

Twitter Tweet Lookup

docs/integrations/block-integrations/twitter/tweet_lookup.md

0.6.446.2 KB
Original Source

Twitter Tweet Lookup

<!-- MANUAL: file_description -->

Blocks for retrieving information about specific tweets on Twitter/X.

<!-- END MANUAL -->

Twitter Get Tweet

What it is

This block retrieves information about a specific Tweet.

How it works

<!-- MANUAL: how_it_works -->

This block queries the Twitter API v2 to retrieve detailed information about a specific tweet by its ID. Returns tweet content, author information, engagement metrics, and any requested expanded data.

The block uses Tweepy with OAuth 2.0 authentication and supports extensive expansions to include additional data like media, author profile, location, poll results, and referenced tweets. Useful for analyzing individual tweets or verifying tweet content.

<!-- END MANUAL -->

Inputs

InputDescriptionTypeRequired
expansionsChoose what extra information you want to get with your tweets. For example: - Select 'Media_Keys' to get media details - Select 'Author_User_ID' to get user information - Select 'Place_ID' to get location detailsExpansionFilterNo
media_fieldsSelect what media information you want to see (images, videos, etc). To use this, you must first select 'Media_Keys' in the expansions above.TweetMediaFieldsFilterNo
place_fieldsSelect what location information you want to see (country, coordinates, etc). To use this, you must first select 'Place_ID' in the expansions above.TweetPlaceFieldsFilterNo
poll_fieldsSelect what poll information you want to see (options, voting status, etc). To use this, you must first select 'Poll_IDs' in the expansions above.TweetPollFieldsFilterNo
tweet_fieldsSelect what tweet information you want to see. For referenced tweets (like retweets), select 'Referenced_Tweet_ID' in the expansions above.TweetFieldsFilterNo
user_fieldsSelect what user information you want to see. To use this, you must first select one of these in expansions above: - 'Author_User_ID' for tweet authors - 'Mentioned_Usernames' for mentioned users - 'Reply_To_User_ID' for users being replied to - 'Referenced_Tweet_Author_ID' for authors of referenced tweetsTweetUserFieldsFilterNo
tweet_idUnique identifier of the Tweet to request (ex: 1460323737035677698)strYes

Outputs

OutputDescriptionType
errorError message if the operation failedstr
idTweet IDstr
textTweet textstr
userIdID of the tweet authorstr
userNameUsername of the tweet authorstr
dataTweet dataDict[str, Any]
includedAdditional data that you have requested (Optional) via Expansions fieldDict[str, Any]
metaMetadata about the tweetDict[str, Any]

Possible use case

<!-- MANUAL: use_case -->

Content Verification: Retrieve a specific tweet to verify its content, author, or current engagement metrics.

Thread Analysis: Look up individual tweets in a thread to analyze specific parts of a conversation.

Link Processing: Fetch tweet details when processing shared Twitter links in your workflows.

<!-- END MANUAL -->

Twitter Get Tweets

What it is

This block retrieves information about multiple Tweets.

How it works

<!-- MANUAL: how_it_works -->

This block queries the Twitter API v2 to retrieve detailed information about multiple tweets in a single request. Accepts up to 100 tweet IDs and returns comprehensive data for all of them efficiently.

The block uses Tweepy with OAuth 2.0 authentication and supports extensive expansions to include additional data like media, author profiles, and referenced tweets. Returns arrays of tweet IDs, text content, author information, and complete tweet data objects.

<!-- END MANUAL -->

Inputs

InputDescriptionTypeRequired
expansionsChoose what extra information you want to get with your tweets. For example: - Select 'Media_Keys' to get media details - Select 'Author_User_ID' to get user information - Select 'Place_ID' to get location detailsExpansionFilterNo
media_fieldsSelect what media information you want to see (images, videos, etc). To use this, you must first select 'Media_Keys' in the expansions above.TweetMediaFieldsFilterNo
place_fieldsSelect what location information you want to see (country, coordinates, etc). To use this, you must first select 'Place_ID' in the expansions above.TweetPlaceFieldsFilterNo
poll_fieldsSelect what poll information you want to see (options, voting status, etc). To use this, you must first select 'Poll_IDs' in the expansions above.TweetPollFieldsFilterNo
tweet_fieldsSelect what tweet information you want to see. For referenced tweets (like retweets), select 'Referenced_Tweet_ID' in the expansions above.TweetFieldsFilterNo
user_fieldsSelect what user information you want to see. To use this, you must first select one of these in expansions above: - 'Author_User_ID' for tweet authors - 'Mentioned_Usernames' for mentioned users - 'Reply_To_User_ID' for users being replied to - 'Referenced_Tweet_Author_ID' for authors of referenced tweetsTweetUserFieldsFilterNo
tweet_idsList of Tweet IDs to request (up to 100)List[str]Yes

Outputs

OutputDescriptionType
errorError message if the operation failedstr
idsAll Tweet IDsList[str]
textsAll Tweet textsList[str]
userIdsList of user ids that authored the tweetsList[str]
userNamesList of user names that authored the tweetsList[str]
dataComplete Tweet dataList[Dict[str, Any]]
includedAdditional data that you have requested (Optional) via Expansions fieldDict[str, Any]
metaMetadata about the tweetsDict[str, Any]

Possible use case

<!-- MANUAL: use_case -->

Batch Processing: Efficiently retrieve data for multiple tweets at once, such as all tweets in a thread.

Content Analysis: Analyze multiple tweets for sentiment, engagement patterns, or content classification.

Report Generation: Gather data on multiple tweets for creating engagement reports or content audits.

<!-- END MANUAL -->