Skip to main content

ActorClient

Sub-client for manipulating a single actor.

Index

Methods

build

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

  • Parameters

    • version_number: str

      Actor version number to be built.

    • optionalbeta_packages: bool

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

    • optionaltag: str

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

    • optionaluse_cache: bool

      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.

    • optionalwait_for_finish: int

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

    Returns Dict

builds

call

  • call(run_input, content_type, build, memory_mbytes, timeout_secs, webhooks, wait_secs): 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

    • optionalrun_input: Any

      The input to pass to the actor run.

    • optionalcontent_type: str

      The content type of the input.

    • optionalbuild: str

      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).

    • optionalmemory_mbytes: int

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

    • optionaltimeout_secs: int

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

    • optionalwebhooks: List[Dict]

      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.

    • optionalwait_secs: int

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

    Returns Dict

delete

  • delete(): None

get

  • get(): 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

    • optionalstatus: ActorJobStatus

      Consider only runs with this status.

    • optionalorigin: MetaOrigin

      Consider only runs started with this origin.

    Returns RunClient

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

    • optionalrun_input: Any

      The input to pass to the actor run.

    • optionalcontent_type: str

      The content type of the input.

    • optionalbuild: str

      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).

    • optionalmemory_mbytes: int

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

    • optionaltimeout_secs: int

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

    • optionalwait_for_finish: int

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

    • optionalwebhooks: List[Dict]

      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

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

    • optionalname: str

      The name of the actor

    • optionaltitle: str

      The title of the actor (human-readable)

    • optionaldescription: str

      The description for the actor

    • optionalseo_title: str

      The title of the actor optimized for search engines

    • optionalseo_description: str

      The description of the actor optimized for search engines

    • optionalversions: List[Dict]

      The list of actor versions

    • optionalrestart_on_error: bool

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

    • optionalis_public: bool

      Whether the actor is public.

    • optionalis_deprecated: bool

      Whether the actor is deprecated.

    • optionalis_anonymously_runnable: bool

      Whether the actor is anonymously runnable.

    • optionalcategories: List[str]

      The categories to which the actor belongs to.

    • optionaldefault_run_build: str

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

    • optionaldefault_run_memory_mbytes: int

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

    • optionaldefault_run_timeout_secs: int

      Default timeout for the runs of this actor in seconds.

    • optionalexample_run_input_body: Any

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

    • optionalexample_run_input_content_type: str

      The content type of the example run input.

    Returns Dict

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

versions

webhooks