Skip to content

Document why the default request compression differs from the JS client #1179

Description

@vdusek

The Python client compresses request bodies with gzip by default (_apify_client.py#L129). brotli is available through the optional brotli extra (http_compressors/init.py#L10-L13). The compression docstring does not mention the default or the extra (_apify_client.py#L151-L152).

The JS client defaults to brotli at quality 6 (apify_client.ts#L63), built on node:zlib, so it needs no extra dependency. It compresses only in Node.js; a browser sends bodies uncompressed (runtime/web.ts#L12-L17).

The difference has a reason: brotli is a native package in Python, and making it a default would add a required compiled dependency. The API accepts both encodings.

Recommendation

Keep gzip as the Python default. Extend the compression docstring in ApifyClient and ApifyClientAsync to state the default and that 'brotli' needs pip install "apify-client[brotli]", so users comparing the two clients can find why they differ.

✍️ Drafted by Claude Code

Activity

  1. added
    t-toolingIssues with this label are in the ownership of the tooling team.
    on Oct 30, 2026
  2. added theissue type on Oct 30, 2026
  3. self-assigned this
    on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

t-toolingIssues with this label are in the ownership of the tooling team.

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions