Skip to content

Expose request statistics on ApifyClient #1175

Description

@vdusek

ApifyClient keeps its counters in a private _statistics attribute (_apify_client.py#L170) and hands it only to the default ImpitHttpClient (#L284). with_custom_http_client sets _http_client and leaves _statistics alone (#L257-L261), so with a custom client the root object's counters stay at zero while the HTTP client counts into its own ClientStatistics (_base.py#L152). ClientStatistics is not exported either (_statistics.py), so there is no supported way to read calls, requests, or rate-limit errors.

The JS client has a public client.stats (apify_client.ts#L120-L124) and points it at the custom HTTP client's stats when one is assigned (#L231-L235). Statistics is exported (statistics.ts).

Expected behavior

A public read-only statistics property on ApifyClient and ApifyClientAsync that returns the statistics of the HTTP client actually in use, custom or default, with ClientStatistics exported from apify_client.

✍️ Drafted by Claude Code

Activity

  1. added
    enhancement
    t-tooling
    on Oct 30, 2026
  2. added theissue type on Oct 30, 2026
  3. removed
    enhancement
    on Oct 30, 2026
  4. self-assigned this
    on Nov 15, 2026
  5. added a commit that references this issue on Nov 16, 2026
    27a3f61
  6. vdusek commented on Nov 24, 2026

    @vdusek
    ContributorAuthor

    resolved by #1228

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

t-tooling

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions