pypi / tweepy
tweepy
What changed in tweepy 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-23.
79 breaking45 new APIs and options8 behavior and defaults10 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli inittweepy 4142 changes
Breaking changes 79
The initialization parameter auth_handler is renamed auth, and initialization no longer accepts positional arguments other than auth.
Several API method parameters are renamed, including id to place_id, screen_names to screen_name, environment_name to label, and file_ to file.
Parameters previously optional on listed API methods are now required, including query, status, id, and q on the specified methods.
Many API methods are renamed, including blocks to get_blocks, search to search_tweets, and update_with_media to update_status_with_media.
Listed API methods no longer accept positional arguments; arguments must be passed by keyword.
API.api_root and API.upload_root are removed.
API.compression is removed.
API.configuration was removed.
The id endpoint parameter was removed.
The id endpoint parameter was removed.
The id endpoint parameter was removed.
The id endpoint parameter was removed.
The id endpoint parameter was removed.
The id endpoint parameter was removed.
API.geo_similar_places was removed.
The id endpoint parameter was removed.
The id endpoint parameter was removed.
The id endpoint parameter was removed.
The id endpoint parameter was removed.
The id endpoint parameter was removed.
The map_ keyword argument alias is no longer supported.
API.me, AuthHandler.get_username, and OAuthHandler.get_username are removed.
API.related_results was removed along with the Relation model.
The API is reworked around API.request, replacing bind_api and APIMethod; methods no longer use property decorators, and pagination uses a decorator.
Unexpected keyword arguments that are not endpoint parameters now produce a logged warning; allowed_param is renamed endpoint_parameters.
The accuracy and contained_within endpoint parameters were removed.
API.search_host and API.search_root are removed.
Direct Messages can send Quick Reply Options; quick_reply_type was replaced by quick_reply_options.
The allow_contributor_request endpoint parameter was removed.
The endpoint parameter offset_right was renamed to offset_top.
The enable_dmcommands and fail_dmcommands parameters were removed.
The method's parameters are reordered.
The in_reply_to_status_id_str and auto_populate_reply_metadata endpoint parameters were removed.
The id endpoint parameter was removed.
Handling of HTTP status code 401 was removed.
API.wait_on_rate_limit_notify is removed; warnings are always logged when a rate limit is reached.
return_cursors is now keyword-only.
return_cursors is now keyword-only.
The created_at datetime value is now timezone-aware.
models.List.is_member was removed.
models.List.is_subscribed was removed.
The created_at datetime value is now timezone-aware.
The created_at datetime value is now timezone-aware.
The created_at datetime value is now timezone-aware.
PageIterator now starts on page 1.
Parser.parse_error is removed.
The method parameter was removed from parse methods on Parser and its subclasses.
Support for Python 2 is dropped.
Support for Python 3.5 is dropped.
The Relation model was removed.
StreamListener is merged into Stream. Stream data and event handlers now log by default and disregard return values.
Stream.auth was replaced with separate credential parameters and attributes: consumer_key, consumer_secret, access_token, and access_token_secret.
The Stream parameter proxies was replaced by proxy.
Stream reconnect-wait parameters and attributes were removed, including retry_time_start, retry_420_start, retry_time_cap, snooze_time_step, snooze_time_cap, retry_time, and snooze_time.
Exceptions raised in Stream._connect are no longer reraised.
The Stream.api attribute was removed.
The Stream.body attribute was removed.
Positional arguments are no longer accepted by Stream.filter.
The encoding parameter was removed from Stream.filter.
The is_async parameter was renamed to threaded.
Stream.firehose was removed.
The Stream.headers attribute was removed.
The Stream.host attribute was removed.
Stream.retry_count was renamed to Stream.max_retries.
The Stream.new_session attribute was removed.
Stream.retweet was removed.
Positional arguments are no longer accepted by Stream.sample.
The is_async parameter was renamed to threaded.
Stream.sitestream and Stream.userstream were removed.
The Stream.timeout attribute was removed.
The Stream.url attribute was removed.
Stream.sitestream and Stream.userstream were removed.
The stream can disconnect when any line of data is received, including keep-alive signals.
StreamListener was removed and merged into Stream; migrate callbacks to Stream, including renamed callbacks on_disconnect_message, on_request_error, and on_connection_error.
The on_direct_message and on_friends callbacks were removed along with userstream and sitestream support.
The on_event callback was removed.
TooManyRequests replaces RateLimitError.
TweepyException replaces TweepError.
Tweepy adds support for Twitter API v2 and replaces API v1.1 models in the package namespace.
New APIs and options 45
Adds the reset_time parameter to TooManyRequests.
Added include_entities and skip_status endpoint parameters.
Added the include_entities endpoint parameter.
Added include_entities and skip_status endpoint parameters.
Added the include_entities endpoint parameter.
Added the trim_user endpoint parameter.
Added the stringify_ids endpoint parameter.
Added include_entities and skip_status endpoint parameters.
Added the include_entities endpoint parameter.
Added the stringify_ids endpoint parameter.
Added stringify_ids and count endpoint parameters.
Added include_entities and skip_status endpoint parameters.
Added count, include_entities, and skip_status endpoint parameters.
Added an API method to retrieve list ownerships.
Added include_entities and skip_status endpoint parameters.
Added the stringify_ids endpoint parameter.
Added API.get_profile_banner.
Added the count endpoint parameter.
Added trim_user, include_entities, and include_user_entities endpoint parameters.
Added the trim_user endpoint parameter.
Added the include_entities endpoint parameter.
Added the stringify_ids endpoint parameter.
Added media_category and additional_owners endpoint parameters.
Added trim_user and include_entities endpoint parameters.
Added API.no_retweets_friendships.
Added the stringify_ids endpoint parameter.
Added API.remove_profile_banner.
Added the trim_user endpoint parameter.
Added the include_entities endpoint parameter.
API.send_direct_message can send Call-To-Action buttons with Direct Messages.
Each API instance exposes one requests.Session instance, reused across requests.
Added the trim_user endpoint parameter.
Added API.update_friendship.
Added include_entities and skip_status endpoint parameters.
Added API.user_agent.
Tweepy adds support for asynchronous streaming.
The BadRequest exception is added.
The Forbidden exception is added.
Streaming now supports gevent.
Added the list_ownerships attribute to models.User.
The NotFound exception is added.
Added the Stream.on_disconnect method.
Exposed Stream.thread.
The TwitterServerError exception is added.
The Unauthorized exception is added.
Behavior and default changes 8
All 2xx HTTP status codes are treated as successful responses.
Media uploading is reworked.
Defaults to models.Status more broadly for results when parsers or model factories lack the relevant attributes.
Defaults to models.User more broadly for the user attribute when parsers or model factories lack the relevant attributes.
models.User instances are now hashable.
Stream.sample now uses the GET HTTP method.
Stream now uses a specific user agent.
Streaming no longer depends on string-length delimitation.
Fixes and other changes 10
Handles the Twitter API issue that returns duplicate pages.
Keyword arguments are now handled.
Keyword arguments are now handled.
ChunkedEncodingError is handled during streaming.
Cursor iterators now handle initial negative or zero limits.
Threaded Stream.filter returns the thread.
Integer IDs are now allowed.
Threaded Stream.sample returns the thread.
Connection errors during streaming are handled.
Twitter API errors returned with successful HTTP status codes are handled.