Skip to main content

TaskCollectionClient

Sub-client for the task collection.

Provides methods to manage the task collection, e.g. list or create tasks. Obtain an instance via an appropriate method on the ApifyClient class.

Hierarchy

Index

Methods

__init__

  • __init__(*, base_url, public_base_url, http_client, resource_path, client_registry, resource_id, params): None
  • Initialize the resource client.


    Parameters

    • keyword-onlybase_url: str

      API base URL.

    • keyword-onlypublic_base_url: str

      Public CDN base URL.

    • keyword-onlyhttp_client: HttpClient

      HTTP client for making requests.

    • keyword-onlyresource_path: str

      Resource endpoint path (e.g., 'actors', 'datasets').

    • keyword-onlyclient_registry: ClientRegistry

      Bundle of client classes for dependency injection.

    • optionalkeyword-onlyresource_id: str | None = None

      Optional resource ID for single-resource clients.

    • optionalkeyword-onlyparams: dict | None = None

      Optional default parameters for all requests.

    Returns None

create

  • create(*, actor_id, name, build, timeout, memory_mbytes, max_items, restart_on_error, task_input, title, actor_standby_desired_requests_per_actor_run, actor_standby_max_requests_per_actor_run, actor_standby_idle_timeout, actor_standby_build, actor_standby_memory_mbytes): Task

  • Parameters

    • keyword-onlyactor_id: str

      Id of the Actor that should be run.

    • keyword-onlyname: str

      Name of the task.

    • optionalkeyword-onlybuild: str | None = None

      Actor build to run. It can be either a build tag or build number. By default, the run uses the build specified in the task settings (typically latest).

    • optionalkeyword-onlytimeout: timedelta | None = None

      Optional timeout for the run. By default, the run uses timeout specified in the task settings.

    • optionalkeyword-onlymemory_mbytes: int | None = None

      Memory limit for the run, in megabytes. By default, the run uses a memory limit specified in the task settings.

    • optionalkeyword-onlymax_items: int | None = None

      Maximum number of results that will be returned by runs of this task. If the Actor of this task is charged per result, you will not be charged for more results than the given limit.

    • optionalkeyword-onlyrestart_on_error: bool | None = None

      If true, the Task run process will be restarted whenever it exits with a non-zero status code.

    • optionalkeyword-onlytask_input: dict | None = None

      Task input object.

    • optionalkeyword-onlytitle: str | None = None

      A human-friendly equivalent of the name.

    • optionalkeyword-onlyactor_standby_desired_requests_per_actor_run: int | None = None

      The desired number of concurrent HTTP requests for a single Actor Standby run.

    • optionalkeyword-onlyactor_standby_max_requests_per_actor_run: int | None = None

      The maximum number of concurrent HTTP requests for a single Actor Standby run.

    • optionalkeyword-onlyactor_standby_idle_timeout: timedelta | None = None

      If the Actor run does not receive any requests for this time, it will be shut down.

    • optionalkeyword-onlyactor_standby_build: str | None = None

      The build tag or number to run when the Actor is in Standby mode.

    • optionalkeyword-onlyactor_standby_memory_mbytes: int | None = None

      The memory in megabytes to use when the Actor is in Standby mode.

    Returns Task

    The created task.

list


  • Parameters

    • optionalkeyword-onlylimit: int | None = None

      How many tasks to list.

    • optionalkeyword-onlyoffset: int | None = None

      What task to include as first when retrieving the list.

    • optionalkeyword-onlydesc: bool | None = None

      Whether to sort the tasks in descending order based on their creation date.

    Returns ListOfTasks

    The list of available tasks matching the specified filters.

Properties

resource_id

resource_id: str | None

Get the resource ID.

Page Options