| id | upgrading-to-v2 |
|---|---|
| title | Upgrading to v2 |
| description | Breaking changes and migration guide from v1 to v2. |
import ApiLink from '@site/src/components/ApiLink';
This page summarizes the breaking changes between Apify Python API Client v1.x and v2.0.
Support for Python 3.9 has been dropped. The Apify Python API Client v2.x now requires Python 3.10 or later. Make sure your environment is running a compatible version before upgrading.
In v2.0, the Apify Python API client switched from using httpx to impit as the underlying HTTP library. However, this change shouldn't have much impact on the end user.
Several public methods have changed their signatures or behavior.
- The
parse_responseparameter has been removed from theHTTPClient.call()method. This was an internal parameter that added a private attribute to theResponseobject. - The private
_maybe_parsed_bodyattribute has been removed from theResponseobject.
- The deprecated parameters
as_bytesandas_filehave been removed fromKeyValueStoreClient.get_record(). Use the dedicated methodsget_record_as_bytes()andstream_record()instead.
- The
unwindparameter no longer accepts a single string value. Use a list of strings instead:unwind=['items']rather thanunwind='items'.
Some modules have been restructured.
- Deprecated constant re-exports from
consts.pyhave been removed. Constants should now be imported from the apify-shared-python package if needed.
- Error classes are now accessible from the public
apify_client.errorsmodule. See the API documentation for a complete list of available error classes.