CLI reference

zyte-api

Send Zyte API requests.

usage: zyte-api [-h] [--intype {txt,jl}] [--limit LIMIT] [--output OUTPUT]
                [--n-conn N_CONN] [--api-key API_KEY | --eth-key ETH_KEY]
                [--api-url API_URL] [--loglevel {DEBUG,INFO,WARNING,ERROR}]
                [--shuffle] [--dont-retry-errors] [--store-errors]
                [--trust-env]
                INPUT

Positional Arguments

INPUT

Path to an input file (see 'Command-line client > Input file' in the docs for details).

Named Arguments

--intype

Possible choices: txt, jl

Type of the input file, either 'txt' (plain text) or 'jl' (JSON Lines).

If not specified, the input type is guessed based on the input file extension ('.jl', '.jsonl', or '.txt'), or in its content, with 'txt' as fallback.

--limit

Maximum number of requests to send.

--output, -o

Path for the output file. Results are written into the output file in JSON Lines format.

If not specified, results are printed to the standard output.

--n-conn

Number of concurrent connections to use (default: 20).

--api-key

Zyte API key.

If not specified, it is read from the ZYTE_API_KEY environment variable. Cannot be combined with --eth-key.

--eth-key

Ethereum private key, as a hexadecimal string.

If not specified, it is read from the ZYTE_API_ETH_KEY environment variable. Cannot be combined with --api-key.

--api-url

Zyte API endpoint (default: https://api.zyte.com/v1/).

Using an Ethereum private key, e.g. through --eth-key or through the ZYTE_API_ETH_KEY environment variable, changes the default API URL to https://api-x402.zyte.com/v1/.

--loglevel, -L

Possible choices: DEBUG, INFO, WARNING, ERROR

Log level (default: 'INFO').

--shuffle

Shuffle request order.

--dont-retry-errors

Do not retry unsuccessful responses and network errors, only rate-limiting responses.

--store-errors

Store error responses in the output file.

If omitted, only successful responses are stored.

--trust-env

Enable environment-based network settings such as HTTP_PROXY and HTTPS_PROXY for Zyte API requests.