Zyte API usage documentation#

Initial setup#

How would you prefer to use Zyte API?

Scrapy

Use scrapy-zyte-api (tutorial).

Python

Use python-zyte-api.

HTTP clients

POST to https://api.zyte.com/v1/extract with your API key and parameters:

curl \
    --user YOUR_API_KEY: \
    --header 'Content-Type: application/json' \
    --data '{"url": "https://toscrape.com", "httpResponseBody": true}' \
    --compressed \
    https://api.zyte.com/v1/extract
Proxy mode

Use https://api.zyte.com:8011 as your proxy endpoint, with your API key and proxy headers:

curl \
    --proxy api.zyte.com:8011 \
    --proxy-user YOUR_API_KEY: \
    --compressed \
    https://toscrape.com

Tip

Learn about the different features of the HTTP API and the proxy mode before you choose one.

Tip

Got an SSL error? Install our CA certificate.

Basic usage#

What do you want to do with Zyte API?

HTTP requests

Send low-level HTTP requests, with custom method, headers and body, opt-out redirection following, device emulation, and more.

HTTP

Browser automation

Get browser-rendered HTML, take screenshots, interact with pages, capture background requests, and more.

Browser

Automatic extraction

Get structured data from single pages or entire websites, and enrich it with custom LLM prompts.

Extraction

Additional features#

Customize your Zyte API requests further to get what you want:

Geolocation

Choose a location of origin for your request.

IP type

Choose the type of IP address used by your request.

Cookies

Get and set cookies to reproduce requests and maintain sessions.

Sessions

Use the same IP address, cookie jar, network stack, etc. on multiple requests.

Advanced topics#

Proxy mode

Use Zyte API as a proxy.

Optimization

Make the most out of Zyte API.

Error handling

Handle rate-limiting and unsuccessful API responses, as well as issues in successful API responses.

API reference

See the complete API reference documentation.

Stats API

Check your Zyte API usage details.