Registry / http-networking / scrapy-zyte-api

scrapy-zyte-api

JSON →
library0.34.0pypypi✓ verified 83d ago

Client library to process URLs through Zyte API (formerly Crawlera). Enables Scrapy spiders to use Zyte's proxy rotation and data extraction services. Current version: 0.33.1. Release cadence: monthly.

pip install scrapy-zyte-api
INSTALL
IMPORT
SIG · SCRAPY-ZYTE-API
S
scrapy-zyte-api
http-networkingpythonv0.34.0
Install
10.8s avg
Import
Disk
108MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 103.2MB
glibc
py 3.103.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).
fix
Upgrade 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.
fix
Use 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.
fix
Replace 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.
fix
Set 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.

Agent activity
17 hits · last 30 days
node
10
Meta
1
Amazon
1
OpenAI (training)
1
Resources
scrapy-zyte-api — pip install scrapy-zyte-api · libregistry