Install & Compatibility
Where this runs
tested against v0.34.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 103.2MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 10.8s · import 0.000s · 107MB
108MB installed
● package 108MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ScrapyZyteAPIDownloadHandler
✓ from scrapy_zyte_api import ScrapyZyteAPIDownloadHandler
✗ from scrapy_zyte_api import ZyteAPI
ScrapyZyteAPIDownloaderMiddleware
✓ from scrapy_zyte_api import ScrapyZyteAPIDownloaderMiddleware
Actions
✓ from scrapy_zyte_api import Actions
Quickstart: Instantiate ZyteAPI and configure settings for Scrapy.
import os
from scrapy_zyte_api import ZyteAPI
api_key = os.environ.get('ZYTE_API_KEY', '')
zym = ZyteAPI(api_key=api_key, downloader_middleware_settings={
'ZYTE_API_DOWNLOADER_MIDDLEWARE_ENABLED': True,
'ZYTE_API_ENABLED': True,
})
# Then add to your Scrapy settings:
# DOWNLOADER_MIDDLEWARES = {
# 'scrapy_zyte_api.ZyteAPI': 1000,
# }
# ZYTE_API_KEY = api_key
scrapy-zyte-api --version
Debug
Known issues
breakingVersion 0.33.0 dropped Python 3.9 support (min is 3.10).fixUpgrade to Python 3.10+ or pin to <0.33.0.
affects: >=0.33.0,<0.33.0
breakingIn 0.33.0, the middleware class was renamed from ScrapyZyteAPIDownloaderMiddleware to ZyteAPI. The old import still works as an alias, but the class no longer accepts the same constructor parameters.fixUse new import syntax and pass api_key via settings or env var.
affects: >=0.33.0
deprecatedThe old setting ZYTE_API_DOWNLOADER_MIDDLEWARE_ENABLED is deprecated; use ZYTE_API_ENABLED instead.fixReplace ZYTE_API_DOWNLOADER_MIDDLEWARE_ENABLED with ZYTE_API_ENABLED in settings.
affects: >=0.30.0
gotchaThe API key must be provided via ZYTE_API_KEY environment variable or explicitly passed, not just set in settings.py when using the middleware.fixSet env var before running spider: export ZYTE_API_KEY='your_key'.
affects: All
Upgrade
Version history
0.34.0latest on PyPI · released May 14, 2026
Audit
Dependencies
No dependency data recorded yet.