Skip to main content
Version: 0.6

ActorClient

Sub-client for manipulating a single actor.

Hierarchy

Index

Methods

__init__

  • __init__(args, kwargs): None

build

  • build(*, version_number, beta_packages, tag, use_cache, wait_for_finish): Dict

  • Parameters

    • keyword-onlyversion_number: str

      Actor version number to be built.

    • optionalkeyword-onlybeta_packages: Optional[bool] = None

      If True, then the actor is built with beta versions of Apify NPM packages. By default, the build uses latest stable packages.

    • optionalkeyword-onlytag: Optional[str] = None

      Tag to be applied to the build on success. By default, the tag is taken from the actor version's buildTag property.

    • optionalkeyword-onlyuse_cache: Optional[bool] = None

      If true, the actor's Docker container will be rebuilt using layer cache (https://docs.docker.com/develop/develop-images/dockerfile_best-practices/`leverage`-build-cache). This is to enable quick rebuild during development. By default, the cache is not used.

    • optionalkeyword-onlywait_for_finish: Optional[int] = None

      The maximum number of seconds the server waits for the build to finish before returning. By default it is 0, the maximum value is 300.

    Returns Dict

    dict: The build object

builds

call

  • call(*, run_input, content_type, build, memory_mbytes, timeout_secs, webhooks, wait_secs): Optional[Dict]
  • Start the actor and wait for it to finish before returning the Run object.

    It waits indefinitely, unless the wait_secs argument is provided.

    https://docs.apify.com/api/v2#/reference/actors/run-collection/run-actor


    Parameters

    • optionalkeyword-onlyrun_input: Optional[Any] = None

      The input to pass to the actor run.

    • optionalkeyword-onlycontent_type: Optional[str] = None

      The content type of the input.

    • optionalkeyword-onlybuild: Optional[str] = None

      Specifies the actor build to run. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the actor (typically latest).

    • optionalkeyword-onlymemory_mbytes: Optional[int] = None

      Memory limit for the run, in megabytes. By default, the run uses a memory limit specified in the default run configuration for the actor.

    • optionalkeyword-onlytimeout_secs: Optional[int] = None

      Optional timeout for the run, in seconds. By default, the run uses timeout specified in the default run configuration for the actor.

    • optionalkeyword-onlywebhooks: Optional[List[Dict]] = None

      Optional webhooks (https://docs.apify.com/webhooks) associated with the actor run, which can be used to receive a notification, e.g. when the actor finished or failed. If you already have a webhook set up for the actor, you do not have to add it again here.

    • optionalkeyword-onlywait_secs: Optional[int] = None

      The maximum number of seconds the server waits for the run to finish. If not provided, waits indefinitely.

    Returns Optional[Dict]

    dict: The run object

delete

  • delete(): None

get

  • get(): Optional[Dict]

last_run

  • Retrieve the client for the last run of this actor.

    Last run is retrieved based on the start time of the runs.


    Parameters

    • optionalkeyword-onlystatus: Optional[ActorJobStatus] = None

      Consider only runs with this status.

    Returns RunClient

    RunClient: The resource client for the last run of this actor.

runs

start

  • start(*, run_input, content_type, build, memory_mbytes, timeout_secs, wait_for_finish, webhooks): Dict
  • Start the actor and immediately return the Run object.

    https://docs.apify.com/api/v2#/reference/actors/run-collection/run-actor


    Parameters

    • optionalkeyword-onlyrun_input: Optional[Any] = None

      The input to pass to the actor run.

    • optionalkeyword-onlycontent_type: Optional[str] = None

      The content type of the input.

    • optionalkeyword-onlybuild: Optional[str] = None

      Specifies the actor build to run. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the actor (typically latest).

    • optionalkeyword-onlymemory_mbytes: Optional[int] = None

      Memory limit for the run, in megabytes. By default, the run uses a memory limit specified in the default run configuration for the actor.

    • optionalkeyword-onlytimeout_secs: Optional[int] = None

      Optional timeout for the run, in seconds. By default, the run uses timeout specified in the default run configuration for the actor.

    • optionalkeyword-onlywait_for_finish: Optional[int] = None

      The maximum number of seconds the server waits for the run to finish. By default, it is 0, the maximum value is 300.

    • optionalkeyword-onlywebhooks: Optional[List[Dict]] = None

      Optional ad-hoc webhooks (https://docs.apify.com/webhooks/ad-hoc-webhooks) associated with the actor run which can be used to receive a notification, e.g. when the actor finished or failed. If you already have a webhook set up for the actor or task, you do not have to add it again here. Each webhook is represented by a dictionary containing these items:

      • `event_types`: list of `WebhookEventType` values which trigger the webhook
      • `request_url`: URL to which to send the webhook HTTP request
      • `payload_template` (optional): Optional template for the request payload

    Returns Dict

    dict: The run object

update

  • update(*, name, title, description, seo_title, seo_description, versions, restart_on_error, is_public, is_deprecated, is_anonymously_runnable, categories, default_run_build, default_run_memory_mbytes, default_run_timeout_secs, example_run_input_body, example_run_input_content_type): Dict

  • Parameters

    • optionalkeyword-onlyname: Optional[str] = None

      The name of the actor

    • optionalkeyword-onlytitle: Optional[str] = None

      The title of the actor (human-readable)

    • optionalkeyword-onlydescription: Optional[str] = None

      The description for the actor

    • optionalkeyword-onlyseo_title: Optional[str] = None

      The title of the actor optimized for search engines

    • optionalkeyword-onlyseo_description: Optional[str] = None

      The description of the actor optimized for search engines

    • optionalkeyword-onlyversions: Optional[List[Dict]] = None

      The list of actor versions

    • optionalkeyword-onlyrestart_on_error: Optional[bool] = None

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

    • optionalkeyword-onlyis_public: Optional[bool] = None

      Whether the actor is public.

    • optionalkeyword-onlyis_deprecated: Optional[bool] = None

      Whether the actor is deprecated.

    • optionalkeyword-onlyis_anonymously_runnable: Optional[bool] = None

      Whether the actor is anonymously runnable.

    • optionalkeyword-onlycategories: Optional[List[str]] = None

      The categories to which the actor belongs to.

    • optionalkeyword-onlydefault_run_build: Optional[str] = None

      Tag or number of the build that you want to run by default.

    • optionalkeyword-onlydefault_run_memory_mbytes: Optional[int] = None

      Default amount of memory allocated for the runs of this actor, in megabytes.

    • optionalkeyword-onlydefault_run_timeout_secs: Optional[int] = None

      Default timeout for the runs of this actor in seconds.

    • optionalkeyword-onlyexample_run_input_body: Optional[Any] = None

      Input to be prefilled as default input to new users of this actor.

    • optionalkeyword-onlyexample_run_input_content_type: Optional[str] = None

      The content type of the example run input.

    Returns Dict

    dict: The updated actor

version

  • Retrieve the client for the specified version of this actor.


    Parameters

    • version_number: str

      The version number for which to retrieve the resource client.

    Returns ActorVersionClient

    ActorVersionClient: The resource client for the specified actor version.

versions

webhooks