xtract.bot
POST /api/zstd-compress

Compress arbitrary bytes with Zstandard. Standard .zst frame any tool can decompress (`zstd -d`, libraries, etc.). Configurable level 1–22.

Takes any bytes and returns a Zstandard (.zst) compressed frame — a modern alternative to gzip that typically produces 30–50% smaller output at similar (or better) speeds. Decompresses cleanly with `zstd -d` or any zstd-compatible library. Compression level ranges 1–22. `3` is the upstream default; `19+` is "long mode" with substantially higher CPU cost — useful for archival workloads where decompression speed is what matters.

Inputs

NameTypeDefaultDescription
data*fileBytes to compress.
levelnumber (1…22)3Zstd compression level (1 = fastest, 22 = strongest).

Response

Modes: binary, json. Cache: yes (24h TTL).

Code samples

Built from the lorem example.

# Download or substitute the example input:
#   curl -O https://xtract.bot/examples/zstd-compress/lorem.txt
DATA=$(base64 -w0 < lorem.txt)

curl -X POST https://api.xtract.bot/api/zstd-compress \
  -H "Content-Type: application/json" \
  -H "Accept: application/octet-stream" \
  -H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
  -H "X-Api-Key: $XTRACT_API_KEY" \
  -d '{
  "level": 3,
  "data": "'"$DATA"'"
}'