Skip to main content

Python interface to Zyte API

Project description

PyPI Version Supported Python Versions Build Status Coverage report

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zyte_api-0.10.0.tar.gz (44.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zyte_api-0.10.0-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

Details for the file zyte_api-0.10.0.tar.gz.

File metadata

  • Download URL: zyte_api-0.10.0.tar.gz
  • Upload date:
  • Size: 44.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zyte_api-0.10.0.tar.gz
Algorithm Hash digest
SHA256 ebce9fac45be2c586110b923e10153eb97d101a02c73cf87c10edbd0edeee07c
MD5 e35976ef814096e1421d5f777c200a2b
BLAKE2b-256 0e1d032aeaf89c79640a981b9656a4977bc24f0d8c00e201e4066d545293f99f

See more details on using hashes here.

Provenance

The following attestation bundles were made for zyte_api-0.10.0.tar.gz:

Publisher: publish.yml on zytedata/python-zyte-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zyte_api-0.10.0-py3-none-any.whl.

File metadata

  • Download URL: zyte_api-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 26.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zyte_api-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 99f88962b4f95253147f41890b471f4571b2f3fd6588e0043e41e4f89f00e1c5
MD5 419906be25bdf0a97c2d42d63470c5f1
BLAKE2b-256 2fa1cd594476874f64e5fa1cb19bc53a30c2769ad5a0b1e9e63199155f2e01a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for zyte_api-0.10.0-py3-none-any.whl:

Publisher: publish.yml on zytedata/python-zyte-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page