apify-client 3.0.0


pip install apify-client

  Latest version

Released: May 20, 2026


Meta
Author: Apify Technologies s.r.o.
Requires Python: >=3.11

Classifiers

Development Status
  • 5 - Production/Stable

Environment
  • Console

Intended Audience
  • Developers

License
  • OSI Approved :: Apache Software License

Operating System
  • OS Independent

Programming Language
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14

Topic
  • Software Development :: Libraries

Apify API client for Python

The official Python client for the Apify REST API.

PyPI version PyPI downloads Python versions Coverage License Chat on Discord

apify-client lets you talk to the Apify platform from Python — run Actors, manage storages (datasets, key-value stores, request queues), schedule tasks, configure webhooks, and use everything else exposed by the Apify API. It ships both synchronous and asynchronous clients, fully typed responses, automatic retries with exponential backoff, tiered timeouts, pagination helpers, streaming, and a pluggable HTTP layer.

If you want to build Apify Actors in Python rather than consume the API, use the Apify SDK for Python instead — it bundles this client and adds Actor-side primitives.

Table of contents

Installation

apify-client requires Python 3.11 or higher. It is published on PyPI and can be installed for example with pip:

pip install apify-client

or with uv:

uv add apify-client

or any other Python package manager that consumes PyPI.

Quick start

You'll need an Apify API token — find yours in the Integrations section of Apify Console. Pass it to the client and you're ready to go.

Synchronous client

from apify_client import ApifyClient

client = ApifyClient('MY-APIFY-TOKEN')

# Start an Actor and wait for it to finish.
run = client.actor('apify/hello-world').call(
    run_input={'message': 'Hello, Apify!'},
)

# Iterate items from the run's default dataset.
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

Asynchronous client

import asyncio

from apify_client import ApifyClientAsync


async def main() -> None:
    client = ApifyClientAsync('MY-APIFY-TOKEN')

    run = await client.actor('apify/hello-world').call(
        run_input={'message': 'Hello, Apify!'},
    )

    # Iterate items from the run's default dataset.
    async for item in client.dataset(run.default_dataset_id).iterate_items():
        print(item)


asyncio.run(main())

Keep your token secret. It authorizes requests on your behalf and can incur usage costs. Never commit it to source control or expose it to client-side code.

For a guided walkthrough — authenticating, running an Actor, and reading its results — see the Quick start guide.

Features

  • Synchronous and asynchronous clients — pick ApifyClient or ApifyClientAsync to match your codebase; both expose the same API (Asyncio support).
  • Fully typed responses — every method returns a Pydantic model generated from the Apify OpenAPI spec, with IDE autocomplete and runtime validation (Typed models).
  • Automatic retries — exponential backoff for network errors, HTTP 429, and 5xx responses, configurable per client (Retries).
  • Tiered timeouts — short / medium / long tiers picked per endpoint, overridable per call (Timeouts).
  • Pagination and streaming — iterate datasets, key-value store keys, or live logs without manual paging or buffering (Pagination, Streaming).
  • Convenience methodscall(), wait_for_finish(), nested resource access, and other shortcuts that hide platform quirks (Convenience methods).
  • Pluggable HTTP layer — swap the default Impit-based HTTP client for httpx, requests, aiohttp, or any custom implementation (Custom HTTP clients).
  • Structured errors — every API error surfaces as an ApifyApiError with HTTP-specific subclasses for precise handling (Error handling).
  • Debug logging — opt-in structured logging on the apify_client logger captures request URLs, status codes, retry attempts, and more (Logging).

Usage examples

The client mirrors the platform's resource model. Each entry point returns either a single-resource client for an individual item or a collection client for listing and creating items (Single and collection clients).

List Actors and create one

actors = client.actors()
print(actors.list(limit=10).items)

new_actor = actors.create(name='my-actor')

Stream live logs while a run is in progress

run = client.actor('apify/web-scraper').start(run_input={...})

with client.run(run.id).log().stream() as log_stream:
    for chunk in log_stream.iter_bytes():
        print(chunk.decode(), end='')

Read and write key-value store records

store = client.key_value_store('STORE-ID')
store.set_record('greeting', {'message': 'Hello!'})
record = store.get_record('greeting')

Iterate dataset items with automatic pagination

for item in client.dataset('DATASET-ID').iterate_items(fields='title,url'):
    process(item)

Tune retries and timeouts

from datetime import timedelta

from apify_client import ApifyClient

client = ApifyClient(
    token='MY-APIFY-TOKEN',
    max_retries=8,
    min_delay_between_retries=timedelta(milliseconds=500),
    timeout_long=timedelta(minutes=10),
)

For end-to-end recipes — passing input, managing tasks for reusable input, retrieving and merging Actor data, integrating with Pandas, plugging in a custom HTTP client — see the Guides.

Documentation

The full documentation lives at docs.apify.com/api/client/python.

Section What you'll find
Introduction Overview, prerequisites, and a tour of the client.
Quick start Authenticate, run an Actor, and fetch its results step by step.
Concepts Asyncio, single vs. collection clients, nested clients, error handling, retries, logging, convenience methods, pagination, streaming, custom HTTP clients, timeouts.
Guides Pass input to an Actor, manage tasks for reusable input, retrieve Actor data, integrate with data libraries (e.g. Pandas), use HTTPX as the HTTP client.
Upgrading Migrating between major versions.
API reference Generated reference for every class, method, and model.
Changelog Release history and breaking changes.

Related projects

Support and community

Contributing

Bug reports, fixes, and improvements are welcome! See CONTRIBUTING.md for the development setup, coding standards, testing, and the release process. The repo uses uv for project management and Poe the Poet as a task runner; the typical loop is:

uv run poe install-dev   # install dev deps and git hooks
uv run poe check-code    # lint, type-check, unit tests, docstring check

License

Released under the Apache License 2.0.

3.0.0 May 20, 2026
2.5.1 May 20, 2026
2.5.1b36 May 19, 2026
2.5.1b35 May 19, 2026
2.5.1b34 May 18, 2026
2.5.1b33 May 18, 2026
2.5.1b32 May 07, 2026
2.5.1b31 May 03, 2026
2.5.1b30 Apr 29, 2026
2.5.1b29 Apr 28, 2026
2.5.1b28 Apr 28, 2026
2.5.1b27 Apr 27, 2026
2.5.1b26 Apr 23, 2026
2.5.1b25 Apr 23, 2026
2.5.1b24 Apr 23, 2026
2.5.1b23 Apr 22, 2026
2.5.1b22 Apr 22, 2026
2.5.1b21 Apr 22, 2026
2.5.1b20 Apr 21, 2026
2.5.1b19 Apr 21, 2026
2.5.1b18 Apr 21, 2026
2.5.1b17 Apr 17, 2026
2.5.1b16 Apr 17, 2026
2.5.1b15 Apr 16, 2026
2.5.1b14 Apr 13, 2026
2.5.1b13 Apr 09, 2026
2.5.1b12 Apr 09, 2026
2.5.1b11 Apr 07, 2026
2.5.1b10 Mar 30, 2026
2.5.1b9 Mar 11, 2026
2.5.1b8 Mar 11, 2026
2.5.1b7 Mar 09, 2026
2.5.1b6 Mar 03, 2026
2.5.1b5 Feb 27, 2026
2.5.1b4 Feb 27, 2026
2.5.1b3 Feb 26, 2026
2.5.1b2 Feb 25, 2026
2.5.1b1 Feb 23, 2026
2.5.0 Feb 18, 2026
2.4.2b14 Feb 18, 2026
2.4.2b13 Feb 18, 2026
2.4.2b12 Feb 17, 2026
2.4.2b11 Feb 17, 2026
2.4.2b10 Feb 17, 2026
2.4.2b9 Feb 16, 2026
2.4.2b8 Feb 16, 2026
2.4.2b7 Feb 16, 2026
2.4.2b6 Feb 11, 2026
2.4.2b5 Feb 09, 2026
2.4.2b4 Feb 09, 2026
2.4.2b3 Feb 04, 2026
2.4.2b2 Feb 03, 2026
2.4.2b1 Feb 02, 2026
2.4.1 Jan 30, 2026
2.4.1b11 Jan 27, 2026
2.4.1b10 Jan 27, 2026
2.4.1b9 Jan 26, 2026
2.4.1b8 Jan 26, 2026
2.4.1b7 Jan 26, 2026
2.4.1b6 Jan 26, 2026
2.4.1b5 Jan 23, 2026
2.4.1b4 Jan 22, 2026
2.4.1b3 Jan 21, 2026
2.4.1b2 Jan 20, 2026
2.4.1b1 Jan 13, 2026
2.4.0 Jan 09, 2026
2.3.1b22 Jan 09, 2026
2.3.1b21 Jan 08, 2026
2.3.1b20 Jan 05, 2026
2.3.1b19 Jan 05, 2026
2.3.1b18 Jan 02, 2026
2.3.1b17 Dec 31, 2025
2.3.1b16 Dec 30, 2025
2.3.1b15 Dec 30, 2025
2.3.1b14 Dec 26, 2025
2.3.1b13 Dec 26, 2025
2.3.1b12 Dec 18, 2025
2.3.1b11 Dec 18, 2025
2.3.1b10 Dec 17, 2025
2.3.1b9 Dec 12, 2025
2.3.1b8 Dec 11, 2025
2.3.1b7 Dec 09, 2025
2.3.1b6 Dec 08, 2025
2.3.1b5 Dec 03, 2025
2.3.1b4 Dec 01, 2025
2.3.1b3 Dec 01, 2025
2.3.1b2 Dec 01, 2025
2.3.1b1 Nov 28, 2025
2.3.0 Nov 13, 2025
2.2.2b8 Nov 13, 2025
2.2.2b7 Nov 10, 2025
2.2.2b6 Nov 07, 2025
2.2.2b5 Nov 07, 2025
2.2.2b4 Nov 06, 2025
2.2.2b3 Oct 29, 2025
2.2.2b2 Oct 29, 2025
2.2.2b1 Oct 22, 2025
2.2.1 Oct 20, 2025
2.2.1b3 Oct 20, 2025
2.2.1b2 Oct 20, 2025
2.2.1b1 Oct 14, 2025
2.2.0 Oct 13, 2025
2.1.1b12 Oct 13, 2025
2.1.1b11 Oct 13, 2025
2.1.1b10 Oct 13, 2025
2.1.1b9 Oct 10, 2025
2.1.1b8 Oct 09, 2025
2.1.1b7 Oct 08, 2025
2.1.1b6 Oct 06, 2025
2.1.1b5 Oct 02, 2025
2.1.1b4 Sep 30, 2025
2.1.1b3 Sep 29, 2025
2.1.1b2 Sep 22, 2025
2.1.1b1 Sep 15, 2025
2.1.0 Sep 15, 2025
2.0.1b13 Sep 12, 2025
2.0.1b12 Sep 11, 2025
2.0.1b11 Sep 10, 2025
2.0.1b10 Sep 09, 2025
2.0.1b9 Sep 09, 2025
2.0.1b8 Sep 08, 2025
2.0.1b7 Sep 05, 2025
2.0.1b6 Sep 04, 2025
2.0.1b5 Sep 04, 2025
2.0.1b4 Aug 27, 2025
2.0.1b3 Aug 25, 2025
2.0.1b2 Aug 20, 2025
2.0.1b1 Aug 18, 2025
2.0.0 Aug 15, 2025
1.12.2 Aug 08, 2025
1.12.1 Jul 30, 2025
1.12.0 Jun 26, 2025
1.11.0 Jun 13, 2025
1.10.0 Apr 29, 2025
1.9.4 Apr 24, 2025
1.9.3 Apr 14, 2025
1.9.2 Feb 14, 2025
1.9.1 Feb 07, 2025
1.9.0 Feb 04, 2025
1.8.1 Sep 17, 2024
1.8.0 Aug 30, 2024
1.7.1 Jul 11, 2024
1.7.0 May 20, 2024
1.6.4 Feb 27, 2024
1.6.3 Feb 16, 2024
1.6.2 Jan 08, 2024
1.6.1 Dec 11, 2023
1.6.0 Nov 16, 2023
1.5.0 Oct 18, 2023
1.4.1 Sep 06, 2023
1.4.0 Aug 23, 2023
1.3.1 Jul 28, 2023
1.3.0 Jul 24, 2023
1.2.2 May 31, 2023
1.2.1 May 23, 2023
1.2.0 May 23, 2023
1.1.1 May 05, 2023
1.1.0.post1 May 05, 2023
1.1.0 May 05, 2023
1.0.0 Mar 13, 2023
0.6.0 Jun 27, 2022
0.5.0 Sep 16, 2021
0.4.0 Sep 07, 2021
0.3.0 Aug 26, 2021
0.2.0 Aug 09, 2021
0.1.0 Aug 02, 2021
0.0.1 May 17, 2021

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras: None
Dependencies:
colorama (>=0.4.0)
impit (>=0.9.2)
more-itertools (>=10.0.0)
pydantic[email] (>=2.11.0)