Code example requirements#
The Zyte API documentation features code examples for many different technologies.
You can find those examples in pages like Zyte API HTTP requests, Zyte API browser automation, Zyte API automatic extraction, or Zyte API shared features.
Select a technology tab below to learn how to install and configure the requirements to run code examples for that technology:
C# code examples use C# 9.0.
To run C# code examples, install:
.NET SDK 5.x or later
Html Agility Pack, for HTML parsing
CLI client code examples feature the command-line interface of python-zyte-api, the official Python client of Zyte API, along with other command-line tools.
To run CLI client code examples, install:
python-zyte-api, for requests.
Requires installing Python first.
jq, for JSON parsing.
base64, for base64 encoding and decoding.
On Windows, you can use chocolatey to install GNU Core Utilities, which includes a
base64
command-line application.macOS comes with a
base64
command-line application pre-installed.Most Linux distributions come with GNU Core Utilities pre-installed, or make it easy to install it. GNU Core Utilities includes a
base64
command-line application.
xmllint, for HTML parsing.
On Windows, install libxml2, which provides
xmllint
.macOS comes with
xmllint
pre-installed.Most Linux distributions make it easy to install libxml2, which provides
xmllint
.
xargs, for parallelization.
On Windows, you can use chocolatey to install GNU findutils, which includes a
xargs
command-line application.macOS comes with a
xargs
command-line application pre-installed.Most Linux distributions come with GNU findutils pre-installed, or make it easy to install it. GNU findutils includes a
xargs
command-line application.
curl code examples feature curl and other command-line tools.
To run curl code examples, install:
curl, for requests.
Note
curl comes pre-installed in many operating systems.
jq, for JSON parsing.
base64, for base64 encoding and decoding.
On Windows, you can use chocolatey to install GNU Core Utilities, which includes a
base64
command-line application.macOS comes with a
base64
command-line application pre-installed.Most Linux distributions come with GNU Core Utilities pre-installed, or make it easy to install it. GNU Core Utilities includes a
base64
command-line application.
xmllint, for HTML parsing.
On Windows, install libxml2, which provides
xmllint
.macOS comes with
xmllint
pre-installed.Most Linux distributions make it easy to install libxml2, which provides
xmllint
.
xargs, for parallelization.
On Windows, you can use chocolatey to install GNU findutils, which includes a
xargs
command-line application.macOS comes with a
xargs
command-line application pre-installed.Most Linux distributions come with GNU findutils pre-installed, or make it easy to install it. GNU findutils includes a
xargs
command-line application.
Java code examples use Java SE 8.
To run Java code examples, install:
JS code examples use JavaScript.
To run JS code examples, install:
axios, for requests.
cheerio, for HTML parsing.
https-proxy-agent, for proxy mode.
PHP code examples use PHP 7.4.
To run PHP code examples, install:
Proxy mode code examples use curl with Zyte API as a proxy. See the curl tab for code example requirement details.
See Zyte API proxy mode to learn how to use Zyte API as a proxy with other technologies.
Python code examples use Python 3.
To run Python code examples, install:
Python client code examples feature the asyncio API of python-zyte-api, the official Python client of Zyte API.
To run Python client code examples, install:
python-zyte-api, for requests.
Parsel for HTML parsing.
Scrapy code examples feature Scrapy with the scrapy-zyte-api plugin configured in transparent mode.
To run Scrapy code examples, install:
After installing scrapy-zyte-api, you must also configure it in your Scrapy project, and enable its transparent mode.
Tip
The web scraping tutorial covers installing and configuring the requirements for Scrapy code examples.