### Get User Followings Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/all-functions Retrieves users followed by a specified user. Supports pagination and waiting between requests. ```APIDOC ## GET /api/get_user_followings ### Description Retrieves users followed by a specified user. Supports pagination and waiting between requests. ### Method GET ### Endpoint /api/get_user_followings ### Parameters #### Query Parameters - **username** (string|int|User) - Required - Username of the target user. - **pages** (int) - Optional - Number of following pages to retrieve. Default is 1. - **wait_time** (int) - Optional - Number of seconds to wait between requests. Default is 2. - **cursor** (string) - Optional - Pagination cursor for retrieving pages from a specific point. ### Response #### Success Response (200) - **followings** (list) - List of users followed by the specified user. #### Response Example { "followings": [ { "id": "123", "username": "user1" } ] } ``` -------------------------------- ### Get User Info with TwitterAsync Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieves user information based on a username, user ID, or list of user IDs. Requires authentication. Returns a User object or list of User objects. All examples assume `app` is an authenticated instance of `TwitterAsync`. ```python user = await app.get_user_info('elonmusk') ``` -------------------------------- ### Get User Subscribers Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/all-functions Retrieves subscribers of a specified user. Supports pagination and waiting between requests. ```APIDOC ## GET /api/get_user_subscribers ### Description Retrieves subscribers of a specified user. Supports pagination and waiting between requests. ### Method GET ### Endpoint /api/get_user_subscribers ### Parameters #### Query Parameters - **username** (string|int|User) - Required - Username of the target user. - **pages** (int) - Optional - Number of subscriber pages to retrieve. Default is 1. - **wait_time** (int) - Optional - Number of seconds to wait between requests. Default is 2. - **cursor** (string) - Optional - Pagination cursor for retrieving pages from a specific point. ### Response #### Success Response (200) - **subscribers** (list) - List of subscribers for the specified user. #### Response Example { "subscribers": [ { "id": "123", "username": "user1" } ] } ``` -------------------------------- ### Get User Followers Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/all-functions Retrieves followers of a specified user. Supports pagination and waiting between requests. ```APIDOC ## GET /api/get_user_followers ### Description Retrieves followers of a specified user. Supports pagination and waiting between requests. ### Method GET ### Endpoint /api/get_user_followers ### Parameters #### Query Parameters - **username** (string|int|User) - Required - Username of the target user. - **pages** (int) - Optional - Number of follower pages to retrieve. Default is 1. - **wait_time** (int) - Optional - Number of seconds to wait between requests. Default is 2. - **cursor** (string) - Optional - Pagination cursor for retrieving pages from a specific point. ### Response #### Success Response (200) - **followers** (list) - List of followers for the specified user. #### Response Example { "followers": [ { "id": "123", "username": "user1" } ] } ``` -------------------------------- ### GET /trends Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/all-functions Get the top 20 local trending topics on Twitter. ```APIDOC ## GET /trends ### Description Get the top 20 local trending topics on Twitter. ### Method GET ### Endpoint /trends ### Parameters No parameters required. ### Response #### Success Response (200) - **list[Trends]** - List of current trending topics #### Response Example ```python from tweety import Twitter app = Twitter("session") all_trends = await app.get_trends() for trend in all_trends: print(trend) ``` ``` -------------------------------- ### GET /timeline/home Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/all-functions Get tweets from the authenticated user's home timeline. Supports different timeline types and pagination. ```APIDOC ## GET /timeline/home ### Description Get tweets from the authenticated user's home timeline. Supports different timeline types and pagination. ### Method GET ### Endpoint /timeline/home ### Parameters #### Query Parameters - **timeline_type** (str) - Optional - The type of Timeline to Get ("HomeTimeline", "HomeLatestTimeline") (default: "HomeTimeline") - **pages** (int) - Optional - Number of Tweet Pages you want to get (default: 1) - **wait_time** (int) - Optional - Number of seconds to wait between multiple requests (default: 2) - **cursor** (str) - Optional - Pagination cursor if you want to get the pages from that cursor up-to (default: None) ### Response #### Success Response (200) - **SelfTimeline** - Timeline information - **Generator** - Generator returning SelfTimeline object and list of Tweet objects #### Response Example ```python from tweety.types import HOME_TIMELINE_TYPE_FOR_YOU, HOME_TIMELINE_TYPE_FOLLOWING tweets = await app.get_home_timeline(timeline_type=HOME_TIMELINE_TYPE_FOR_YOU) for tweet in tweets: print(tweet) ``` ``` -------------------------------- ### Get Bookmarks (Python) Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/all-functions Retrieves the user's bookmarks. This function takes the number of pages to retrieve, wait time between requests (in seconds), and an optional pagination cursor as input. The return format is not specified in the input text. ```Python tweets = await app.get_bookmarks() ``` -------------------------------- ### GET /tweet/{identifier} Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/all-functions Get detailed information about a specific tweet using either its ID or URL. ```APIDOC ## GET /tweet/{identifier} ### Description Get detailed information about a specific tweet using either its ID or URL. ### Method GET ### Endpoint /tweet/{identifier} ### Parameters #### Path Parameters - **identifier** (str) - Required - Either ID of the Tweet or URL of the Tweet you want details of ### Response #### Success Response (200) - **Tweet** - Detailed tweet information #### Response Example ```python tweet = await app.tweet_detail("https://twitter.com/Microsoft/status/1442542812197801985") ``` ``` -------------------------------- ### Get Lists with Python Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieves lists of the authenticated user. Supports pagination and wait time between requests. Returns Lists object or generator with TwList objects. ```python lists = await app.get_lists() for _list in lists: print(_list) ``` -------------------------------- ### Get List with Python Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieves a specific list using its ID. Returns TwList object representing the requested list. ```python _list = await app.get_list("123515") print(_list) ``` -------------------------------- ### Fetch User Info and Tweets - Python Source: https://mahrtayyab.github.io/tweety_docs/basic/quick-start This example demonstrates how to authenticate with the Twitter API using Tweety, retrieve a user's information and their tweets, and iterate through the tweets. It utilizes the `TwitterAsync` class for asynchronous operations and requires a valid Twitter username and password. The `get_user_info` method returns a `User` object, and `get_tweets` returns a `UserTweets` object. ```Python from tweety import TwitterAsync async def main(): app = TwitterAsync("session") await app.sign_in(username, password) target_username = "elonmusk" user = await app.get_user_info(target_username) all_tweets = await app.get_tweets(user) for tweet in all_tweets: print(tweet) ``` -------------------------------- ### GET /blocked_users Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieves the list of users blocked by the authenticated user. Supports pagination. ```APIDOC ## GET /blocked_users\n\n### Description\nGet the users blocked by the authenticated user.\n\n### Method\nGET\n\n### Endpoint\n/blocked_users\n\n### Parameters\n#### Query Parameters\n- **pages** (integer) - Optional - Number of pages to retrieve (default: 1).\n- **wait_time** (integer) - Optional - Seconds to wait between requests (default: 2).\n- **cursor** (string) - Optional - Pagination cursor to continue from a previous request.\n\n### Response\n#### Success Response (200)\n- **blocked_users** (array) - List of User objects that are blocked.\n\n### Response Example\n{\n \"blocked_users\": [\n {\n \"id\": \"3333",n \"username\": \"spamAccount\"\n }\n ]\n} ``` -------------------------------- ### GET /users/inbox Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieve the inbox of the authenticated user. Supports pagination and provides both direct retrieval and generator-based iteration. ```APIDOC ## GET /users/inbox ### Description Retrieve the inbox of the authenticated user. Supports pagination and provides both direct retrieval and generator-based iteration. ### Method GET ### Endpoint /users/inbox ### Parameters #### Query Parameters - **user_id** (string|integer) - Optional - User ID of the user whom to get the conversation of (default: None) - **pages** (integer) - Optional - Number of Inbox Pages you want to get (default: 1) - **wait_time** (integer) - Optional - Number of seconds to wait between multiple requests (default: 2) ### Response #### Success Response (200) - **Inbox** - Object containing inbox information #### Response Example ``` inbox = await app.get_inbox() for conversation in inbox: print(conversation) ``` ``` -------------------------------- ### Get Mutual Followers using TwitterAsync in Python Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Gets mutual followers/friends of a user, with pagination and iteration options. Depends on app; inputs username (str/int/User), pages (int=1), wait_time (int=2), cursor (str=None). Returns MutualFollowers or generator of (MutualFollowers, list[User]). Includes wait_time for API throttling. ```python users = await app.get_mutual_followers('elonmusk') for user in users: print(user) ``` -------------------------------- ### Get User Media with TwitterAsync Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Fetches media content from a specified user's tweets. Supports pagination. Returns a UserMedia object or a generator for iterative retrieval. Requires authentication. ```python tweets = await app.get_user_media('elonmusk') for tweet in tweets: print(tweet.media) ``` -------------------------------- ### GET /users/bookmarks Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieve bookmarked tweets of the authenticated user. Supports pagination and provides both direct retrieval and generator-based iteration. ```APIDOC ## GET /users/bookmarks ### Description Retrieve bookmarked tweets of the authenticated user. Supports pagination and provides both direct retrieval and generator-based iteration. ### Method GET ### Endpoint /users/bookmarks ### Parameters #### Query Parameters - **pages** (integer) - Optional - Number of Tweet Pages you want to get (default: 1) - **wait_time** (integer) - Optional - Number of seconds to wait between multiple requests (default: 2) - **cursor** (string) - Optional - Pagination cursor if you want to get the pages from that cursor up-to (default: None) ### Response #### Success Response (200) - **Bookmarks** - Object containing bookmark information #### Response Example ``` tweets = await app.get_bookmarks() for tweet in tweets: print(tweet) ``` ``` -------------------------------- ### Fetch tweets using Tweety library in Python Source: https://mahrtayyab.github.io/tweety_docs/_sources/index This snippet shows how to use the Tweety library to sign in asynchronously and retrieve all tweets from a given Twitter handle. It requires the Tweety package and valid Twitter credentials, and outputs each tweet to the console. The example is limited to demonstration purposes and does not include error handling. ```python from tweety import TwitterAsync async def main(): app = TwitterAsync("session") await app.sign_in(username, password) all_tweets = await app.get_tweets("elonmusk") for tweet in all_tweets: print(tweet) ``` -------------------------------- ### GET /tweet/{tweet_id}/likes Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/all-functions Get users who have liked a specific tweet. Available in both regular and generator versions. ```APIDOC ## GET /tweet/{tweet_id}/likes ### Description Get users who have liked a specific tweet. ### Method GET ### Endpoint /tweet/{tweet_id}/likes ### Parameters #### Path Parameters - **tweet_id** (str | Tweet) - Required - ID of the Tweet #### Query Parameters - **pages** (int) - Optional - Number of pages you want to get (default: 1) - **wait_time** (int) - Optional - Number of seconds to wait between multiple requests (default: 2) - **cursor** (str) - Optional - Pagination cursor if you want to get the pages from that cursor up-to (default: None) ### Response #### Success Response (200) - **Generator** - Generator returning users who liked the tweet #### Response Example ```python users = await app.get_tweet_likes("1442542812197801985") for user in users: print(user) ``` ``` -------------------------------- ### Get Suggested Users using TwitterAsync in Python Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Fetches users suggested by Twitter using the get_suggested_users method. No arguments required; based on authentication context. Returns list[User]; suggestions are personalized and algorithm-driven. ```python await app.get_suggested_users() ``` -------------------------------- ### GET /topics/{topic_id} Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieves a specific Twitter Topic by its identifier. ```APIDOC ## GET /topics/{topic_id}\n\n### Description\nGet a topic using its ID.\n\n### Method\nGET\n\n### Endpoint\n/topics/{topic_id}\n\n### Parameters\n#### Path Parameters\n- **topic_id** (string|integer) - Required - Identifier of the Topic.\n\n### Responsen#### Success Response (200)\n- **topic** (object) - The requested Topic object.\n\n### Response Example\n{\n \"id\": \"123515\",\n \"name\": \"Technology\",\n \"description\": \"All things tech\"\n} ``` -------------------------------- ### Get List Members with Python Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieves members of a specific list with pagination support. Supports wait time between requests and cursor-based pagination. Returns ListMembers object or generator with User objects. ```python users = await app.get_list_member("123515") for user in users: print(user) ``` -------------------------------- ### Get User Highlights with TwitterAsync Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Fetches highlights from a specified user's tweets. Supports pagination. Returns a UserHighlights object or a generator for iterative retrieval. Requires authentication. ```python tweets = await app.get_user_highlights('elonmusk') for tweet in tweets: print(tweet) ``` -------------------------------- ### Get Tweet Notifications Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/all-functions Retrieves tweets from users for whom the authenticated user has enabled notifications. Supports pagination and waiting between requests. ```APIDOC ## GET /api/get_tweet_notifications ### Description Retrieves tweets from users for whom the authenticated user has enabled notifications. Supports pagination and waiting between requests. ### Method GET ### Endpoint /api/get_tweet_notifications ### Parameters #### Query Parameters - **pages** (int) - Optional - Number of tweet pages to retrieve. Default is 1. - **wait_time** (int) - Optional - Number of seconds to wait between requests. Default is 2. - **cursor** (string) - Optional - Pagination cursor for retrieving pages from a specific point. ### Response #### Success Response (200) - **tweets** (list) - List of tweets from users with enabled notifications. #### Response Example { "tweets": [ { "id": "123", "text": "Hello, world!" } ] } ``` -------------------------------- ### Get User Subscribers - Python Async Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Fetches subscribers (followers) of a specified Twitter user account. Uses async methods for efficient data retrieval. Supports cursor-based pagination and configurable wait times between API calls. Returns UserSubscribers object with subscriber information. ```Python from tweety import Twitter app = Twitter("session") users = await app.get_user_subscribers() for user in users: print(user) ``` -------------------------------- ### GET /community/{community_id}/members Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/all-functions Retrieves the members of a specified community with pagination and filtering options. Includes both standard fetch and iterator methods for generators. ```APIDOC ## GET /community/{community_id}/members ### Description Get the Members of the specified community (iter for generator) ### Method GET ### Endpoint /community/{community_id}/members ### Parameters #### Path Parameters - **community_id** (int | str | Community) - Required - ID of the community you want to get Members of. #### Query Parameters - **pages** (int) - Optional - Number of Member Pages you want to get (default: 1) - **filter_** (str) - Optional - Filter you would like to apply on the members (default: None). More about filter - **wait_time** (int) - Optional - Number of seconds to wait between multiple requests (default: 2) - **cursor** (str) - Optional - Pagination cursor if you want to get the pages from that cursor up-to (default: None) #### Request Body None ### Request Example N/A ### Response #### Success Response (200) - **data** (CommunityMembers) - CommunityMembers object or Generator yielding (CommunityMembers, list[User]) #### Response Example { "data": "CommunityMembers object or generator" } ``` -------------------------------- ### GET /user/highlights/{username} Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/all-functions Retrieve highlighted tweets from a specific user. This endpoint returns a generator that yields UserHighlights and a list of Tweet objects. ```APIDOC ## GET /user/highlights/{username} ### Description Retrieve highlighted tweets from a specific user. ### Method GET ### Endpoint /user/highlights/{username} ### Parameters #### Path Parameters - **username** (str) - Required - The username of the account to get highlights from #### Query Parameters - **pages** (int) - Optional - Number of Tweet Pages you want to get (default: 1) - **wait_time** (int) - Optional - Number of seconds to wait between multiple requests (default: 2) - **cursor** (str) - Optional - Pagination cursor if you want to get the pages from that cursor up-to (default: None) ### Response #### Success Response (200) - **UserHighlights** - Highlighted user information - **list[Tweet]** - List of highlighted tweets #### Response Example ```python tweets = await app.get_user_highlights('elonmusk') for tweet in tweets: print(tweet) ``` ``` -------------------------------- ### GET /tweets/{tweet_id}/translate Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Translates a specific tweet into the requested language. ```APIDOC ## GET /tweets/{tweet_id}/translate\n\n### Description\nGet specific Tweet in a specific Language.\n\n### Method\nGET\n\n### Endpoint\n/tweets/{tweet_id}/translate\n\n### Parameters\n#### Path Parameters\n- **tweet_id** (string|integer) - Required - Identifier of the Tweet.\n\n#### Query Parameters\n- **language** (string) - Required - Language code to translate the tweet into (e.g., \"en\", \"es\").\n\n### Response\n#### Success Response (200)\n- **translation** (object) - Translated tweet text and metadata.\n\n### Response Example\n{\n \"tweet_id\": \"123515\",\n \"original_text\": \"Bonjour le monde\",\n \"translated_text\": \"Hello world\",\n \"language\": \"en\"\n} ``` -------------------------------- ### GET /tweets/{tweet_id}/analytics Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieves analytics data for a tweet authored by the authenticated user. ```APIDOC ## GET /tweets/{tweet_id}/analytics\n\n### Description\nGet analytics of a Tweet (made by authenticated user).\n\n### Method\nGET\n\n### Endpoint\n/tweets/{tweet_id}/analytics\n\n### Parameters\n#### Path Parameters\n- **tweet_id** (string|integer) - Required - Identifier of the Tweet.\n\n### Response\n#### Success Response (200)\n- **analytics** (object) - Tweet analytics data (impressions, engagements, etc.).\n\n### Response Example\n{\n \"tweet_id\": \"123515\",\n \"impressions\": 1500,\n \"engagements\": 120,\n \"detail\": {\n \"likes\": 80,\n \"retweets\": 30,\n \"replies\": 10\n }\n} ``` -------------------------------- ### GET /users/mentions Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieve tweets in which the authenticated user is mentioned. Supports pagination and provides both direct retrieval and generator-based iteration. ```APIDOC ## GET /users/mentions ### Description Retrieve tweets in which the authenticated user is mentioned. Supports pagination and provides both direct retrieval and generator-based iteration. ### Method GET ### Endpoint /users/mentions ### Parameters #### Query Parameters - **pages** (integer) - Optional - Number of Tweet Pages you want to get (default: 1) - **wait_time** (integer) - Optional - Number of seconds to wait between multiple requests (default: 2) - **cursor** (string) - Optional - Pagination cursor if you want to get the pages from that cursor up-to (default: None) ### Response #### Success Response (200) - **Mention** - Object containing mention information #### Response Example ``` tweets = await app.get_mentions() for tweet in tweets: print(tweet) ``` ``` -------------------------------- ### GET /topics/{topic_id}/tweets Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Fetches tweets associated with a specific Topic. Supports pagination through pages and cursor parameters. ```APIDOC ## GET /topics/{topic_id}/tweets\n\n### Description\nGet the Tweets of the specified Topic.\n\n### Method\nGET\n\n### Endpoint\n/topics/{topic_id}/tweets\n\n### Parameters\n#### Path Parameters\n- **topic_id** (string|integer) - Required - Identifier of the Topic.\n\n#### Query Parameters\n- **pages** (integer) - Optional - Number of tweet pages to retrieve (default: 1).\n- **wait_time** (integer) - Optional - Seconds to wait between requests (default: 2).\n- **cursor** (string) - Optional - Pagination cursor to continue from a previous request.\n\n### Response\n#### Success Response (200)\n- **tweets** (array) - List of Tweet objects for the requested pages.\n\n### Response Example\n{\n \"tweets\": [\n {\n \"id\": \"987654\",\n \"text\": \"Exciting news!\"\n },\n {\n \"id\": \"987655\",\n \"text\": \"Another update.\"\n }\n ]\n} ``` -------------------------------- ### Get User Followers - Python Async Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Fetches followers of a specified Twitter user using async methods. Supports pagination with customizable page limits and wait times. Requires Twitter session authentication. Returns UserFollowers object with user data. ```Python from tweety import Twitter app = Twitter("session") users = await app.get_user_followers() for user in users: print(user) ``` -------------------------------- ### Get Bookmarks - Python Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Asynchronously retrieves bookmarked tweets of the authenticated user. Accepts number of pages, wait time between requests, and pagination cursor. Returns Bookmarks object or a generator of Tweet objects. ```Python tweets = await app.get_bookmarks() for tweet in tweets: print(tweet) ``` -------------------------------- ### GET /search Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/all-functions Search for tweets containing a specific keyword or hashtag on Twitter. Provides both regular and generator versions for fetching results. ```APIDOC ## GET /search ### Description Search for tweets containing a specific keyword or hashtag on Twitter. ### Method GET ### Endpoint /search ### Parameters #### Query Parameters - **keyword** (str) - Required - The keyword which is supposed to be searched - **pages** (int) - Optional - Number of Tweet Pages you want to get (default: 1) - **filter_** (str) - Optional - Filter you would like to apply on the search (default: None) - **wait_time** (int) - Optional - Number of seconds to wait between multiple requests (default: 2) - **cursor** (str) - Optional - Pagination cursor if you want to get the pages from that cursor up-to (default: None) ### Response #### Success Response (200) - **Search** - Search result information - **Generator** - Generator returning Search object and list of Tweet objects #### Response Example ```python tweets = await app.search('elonmusk') for tweet in tweets: print(tweet) ``` ``` -------------------------------- ### Get Home Timeline (Python) Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/all-functions Retrieves home timeline tweets using app.get_home_timeline() or app.iter_home_timeline() method. It iterates through the results and prints each tweet. The method allows for specifying timeline type, pages, wait time, and cursor. ```python from tweety.types import HOME_TIMELINE_TYPE_FOR_YOU tweets = await app.get_home_timeline(timeline_type=HOME_TIMELINE_TYPE_FOR_YOU) for tweet in tweets: print(tweet) ``` -------------------------------- ### Tweet Class Methods Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/twDataTypes The Tweet class represents a Twitter post and provides methods to fetch comments, like/unlike, translate, delete, download media, retweet, and get reply context. All methods are asynchronous. ```APIDOC ## get_comments() ### Description Get the comments or replies posted in response to this tweet. ### Method Python async method ### Endpoint N/A (Object method: tweet.get_comments()) ### Parameters #### Arguments - **pages** (int) - Optional - Default: 1 - How many pages to get - **wait_time** (int) - Optional - Default: 2 - Number of seconds to wait between requests - **cursor** (str) - Optional - Default: None - Pagination cursor ### Request Example N/A ### Response #### Success Response - **Return** (list[Tweet]) - List of comment tweets #### Response Example [] ## iter_comments() ### Description Iterator version to get comments or replies posted in response to this tweet. ### Method Python async method ### Endpoint N/A (Object method: tweet.iter_comments()) ### Parameters #### Arguments - **pages** (int) - Optional - Default: 1 - How many pages to get - **wait_time** (int) - Optional - Default: 2 - Number of seconds to wait between requests - **cursor** (str) - Optional - Default: None - Pagination cursor ### Request Example N/A ### Response #### Success Response - **Return** (Iterator of Tweet) - Yields comment tweets #### Response Example N/A ## like() ### Description Like the tweet. ### Method Python async method ### Endpoint N/A (Object method: tweet.like()) ### Parameters None ### Request Example N/A ### Response #### Success Response (200 equivalent) - **Return** (Bool) - True if successful #### Response Example true ## unlike() ### Description Unlike the tweet. ### Method Python async method ### Endpoint N/A (Object method: tweet.unlike()) ### Parameters None ### Request Example N/A ### Response #### Success Response (200 equivalent) - **Return** (Bool) - True if successful #### Response Example true ## translate() ### Description Translate the tweet content. ### Method Python async method ### Endpoint N/A (Object method: tweet.translate()) ### Parameters None ### Request Example N/A ### Response #### Success Response (200 equivalent) - **Return** (TweetTranslate) - Translated tweet object #### Response Example {} ## delete() ### Description Delete the tweet. ### Method Python async method ### Endpoint N/A (Object method: tweet.delete()) ### Parameters None ### Request Example N/A ### Response #### Success Response (200 equivalent) - **Return** (Bool) - True if successful #### Response Example true ## download_all_media() ### Description Download all media attached to the tweet. ### Method Python async method ### Endpoint N/A (Object method: tweet.download_all_media()) ### Parameters #### Arguments - **progress_callback** (Callable[[str, int, int], None]) - Optional - Default: None - Callback for download progress [filename, total_size_in_bytes, downloaded_in_bytes] ### Request Example N/A ### Response #### Success Response (200 equivalent) No return value #### Response Example N/A ## retweet() ### Description Retweet the tweet. ### Method Python async method ### Endpoint N/A (Object method: tweet.retweet()) ### Parameters None ### Request Example N/A ### Response #### Success Response (200 equivalent) - **Return** (Bool) - True if successful #### Response Example true ## get_reply_to() ### Description Get the tweet to which this tweet is a reply. ### Method Python async method ### Endpoint N/A (Object method: tweet.get_reply_to()) ### Parameters None ### Request Example N/A ### Response #### Success Response (200 equivalent) - **Return** (Tweet) - Parent tweet object #### Response Example {} ``` -------------------------------- ### Get User Followings - Python Async Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieves the list of users that a specified Twitter user is following. Implements async/await for non-blocking operations. Supports pagination and customizable delay between requests. Returns UserFollowings object containing following user data. ```Python from tweety import Twitter app = Twitter("session") users = await app.get_user_followings() for user in users: print(user) ``` -------------------------------- ### GET /community/{community_id} Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/all-functions Retrieves the details of a specific Twitter community using its ID. This endpoint is useful for fetching community information asynchronously. ```APIDOC ## GET /community/{community_id} ### Description Get a Community Details ### Method GET ### Endpoint /community/{community_id} ### Parameters #### Path Parameters - **community_id** (str | int) - Required - Id of the Community #### Query Parameters None #### Request Body None ### Request Example N/A ### Response #### Success Response (200) - **data** (Community) - Community object containing details #### Response Example { "data": "Community object" } ``` -------------------------------- ### Get Twitter Trends (Python) Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieves the current local Twitter trends. Takes no input arguments and returns a list of Trend objects representing current trends. ```Python from tweety import Twitter app = Twitter("session") all_trends = await app.get_trends() for trend in all_trends: print(trend) ``` -------------------------------- ### GET /users/{username}/mutual_followers Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieves mutual followers (friends) between the authenticated user and the specified user. Supports pagination. ```APIDOC ## GET /users/{username}/mutual_followers\n\n### Description\nGet the Mutual Followers/Friends of a User.\n\n### Method\nGET\n\n### Endpoint\n/users/{username}/mutual_followers\n\n### Parameters\n#### Path Parameters\n- **username** (string) - Required - Username of the target user.\n\n#### Query Parameters\n- **pages** (integer) - Optional - Number of pages to retrieve (default: 1).\n- **wait_time** (integer) - Optional - Seconds to wait between requests (default: 2).\n- **cursor** (string) - Optional - Pagination cursor to continue from a previous request.\n\n Response\n#### Success Response (200)\n- **users** (array) - List of User objects that are mutual followers.\n\n### Response Example\n{\n \"users\": [\n {\n \"id\": \"1111\",\n \"username\": \"alice\"\n },\n {\n \"id\": \"2222\",\n \"username\": \"bob\"\n }\n ]\n} ``` -------------------------------- ### Get User Tweets with TwitterAsync Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Fetches tweets from a specified user. Supports pagination and options to include replies. Returns a UserTweets object or a generator for iterative retrieval. Requires authentication. ```python tweets = await app.get_tweets('elonmusk') for tweet in tweets: print(tweet) ``` -------------------------------- ### Get Tweet Likes (Python) Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/all-functions Retrieves the users who have liked a tweet using the app.get_tweet_likes() or app.iter_tweet_likes() method. It iterates through the results. The method takes a tweet ID as input. ```python tweets = await app.get_tweet_likes(tweet_id=1) for tweet in tweets: print(tweet) ``` -------------------------------- ### GET /community/{community_id}/tweets Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/all-functions Fetches tweets from a specified community with options for pagination, filtering, and cursor-based retrieval. Supports both standard fetch and iterator methods for generators. ```APIDOC ## GET /community/{community_id}/tweets ### Description Get the Tweets of the specified community (iter for generator) ### Method GET ### Endpoint /community/{community_id}/tweets ### Parameters #### Path Parameters - **community_id** (int | str | Community) - Required - ID of the community you want to get Tweets of. #### Query Parameters - **pages** (int) - Optional - Number of Tweet Pages you want to get (default: 1) - **filter_** (str) - Optional - Filter you would like to apply on the tweets (default: None). More about filter - **wait_time** (int) - Optional - Number of seconds to wait between multiple requests (default: 2) - **cursor** (str) - Optional - Pagination cursor if you want to get the pages from that cursor up-to (default: None) #### Request Body None ### Request Example N/A ### Response #### Success Response (200) - **data** (CommunityTweets) - CommunityTweets object or Generator yielding (CommunityTweets, list[Tweet]) #### Response Example { "data": "CommunityTweets object or generator" } ``` -------------------------------- ### Get Community Details in Python Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieves details of a Twitter community using its ID. Accepts community ID as string or integer. Returns a Community object with community information. Requires authenticated Twitter session. ```python from tweety import Twitter app = Twitter("session") await app.get_community("123456789") ``` -------------------------------- ### GET /tweets/{tweet_id}/retweets Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieve users who have retweeted a specific tweet. Supports pagination and provides both direct retrieval and generator-based iteration. ```APIDOC ## GET /tweets/{tweet_id}/retweets ### Description Retrieve users who have retweeted a specific tweet. Supports pagination and provides both direct retrieval and generator-based iteration. ### Method GET ### Endpoint /tweets/{tweet_id}/retweets ### Parameters #### Path Parameters - **tweet_id** (string) - Required - ID of the Tweet #### Query Parameters - **pages** (integer) - Optional - Number of Tweet Pages you want to get (default: 1) - **wait_time** (integer) - Optional - Number of seconds to wait between multiple requests (default: 2) - **cursor** (string) - Optional - Pagination cursor if you want to get the pages from that cursor up-to (default: None) ### Response #### Success Response (200) - **TweetRetweets** - Object containing retweet information #### Response Example ``` tweet = await app.tweet_detail("1232515235253352") users = await app.get_tweet_retweets(tweet) for user in users: print(user) ``` ``` -------------------------------- ### TwitterAsync.enable_user_notification Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions This method enables notifications for new tweets from a specific user. Provide the user ID as a parameter and it returns a boolean. Use to start receiving notifications for a user's activity. ```APIDOC ## ASYNC METHOD TwitterAsync.enable_user_notification ### Description Enable user notification on new tweet from specific user ### Method ASYNC METHOD ### Endpoint TwitterAsync.enable_user_notification(user_id : str | int | User) ### Parameters #### Function Parameters - **user_id** (str | int | User) - Required - Id of the User ### Request Example ``` await app.enable_user_notification("123456789") ``` ### Response #### Success Response - **Returns** (Bool) - Boolean indicating success #### Response Example { "example": "true or false" } ``` -------------------------------- ### Get Inbox - Python Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Asynchronously retrieves inbox messages of the authenticated user. Accepts optional user ID for conversation filtering, number of pages, and wait time between requests. Returns Inbox object. ```Python inbox = await app.get_inbox() for conversation in inbox: print(conversation) ``` -------------------------------- ### get_tweet_comments Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/all-functions This method fetches the comments of a specified tweet. It includes options for pagination, wait time between requests, cursor for pagination, and whether to get hidden comments. Available as both a getter and iterator. ```APIDOC ## GET TWEET COMMENTS ### Description Get the Comments of specified Tweet, use `iter` for generator. ### Method TwitterAsync.get_tweet_comments / iter_tweet_comments (async) ### Endpoint N/A ### Parameters #### Parameters - **tweet_id** (str | int | Tweet) - Required - Target Tweet - **pages** (int) - Optional - Number of Tweet Pages you want to get (default: 1) - **wait_time** (int) - Optional - Number of seconds to wait between multiple requests (default: 2) - **cursor** (str) - Optional - Pagination cursor if you want to get the pages from that cursor up-to (This cursor is different from actual API cursor) (default: None) - **get_hidden** (bool) - Optional - Get hidden comments or not (default: False) ### Request Example { "from tweety import Twitter\n\napp = Twitter(\"session\")\nthreads = await app.get_tweet_comments(\"123456789\")\nfor thread in threads:\n print(thread)" } ### Response #### Success Response - **TweetComments** or **Generator: (TweetComments, list[ConversationThread])** - The tweet comments or generator with comments and thread list #### Response Example { "TweetComments object or generator output" } ``` -------------------------------- ### GET /tweets/{tweet_id}/quotes Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieve users who have quoted a specific tweet. Supports pagination and provides both direct retrieval and generator-based iteration. ```APIDOC ## GET /tweets/{tweet_id}/quotes ### Description Retrieve users who have quoted a specific tweet. Supports pagination and provides both direct retrieval and generator-based iteration. ### Method GET ### Endpoint /tweets/{tweet_id}/quotes ### Parameters #### Path Parameters - **tweet_id** (string) - Required - ID of the Tweet #### Query Parameters - **pages** (integer) - Optional - Number of Tweet Pages you want to get (default: 1) - **wait_time** (integer) - Optional - Number of seconds to wait between multiple requests (default: 2) - **cursor** (string) - Optional - Pagination cursor if you want to get the pages from that cursor up-to (default: None) ### Response #### Success Response (200) - **Search** - Object containing quote information #### Response Example ``` tweet = await app.tweet_detail("1232515235253352") users = await app.get_tweet_quotes(tweet) for user in users: print(user) ``` ``` -------------------------------- ### Get Topic using TwitterAsync in Python Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieves a Twitter topic by its ID. Uses authenticated app. Input is topic_id (str/int); outputs a Topic object. Limited to valid topic IDs. ```python topic = await app.get_topic("123515") print(topic) ``` -------------------------------- ### Get User Mentions - Python Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Asynchronously retrieves tweets mentioning the authenticated user. Accepts number of pages, wait time between requests, and pagination cursor. Returns Mention object or a generator of Tweet objects. ```Python tweets = await app.get_mentions() for tweet in tweets: print(tweet) ``` -------------------------------- ### Get List Tweets with Python Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieves tweets from a specific list with pagination support. Supports wait time between requests and cursor-based pagination. Returns ListTweets object or generator with Tweet objects. ```python tweets = await app.get_list_tweets("123515") for tweet in tweets: print(tweet) ``` -------------------------------- ### Get User ID with TwitterAsync Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieves the user ID of a specific username. Useful when only the ID is needed. Requires authentication. Returns a string representing the user ID. ```python user = await app.get_user_id('elonmusk') ``` -------------------------------- ### Get Specific Conversation (Python) Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/all-functions Retrieves a specific conversation identified by its ID. Supports fetching messages up to a certain `max_id` to ignore older messages. Returns a 'Conversation' object. ```python message = await app.get_conversation("kharltayyab") ``` -------------------------------- ### Get Blocked Users using TwitterAsync in Python Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieves users blocked by the authenticated user, supporting pagination and iteration. Inputs pages (int=1), wait_time (int=2), cursor (str=None). Outputs BlockedUsers or generator of (BlockedUsers, list[User]). Wait_time prevents rate limit issues. ```python users = await app.get_blocked_users() for user in users: print(user) ``` -------------------------------- ### Get Tweet Notifications - Python Async Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieves tweets from users who have enabled new tweet notifications for the authenticated user. Uses async/await pattern for non-blocking execution. Returns TweetNotifications object containing tweet data. ```Python tweets = await app.get_tweet_notifications() for tweet in tweets: print(tweet) ``` -------------------------------- ### create_list Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/all-functions This method creates a new list on Twitter with the specified name, description, and privacy setting. ```APIDOC ## CREATE LIST ### Description Create a List on Twitter. ### Method TwitterAsync.create_list (async) ### Endpoint N/A ### Parameters #### Parameters - **name** (str) - Required - Name of List - **description** (str) - Optional - Description of List (default: "") - **is_private** (bool) - Optional - Either to create the list private or not ### Request Example { "_list = await app.create_list(\"list_name\")\nprint(_list)" } ### Response #### Success Response - **TwList** - The created list object #### Response Example { "TwList object" } ``` -------------------------------- ### Get Tweet Likes (Python) Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/all-functions Retrieves the users who liked a specific tweet. This function takes a tweet ID, number of pages to retrieve, wait time between requests (in seconds), and an optional pagination cursor as input. It returns a list of TweetLikes objects. ```Python tweet = await app.tweet_detail("1232515235253352") likes = await app.get_tweet_likes(tweet) for like in likes: print(like) ``` -------------------------------- ### Get Tweet Analytics using TwitterAsync in Python Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieves analytics for a tweet made by the authenticated user. Inputs tweet_id (str/int/Tweet); outputs TweetAnalytics. Only works for user's own tweets. ```python tweet = await app.get_tweet_analytics("123515") print(tweet) ``` -------------------------------- ### Create Tweet - Python Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/all-functions Creates a tweet with optional parameters like files, filters, reply-to, quote, place, and community settings. Returns the created Tweet object. ```python message = await app.create_tweet("user", reply_to="1690430294208483322") ``` -------------------------------- ### Get Topic Tweets using TwitterAsync in Python Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Fetches tweets for a specified topic, with optional pagination and iteration. Requires app authentication; inputs topic_id (str/int/Topic), pages (int=1), wait_time (int=2), cursor (str=None). Returns TopicTweets or generator of (TopicTweets, list[Tweet]). Handles rate limiting via wait_time. ```python tweets = await app.get_topic_tweets('123456') for tweet in tweets: print(tweet) ``` -------------------------------- ### Get Tweet Likes (Python) Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieves the users who have liked a given Tweet. Takes the Tweet ID as input and returns a TweetLikes object or generator, allowing access to the list of users who liked the tweet, with pagination support. ```Python tweet = await app.tweet_detail("1232515235253352") lives = await app.get_tweet_likes(tweet) for like in likes: print(like) ``` -------------------------------- ### Sign In to Twitter with Credentials using Python and Tweety Source: https://mahrtayyab.github.io/tweety_docs/_sources/basic/singing-in This code demonstrates basic sign-in to Twitter using username and password with the Tweety library. Requires tweety package and valid Twitter credentials; outputs saved session cookies on success. May raise ActionRequired for additional steps like 2FA. ```python from tweety import TwitterAsync app = Twitter("session") await app.sign_in(username, password) print(app.me) ``` -------------------------------- ### Create List with Python Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Creates a new list on Twitter with specified name, description and privacy settings. Returns TwList object representing the created list. ```python _list = await app.create_list("list_name") print(_list) ``` -------------------------------- ### Get Tweet Detail (Python) Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieves the detail of a Tweet, given either its ID or URL. It takes tweet identifier (ID or URL) as input and returns Tweet object. It facilitates accessing detailed information for individual tweets. ```Python tweet = await app.tweet_detail("https://twitter.com/Microsoft/status/1442542812197801985") ``` -------------------------------- ### Get Community Members in Python Source: https://mahrtayyab.github.io/tweety_docs/basic/all-functions Retrieves members of a specified Twitter community. Supports pagination, filtering, and custom wait times between requests. Returns CommunityMembers object or generator yielding User objects. Accepts community ID, pages count, filter, wait time, and cursor parameters. ```python from tweety import Twitter app = Twitter("session") users = await app.get_community_members(12345678) for user in users: print(user) ```