This page contains some basic documentation for the Tweepy module.
Document this class.
Returns the 20 most recent statuses from non-protected users who have set a custom user icon. The public timeline is cached for 60 seconds so requesting it more often than that is a waste of resources.
Parameters: None
Returns: list of class:Status objects
Returns the 20 most recent statuses, including retweets, posted by the authenticating user and that user’s friends. This is the equivalent of /timeline/home on the Web.
Parameters: since_id, max_id, count, page
Returns: list of class:Status objects
Returns the 20 most recent statuses posted by the authenticating user and that user’s friends.
Parameters: since_id, max_id, count, page
Returns: list of class:Status objects
Returns the 20 most recent statuses posted from the authenticating user. It’s also possible to request another user’s timeline via the id parameter.
Parameters: (id or user_id or screen_name), since_id, max_id, count, page
Returns: list of class:Status objects
Returns the 20 most recent mentions (status containing @username) for the authenticating user.
Parameters: since_id, max_id, count, page
Returns: list of class:Status objects
Returns the 20 most recent retweets posted by the authenticating user.
Parameters: since_id, max_id, count, page
Returns: list of class:Status objects
Returns the 20 most recent retweets posted by the authenticating user’s friends.
Parameters: since_id, max_id, count, page
Returns: list of class:Status objects
Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
Parameters: since_id, max_id, count, page
Returns: list of class:Status objects
Returns a single status specified by the ID parameter.
Parameters: id (Required)
Returns: class:Status object
Update the authenticated user’s status. Statuses that are duplicates or too long will be silently ignored.
Parameters: status (Required), in_reply_to_status_id, lat, long
Returns: class:Status object
Destroy the status specified by the id parameter. The authenticated user must be the author of the status to destroy.
Parameters: id (Required)
Returns: class:Status object
Retweets a tweet. Requires the id of the tweet you are retweeting.
Parameters: id (Required)
Returns: class:Status object
Returns up to 100 of the first retweets of the given tweet.
Parameters: id (Required), count
Returns: list of class:Status objects
Returns information about the specified user.
Parameters: id OR screen_name OR id (One of these is Required)
Returns: User object
Returns the authenticated user’s information.
Parameters: None
Returns: User object friends
Returns an user’s friends ordered in which they were added 100 at a time. If no user is specified by id/screen name, it defaults to the authenticated user.
Parameters: id OR screen_name OR user_id, cursor
Returns: list of User objects
Returns an user’s followers ordered in which they were added 100 at a time. If no user is specified by id/screen name, it defaults to the authenticated user.
Parameters: id OR screen_name OR user_id, cursor
Returns: list of User objects
Run a search for users similar to Find People button on Twitter.com; the same results returned by people search on Twitter.com will be returned by using this API (about being listed in the People Search). It is only possible to retrieve the first 1000 matches from this API.
Parameters: q (Required. The query.), per_page, page
Returns: list of User objects
Returns direct messages sent to the authenticating user.
Parameters: since_id, max_id, count, page
Returns: list of DirectMessage objects
Returns direct messages sent by the authenticating user.
Parameters: since_id, max_id, count, page
Returns: list of DirectMessage objects
Sends a new direct message to the specified user from the authenticating user.
Parameters: user (Required), text (Required)
Returns: DirectMessage object
Destroy a direct message. Authenticating user must be the recipient of the direct message.
Parameters: id (Required)
Returns: DirectMessage object
Create a new friendship with the specified user (aka follow).
Parameters: id OR screen_name OR user_id (One of these is required)
Returns: User object
Destroy a friendship with the specified user (aka unfollow).
Parameters: id OR screen_name OR user_id (One of these is required)
Returns: User object
Checks if a friendship exists between two users. Will return True if user_a follows user_b, otherwise False.
Parameters: user_a (Required), user_b (Required)
Returns: True/False
Returns detailed information about the relationship between two users.
Parameters: source_id OR source_screen_name (One of these is required), target_id OR target_screen_name (One of these is required)
Returns: Friendship object
Returns an array containing the IDs of users being followed by the specified user.
Parameters: id OR screen_name OR user_id (One of these is required)
Returns: list of Integers
Returns an array containing the IDs of users following the specified user.
Parameters: id OR screen_name OR user_id (One of these is required)
Returns: list of Integers
Verify the supplied user credentials are valid.
Parameters: None
Returns: User object if credentials are valid, otherwise False
Returns the remaining number of API requests available to the requesting user before the API limit is reached for the current hour. Calls to rate_limit_status do not count against the rate limit. If authentication credentials are provided, the rate limit status for the authenticating user is returned. Otherwise, the rate limit status for the requester’s IP address is returned.
Parameters: None
Returns: JSON object
Sets which device Twitter delivers updates to for the authenticating user. Sending “none” as the device parameter will disable SMS updates.
Parameters: device (Required. Valid values: sms OR none)
Returns: User object
Sets one or more hex values that control the color scheme of the authenticating user’s profile page on twitter.com.
Parameters: profile_background_color, profile_text_color, profile_link_color, profile_sidebar_fill_color, profile_sidebar_border_color
Returns: User object
Update the authenticating user’s profile image. Valid formats: GIF, JPG, or PNG
Parameters: filename (Path to image file. Required)
Returns: User object
Update authenticating user’s background image. Valid formats: GIF, JPG, or PNG
Parameters: filename (Path to image file. Required), tile
Returns: User object
Sets values that users are able to set under the “Account” tab of their settings page.
Parameters: name, url, location, description
Returns: User object
Returns the favorite statuses for the authenticating user or user specified by the ID parameter.
Parameters: id, page
Returns: list of class:Status objects
Favorites the status specified in the ID parameter as the authenticating user.
Parameters: id (Required)
Returns: class:Status object
Un-favorites the status specified in the ID parameter as the authenticating user.
Parameters: id (Required)
Returns: class:Status object
Enables device notifications for updates from the specified user.
Parameters: id OR screen_name OR user_id (One of these is required)
Returns: User object
Disables notifications for updates from the specified user to the authenticating user.
Parameters: id OR screen_name OR user_id (One of these is required)
Returns: User object
Blocks the user specified in the ID parameter as the authenticating user. Destroys a friendship to the blocked user if it exists.
Parameters: id OR screen_name OR user_id (One of these is required)
Returns: User object
Un-blocks the user specified in the ID parameter for the authenticating user.
Parameters: id OR screen_name OR user_id (One of these is required)
Returns: User object
Checks if the authenticated user is blocking the specified user.
Parameters: id OR screen_name OR user_id (One of these is required)
Returns: True/False
Returns an array of user objects that the authenticating user is blocking.
Parameters: page
Returns: list of User objects
Returns an array of numeric user ids the authenticating user is blocking.
Parameters: None
Returns: list of Integers
The user specified in the id is blocked by the authenticated user and reported as a spammer.
Parameters: id OR screen_name OR user_id (One of these is required)
Returns: User object
Returns the authenticated user’s saved search queries.
Parameters: None
Returns: list of SavedSearch objects
Retrieve the data for a saved search owned by the authenticating user specified by the given id.
Parameters: id (Required)
Returns: SavedSearch object
Creates a saved search for the authenticated user.
Parameters: query (Required)
Returns: SavedSearch object
Destroys a saved search for the authenticated user. The search specified by id must be owned by the authenticating user.
Parameters: id (Required)
Returns: SavedSearch object
Invokes the test method in the Twitter API. Return True if successful, otherwise False.
Parameters: None
Returns: True/False
Returns tweets that match a specified query.
Parameters: q (Required. The search query string.), lang, locale, rpp, page, since_id, geocode, show_user
Returns: list of SearchResult objects
Returns the top ten topics that are currently trending on Twitter. The response includes the time of the request, the name of each trend, and the url to the Twitter Search results page for that topic.
Parameters: None
Returns: JSON object
Returns the current top 10 trending topics on Twitter. The response includes the time of the request, the name of each trending topic, and query used on Twitter Search results page for that topic.
Parameters: exclude
Returns: JSON object
Returns the top 20 trending topics for each hour in a given day.
Parameters: date, exclude
Returns: JSON object
Returns the top 30 trending topics for each day in a given week.
Parameters: date, exclude
Returns: JSON object
Creates a new list for the authenticated user. Accounts are limited to 20 lists.
Parameters: name (Required), mode (public/private default: public)
Returns: class:List object
Deletes the specified list. Must be owned by the authenticated user.
Parameters: slug (Required. May also be the list ID.)
Returns: class:List object
Updates the specified list. Note: this current throws a 500. Twitter is looking into the issue.
Parameters: slug (Required. May also be the list ID.), name, mode (public/private)
Returns: class:List object
List the lists of the specified user. Private lists will be included if the authenticated users is the same as the user who’s lists are being returned.
Parameters: cursor
Returns: list of class:List objects
List the lists the specified user has been added to.
Parameters: cursor
Returns: list of class:List objects
List the lists the specified user follows.
Parameters: cursor
Returns: list of class:List objects
Show tweet timeline for members of the specified list.
Parameters: owner (Required.), slug (Required. May also be the list ID.), since_id, max_id, count, page
Returns: list of class:Status objects
Show the specified list. Private lists will only be shown if the authenticated user owns the specified list.
Parameters: owner (Required.), slug (Required. May also be the list ID.)
Returns: class:List object
Add a member to a list. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members.
Parameters: slug (Required. May also be the list ID.), id (Required. ID of user to add.)
Returns: class:List object
Removes the specified member from the list. The authenticated user must be the list’s owner to remove members from the list.
Parameters: slug (Required. May also be the list ID.), id (Required. ID of user to remove.)
Returns: class:List object
Returns the members of the specified list.
Parameters: owner (Required.), slug (Required. May also be list ID.), cursor
Returns: list of User objects
Check if a user is a member of the specified list.
Parameters: owner (Required.), slug (Required. May also be list ID.), id (Required. User to check if is a member on the list or not.)
Returns: User object if user is a member of list, otherwise False.
Make the authenticated user follow the specified list.
Parameters: owner (Required.), slug (Required. May also be list ID.)
Returns: class:List object
Unsubscribes the authenticated user form the specified list.
Parameters: owner (Required.), slug (Required. May also be list ID.)
Returns: class:List object
Returns the subscribers of the specified list.
Parameters: owner (Required.), slug (Required. May also be list ID.), cursor
Returns: list of User objects
Check if the specified user is a subscriber of the specified list.
Parameters: owner (Required.), slug (Required. May also be list ID.), id (Required. User to check if subscribed to the list.)
Returns: User object if user is subscribed to the list, otherwise False.