Skip to main content
Version: Next

ActorCollectionClient

Client for managing the collection of Actors in your account.

Provides methods to list and create Actors. To access an individual Actor, use the actor() method on the main ApifyClient.

@example
const client = new ApifyClient({ token: 'my-token' });
const actorsClient = client.actors();

// List all Actors
const { items } = await actorsClient.list();

// Create a new Actor
const newActor = await actorsClient.create({
name: 'my-actor',
title: 'My Actor'
});
@see

Hierarchy

  • ResourceCollectionClient
    • ActorCollectionClient

Index

Properties

inheritedapifyClient

apifyClient: ApifyClient

inheritedbaseUrl

baseUrl: string

inheritedhttpClient

httpClient: HttpClient

optionalinheritedid

id?: string

optionalinheritedparams

params?: Record<string, unknown>

inheritedpublicBaseUrl

publicBaseUrl: string

inheritedresourcePath

resourcePath: string

optionalinheritedsafeId

safeId?: string

inheritedurl

url: string

Methods

create

  • create(actor): Promise<Actor>

list

  • Lists all Actors.

    Awaiting the return value (as you would with a Promise) will result in a single API call. The amount of fetched items in a single API call is limited.

    const paginatedList = await client.list(options);

    Asynchronous iteration is also supported. This will fetch additional pages if needed until all items are retrieved.

    for await (const singleItem of client.list(options)) {...}
    @see

    Parameters

    Returns PaginatedIterator<ActorCollectionListItem>

    A paginated iterator of Actors.