Python interface to Zyte API
Project description
Command-line client and Python client library for Zyte API.
Installation
pip install zyte-api
Or, to use x402:
pip install zyte-api[x402]
Basic usage
Set your API key
After you sign up for a Zyte API account, copy your API key.
Use the command-line client
Then you can use the zyte-api command-line client to send Zyte API requests. First create a text file with a list of URLs:
https://books.toscrape.com
https://quotes.toscrape.com
And then call zyte-api from your shell:
zyte-api url-list.txt --api-key YOUR_API_KEY --output results.jsonl
Use the Python sync API
For very basic Python scripts, use the sync API:
from zyte_api import ZyteAPI
client = ZyteAPI(api_key="YOUR_API_KEY")
response = client.get({"url": "https://toscrape.com", "httpResponseBody": True})
Use the Python async API
For asyncio code, use the async API:
import asyncio
from zyte_api import AsyncZyteAPI
async def main():
client = AsyncZyteAPI(api_key="YOUR_API_KEY")
response = await client.get(
{"url": "https://toscrape.com", "httpResponseBody": True}
)
asyncio.run(main())
Read the documentation for more information.
Documentation: https://python-zyte-api.readthedocs.io
Source code: https://github.com/zytedata/python-zyte-api
Issue tracker: https://github.com/zytedata/python-zyte-api/issues
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zyte_api-0.8.1.tar.gz.
File metadata
- Download URL: zyte_api-0.8.1.tar.gz
- Upload date:
- Size: 37.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38d78e11e528c8b3f86c786f3ec88b1bab9dd8365ed2bcfc54bb41113963c31e
|
|
| MD5 |
446474a585f67db62d5d1d2f02bae3b2
|
|
| BLAKE2b-256 |
280e8e8b07fa2b97775a00ffd4f65e1903089fce3a15848722378efd4fce16cd
|
Provenance
The following attestation bundles were made for zyte_api-0.8.1.tar.gz:
Publisher:
publish.yml on zytedata/python-zyte-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zyte_api-0.8.1.tar.gz -
Subject digest:
38d78e11e528c8b3f86c786f3ec88b1bab9dd8365ed2bcfc54bb41113963c31e - Sigstore transparency entry: 584990491
- Sigstore integration time:
-
Permalink:
zytedata/python-zyte-api@e8051297125ae50957541012ab83d75d1fc8d8a5 -
Branch / Tag:
refs/tags/0.8.1 - Owner: https://github.com/zytedata
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e8051297125ae50957541012ab83d75d1fc8d8a5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file zyte_api-0.8.1-py3-none-any.whl.
File metadata
- Download URL: zyte_api-0.8.1-py3-none-any.whl
- Upload date:
- Size: 25.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59565fae3898ffbd1962f260b32e9de957900d89bb8c16ddf1578c22d4fecbb7
|
|
| MD5 |
5323fff5808ed88e01924daa8fb313c0
|
|
| BLAKE2b-256 |
cacfc20e05c0e5f041f3b45201575a90572e275761d86a9b9c225067b38128fb
|
Provenance
The following attestation bundles were made for zyte_api-0.8.1-py3-none-any.whl:
Publisher:
publish.yml on zytedata/python-zyte-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zyte_api-0.8.1-py3-none-any.whl -
Subject digest:
59565fae3898ffbd1962f260b32e9de957900d89bb8c16ddf1578c22d4fecbb7 - Sigstore transparency entry: 584990492
- Sigstore integration time:
-
Permalink:
zytedata/python-zyte-api@e8051297125ae50957541012ab83d75d1fc8d8a5 -
Branch / Tag:
refs/tags/0.8.1 - Owner: https://github.com/zytedata
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e8051297125ae50957541012ab83d75d1fc8d8a5 -
Trigger Event:
push
-
Statement type: