# ActorCollectionClient<!-- -->

Sub-client for the Actor collection.

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

### Hierarchy

* [ResourceClient](https://docs.apify.com/api/client/python/reference/class/ResourceClient.md)
  * *ActorCollectionClient*

## Index[](#Index)

### Methods

* [\_\_init\_\_](https://docs.apify.com/api/client/python/reference/class/ActorCollectionClient.md#__init__)
* [create](https://docs.apify.com/api/client/python/reference/class/ActorCollectionClient.md#create)
* [iterate](https://docs.apify.com/api/client/python/reference/class/ActorCollectionClient.md#iterate)
* [list](https://docs.apify.com/api/client/python/reference/class/ActorCollectionClient.md#list)

### Properties

* [resource_id](https://docs.apify.com/api/client/python/reference/class/ActorCollectionClient.md#resource_id)

## Methods<!-- -->[](#Methods)

### [](#__init__)\_\_init\_\_

* **\_\_init\_\_**(\*, base_url, public_base_url, http_client, resource_path, client_registry, resource_id, params, api_base_url): None

- Overrides [ResourceClient.\_\_init\_\_](https://docs.apify.com/api/client/python/reference/class/ResourceClient.md#__init__)

  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](https://docs.apify.com/api/client/python/reference/class/HttpClient.md)

    HTTP client for making requests.

  * ##### keyword-onlyresource_path: str

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

  * ##### keyword-onlyclient_registry: [ClientRegistry](https://docs.apify.com/api/client/python/reference/class/ClientRegistry.md)

    Bundle of client classes for dependency injection.

  * ##### optionalkeyword-onlyresource_id: str | None = <!-- -->None

    Optional resource ID for single-resource clients.

  * ##### optionalkeyword-onlyparams: [QueryParams](https://docs.apify.com/api/client/python/reference.md#QueryParams) | None = <!-- -->None

    Optional default parameters for all requests.

  * ##### optionalkeyword-onlyapi_base_url: str | None = <!-- -->None

    Base URL of the API itself, for clients of top-level resources. Defaults to `base_url`.

  #### Returns None

### [](#create)create

* **create**(\*, name, title, description, seo_title, seo_description, versions, restart_on_error, is_public, is_deprecated, categories, default_run_build, default_run_max_items, default_run_memory_mbytes, default_run_timeout, default_run_force_permission_level, example_run_input_body, example_run_input_content_type, server_is_enabled, server_desired_requests_per_actor_run, server_max_requests_per_actor_run, server_idle_timeout, server_build, server_memory_mbytes, server_disable_fields_override, server_should_pass_actor_input, server_tenancy, actor_permission_level, timeout, actor_standby_is_enabled, 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, actor_standby_disable_standby_fields_override, actor_standby_should_pass_actor_input, actor_standby_tenancy): [ActorResource](https://docs.apify.com/api/client/python/reference/class/ActorResource.md)

- Create a new Actor.

  <https://docs.apify.com/api/v2#/reference/actors/actor-collection/create-actor>

  ***

  #### Parameters

  * ##### keyword-onlyname: str

    The name of the Actor.

  * ##### optionalkeyword-onlytitle: str | None = <!-- -->None

    The title of the Actor (human-readable).

  * ##### optionalkeyword-onlydescription: str | None = <!-- -->None

    The description for the Actor.

  * ##### optionalkeyword-onlyseo_title: str | None = <!-- -->None

    The title of the Actor optimized for search engines.

  * ##### optionalkeyword-onlyseo_description: str | None = <!-- -->None

    The description of the Actor optimized for search engines.

  * ##### optionalkeyword-onlyversions: [list](https://docs.apify.com/api/client/python/reference/class/ActorCollectionClient.md#list)\[dict\[str, Any]] | None = <!-- -->None

    The list of Actor versions.

  * ##### optionalkeyword-onlyrestart_on_error: bool | None = <!-- -->None

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

  * ##### optionalkeyword-onlyis_public: bool | None = <!-- -->None

    Whether the Actor is public.

  * ##### optionalkeyword-onlyis_deprecated: bool | None = <!-- -->None

    Whether the Actor is deprecated.

  * ##### optionalkeyword-onlycategories: [list](https://docs.apify.com/api/client/python/reference/class/ActorCollectionClient.md#list)\[str] | None = <!-- -->None

    The categories to which the Actor belongs to.

  * ##### optionalkeyword-onlydefault_run_build: str | None = <!-- -->None

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

  * ##### optionalkeyword-onlydefault_run_max_items: int | None = <!-- -->None

    Default limit of the number of results that will be returned by runs of this Actor, if the Actor is charged per result.

  * ##### optionalkeyword-onlydefault_run_memory_mbytes: int | None = <!-- -->None

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

  * ##### optionalkeyword-onlydefault_run_timeout: timedelta | None = <!-- -->None

    Default timeout for the runs of this Actor.

  * ##### optionalkeyword-onlydefault_run_force_permission_level: [ActorPermissionLevel](https://docs.apify.com/api/client/python/reference.md#ActorPermissionLevel) | None = <!-- -->None

    Permission level to force on the runs of this Actor, overriding the permission level of the Actor.

  * ##### optionalkeyword-onlyexample_run_input_body: str | None = <!-- -->None

    Input to be prefilled as default input to new users of this Actor, serialized as a string (e.g. `json.dumps(input)` for a JSON input).

  * ##### optionalkeyword-onlyexample_run_input_content_type: str | None = <!-- -->None

    The content type of the example run input.

  * ##### optionalkeyword-onlyserver_is_enabled: bool | None = <!-- -->None

    Whether the Actor is a Server Actor, which runs a web server called over HTTP.

  * ##### optionalkeyword-onlyserver_desired_requests_per_actor_run: int | None = <!-- -->None

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

  * ##### optionalkeyword-onlyserver_max_requests_per_actor_run: int | None = <!-- -->None

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

  * ##### optionalkeyword-onlyserver_idle_timeout: timedelta | None = <!-- -->None

    If a run of the Server Actor does not receive any requests for this time, it is shut down.

  * ##### optionalkeyword-onlyserver_build: str | None = <!-- -->None

    The build tag or number that the Server Actor runs.

  * ##### optionalkeyword-onlyserver_memory_mbytes: int | None = <!-- -->None

    The memory in megabytes for the runs of the Server Actor.

  * ##### optionalkeyword-onlyserver_disable_fields_override: bool | None = <!-- -->None

    If true, prevents the Server Actor configuration from being overridden elsewhere.

  * ##### optionalkeyword-onlyserver_should_pass_actor_input: bool | None = <!-- -->None

    Whether to pass the Actor input to the runs of the Server Actor. If false, they start with no input.

  * ##### optionalkeyword-onlyserver_tenancy: [Tenancy](https://docs.apify.com/api/client/python/reference.md#Tenancy) | None = <!-- -->None

    Whether each user gets their own runs of the Server Actor (`SINGLE_TENANT`) or the runs are shared across users (`MULTI_TENANT`). `MULTI_TENANT` requires pay-per-event pricing.

  * ##### optionalkeyword-onlyactor_permission_level: [ActorPermissionLevel](https://docs.apify.com/api/client/python/reference.md#ActorPermissionLevel) | None = <!-- -->None

    The permission level of the Actor on Apify platform.

  * ##### optionalkeyword-onlytimeout: [Timeout](https://docs.apify.com/api/client/python/reference.md#Timeout) = <!-- -->'medium'

    Timeout for the API HTTP request.

  * ##### optionalkeyword-onlyactor_standby_is_enabled: bool | None = <!-- -->None

    Deprecated alias of `server_is_enabled`. Will be removed in v4.

  * ##### optionalkeyword-onlyactor_standby_desired_requests_per_actor_run: int | None = <!-- -->None

    Deprecated alias of `server_desired_requests_per_actor_run`. Will be removed in v4.

  * ##### optionalkeyword-onlyactor_standby_max_requests_per_actor_run: int | None = <!-- -->None

    Deprecated alias of `server_max_requests_per_actor_run`. Will be removed in v4.

  * ##### optionalkeyword-onlyactor_standby_idle_timeout: timedelta | None = <!-- -->None

    Deprecated alias of `server_idle_timeout`. Will be removed in v4.

  * ##### optionalkeyword-onlyactor_standby_build: str | None = <!-- -->None

    Deprecated alias of `server_build`. Will be removed in v4.

  * ##### optionalkeyword-onlyactor_standby_memory_mbytes: int | None = <!-- -->None

    Deprecated alias of `server_memory_mbytes`. Will be removed in v4.

  * ##### optionalkeyword-onlyactor_standby_disable_standby_fields_override: bool | None = <!-- -->None

    Deprecated alias of `server_disable_fields_override`. Will be removed in v4.

  * ##### optionalkeyword-onlyactor_standby_should_pass_actor_input: bool | None = <!-- -->None

    Deprecated alias of `server_should_pass_actor_input`. Will be removed in v4.

  * ##### optionalkeyword-onlyactor_standby_tenancy: [Tenancy](https://docs.apify.com/api/client/python/reference.md#Tenancy) | None = <!-- -->None

    Deprecated alias of `server_tenancy`. Will be removed in v4.

  #### Returns [ActorResource](https://docs.apify.com/api/client/python/reference/class/ActorResource.md)

  The created Actor.

### [](#iterate)iterate

* **iterate**(\*, my, limit, offset, desc, sort_by, chunk_size, timeout): Iterator\[[ActorListItem](https://docs.apify.com/api/client/python/reference/class/ActorListItem.md)]

- Iterate over the Actors the user has created or used.

  Simple `list` does only one API call, possibly not listing all items matching the criteria. This method returns an iterator that is capable of making multiple API calls to retrieve all items matching the criteria.

  <https://docs.apify.com/api/v2#/reference/actors/actor-collection/get-list-of-actors>

  ***

  #### Parameters

  * ##### optionalkeyword-onlymy: bool | None = <!-- -->None

    If True, will return only Actors which the user has created themselves.

  * ##### optionalkeyword-onlylimit: int | None = <!-- -->None

    How many Actors to list.

  * ##### optionalkeyword-onlyoffset: int | None = <!-- -->None

    What Actor to include as first when retrieving the list.

  * ##### optionalkeyword-onlydesc: bool | None = <!-- -->None

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

  * ##### optionalkeyword-onlysort_by: Literal\[createdAt, stats.lastRunStartedAt] | None = <!-- -->'createdAt'

    Field to sort the results by.

  * ##### optionalkeyword-onlychunk_size: int | None = <!-- -->None

    Maximum number of Actors requested per API call when iterating across pages.

  * ##### optionalkeyword-onlytimeout: [Timeout](https://docs.apify.com/api/client/python/reference.md#Timeout) = <!-- -->'medium'

    Timeout for the API HTTP request.

  #### Returns Iterator\[[ActorListItem](https://docs.apify.com/api/client/python/reference/class/ActorListItem.md)]

### [](#list)list

* **list**(\*, my, limit, offset, desc, sort_by, timeout): [ListOfActors](https://docs.apify.com/api/client/python/reference/class/ListOfActors.md)

- List the Actors the user has created or used.

  <https://docs.apify.com/api/v2#/reference/actors/actor-collection/get-list-of-actors>

  ***

  #### Parameters

  * ##### optionalkeyword-onlymy: bool | None = <!-- -->None

    If True, will return only Actors which the user has created themselves.

  * ##### optionalkeyword-onlylimit: int | None = <!-- -->None

    How many Actors to list.

  * ##### optionalkeyword-onlyoffset: int | None = <!-- -->None

    What Actor to include as first when retrieving the list.

  * ##### optionalkeyword-onlydesc: bool | None = <!-- -->None

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

  * ##### optionalkeyword-onlysort_by: Literal\[createdAt, stats.lastRunStartedAt] | None = <!-- -->'createdAt'

    Field to sort the results by.

  * ##### optionalkeyword-onlytimeout: [Timeout](https://docs.apify.com/api/client/python/reference.md#Timeout) = <!-- -->'medium'

    Timeout for the API HTTP request.

  #### Returns [ListOfActors](https://docs.apify.com/api/client/python/reference/class/ListOfActors.md)

  The list of available Actors matching the specified filters.

## Properties<!-- -->[](#Properties)

### [](#resource_id)resource_id

resource_id: str | None

Inherited from [ResourceClientBase.resource_id](https://docs.apify.com/api/client/python/reference/class/ResourceClientBase.md#resource_id)

Get the resource ID.
