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

Use any HTTP client library or program.

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 Zyte API as a proxy.

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

Warning

The proxy mode cannot make use of all Zyte API features. See Limitations.

Tip

Got an SSL error? Install our CA certificate.

Basic usage#

What do you want to do with Zyte API?

HTTP requests

Get HTTP responses.

HTTP

Browser automation

Get rendered content.

Browser

Automatic extraction

Get structured data.

Extraction

Additional features#

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

Geolocation

Choose a location of origin for your request.

http browser extraction
http api proxy mode
IP type

Choose the type of IP address used by your request.

http browser extraction
http api
Cookies

Get and set cookies to reproduce requests and maintain sessions.

http browser extraction
http api proxy mode
Sessions

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

http browser extraction
http api
Screenshots

Take a screenshot of a webpage.

browser extraction
http api
Actions

Interact with a webpage.

browser extraction
http api

Advanced topics#

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.

Proxy mode

Use Zyte API as a proxy.

Stats API

Check your Zyte API usage details.