# Apify > * **statusMessage --- # Source: https://docs.apify.com/sdk/js/reference/interface/AbortOptions.md # AbortOptions ### Hierarchy * RunAbortOptions * *AbortOptions* ## Index[**](#Index) ### Properties * [**gracefully](#gracefully) * [**statusMessage](#statusMessage) * [**token](#token) ## Properties[**](#Properties) ### [**](#gracefully)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/apify-client/src/resource_clients/run.d.ts#L89)externaloptionalinheritedgracefully **gracefully? : boolean Inherited from RunAbortOptions.gracefully ### [**](#statusMessage)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1912)optionalstatusMessage **statusMessage? : string Exit with given status message ### [**](#token)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1909)optionaltoken **token? : string User API token that is used to run the Actor. By default, it is taken from the `APIFY_TOKEN` environment variable. --- # Source: https://docs.apify.com/sdk/python/reference/class/AbortingEvent.md # AbortingEvent ## Index[**](#Index) ### Properties * [**data](https://docs.apify.com/sdk/python/sdk/python/reference/class/AbortingEvent.md#data) * [**name](https://docs.apify.com/sdk/python/sdk/python/reference/class/AbortingEvent.md#name) ## Properties[**](#Properties) ### [**](#data)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L68)data **data: EventAbortingData ### [**](#name)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L67)name **name: Literal\[Event.ABORTING] --- # Source: https://docs.apify.com/api/client/js/reference/interface/AccountAndUsageLimits.md # AccountAndUsageLimits ## Index[**](#Index) ### Properties * [**current](#current) * [**limits](#limits) * [**monthlyUsageCycle](#monthlyUsageCycle) ## Properties[**](#Properties) ### [**](#current)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L266)current **current: [Current](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Current.md) ### [**](#limits)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L265)limits **limits: [Limits](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Limits.md) ### [**](#monthlyUsageCycle)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L264)monthlyUsageCycle **monthlyUsageCycle: [MonthlyUsageCycle](https://docs.apify.com/api/client/js/api/client/js/reference/interface/MonthlyUsageCycle.md) --- # Source: https://docs.apify.com/sdk/python/reference/class/Actor.md # Source: https://docs.apify.com/sdk/js/reference/class/Actor.md # Source: https://docs.apify.com/api/client/js/reference/interface/Actor.md # Actor Represents an Actor in the Apify platform. Actors are serverless computing units that can perform arbitrary tasks such as web scraping, data processing, automation, and more. Each Actor has versions, builds, and can be executed with different configurations. ## Index[**](#Index) ### Properties * [**actorPermissionLevel](#actorPermissionLevel) * [**actorStandby](#actorStandby) * [**categories](#categories) * [**createdAt](#createdAt) * [**defaultRunOptions](#defaultRunOptions) * [**deploymentKey](#deploymentKey) * [**description](#description) * [**exampleRunInput](#exampleRunInput) * [**id](#id) * [**isAnonymouslyRunnable](#isAnonymouslyRunnable) * [**isDeprecated](#isDeprecated) * [**isPublic](#isPublic) * [**modifiedAt](#modifiedAt) * [**name](#name) * [**pricingInfos](#pricingInfos) * [**restartOnError](#restartOnError) * [**seoDescription](#seoDescription) * [**seoTitle](#seoTitle) * [**stats](#stats) * [**taggedBuilds](#taggedBuilds) * [**title](#title) * [**userId](#userId) * [**username](#username) * [**versions](#versions) ## Properties[**](#Properties) ### [**](#actorPermissionLevel)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L493)actorPermissionLevel **actorPermissionLevel: ACTOR\_PERMISSION\_LEVEL Permission level of the Actor on Apify platform ### [**](#actorStandby)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L489)optionalactorStandby **actorStandby? : [ActorStandby](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorStandby.md) & { isEnabled: boolean } Standby mode configuration for keeping Actor warm and responsive ### [**](#categories)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L487)optionalcategories **categories? : string\[] Categories the Actor belongs to (e.g., 'ECOMMERCE', 'SCRAPING') ### [**](#createdAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L461)createdAt **createdAt: Date Timestamp when the Actor was created ### [**](#defaultRunOptions)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L471)defaultRunOptions **defaultRunOptions: [ActorDefaultRunOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorDefaultRunOptions.md) Default configuration options for Actor runs ### [**](#deploymentKey)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L477)deploymentKey **deploymentKey: string Deployment key used for automated deployments ### [**](#description)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L453)optionaldescription **description? : string Detailed description of what the Actor does ### [**](#exampleRunInput)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L473)optionalexampleRunInput **exampleRunInput? : [ActorExampleRunInput](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorExampleRunInput.md) Example input to help users understand how to use the Actor ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L445)id **id: string Unique Actor ID ### [**](#isAnonymouslyRunnable)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L459)optionalisAnonymouslyRunnable **isAnonymouslyRunnable? : boolean Whether the Actor can be run by anonymous users without authentication ### [**](#isDeprecated)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L475)optionalisDeprecated **isDeprecated? : boolean Whether the Actor is deprecated and should not be used ### [**](#isPublic)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L457)isPublic **isPublic: boolean Whether the Actor is publicly available in Apify Store ### [**](#modifiedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L463)modifiedAt **modifiedAt: Date Timestamp when the Actor was last modified ### [**](#name)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L449)name **name: string Unique name of the Actor (used in API paths, e.g., 'my-actor') ### [**](#pricingInfos)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L469)optionalpricingInfos **pricingInfos? : [ActorRunPricingInfo](https://docs.apify.com/api/client/js/api/client/js/reference.md#ActorRunPricingInfo)\[] Pricing information for pay-per-result or pay-per-event Actors ### [**](#restartOnError)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L455)optionalrestartOnError **restartOnError? : boolean * **@deprecated** Use defaultRunOptions.restartOnError instead ### [**](#seoDescription)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L485)optionalseoDescription **seoDescription? : string SEO-optimized description for the Actor's public page ### [**](#seoTitle)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L483)optionalseoTitle **seoTitle? : string SEO-optimized title for the Actor's public page ### [**](#stats)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L465)stats **stats: [ActorStats](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorStats.md) Usage and run statistics for the Actor ### [**](#taggedBuilds)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L481)optionaltaggedBuilds **taggedBuilds? : [ActorTaggedBuilds](https://docs.apify.com/api/client/js/api/client/js/reference.md#ActorTaggedBuilds) Mapping of tags to specific builds (e.g., 'latest', 'beta') ### [**](#title)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L479)optionaltitle **title? : string Human-readable title of the Actor (displayed in UI) ### [**](#userId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L447)userId **userId: string ID of the user who owns the Actor ### [**](#username)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L451)username **username: string Username of the Actor's owner ### [**](#versions)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L467)versions **versions: [ActorVersion](https://docs.apify.com/api/client/js/api/client/js/reference.md#ActorVersion)\[] All versions of this Actor --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorBuildOptions.md # ActorBuildOptions Options for building an Actor. ## Index[**](#Index) ### Properties * [**betaPackages](#betaPackages) * [**tag](#tag) * [**useCache](#useCache) * [**waitForFinish](#waitForFinish) ## Properties[**](#Properties) ### [**](#betaPackages)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L807)optionalbetaPackages **betaPackages? : boolean ### [**](#tag)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L808)optionaltag **tag? : string ### [**](#useCache)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L809)optionaluseCache **useCache? : boolean ### [**](#waitForFinish)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L810)optionalwaitForFinish **waitForFinish? : number --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorCallOptions.md # ActorCallOptions Options for calling an Actor and waiting for it to finish. Extends [ActorStartOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorStartOptions.md) with additional options for waiting and log streaming. ### Hierarchy * Omit<[ActorStartOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorStartOptions.md), waitForFinish> * *ActorCallOptions* ## Index[**](#Index) ### Properties * [**build](#build) * [**contentType](#contentType) * [**forcePermissionLevel](#forcePermissionLevel) * [**log](#log) * [**maxItems](#maxItems) * [**maxTotalChargeUsd](#maxTotalChargeUsd) * [**memory](#memory) * [**restartOnError](#restartOnError) * [**timeout](#timeout) * [**waitSecs](#waitSecs) * [**webhooks](#webhooks) ## Properties[**](#Properties) ### [**](#build)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L594)optionalinheritedbuild **build? : string Inherited from Omit.build Tag or number of the Actor build to run (e.g. `beta` or `1.2.345`). If not provided, the run uses build tag or number from the default Actor run configuration (typically `latest`). ### [**](#contentType)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L602)optionalinheritedcontentType **contentType? : string Inherited from Omit.contentType Content type for the `input`. If not specified, `input` is expected to be an object that will be stringified to JSON and content type set to `application/json; charset=utf-8`. If `options.contentType` is specified, then `input` must be a `String` or `Buffer`. ### [**](#forcePermissionLevel)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L660)optionalinheritedforcePermissionLevel **forcePermissionLevel? : ACTOR\_PERMISSION\_LEVEL Inherited from Omit.forcePermissionLevel Override the Actor's permissions for this run. If not set, the Actor will run with permissions configured in the Actor settings. ### [**](#log)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L678)optionallog **log? : null | Log | default `Log` instance that should be used to redirect Actor run logs to. If `undefined` or `'default'` the pre-defined `Log` will be created and used. If `null`, no log redirection will occur. ### [**](#maxItems)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L639)optionalinheritedmaxItems **maxItems? : number Inherited from Omit.maxItems Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the Actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. ### [**](#maxTotalChargeUsd)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L647)optionalinheritedmaxTotalChargeUsd **maxTotalChargeUsd? : number Inherited from Omit.maxTotalChargeUsd Specifies the maximum cost of the Actor run. This parameter is used only for pay-per-event Actors. It allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. ### [**](#memory)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L608)optionalinheritedmemory **memory? : number Inherited from Omit.memory Memory in megabytes which will be allocated for the new Actor run. If not provided, the run uses memory of the default Actor run configuration. ### [**](#restartOnError)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L652)optionalinheritedrestartOnError **restartOnError? : boolean Inherited from Omit.restartOnError Determines whether the run will be restarted if it fails. ### [**](#timeout)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L613)optionalinheritedtimeout **timeout? : number Inherited from Omit.timeout Timeout for the Actor run in seconds. Zero value means there is no timeout. If not provided, the run uses timeout of the default Actor run configuration. ### [**](#waitSecs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L672)optionalwaitSecs **waitSecs? : number Wait time in seconds for the Actor run to finish. ### [**](#webhooks)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L630)optionalinheritedwebhooks **webhooks? : readonly [WebhookUpdateData](https://docs.apify.com/api/client/js/api/client/js/reference.md#WebhookUpdateData)\[] Inherited from Omit.webhooks Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed, see [ad hook webhooks documentation](https://docs.apify.com/webhooks/ad-hoc-webhooks) for detailed description. --- # Source: https://docs.apify.com/sdk/python/reference/class/ActorChargeEvent.md # Source: https://docs.apify.com/api/client/js/reference/interface/ActorChargeEvent.md # ActorChargeEvent Definition of a chargeable event for pay-per-event Actors. ## Index[**](#Index) ### Properties * [**eventDescription](#eventDescription) * [**eventPriceUsd](#eventPriceUsd) * [**eventTitle](#eventTitle) ## Properties[**](#Properties) ### [**](#eventDescription)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L892)optionaleventDescription **eventDescription? : string ### [**](#eventPriceUsd)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L890)eventPriceUsd **eventPriceUsd: number ### [**](#eventTitle)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L891)eventTitle **eventTitle: string --- # Source: https://docs.apify.com/api/client/python/reference/class/ActorClient.md # Source: https://docs.apify.com/api/client/js/reference/class/ActorClient.md # ActorClient Client for managing a specific Actor. Provides methods to start, call, build, update, and delete an Actor, as well as manage its versions, builds, runs, and webhooks. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const actorClient = client.actor('my-actor-id'); // Start an Actor const run = await actorClient.start(input, { memory: 256 }); // Call an Actor and wait for it to finish const finishedRun = await actorClient.call({ url: 'https://example.com' }); ``` * **@see** ### Hierarchy * ResourceClient * *ActorClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**build](#build) * [**builds](#builds) * [**call](#call) * [**defaultBuild](#defaultBuild) * [**delete](#delete) * [**get](#get) * [**lastRun](#lastRun) * [**runs](#runs) * [**start](#start) * [**update](#update) * [**version](#version) * [**versions](#versions) * [**webhooks](#webhooks) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceClient.url ## Methods[**](#Methods) ### [**](#build)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L287)build * ****build**(versionNumber, options): Promise<[Build](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Build.md)> - Builds the Actor. Creates a new build of the specified Actor version. The build compiles the Actor's source code, installs dependencies, and prepares it for execution. * **@see** * **@example** ``` // Start a build and return immediately const build = await client.actor('my-actor').build('0.1'); console.log(`Build ${build.id} started with status: ${build.status}`); // Build and wait up to 120 seconds for it to finish const build = await client.actor('my-actor').build('0.1', { waitForFinish: 120, tag: 'latest', useCache: true }); ``` *** #### Parameters * ##### versionNumber: string Version number or tag to build (e.g., `'0.1'`, `'0.2'`, `'latest'`) * ##### options: [ActorBuildOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorBuildOptions.md) = {} Build configuration options #### Returns Promise<[Build](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Build.md)> The Build object with status and build details ### [**](#builds)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L377)builds * ****builds**(): [BuildCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/BuildCollectionClient.md) - Returns a client for managing builds of this Actor. * **@see** *** #### Returns [BuildCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/BuildCollectionClient.md) A client for the Actor's build collection ### [**](#call)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L220)call * ****call**(input, options): Promise<[ActorRun](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRun.md)> - Starts the Actor and waits for it to finish before returning the Run object. This is a convenience method that starts the Actor run and waits for its completion by polling the run status. It optionally streams logs to the console or a custom Log instance. By default, it waits indefinitely unless the `waitSecs` option is provided. * **@see** * **@example** ``` // Run an Actor and wait for it to finish const run = await client.actor('my-actor').call({ url: 'https://example.com' }); console.log(`Run finished with status: ${run.status}`); console.log(`Dataset ID: ${run.defaultDatasetId}`); // Run with a timeout and log streaming to console const run = await client.actor('my-actor').call( { url: 'https://example.com' }, { waitSecs: 300, log: 'default' } ); // Run with custom log instance import { Log } from '@apify/log'; const log = new Log({ prefix: 'My Actor' }); const run = await client.actor('my-actor').call({ url: 'https://example.com' }, { log }); ``` *** #### Parameters * ##### optionalinput: unknown Input for the Actor. Can be any JSON-serializable value (object, array, string, number). If `contentType` is specified in options, input should be a string or Buffer. * ##### options: [ActorCallOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorCallOptions.md) = {} Run configuration options (extends all options from start) #### Returns Promise<[ActorRun](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRun.md)> The finished Actor run object with final status (`SUCCEEDED`, `FAILED`, `ABORTED`, or `TIMED-OUT`) ### [**](#defaultBuild)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L318)defaultBuild * ****defaultBuild**(options): Promise<[BuildClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/BuildClient.md)> - Retrieves the default build of the Actor. * **@see** *** #### Parameters * ##### options: [BuildClientGetOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/BuildClientGetOptions.md) = {} Options for getting the build. #### Returns Promise<[BuildClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/BuildClient.md)> A client for the default build. ### [**](#delete)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L81)delete * ****delete**(): Promise\ - Deletes the Actor. * **@see** *** #### Returns Promise\ ### [**](#get)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L59)get * ****get**(): Promise\ - Gets the Actor object from the Apify API. * **@see** *** #### Returns Promise\ The Actor object, or `undefined` if it does not exist ### [**](#lastRun)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L353)lastRun * ****lastRun**(options): [RunClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/RunClient.md) - Returns a client for the last run of this Actor. Provides access to the most recent Actor run, optionally filtered by status or origin. * **@see** * **@example** ``` // Get the last successful run const lastRun = await client.actor('my-actor').lastRun({ status: 'SUCCEEDED' }).get(); ``` *** #### Parameters * ##### options: [ActorLastRunOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorLastRunOptions.md) = {} Options to filter the last run #### Returns [RunClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/RunClient.md) A client for the last run ### [**](#runs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L391)runs * ****runs**(): [RunCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/RunCollectionClient.md) - Returns a client for managing runs of this Actor. * **@see** *** #### Returns [RunCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/RunCollectionClient.md) A client for the Actor's run collection ### [**](#start)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L119)start * ****start**(input, options): Promise<[ActorRun](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRun.md)> - Starts the Actor and immediately returns the Run object. The Actor run can be configured with optional input and various options. The run starts asynchronously and this method returns immediately without waiting for completion. Use the call method if you want to wait for the Actor to finish. * **@see** * **@example** ``` // Start Actor with simple input const run = await client.actor('my-actor').start({ url: 'https://example.com' }); console.log(`Run started with ID: ${run.id}, status: ${run.status}`); // Start Actor with specific build and memory const run = await client.actor('my-actor').start( { url: 'https://example.com' }, { build: '0.1.2', memory: 512, timeout: 300 } ); ``` *** #### Parameters * ##### optionalinput: unknown Input for the Actor. Can be any JSON-serializable value (object, array, string, number). If `contentType` is specified in options, input should be a string or Buffer. * ##### options: [ActorStartOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorStartOptions.md) = {} Run configuration options #### Returns Promise<[ActorRun](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRun.md)> The Actor run object with status, usage, and storage IDs ### [**](#update)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L70)update * ****update**(newFields): Promise<[Actor](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Actor.md)> - Updates the Actor with specified fields. * **@see** *** #### Parameters * ##### newFields: Partial\> Fields to update in the Actor #### Returns Promise<[Actor](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Actor.md)> The updated Actor object ### [**](#version)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L406)version * ****version**(versionNumber): [ActorVersionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ActorVersionClient.md) - Returns a client for a specific version of this Actor. * **@see** *** #### Parameters * ##### versionNumber: string Version number (e.g., '0.1', '1.2.3') #### Returns [ActorVersionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ActorVersionClient.md) A client for the specified Actor version ### [**](#versions)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L421)versions * ****versions**(): [ActorVersionCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ActorVersionCollectionClient.md) - Returns a client for managing versions of this Actor. * **@see** *** #### Returns [ActorVersionCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ActorVersionCollectionClient.md) A client for the Actor's version collection ### [**](#webhooks)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L431)webhooks * ****webhooks**(): [WebhookCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/WebhookCollectionClient.md) - Returns a client for managing webhooks associated with this Actor. * **@see** *** #### Returns [WebhookCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/WebhookCollectionClient.md) A client for the Actor's webhook collection --- # Source: https://docs.apify.com/api/client/python/reference/class/ActorClientAsync.md # ActorClientAsync Async sub-client for manipulating a single Actor. ### Hierarchy * [ResourceClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md) * *ActorClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md#__init__) * [**build](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md#build) * [**builds](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md#builds) * [**call](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md#call) * [**default\_build](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md#default_build) * [**delete](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md#delete) * [**get](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md#get) * [**last\_run](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md#last_run) * [**runs](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md#runs) * [**start](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md#start) * [**update](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md#update) * [**validate\_input](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md#validate_input) * [**version](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md#version) * [**versions](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md#versions) * [**webhooks](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md#webhooks) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor.py#L548)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#build)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor.py#L822)build * **async **build**(\*, version\_number, beta\_packages, tag, use\_cache, wait\_for\_finish): dict - Build the Actor. *** #### Parameters * ##### keyword-onlyversion\_number: str Actor version number to be built. * ##### optionalkeyword-onlybeta\_packages: bool | None = 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: str | None = None Tag to be applied to the build on success. By default, the tag is taken from the Actor version's build tag property. * ##### optionalkeyword-onlyuse\_cache: bool | None = None If true, the Actor's Docker container will be rebuilt using layer cache (). This is to enable quick rebuild during development. By default, the cache is not used. * ##### optionalkeyword-onlywait\_for\_finish: int | None = 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 60. #### Returns dict ### [**](#builds)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor.py#L866)builds * ****builds**(): [BuildCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildCollectionClientAsync.md) - Retrieve a client for the builds of this Actor. *** #### Returns [BuildCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildCollectionClientAsync.md) ### [**](#call)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor.py#L744)call * **async **call**(\*, run\_input, content\_type, build, max\_items, max\_total\_charge\_usd, restart\_on\_error, memory\_mbytes, timeout\_secs, webhooks, force\_permission\_level, wait\_secs, logger): dict | None - Start the Actor and wait for it to finish before returning the Run object. It waits indefinitely, unless the wait\_secs argument is provided. *** #### Parameters * ##### optionalkeyword-onlyrun\_input: Any = None The input to pass to the Actor run. * ##### optionalkeyword-onlycontent\_type: str | None = None The content type of the input. * ##### optionalkeyword-onlybuild: str | None = 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-onlymax\_items: int | None = None Maximum number of results that will be returned by this run. If the Actor is charged per result, you will not be charged for more results than the given limit. * ##### optionalkeyword-onlymax\_total\_charge\_usd: Decimal | None = None A limit on the total charged amount for pay-per-event actors. * ##### 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-onlymemory\_mbytes: int | None = 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: int | None = 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: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[dict] | None = None Optional 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-onlyforce\_permission\_level: ActorPermissionLevel | None = None Override the Actor's permissions for this run. If not set, the Actor will run with permissions configured in the Actor settings. * ##### optionalkeyword-onlywait\_secs: int | None = None The maximum number of seconds the server waits for the run to finish. If not provided, waits indefinitely. * ##### optionalkeyword-onlylogger: (Logger | None) | Literal\[default] = 'default' Logger used to redirect logs from the Actor run. Using "default" literal means that a predefined default logger will be used. Setting `None` will disable any log propagation. Passing custom logger will redirect logs to the provided logger. The logger is also used to capture status and status message of the other Actor run. #### Returns dict | None ### [**](#default_build)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor.py#L874)default\_build * **async **default\_build**(\*, wait\_for\_finish): [BuildClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildClientAsync.md) - Retrieve Actor's default build. *** #### Parameters * ##### optionalkeyword-onlywait\_for\_finish: int | None = 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 60. #### Returns [BuildClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildClientAsync.md) ### [**](#delete)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor.py#L665)delete * **async **delete**(): None - Delete the Actor. *** #### Returns None ### [**](#get)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor.py#L552)get * **async **get**(): dict | None - Retrieve the Actor. *** #### Returns dict | None ### [**](#last_run)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor.py#L908)last\_run * ****last\_run**(\*, status, origin): [RunClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md) - 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: ActorJobStatus | None = None Consider only runs with this status. * ##### optionalkeyword-onlyorigin: MetaOrigin | None = None Consider only runs started with this origin. #### Returns [RunClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md) ### [**](#runs)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor.py#L870)runs * ****runs**(): [RunCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunCollectionClientAsync.md) - Retrieve a client for the runs of this Actor. *** #### Returns [RunCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunCollectionClientAsync.md) ### [**](#start)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor.py#L672)start * **async **start**(\*, run\_input, content\_type, build, max\_items, max\_total\_charge\_usd, restart\_on\_error, memory\_mbytes, timeout\_secs, force\_permission\_level, wait\_for\_finish, webhooks): dict - Start the Actor and immediately return the Run object. *** #### Parameters * ##### optionalkeyword-onlyrun\_input: Any = None The input to pass to the Actor run. * ##### optionalkeyword-onlycontent\_type: str | None = None The content type of the input. * ##### optionalkeyword-onlybuild: str | None = 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-onlymax\_items: int | None = None Maximum number of results that will be returned by this run. If the Actor is charged per result, you will not be charged for more results than the given limit. * ##### optionalkeyword-onlymax\_total\_charge\_usd: Decimal | None = None A limit on the total charged amount for pay-per-event actors. * ##### 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-onlymemory\_mbytes: int | None = 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: int | None = None Optional timeout for the run, in seconds. By default, the run uses timeout specified in the default run configuration for the Actor. * ##### optionalkeyword-onlyforce\_permission\_level: ActorPermissionLevel | None = None Override the Actor's permissions for this run. If not set, the Actor will run with permissions configured in the Actor settings. * ##### optionalkeyword-onlywait\_for\_finish: int | None = None The maximum number of seconds the server waits for the run to finish. By default, it is 0, the maximum value is 60. * ##### optionalkeyword-onlywebhooks: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[dict] | None = None Optional 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 template for the request payload. #### Returns dict ### [**](#update)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor.py#L562)update * **async **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\_max\_items, default\_run\_memory\_mbytes, default\_run\_timeout\_secs, example\_run\_input\_body, example\_run\_input\_content\_type, actor\_standby\_is\_enabled, actor\_standby\_desired\_requests\_per\_actor\_run, actor\_standby\_max\_requests\_per\_actor\_run, actor\_standby\_idle\_timeout\_secs, actor\_standby\_build, actor\_standby\_memory\_mbytes, pricing\_infos, actor\_permission\_level, tagged\_builds): dict - Update the Actor with the specified fields. *** #### Parameters * ##### optionalkeyword-onlyname: str | None = None 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/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[dict] | 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-onlyis\_anonymously\_runnable: bool | None = None Whether the Actor is anonymously runnable. * ##### optionalkeyword-onlycategories: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.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\_secs: int | None = None Default timeout for the runs of this Actor in seconds. * ##### optionalkeyword-onlyexample\_run\_input\_body: Any = None Input to be prefilled as default input to new users of this Actor. * ##### optionalkeyword-onlyexample\_run\_input\_content\_type: str | None = None The content type of the example run input. * ##### optionalkeyword-onlyactor\_standby\_is\_enabled: bool | None = None Whether the Actor Standby is enabled. * ##### 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\_secs: int | 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. * ##### optionalkeyword-onlypricing\_infos: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[dict] | None = None A list of objects that describes the pricing of the Actor. * ##### optionalkeyword-onlyactor\_permission\_level: ActorPermissionLevel | None = None The permission level of the Actor on Apify platform. * ##### optionalkeyword-onlytagged\_builds: dict\[str, None | dict\[str, str]] | None = None A dictionary mapping build tag names to their settings. Use it to create, update, or remove build tags. To assign a tag, provide a dict with 'buildId' key. To remove a tag, set its value to None. Example: {'latest': {'buildId': 'abc'}, 'beta': None}. #### Returns dict ### [**](#validate_input)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor.py#L955)validate\_input * **async **validate\_input**(run\_input, \*, build\_tag, content\_type): bool - Validate an input for the Actor that defines an input schema. *** #### Parameters * ##### optionalrun\_input: Any = None The input to validate. * ##### optionalkeyword-onlybuild\_tag: str | None = None The actor's build tag. * ##### optionalkeyword-onlycontent\_type: str | None = None The content type of the input. #### Returns bool ### [**](#version)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor.py#L940)version * ****version**(version\_number): [ActorVersionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionClientAsync.md) - 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 [ActorVersionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionClientAsync.md) ### [**](#versions)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor.py#L936)versions * ****versions**(): [ActorVersionCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionCollectionClientAsync.md) - Retrieve a client for the versions of this Actor. *** #### Returns [ActorVersionCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionCollectionClientAsync.md) ### [**](#webhooks)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor.py#L951)webhooks * ****webhooks**(): [WebhookCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookCollectionClientAsync.md) - Retrieve a client for webhooks associated with this Actor. *** #### Returns [WebhookCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookCollectionClientAsync.md) ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/python/reference/class/ActorCollectionClient.md # Source: https://docs.apify.com/api/client/js/reference/class/ActorCollectionClient.md # 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[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**create](#create) * [**list](#list) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceCollectionClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceCollectionClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceCollectionClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceCollectionClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceCollectionClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceCollectionClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceCollectionClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceCollectionClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceCollectionClient.url ## Methods[**](#Methods) ### [**](#create)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L85)create * ****create**(actor): Promise<[Actor](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Actor.md)> - Creates a new Actor. * **@see** *** #### Parameters * ##### actor: [ActorCollectionCreateOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorCollectionCreateOptions.md) The Actor data. #### Returns Promise<[Actor](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Actor.md)> The created Actor object. ### [**](#list)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L63)list * ****list**(options): PaginatedIterator<[ActorCollectionListItem](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorCollectionListItem.md)> - 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 * ##### options: [ActorCollectionListOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorCollectionListOptions.md) = {} Pagination options. #### Returns PaginatedIterator<[ActorCollectionListItem](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorCollectionListItem.md)> A paginated iterator of Actors. --- # Source: https://docs.apify.com/api/client/python/reference/class/ActorCollectionClientAsync.md # ActorCollectionClientAsync Async sub-client for manipulating Actors. ### Hierarchy * [ResourceCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md) * *ActorCollectionClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorCollectionClientAsync.md#__init__) * [**create](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorCollectionClientAsync.md#create) * [**list](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorCollectionClientAsync.md#list) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorCollectionClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorCollectionClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorCollectionClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorCollectionClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorCollectionClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor_collection.py#L141)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceCollectionClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#create)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor_collection.py#L170)create * **async **create**(\*, name, title, description, seo\_title, seo\_description, versions, restart\_on\_error, is\_public, is\_deprecated, is\_anonymously\_runnable, categories, default\_run\_build, default\_run\_max\_items, default\_run\_memory\_mbytes, default\_run\_timeout\_secs, example\_run\_input\_body, example\_run\_input\_content\_type, actor\_standby\_is\_enabled, actor\_standby\_desired\_requests\_per\_actor\_run, actor\_standby\_max\_requests\_per\_actor\_run, actor\_standby\_idle\_timeout\_secs, actor\_standby\_build, actor\_standby\_memory\_mbytes): dict - Create a new 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/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[dict] | 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-onlyis\_anonymously\_runnable: bool | None = None Whether the Actor is anonymously runnable. * ##### optionalkeyword-onlycategories: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.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\_secs: int | None = None Default timeout for the runs of this Actor in seconds. * ##### optionalkeyword-onlyexample\_run\_input\_body: Any = None Input to be prefilled as default input to new users of this Actor. * ##### optionalkeyword-onlyexample\_run\_input\_content\_type: str | None = None The content type of the example run input. * ##### optionalkeyword-onlyactor\_standby\_is\_enabled: bool | None = None Whether the Actor Standby is enabled. * ##### 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\_secs: int | 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 dict ### [**](#list)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor_collection.py#L145)list * **async **list**(\*, my, limit, offset, desc, sort\_by): [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] - List the Actors the user has created or used. *** #### 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. #### Returns [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorCollectionCreateOptions.md # ActorCollectionCreateOptions ## Index[**](#Index) ### Properties * [**actorStandby](#actorStandby) * [**categories](#categories) * [**defaultRunOptions](#defaultRunOptions) * [**description](#description) * [**exampleRunInput](#exampleRunInput) * [**isDeprecated](#isDeprecated) * [**isPublic](#isPublic) * [**name](#name) * [**restartOnError](#restartOnError) * [**seoDescription](#seoDescription) * [**seoTitle](#seoTitle) * [**title](#title) * [**versions](#versions) ## Properties[**](#Properties) ### [**](#actorStandby)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L127)optionalactorStandby **actorStandby? : [ActorStandby](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorStandby.md) & { isEnabled: boolean } ### [**](#categories)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L114)optionalcategories **categories? : string\[] ### [**](#defaultRunOptions)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L115)optionaldefaultRunOptions **defaultRunOptions? : [ActorDefaultRunOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorDefaultRunOptions.md) ### [**](#description)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L116)optionaldescription **description? : string ### [**](#exampleRunInput)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L117)optionalexampleRunInput **exampleRunInput? : [ActorExampleRunInput](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorExampleRunInput.md) ### [**](#isDeprecated)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L118)optionalisDeprecated **isDeprecated? : boolean ### [**](#isPublic)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L119)optionalisPublic **isPublic? : boolean ### [**](#name)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L120)optionalname **name? : string ### [**](#restartOnError)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L122)optionalrestartOnError **restartOnError? : boolean * **@deprecated** Use defaultRunOptions.restartOnError instead ### [**](#seoDescription)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L124)optionalseoDescription **seoDescription? : string ### [**](#seoTitle)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L123)optionalseoTitle **seoTitle? : string ### [**](#title)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L125)optionaltitle **title? : string ### [**](#versions)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L126)optionalversions **versions? : [ActorVersion](https://docs.apify.com/api/client/js/api/client/js/reference.md#ActorVersion)\[] --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorCollectionListItem.md # ActorCollectionListItem ## Index[**](#Index) ### Properties * [**createdAt](#createdAt) * [**id](#id) * [**modifiedAt](#modifiedAt) * [**name](#name) * [**username](#username) ## Properties[**](#Properties) ### [**](#createdAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L105)createdAt **createdAt: Date ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L104)id **id: string ### [**](#modifiedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L106)modifiedAt **modifiedAt: Date ### [**](#name)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L107)name **name: string ### [**](#username)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L108)username **username: string --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorCollectionListOptions.md # ActorCollectionListOptions ### Hierarchy * PaginationOptions * *ActorCollectionListOptions* ## Index[**](#Index) ### Properties * [**chunkSize](#chunkSize) * [**desc](#desc) * [**limit](#limit) * [**my](#my) * [**offset](#offset) * [**sortBy](#sortBy) ## Properties[**](#Properties) ### [**](#chunkSize)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L258)optionalinheritedchunkSize **chunkSize? : number Inherited from PaginationOptions.chunkSize Maximum number of items returned in one API response. Relevant in the context of asyncIterator, the iterator will fetch results in chunks of this size from API and yield them one by one. It will stop fetching once the limit is reached or once all items from API have been fetched. Chunk size is usually limited by API. Minimum of those two limits will be used. ### [**](#desc)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L99)optionaldesc **desc? : boolean ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L251)optionalinheritedlimit **limit? : number Inherited from PaginationOptions.limit Maximum number of entries requested. ### [**](#my)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L98)optionalmy **my? : boolean ### [**](#offset)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L249)optionalinheritedoffset **offset? : number Inherited from PaginationOptions.offset Position of the first returned entry. ### [**](#sortBy)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L100)optionalsortBy **sortBy? : [ActorListSortBy](https://docs.apify.com/api/client/js/api/client/js/reference/enum/ActorListSortBy.md) --- # Source: https://docs.apify.com/sdk/python/reference/class/ActorDatasetPushPipeline.md # ActorDatasetPushPipeline A Scrapy pipeline for pushing items to an Actor's default dataset. This pipeline is designed to be enabled only when the Scrapy project is run as an Actor. ## Index[**](#Index) ### Methods * [**process\_item](https://docs.apify.com/sdk/python/sdk/python/reference/class/ActorDatasetPushPipeline.md#process_item) ## Methods[**](#Methods) ### [**](#process_item)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/scrapy/pipelines/actor_dataset_push.py#L22)process\_item * **async **process\_item**(item, spider): Item - Pushes the provided Scrapy item to the Actor's default dataset. *** #### Parameters * ##### item: Item * ##### spider: Spider #### Returns Item --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorDefaultRunOptions.md # ActorDefaultRunOptions Default configuration options for Actor runs. ## Index[**](#Index) ### Properties * [**build](#build) * [**memoryMbytes](#memoryMbytes) * [**restartOnError](#restartOnError) * [**timeoutSecs](#timeoutSecs) ## Properties[**](#Properties) ### [**](#build)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L522)build **build: string ### [**](#memoryMbytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L524)memoryMbytes **memoryMbytes: number ### [**](#restartOnError)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L525)optionalrestartOnError **restartOnError? : boolean ### [**](#timeoutSecs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L523)timeoutSecs **timeoutSecs: number --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorDefinition.md # ActorDefinition Actor definition from the `.actor/actor.json` file. Contains the Actor's configuration, input schema, and other metadata. ## Index[**](#Index) ### Properties * [**actorSpecification](#actorSpecification) * [**buildTag](#buildTag) * [**changelog](#changelog) * [**dockerContextDir](#dockerContextDir) * [**dockerfile](#dockerfile) * [**environmentVariables](#environmentVariables) * [**input](#input) * [**maxMemoryMbytes](#maxMemoryMbytes) * [**minMemoryMbytes](#minMemoryMbytes) * [**name](#name) * [**readme](#readme) * [**storages](#storages) * [**usesStandbyMode](#usesStandbyMode) * [**version](#version) ## Properties[**](#Properties) ### [**](#actorSpecification)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L826)actorSpecification **actorSpecification: number ### [**](#buildTag)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L829)optionalbuildTag **buildTag? : string ### [**](#changelog)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L835)optionalchangelog **changelog? : null | string ### [**](#dockerContextDir)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L832)optionaldockerContextDir **dockerContextDir? : string ### [**](#dockerfile)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L831)optionaldockerfile **dockerfile? : string ### [**](#environmentVariables)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L830)optionalenvironmentVariables **environmentVariables? : Record\ ### [**](#input)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L834)optionalinput **input? : null | object ### [**](#maxMemoryMbytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L840)optionalmaxMemoryMbytes **maxMemoryMbytes? : number ### [**](#minMemoryMbytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L839)optionalminMemoryMbytes **minMemoryMbytes? : number ### [**](#name)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L827)name **name: string ### [**](#readme)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L833)optionalreadme **readme? : null | string ### [**](#storages)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L836)optionalstorages **storages? : { dataset? : object } #### Type declaration * ##### optionaldataset?: object ### [**](#usesStandbyMode)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L841)optionalusesStandbyMode **usesStandbyMode? : boolean ### [**](#version)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L828)version **version: string --- # Source: https://docs.apify.com/api/client/python/reference/class/ActorEnvVarClient.md # Source: https://docs.apify.com/api/client/js/reference/class/ActorEnvVarClient.md # ActorEnvVarClient Client for managing a specific Actor environment variable. Environment variables are key-value pairs that are available to the Actor during execution. This client provides methods to get, update, and delete environment variables. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const actorClient = client.actor('my-actor-id'); const versionClient = actorClient.version('0.1'); // Get an environment variable const envVarClient = versionClient.envVar('MY_VAR'); const envVar = await envVarClient.get(); // Update environment variable await envVarClient.update({ value: 'new-value' }); ``` * **@see** ### Hierarchy * ResourceClient * *ActorEnvVarClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**delete](#delete) * [**get](#get) * [**update](#update) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceClient.url ## Methods[**](#Methods) ### [**](#delete)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_env_var.ts#L67)delete * ****delete**(): Promise\ - Deletes the environment variable. * **@see** *** #### Returns Promise\ ### [**](#get)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_env_var.ts#L46)get * ****get**(): Promise\ - Retrieves the environment variable. * **@see** *** #### Returns Promise\ The environment variable object, or `undefined` if it does not exist. ### [**](#update)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_env_var.ts#L57)update * ****update**(actorEnvVar): Promise<[ActorEnvironmentVariable](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorEnvironmentVariable.md)> - Updates the environment variable. * **@see** *** #### Parameters * ##### actorEnvVar: [ActorEnvironmentVariable](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorEnvironmentVariable.md) The updated environment variable data. #### Returns Promise<[ActorEnvironmentVariable](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorEnvironmentVariable.md)> The updated environment variable object. --- # Source: https://docs.apify.com/api/client/python/reference/class/ActorEnvVarClientAsync.md # ActorEnvVarClientAsync Async sub-client for manipulating a single Actor environment variable. ### Hierarchy * [ResourceClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md) * *ActorEnvVarClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarClientAsync.md#__init__) * [**delete](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarClientAsync.md#delete) * [**get](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarClientAsync.md#get) * [**update](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarClientAsync.md#update) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor_env_var.py#L78)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#delete)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor_env_var.py#L119)delete * **async **delete**(): None - Delete the Actor environment variable. *** #### Returns None ### [**](#get)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor_env_var.py#L82)get * **async **get**(): dict | None - Return information about the Actor environment variable. *** #### Returns dict | None ### [**](#update)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor_env_var.py#L92)update * **async **update**(\*, is\_secret, name, value): dict - Update the Actor environment variable with specified fields. *** #### Parameters * ##### optionalkeyword-onlyis\_secret: bool | None = None Whether the environment variable is secret or not. * ##### keyword-onlyname: str The name of the environment variable. * ##### keyword-onlyvalue: str The value of the environment variable. #### Returns dict ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/python/reference/class/ActorEnvVarCollectionClient.md # Source: https://docs.apify.com/api/client/js/reference/class/ActorEnvVarCollectionClient.md # ActorEnvVarCollectionClient Client for managing the collection of environment variables for an Actor version. Environment variables are key-value pairs that are available to the Actor during execution. This client provides methods to list and create environment variables. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const actorClient = client.actor('my-actor-id'); const versionClient = actorClient.version('0.1'); // List all environment variables const envVarsClient = versionClient.envVars(); const { items } = await envVarsClient.list(); // Create a new environment variable const newEnvVar = await envVarsClient.create({ name: 'MY_VAR', value: 'my-value', isSecret: false }); ``` * **@see** ### Hierarchy * ResourceCollectionClient * *ActorEnvVarCollectionClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**create](#create) * [**list](#list) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceCollectionClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceCollectionClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceCollectionClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceCollectionClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceCollectionClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceCollectionClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceCollectionClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceCollectionClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceCollectionClient.url ## Methods[**](#Methods) ### [**](#create)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_env_var_collection.ts#L77)create * ****create**(actorEnvVar): Promise<[ActorEnvironmentVariable](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorEnvironmentVariable.md)> - Creates a new environment variable for this Actor version. * **@see** *** #### Parameters * ##### actorEnvVar: [ActorEnvironmentVariable](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorEnvironmentVariable.md) The environment variable data. #### Returns Promise<[ActorEnvironmentVariable](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorEnvironmentVariable.md)> The created environment variable object. ### [**](#list)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_env_var_collection.ts#L64)list * ****list**(\_options): Promise<[ActorEnvVarListResult](https://docs.apify.com/api/client/js/api/client/js/reference.md#ActorEnvVarListResult)> & AsyncIterable<[ActorEnvironmentVariable](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorEnvironmentVariable.md), any, any> - Lists all environment variables of this Actor version. 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(); ``` Asynchronous iteration is also supported. This will fetch additional pages if needed until all items are retrieved. ``` for await (const singleItem of client.list()) {...} ``` * **@see** *** #### Parameters * ##### \_options: [ActorEnvVarCollectionListOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorEnvVarCollectionListOptions.md) = {} #### Returns Promise<[ActorEnvVarListResult](https://docs.apify.com/api/client/js/api/client/js/reference.md#ActorEnvVarListResult)> & AsyncIterable<[ActorEnvironmentVariable](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorEnvironmentVariable.md), any, any> A paginated iterator of environment variables. --- # Source: https://docs.apify.com/api/client/python/reference/class/ActorEnvVarCollectionClientAsync.md # ActorEnvVarCollectionClientAsync Async sub-client for manipulating actor env vars. ### Hierarchy * [ResourceCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md) * *ActorEnvVarCollectionClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarCollectionClientAsync.md#__init__) * [**create](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarCollectionClientAsync.md#create) * [**list](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarCollectionClientAsync.md#list) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarCollectionClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarCollectionClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarCollectionClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarCollectionClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarCollectionClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor_env_var_collection.py#L61)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceCollectionClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#create)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor_env_var_collection.py#L75)create * **async **create**(\*, is\_secret, name, value): dict - Create a new actor environment variable. *** #### Parameters * ##### optionalkeyword-onlyis\_secret: bool | None = None Whether the environment variable is secret or not. * ##### keyword-onlyname: str The name of the environment variable. * ##### keyword-onlyvalue: str The value of the environment variable. #### Returns dict ### [**](#list)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor_env_var_collection.py#L65)list * **async **list**(): [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] - List the available actor environment variables. *** #### Returns [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorEnvVarCollectionListOptions.md # ActorEnvVarCollectionListOptions * **@deprecated** No options are used in the current API implementation. ### Hierarchy * PaginationOptions * *ActorEnvVarCollectionListOptions* ## Index[**](#Index) ### Properties * [**chunkSize](#chunkSize) * [**desc](#desc) * [**limit](#limit) * [**offset](#offset) ## Properties[**](#Properties) ### [**](#chunkSize)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L258)optionalinheritedchunkSize **chunkSize? : number Inherited from PaginationOptions.chunkSize Maximum number of items returned in one API response. Relevant in the context of asyncIterator, the iterator will fetch results in chunks of this size from API and yield them one by one. It will stop fetching once the limit is reached or once all items from API have been fetched. Chunk size is usually limited by API. Minimum of those two limits will be used. ### [**](#desc)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_env_var_collection.ts#L88)optionaldesc **desc? : boolean ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L251)optionalinheritedlimit **limit? : number Inherited from PaginationOptions.limit Maximum number of entries requested. ### [**](#offset)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L249)optionalinheritedoffset **offset? : number Inherited from PaginationOptions.offset Position of the first returned entry. --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorEnvironmentVariable.md # ActorEnvironmentVariable ## Index[**](#Index) ### Properties * [**isSecret](#isSecret) * [**name](#name) * [**value](#value) ## Properties[**](#Properties) ### [**](#isSecret)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L139)optionalisSecret **isSecret? : boolean ### [**](#name)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L137)optionalname **name? : string ### [**](#value)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L138)optionalvalue **value? : string --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorExampleRunInput.md # ActorExampleRunInput Example input data to demonstrate Actor usage. ## Index[**](#Index) ### Properties * [**body](#body) * [**contentType](#contentType) ## Properties[**](#Properties) ### [**](#body)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L532)body **body: string ### [**](#contentType)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L533)contentType **contentType: string --- # Source: https://docs.apify.com/api/client/python/reference/class/ActorJobBaseClient.md # ActorJobBaseClient Base sub-client class for Actor runs and Actor builds. ### Hierarchy * [ResourceClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClient.md) * *ActorJobBaseClient* * [BuildClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildClient.md) * [RunClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClient.md) ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorJobBaseClient.md#__init__) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorJobBaseClient.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorJobBaseClient.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorJobBaseClient.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorJobBaseClient.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorJobBaseClient.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L56)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ActorJobBaseClient.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorJobBaseClient.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) The ApifyClient instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) The HTTPClient instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L53)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClient.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L54)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClient.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/python/reference/class/ActorJobBaseClientAsync.md # ActorJobBaseClientAsync Base async sub-client class for Actor runs and Actor builds. ### Hierarchy * [ResourceClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md) * *ActorJobBaseClientAsync* * [BuildClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildClientAsync.md) * [RunClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md) ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorJobBaseClientAsync.md#__init__) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorJobBaseClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorJobBaseClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorJobBaseClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorJobBaseClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorJobBaseClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L97)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ActorJobBaseClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorJobBaseClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorLastRunOptions.md # ActorLastRunOptions Options for filtering the last run of an Actor. ## Index[**](#Index) ### Properties * [**status](#status) ## Properties[**](#Properties) ### [**](#status)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L817)optionalstatus **status? : READY | RUNNING | SUCCEEDED | FAILED | TIMING\_OUT | TIMED\_OUT | ABORTING | ABORTED --- # Source: https://docs.apify.com/api/client/js/reference/enum/ActorListSortBy.md # ActorListSortBy ## Index[**](#Index) ### Enumeration Members * [**CREATED\_AT](#CREATED_AT) * [**LAST\_RUN\_STARTED\_AT](#LAST_RUN_STARTED_AT) ## Enumeration Members[**](<#Enumeration Members>) ### [**](#CREATED_AT)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L93)CREATED\_AT **CREATED\_AT: createdAt ### [**](#LAST_RUN_STARTED_AT)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_collection.ts#L94)LAST\_RUN\_STARTED\_AT **LAST\_RUN\_STARTED\_AT: stats.lastRunStartedAt --- # Source: https://docs.apify.com/sdk/python/reference/class/ActorLogFormatter.md # ActorLogFormatter --- # Source: https://docs.apify.com/sdk/python/reference/class/ActorPricingInfo.md # Source: https://docs.apify.com/sdk/js/reference/interface/ActorPricingInfo.md # ActorPricingInfo ## Index[**](#Index) ### Properties * [**isPayPerEvent](#isPayPerEvent) * [**maxTotalChargeUsd](#maxTotalChargeUsd) * [**perEventPrices](#perEventPrices) * [**pricingModel](#pricingModel) ## Properties[**](#Properties) ### [**](#isPayPerEvent)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/charging.ts#L306)isPayPerEvent **isPayPerEvent: boolean ### [**](#maxTotalChargeUsd)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/charging.ts#L305)maxTotalChargeUsd **maxTotalChargeUsd: number ### [**](#perEventPrices)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/charging.ts#L307)perEventPrices **perEventPrices: Record\ ### [**](#pricingModel)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/charging.ts#L304)optionalpricingModel **pricingModel? : PAY\_PER\_EVENT | PRICE\_PER\_DATASET\_ITEM | FLAT\_PRICE\_PER\_MONTH | FREE --- # Source: https://docs.apify.com/sdk/python/reference/class/ActorRun.md # Source: https://docs.apify.com/sdk/js/reference/interface/ActorRun.md # Source: https://docs.apify.com/api/client/js/reference/interface/ActorRun.md # ActorRun Complete Actor run information including statistics and usage details. Represents a single execution of an Actor with all its configuration, status, and resource usage information. ### Hierarchy * [ActorRunListItem](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRunListItem.md) * *ActorRun* ## Index[**](#Index) ### Properties * [**actId](#actId) * [**actorTaskId](#actorTaskId) * [**buildId](#buildId) * [**buildNumber](#buildNumber) * [**chargedEventCounts](#chargedEventCounts) * [**containerUrl](#containerUrl) * [**defaultDatasetId](#defaultDatasetId) * [**defaultKeyValueStoreId](#defaultKeyValueStoreId) * [**defaultRequestQueueId](#defaultRequestQueueId) * [**exitCode](#exitCode) * [**finishedAt](#finishedAt) * [**generalAccess](#generalAccess) * [**gitBranchName](#gitBranchName) * [**id](#id) * [**isContainerServerReady](#isContainerServerReady) * [**meta](#meta) * [**options](#options) * [**pricingInfo](#pricingInfo) * [**startedAt](#startedAt) * [**stats](#stats) * [**status](#status) * [**statusMessage](#statusMessage) * [**usage](#usage) * [**usageTotalUsd](#usageTotalUsd) * [**usageUsd](#usageUsd) * [**userId](#userId) ## Properties[**](#Properties) ### [**](#actId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L688)inheritedactId **actId: string Inherited from ActorRunListItem.actId ### [**](#actorTaskId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L689)optionalinheritedactorTaskId **actorTaskId? : string Inherited from ActorRunListItem.actorTaskId ### [**](#buildId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L694)inheritedbuildId **buildId: string Inherited from ActorRunListItem.buildId ### [**](#buildNumber)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L695)inheritedbuildNumber **buildNumber: string Inherited from ActorRunListItem.buildNumber ### [**](#chargedEventCounts)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L720)optionalchargedEventCounts **chargedEventCounts? : Record\ ### [**](#containerUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L714)containerUrl **containerUrl: string ### [**](#defaultDatasetId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L697)inheriteddefaultDatasetId **defaultDatasetId: string Inherited from ActorRunListItem.defaultDatasetId ### [**](#defaultKeyValueStoreId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L696)inheriteddefaultKeyValueStoreId **defaultKeyValueStoreId: string Inherited from ActorRunListItem.defaultKeyValueStoreId ### [**](#defaultRequestQueueId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L698)inheriteddefaultRequestQueueId **defaultRequestQueueId: string Inherited from ActorRunListItem.defaultRequestQueueId ### [**](#exitCode)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L713)optionalexitCode **exitCode? : number ### [**](#finishedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L691)inheritedfinishedAt **finishedAt: Date Inherited from ActorRunListItem.finishedAt ### [**](#generalAccess)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L721)optionalgeneralAccess **generalAccess? : null | RUN\_GENERAL\_ACCESS ### [**](#gitBranchName)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L716)optionalgitBranchName **gitBranchName? : string ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L687)inheritedid **id: string Inherited from ActorRunListItem.id ### [**](#isContainerServerReady)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L715)optionalisContainerServerReady **isContainerServerReady? : boolean ### [**](#meta)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L693)inheritedmeta **meta: [ActorRunMeta](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRunMeta.md) Inherited from ActorRunListItem.meta ### [**](#options)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L712)options **options: [ActorRunOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRunOptions.md) ### [**](#pricingInfo)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L719)optionalpricingInfo **pricingInfo? : [ActorRunPricingInfo](https://docs.apify.com/api/client/js/api/client/js/reference.md#ActorRunPricingInfo) ### [**](#startedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L690)inheritedstartedAt **startedAt: Date Inherited from ActorRunListItem.startedAt ### [**](#stats)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L711)stats **stats: [ActorRunStats](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRunStats.md) ### [**](#status)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L692)inheritedstatus **status: READY | RUNNING | SUCCEEDED | FAILED | ABORTING | ABORTED | TIMING-OUT | TIMED-OUT Inherited from ActorRunListItem.status ### [**](#statusMessage)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L710)optionalstatusMessage **statusMessage? : string ### [**](#usage)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L717)optionalusage **usage? : [ActorRunUsage](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRunUsage.md) ### [**](#usageTotalUsd)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L699)optionalinheritedusageTotalUsd **usageTotalUsd? : number Inherited from ActorRunListItem.usageTotalUsd ### [**](#usageUsd)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L718)optionalusageUsd **usageUsd? : [ActorRunUsage](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRunUsage.md) ### [**](#userId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L709)userId **userId: string --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorRunListItem.md # ActorRunListItem Simplified Actor run information used in list results. Contains basic information about a run without detailed statistics. ### Hierarchy * *ActorRunListItem* * [ActorRun](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRun.md) ## Index[**](#Index) ### Properties * [**actId](#actId) * [**actorTaskId](#actorTaskId) * [**buildId](#buildId) * [**buildNumber](#buildNumber) * [**defaultDatasetId](#defaultDatasetId) * [**defaultKeyValueStoreId](#defaultKeyValueStoreId) * [**defaultRequestQueueId](#defaultRequestQueueId) * [**finishedAt](#finishedAt) * [**id](#id) * [**meta](#meta) * [**startedAt](#startedAt) * [**status](#status) * [**usageTotalUsd](#usageTotalUsd) ## Properties[**](#Properties) ### [**](#actId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L688)actId **actId: string ### [**](#actorTaskId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L689)optionalactorTaskId **actorTaskId? : string ### [**](#buildId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L694)buildId **buildId: string ### [**](#buildNumber)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L695)buildNumber **buildNumber: string ### [**](#defaultDatasetId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L697)defaultDatasetId **defaultDatasetId: string ### [**](#defaultKeyValueStoreId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L696)defaultKeyValueStoreId **defaultKeyValueStoreId: string ### [**](#defaultRequestQueueId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L698)defaultRequestQueueId **defaultRequestQueueId: string ### [**](#finishedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L691)finishedAt **finishedAt: Date ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L687)id **id: string ### [**](#meta)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L693)meta **meta: [ActorRunMeta](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRunMeta.md) ### [**](#startedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L690)startedAt **startedAt: Date ### [**](#status)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L692)status **status: READY | RUNNING | SUCCEEDED | FAILED | ABORTING | ABORTED | TIMING-OUT | TIMED-OUT ### [**](#usageTotalUsd)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L699)optionalusageTotalUsd **usageTotalUsd? : number --- # Source: https://docs.apify.com/sdk/python/reference/class/ActorRunMeta.md # Source: https://docs.apify.com/api/client/js/reference/interface/ActorRunMeta.md # ActorRunMeta Metadata about how an Actor run was initiated. ## Index[**](#Index) ### Properties * [**clientIp](#clientIp) * [**origin](#origin) * [**userAgent](#userAgent) ## Properties[**](#Properties) ### [**](#clientIp)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L761)optionalclientIp **clientIp? : string ### [**](#origin)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L760)origin **origin: string ### [**](#userAgent)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L762)userAgent **userAgent: string --- # Source: https://docs.apify.com/sdk/python/reference/class/ActorRunOptions.md # Source: https://docs.apify.com/api/client/js/reference/interface/ActorRunOptions.md # ActorRunOptions Configuration options used for an Actor run. These are the actual options that were applied to the run (may differ from requested options). ## Index[**](#Index) ### Properties * [**build](#build) * [**diskMbytes](#diskMbytes) * [**maxItems](#maxItems) * [**maxTotalChargeUsd](#maxTotalChargeUsd) * [**memoryMbytes](#memoryMbytes) * [**restartOnError](#restartOnError) * [**timeoutSecs](#timeoutSecs) ## Properties[**](#Properties) ### [**](#build)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L794)build **build: string ### [**](#diskMbytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L797)diskMbytes **diskMbytes: number ### [**](#maxItems)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L798)optionalmaxItems **maxItems? : number ### [**](#maxTotalChargeUsd)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L799)optionalmaxTotalChargeUsd **maxTotalChargeUsd? : number ### [**](#memoryMbytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L796)memoryMbytes **memoryMbytes: number ### [**](#restartOnError)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L800)optionalrestartOnError **restartOnError? : boolean ### [**](#timeoutSecs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L795)timeoutSecs **timeoutSecs: number --- # Source: https://docs.apify.com/sdk/python/reference/class/ActorRunStats.md # Source: https://docs.apify.com/api/client/js/reference/interface/ActorRunStats.md # ActorRunStats Runtime statistics for an Actor run. Provides detailed metrics about resource consumption and performance during the run. ## Index[**](#Index) ### Properties * [**computeUnits](#computeUnits) * [**cpuAvgUsage](#cpuAvgUsage) * [**cpuCurrentUsage](#cpuCurrentUsage) * [**cpuMaxUsage](#cpuMaxUsage) * [**durationMillis](#durationMillis) * [**inputBodyLen](#inputBodyLen) * [**memAvgBytes](#memAvgBytes) * [**memCurrentBytes](#memCurrentBytes) * [**memMaxBytes](#memMaxBytes) * [**metamorph](#metamorph) * [**netRxBytes](#netRxBytes) * [**netTxBytes](#netTxBytes) * [**restartCount](#restartCount) * [**resurrectCount](#resurrectCount) * [**runTimeSecs](#runTimeSecs) ## Properties[**](#Properties) ### [**](#computeUnits)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L785)computeUnits **computeUnits: number ### [**](#cpuAvgUsage)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L777)cpuAvgUsage **cpuAvgUsage: number ### [**](#cpuCurrentUsage)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L779)cpuCurrentUsage **cpuCurrentUsage: number ### [**](#cpuMaxUsage)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L778)cpuMaxUsage **cpuMaxUsage: number ### [**](#durationMillis)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L782)durationMillis **durationMillis: number ### [**](#inputBodyLen)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L771)inputBodyLen **inputBodyLen: number ### [**](#memAvgBytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L774)memAvgBytes **memAvgBytes: number ### [**](#memCurrentBytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L776)memCurrentBytes **memCurrentBytes: number ### [**](#memMaxBytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L775)memMaxBytes **memMaxBytes: number ### [**](#metamorph)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L784)metamorph **metamorph: number ### [**](#netRxBytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L780)netRxBytes **netRxBytes: number ### [**](#netTxBytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L781)netTxBytes **netTxBytes: number ### [**](#restartCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L772)restartCount **restartCount: number ### [**](#resurrectCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L773)resurrectCount **resurrectCount: number ### [**](#runTimeSecs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L783)runTimeSecs **runTimeSecs: number --- # Source: https://docs.apify.com/sdk/python/reference/class/ActorRunUsage.md # Source: https://docs.apify.com/api/client/js/reference/interface/ActorRunUsage.md # ActorRunUsage Resource usage metrics for an Actor run. All values represent the total consumption during the run's lifetime. ## Index[**](#Index) ### Properties * [**ACTOR\_COMPUTE\_UNITS](#ACTOR_COMPUTE_UNITS) * [**DATA\_TRANSFER\_EXTERNAL\_GBYTES](#DATA_TRANSFER_EXTERNAL_GBYTES) * [**DATA\_TRANSFER\_INTERNAL\_GBYTES](#DATA_TRANSFER_INTERNAL_GBYTES) * [**DATASET\_READS](#DATASET_READS) * [**DATASET\_WRITES](#DATASET_WRITES) * [**KEY\_VALUE\_STORE\_LISTS](#KEY_VALUE_STORE_LISTS) * [**KEY\_VALUE\_STORE\_READS](#KEY_VALUE_STORE_READS) * [**KEY\_VALUE\_STORE\_WRITES](#KEY_VALUE_STORE_WRITES) * [**PROXY\_RESIDENTIAL\_TRANSFER\_GBYTES](#PROXY_RESIDENTIAL_TRANSFER_GBYTES) * [**PROXY\_SERPS](#PROXY_SERPS) * [**REQUEST\_QUEUE\_READS](#REQUEST_QUEUE_READS) * [**REQUEST\_QUEUE\_WRITES](#REQUEST_QUEUE_WRITES) ## Properties[**](#Properties) ### [**](#ACTOR_COMPUTE_UNITS)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L731)optionalACTOR\_COMPUTE\_UNITS **ACTOR\_COMPUTE\_UNITS? : number Compute units consumed (combines CPU and memory usage over time) ### [**](#DATA_TRANSFER_EXTERNAL_GBYTES)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L749)optionalDATA\_TRANSFER\_EXTERNAL\_GBYTES **DATA\_TRANSFER\_EXTERNAL\_GBYTES? : number External data transfer to/from internet (in gigabytes) ### [**](#DATA_TRANSFER_INTERNAL_GBYTES)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L747)optionalDATA\_TRANSFER\_INTERNAL\_GBYTES **DATA\_TRANSFER\_INTERNAL\_GBYTES? : number Internal data transfer within Apify platform (in gigabytes) ### [**](#DATASET_READS)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L733)optionalDATASET\_READS **DATASET\_READS? : number Number of Dataset read operations ### [**](#DATASET_WRITES)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L735)optionalDATASET\_WRITES **DATASET\_WRITES? : number Number of Dataset write operations ### [**](#KEY_VALUE_STORE_LISTS)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L741)optionalKEY\_VALUE\_STORE\_LISTS **KEY\_VALUE\_STORE\_LISTS? : number Number of key-value store list operations ### [**](#KEY_VALUE_STORE_READS)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L737)optionalKEY\_VALUE\_STORE\_READS **KEY\_VALUE\_STORE\_READS? : number Number of key-value store read operations ### [**](#KEY_VALUE_STORE_WRITES)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L739)optionalKEY\_VALUE\_STORE\_WRITES **KEY\_VALUE\_STORE\_WRITES? : number Number of key-value store write operations ### [**](#PROXY_RESIDENTIAL_TRANSFER_GBYTES)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L751)optionalPROXY\_RESIDENTIAL\_TRANSFER\_GBYTES **PROXY\_RESIDENTIAL\_TRANSFER\_GBYTES? : number Residential proxy data transfer (in gigabytes) ### [**](#PROXY_SERPS)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L753)optionalPROXY\_SERPS **PROXY\_SERPS? : number Number of SERP (Search Engine Results Page) proxy requests ### [**](#REQUEST_QUEUE_READS)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L743)optionalREQUEST\_QUEUE\_READS **REQUEST\_QUEUE\_READS? : number Number of Request queue read operations ### [**](#REQUEST_QUEUE_WRITES)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L745)optionalREQUEST\_QUEUE\_WRITES **REQUEST\_QUEUE\_WRITES? : number Number of Request queue write operations --- # Source: https://docs.apify.com/api/client/js/reference/enum/ActorSourceType.md # ActorSourceType ## Index[**](#Index) ### Enumeration Members * [**GitHubGist](#GitHubGist) * [**GitRepo](#GitRepo) * [**SourceFiles](#SourceFiles) * [**Tarball](#Tarball) ## Enumeration Members[**](<#Enumeration Members>) ### [**](#GitHubGist)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L133)GitHubGist **GitHubGist: GITHUB\_GIST ### [**](#GitRepo)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L131)GitRepo **GitRepo: GIT\_REPO ### [**](#SourceFiles)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L130)SourceFiles **SourceFiles: SOURCE\_FILES ### [**](#Tarball)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L132)Tarball **Tarball: TARBALL --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorStandby.md # ActorStandby Configuration for Actor standby mode. Standby mode keeps Actor containers warm and ready to process requests with minimal latency. This is useful for Actors that need to respond quickly to incoming requests. ## Index[**](#Index) ### Properties * [**build](#build) * [**desiredRequestsPerActorRun](#desiredRequestsPerActorRun) * [**disableStandbyFieldsOverride](#disableStandbyFieldsOverride) * [**idleTimeoutSecs](#idleTimeoutSecs) * [**maxRequestsPerActorRun](#maxRequestsPerActorRun) * [**memoryMbytes](#memoryMbytes) * [**shouldPassActorInput](#shouldPassActorInput) ## Properties[**](#Properties) ### [**](#build)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L580)optionalbuild **build? : string ### [**](#desiredRequestsPerActorRun)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L581)optionaldesiredRequestsPerActorRun **desiredRequestsPerActorRun? : number ### [**](#disableStandbyFieldsOverride)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L582)optionaldisableStandbyFieldsOverride **disableStandbyFieldsOverride? : boolean ### [**](#idleTimeoutSecs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L583)optionalidleTimeoutSecs **idleTimeoutSecs? : number ### [**](#maxRequestsPerActorRun)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L584)optionalmaxRequestsPerActorRun **maxRequestsPerActorRun? : number ### [**](#memoryMbytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L585)optionalmemoryMbytes **memoryMbytes? : number ### [**](#shouldPassActorInput)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L586)optionalshouldPassActorInput **shouldPassActorInput? : boolean --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorStartOptions.md # ActorStartOptions ## Index[**](#Index) ### Properties * [**build](#build) * [**contentType](#contentType) * [**forcePermissionLevel](#forcePermissionLevel) * [**maxItems](#maxItems) * [**maxTotalChargeUsd](#maxTotalChargeUsd) * [**memory](#memory) * [**restartOnError](#restartOnError) * [**timeout](#timeout) * [**waitForFinish](#waitForFinish) * [**webhooks](#webhooks) ## Properties[**](#Properties) ### [**](#build)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L594)optionalbuild **build? : string Tag or number of the Actor build to run (e.g. `beta` or `1.2.345`). If not provided, the run uses build tag or number from the default Actor run configuration (typically `latest`). ### [**](#contentType)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L602)optionalcontentType **contentType? : string Content type for the `input`. If not specified, `input` is expected to be an object that will be stringified to JSON and content type set to `application/json; charset=utf-8`. If `options.contentType` is specified, then `input` must be a `String` or `Buffer`. ### [**](#forcePermissionLevel)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L660)optionalforcePermissionLevel **forcePermissionLevel? : ACTOR\_PERMISSION\_LEVEL Override the Actor's permissions for this run. If not set, the Actor will run with permissions configured in the Actor settings. ### [**](#maxItems)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L639)optionalmaxItems **maxItems? : number Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the Actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. ### [**](#maxTotalChargeUsd)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L647)optionalmaxTotalChargeUsd **maxTotalChargeUsd? : number Specifies the maximum cost of the Actor run. This parameter is used only for pay-per-event Actors. It allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. ### [**](#memory)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L608)optionalmemory **memory? : number Memory in megabytes which will be allocated for the new Actor run. If not provided, the run uses memory of the default Actor run configuration. ### [**](#restartOnError)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L652)optionalrestartOnError **restartOnError? : boolean Determines whether the run will be restarted if it fails. ### [**](#timeout)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L613)optionaltimeout **timeout? : number Timeout for the Actor run in seconds. Zero value means there is no timeout. If not provided, the run uses timeout of the default Actor run configuration. ### [**](#waitForFinish)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L623)optionalwaitForFinish **waitForFinish? : number Maximum time to wait for the Actor run to finish, in seconds. If the limit is reached, the returned promise is resolved to a run object that will have status `READY` or `RUNNING` and it will not contain the Actor run output. By default (or when `waitForFinish` is set to `0`), the function resolves immediately without waiting. The wait is limited to 60s and happens on the API directly, as opposed to the `call` method and its `waitSecs` option, which is implemented via polling on the client side instead (and has no limit like that). ### [**](#webhooks)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L630)optionalwebhooks **webhooks? : readonly [WebhookUpdateData](https://docs.apify.com/api/client/js/api/client/js/reference.md#WebhookUpdateData)\[] Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed, see [ad hook webhooks documentation](https://docs.apify.com/webhooks/ad-hoc-webhooks) for detailed description. --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorStats.md # ActorStats Statistics about Actor usage and activity. ## Index[**](#Index) ### Properties * [**lastRunStartedAt](#lastRunStartedAt) * [**totalBuilds](#totalBuilds) * [**totalMetamorphs](#totalMetamorphs) * [**totalRuns](#totalRuns) * [**totalUsers](#totalUsers) * [**totalUsers30Days](#totalUsers30Days) * [**totalUsers7Days](#totalUsers7Days) * [**totalUsers90Days](#totalUsers90Days) ## Properties[**](#Properties) ### [**](#lastRunStartedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L515)lastRunStartedAt **lastRunStartedAt: Date Timestamp when the last run was started ### [**](#totalBuilds)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L501)totalBuilds **totalBuilds: number Total number of builds created for this Actor ### [**](#totalMetamorphs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L513)totalMetamorphs **totalMetamorphs: number Total number of times this Actor was used via metamorph ### [**](#totalRuns)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L503)totalRuns **totalRuns: number Total number of times this Actor has been run ### [**](#totalUsers)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L505)totalUsers **totalUsers: number Total number of unique users who have run this Actor ### [**](#totalUsers30Days)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L509)totalUsers30Days **totalUsers30Days: number Number of unique users in the last 30 days ### [**](#totalUsers7Days)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L507)totalUsers7Days **totalUsers7Days: number Number of unique users in the last 7 days ### [**](#totalUsers90Days)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L511)totalUsers90Days **totalUsers90Days: number Number of unique users in the last 90 days --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorStoreList.md # ActorStoreList ## Index[**](#Index) ### Properties * [**currentPricingInfo](#currentPricingInfo) * [**description](#description) * [**id](#id) * [**name](#name) * [**pictureUrl](#pictureUrl) * [**stats](#stats) * [**title](#title) * [**url](#url) * [**username](#username) * [**userPictureUrl](#userPictureUrl) ## Properties[**](#Properties) ### [**](#currentPricingInfo)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/store_collection.ts#L88)currentPricingInfo **currentPricingInfo: [PricingInfo](https://docs.apify.com/api/client/js/api/client/js/reference/interface/PricingInfo.md) ### [**](#description)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/store_collection.ts#L86)optionaldescription **description? : string ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/store_collection.ts#L82)id **id: string ### [**](#name)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/store_collection.ts#L83)name **name: string ### [**](#pictureUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/store_collection.ts#L89)optionalpictureUrl **pictureUrl? : string ### [**](#stats)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/store_collection.ts#L87)stats **stats: [ActorStats](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorStats.md) ### [**](#title)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/store_collection.ts#L85)optionaltitle **title? : string ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/store_collection.ts#L91)url **url: string ### [**](#username)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/store_collection.ts#L84)username **username: string ### [**](#userPictureUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/store_collection.ts#L90)optionaluserPictureUrl **userPictureUrl? : string --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorTaggedBuild.md # ActorTaggedBuild Information about a specific tagged build. ## Index[**](#Index) ### Properties * [**buildId](#buildId) * [**buildNumber](#buildNumber) * [**finishedAt](#finishedAt) ## Properties[**](#Properties) ### [**](#buildId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L545)optionalbuildId **buildId? : string ### [**](#buildNumber)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L546)optionalbuildNumber **buildNumber? : string ### [**](#finishedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L547)optionalfinishedAt **finishedAt? : Date --- # Source: https://docs.apify.com/api/client/python/reference/class/ActorVersionClient.md # Source: https://docs.apify.com/api/client/js/reference/class/ActorVersionClient.md # ActorVersionClient Client for managing a specific Actor version. Actor versions represent specific builds or snapshots of an Actor's code. This client provides methods to get, update, and delete versions, as well as manage their environment variables. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const actorClient = client.actor('my-actor-id'); // Get a specific version const versionClient = actorClient.version('0.1'); const version = await versionClient.get(); // Update version await versionClient.update({ buildTag: 'latest' }); ``` * **@see** ### Hierarchy * ResourceClient * *ActorVersionClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**delete](#delete) * [**envVar](#envVar) * [**envVars](#envVars) * [**get](#get) * [**update](#update) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceClient.url ## Methods[**](#Methods) ### [**](#delete)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L68)delete * ****delete**(): Promise\ - Deletes the Actor version. * **@see** *** #### Returns Promise\ ### [**](#envVar)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L79)envVar * ****envVar**(envVarName): [ActorEnvVarClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ActorEnvVarClient.md) - Returns a client for the specified environment variable of this Actor version. * **@see** *** #### Parameters * ##### envVarName: string Name of the environment variable. #### Returns [ActorEnvVarClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ActorEnvVarClient.md) A client for the environment variable. ### [**](#envVars)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L94)envVars * ****envVars**(): [ActorEnvVarCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ActorEnvVarCollectionClient.md) - Returns a client for the environment variables of this Actor version. * **@see** *** #### Returns [ActorEnvVarCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ActorEnvVarCollectionClient.md) A client for the Actor version's environment variables. ### [**](#get)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L46)get * ****get**(): Promise\ - Retrieves the Actor version. * **@see** *** #### Returns Promise\ The Actor version object, or `undefined` if it does not exist. ### [**](#update)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L57)update * ****update**(newFields): Promise<[FinalActorVersion](https://docs.apify.com/api/client/js/api/client/js/reference.md#FinalActorVersion)> - Updates the Actor version with the specified fields. * **@see** *** #### Parameters * ##### newFields: [ActorVersion](https://docs.apify.com/api/client/js/api/client/js/reference.md#ActorVersion) Fields to update. #### Returns Promise<[FinalActorVersion](https://docs.apify.com/api/client/js/api/client/js/reference.md#FinalActorVersion)> The updated Actor version object. --- # Source: https://docs.apify.com/api/client/python/reference/class/ActorVersionClientAsync.md # ActorVersionClientAsync Async sub-client for manipulating a single Actor version. ### Hierarchy * [ResourceClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md) * *ActorVersionClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionClientAsync.md#__init__) * [**delete](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionClientAsync.md#delete) * [**env\_var](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionClientAsync.md#env_var) * [**env\_vars](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionClientAsync.md#env_vars) * [**get](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionClientAsync.md#get) * [**update](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionClientAsync.md#update) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor_version.py#L133)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#delete)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor_version.py#L195)delete * **async **delete**(): None - Delete the Actor version. *** #### Returns None ### [**](#env_var)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor_version.py#L206)env\_var * ****env\_var**(env\_var\_name): [ActorEnvVarClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarClientAsync.md) - Retrieve the client for the specified environment variable of this Actor version. *** #### Parameters * ##### env\_var\_name: str The name of the environment variable for which to retrieve the resource client. #### Returns [ActorEnvVarClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarClientAsync.md) ### [**](#env_vars)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor_version.py#L202)env\_vars * ****env\_vars**(): [ActorEnvVarCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarCollectionClientAsync.md) - Retrieve a client for the environment variables of this Actor version. *** #### Returns [ActorEnvVarCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarCollectionClientAsync.md) ### [**](#get)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor_version.py#L137)get * **async **get**(): dict | None - Return information about the Actor version. *** #### Returns dict | None ### [**](#update)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor_version.py#L147)update * **async **update**(\*, build\_tag, env\_vars, apply\_env\_vars\_to\_build, source\_type, source\_files, git\_repo\_url, tarball\_url, github\_gist\_url): dict - Update the Actor version with specified fields. *** #### Parameters * ##### optionalkeyword-onlybuild\_tag: str | None = None Tag that is automatically set to the latest successful build of the current version. * ##### optionalkeyword-onlyenv\_vars: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[dict] | None = None Environment variables that will be available to the Actor run process, and optionally also to the build process. See the API docs for their exact structure. * ##### optionalkeyword-onlyapply\_env\_vars\_to\_build: bool | None = None Whether the environment variables specified for the Actor run will also be set to the Actor build process. * ##### optionalkeyword-onlysource\_type: ActorSourceType | None = None What source type is the Actor version using. * ##### optionalkeyword-onlysource\_files: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[dict] | None = None Source code comprised of multiple files, each an item of the array. Required when `source_type` is `ActorSourceType.SOURCE_FILES`. See the API docs for the exact structure. * ##### optionalkeyword-onlygit\_repo\_url: str | None = None The URL of a Git repository from which the source code will be cloned. Required when `source_type` is `ActorSourceType.GIT_REPO`. * ##### optionalkeyword-onlytarball\_url: str | None = None The URL of a tarball or a zip archive from which the source code will be downloaded. Required when `source_type` is `ActorSourceType.TARBALL`. * ##### optionalkeyword-onlygithub\_gist\_url: str | None = None The URL of a GitHub Gist from which the source will be downloaded. Required when `source_type` is `ActorSourceType.GITHUB_GIST`. #### Returns dict ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/python/reference/class/ActorVersionCollectionClient.md # Source: https://docs.apify.com/api/client/js/reference/class/ActorVersionCollectionClient.md # ActorVersionCollectionClient Client for managing the collection of Actor versions. Actor versions represent specific builds or snapshots of an Actor's code. This client provides methods to list and create versions for a specific Actor. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const actorClient = client.actor('my-actor-id'); // List all versions const versionsClient = actorClient.versions(); const { items } = await versionsClient.list(); // Create a new version const newVersion = await versionsClient.create({ versionNumber: '0.2', buildTag: 'latest' }); ``` * **@see** ### Hierarchy * ResourceCollectionClient * *ActorVersionCollectionClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**create](#create) * [**list](#list) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceCollectionClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceCollectionClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceCollectionClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceCollectionClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceCollectionClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceCollectionClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceCollectionClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceCollectionClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceCollectionClient.url ## Methods[**](#Methods) ### [**](#create)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version_collection.ts#L75)create * ****create**(actorVersion): Promise<[FinalActorVersion](https://docs.apify.com/api/client/js/api/client/js/reference.md#FinalActorVersion)> - Creates a new Actor version. * **@see** *** #### Parameters * ##### actorVersion: [ActorVersion](https://docs.apify.com/api/client/js/api/client/js/reference.md#ActorVersion) The Actor version data. #### Returns Promise<[FinalActorVersion](https://docs.apify.com/api/client/js/api/client/js/reference.md#FinalActorVersion)> The created Actor version object. ### [**](#list)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version_collection.ts#L62)list * ****list**(\_options): Promise<[ActorVersionListResult](https://docs.apify.com/api/client/js/api/client/js/reference.md#ActorVersionListResult)> & AsyncIterable<[FinalActorVersion](https://docs.apify.com/api/client/js/api/client/js/reference.md#FinalActorVersion), any, any> - Lists all Actor versions. 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(); ``` Asynchronous iteration is also supported. This will fetch additional pages if needed until all items are retrieved. ``` for await (const singleItem of client.list()) {...} ``` * **@see** *** #### Parameters * ##### \_options: [ActorVersionCollectionListOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorVersionCollectionListOptions.md) = {} #### Returns Promise<[ActorVersionListResult](https://docs.apify.com/api/client/js/api/client/js/reference.md#ActorVersionListResult)> & AsyncIterable<[FinalActorVersion](https://docs.apify.com/api/client/js/api/client/js/reference.md#FinalActorVersion), any, any> A paginated iterator of Actor versions. --- # Source: https://docs.apify.com/api/client/python/reference/class/ActorVersionCollectionClientAsync.md # ActorVersionCollectionClientAsync Async sub-client for manipulating Actor versions. ### Hierarchy * [ResourceCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md) * *ActorVersionCollectionClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionCollectionClientAsync.md#__init__) * [**create](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionCollectionClientAsync.md#create) * [**list](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionCollectionClientAsync.md#list) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionCollectionClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionCollectionClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionCollectionClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionCollectionClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionCollectionClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor_version_collection.py#L87)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceCollectionClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#create)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor_version_collection.py#L101)create * **async **create**(\*, version\_number, build\_tag, env\_vars, apply\_env\_vars\_to\_build, source\_type, source\_files, git\_repo\_url, tarball\_url, github\_gist\_url): dict - Create a new Actor version. *** #### Parameters * ##### keyword-onlyversion\_number: str Major and minor version of the Actor (e.g. `1.0`). * ##### optionalkeyword-onlybuild\_tag: str | None = None Tag that is automatically set to the latest successful build of the current version. * ##### optionalkeyword-onlyenv\_vars: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[dict] | None = None Environment variables that will be available to the Actor run process, and optionally also to the build process. See the API docs for their exact structure. * ##### optionalkeyword-onlyapply\_env\_vars\_to\_build: bool | None = None Whether the environment variables specified for the Actor run will also be set to the Actor build process. * ##### keyword-onlysource\_type: ActorSourceType What source type is the Actor version using. * ##### optionalkeyword-onlysource\_files: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[dict] | None = None Source code comprised of multiple files, each an item of the array. Required when `source_type` is `ActorSourceType.SOURCE_FILES`. See the API docs for the exact structure. * ##### optionalkeyword-onlygit\_repo\_url: str | None = None The URL of a Git repository from which the source code will be cloned. Required when `source_type` is `ActorSourceType.GIT_REPO`. * ##### optionalkeyword-onlytarball\_url: str | None = None The URL of a tarball or a zip archive from which the source code will be downloaded. Required when `source_type` is `ActorSourceType.TARBALL`. * ##### optionalkeyword-onlygithub\_gist\_url: str | None = None The URL of a GitHub Gist from which the source will be downloaded. Required when `source_type` is `ActorSourceType.GITHUB_GIST`. #### Returns dict ### [**](#list)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/actor_version_collection.py#L91)list * **async **list**(): [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] - List the available Actor versions. *** #### Returns [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorVersionCollectionListOptions.md # ActorVersionCollectionListOptions * **@deprecated** No options are used in the current API implementation. ### Hierarchy * PaginationOptions * *ActorVersionCollectionListOptions* ## Index[**](#Index) ### Properties * [**chunkSize](#chunkSize) * [**desc](#desc) * [**limit](#limit) * [**offset](#offset) ## Properties[**](#Properties) ### [**](#chunkSize)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L258)optionalinheritedchunkSize **chunkSize? : number Inherited from PaginationOptions.chunkSize Maximum number of items returned in one API response. Relevant in the context of asyncIterator, the iterator will fetch results in chunks of this size from API and yield them one by one. It will stop fetching once the limit is reached or once all items from API have been fetched. Chunk size is usually limited by API. Minimum of those two limits will be used. ### [**](#desc)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version_collection.ts#L87)optionaldesc **desc? : boolean ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L251)optionalinheritedlimit **limit? : number Inherited from PaginationOptions.limit Maximum number of entries requested. ### [**](#offset)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L249)optionalinheritedoffset **offset? : number Inherited from PaginationOptions.offset Position of the first returned entry. --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorVersionGitHubGist.md # ActorVersionGitHubGist ### Hierarchy * [BaseActorVersion](https://docs.apify.com/api/client/js/api/client/js/reference/interface/BaseActorVersion.md)\ * *ActorVersionGitHubGist* ## Index[**](#Index) ### Properties * [**applyEnvVarsToBuild](#applyEnvVarsToBuild) * [**buildTag](#buildTag) * [**envVars](#envVars) * [**gitHubGistUrl](#gitHubGistUrl) * [**sourceType](#sourceType) * [**versionNumber](#versionNumber) ## Properties[**](#Properties) ### [**](#applyEnvVarsToBuild)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L103)optionalinheritedapplyEnvVarsToBuild **applyEnvVarsToBuild? : boolean Inherited from BaseActorVersion.applyEnvVarsToBuild ### [**](#buildTag)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L104)optionalinheritedbuildTag **buildTag? : string Inherited from BaseActorVersion.buildTag ### [**](#envVars)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L102)optionalinheritedenvVars **envVars? : [ActorEnvironmentVariable](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorEnvironmentVariable.md)\[] Inherited from BaseActorVersion.envVars ### [**](#gitHubGistUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L126)gitHubGistUrl **gitHubGistUrl: string ### [**](#sourceType)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L101)inheritedsourceType **sourceType: GitHubGist Inherited from BaseActorVersion.sourceType ### [**](#versionNumber)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L100)optionalinheritedversionNumber **versionNumber? : string Inherited from BaseActorVersion.versionNumber --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorVersionGitRepo.md # ActorVersionGitRepo ### Hierarchy * [BaseActorVersion](https://docs.apify.com/api/client/js/api/client/js/reference/interface/BaseActorVersion.md)\ * *ActorVersionGitRepo* ## Index[**](#Index) ### Properties * [**applyEnvVarsToBuild](#applyEnvVarsToBuild) * [**buildTag](#buildTag) * [**envVars](#envVars) * [**gitRepoUrl](#gitRepoUrl) * [**sourceType](#sourceType) * [**versionNumber](#versionNumber) ## Properties[**](#Properties) ### [**](#applyEnvVarsToBuild)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L103)optionalinheritedapplyEnvVarsToBuild **applyEnvVarsToBuild? : boolean Inherited from BaseActorVersion.applyEnvVarsToBuild ### [**](#buildTag)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L104)optionalinheritedbuildTag **buildTag? : string Inherited from BaseActorVersion.buildTag ### [**](#envVars)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L102)optionalinheritedenvVars **envVars? : [ActorEnvironmentVariable](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorEnvironmentVariable.md)\[] Inherited from BaseActorVersion.envVars ### [**](#gitRepoUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L118)gitRepoUrl **gitRepoUrl: string ### [**](#sourceType)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L101)inheritedsourceType **sourceType: GitRepo Inherited from BaseActorVersion.sourceType ### [**](#versionNumber)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L100)optionalinheritedversionNumber **versionNumber? : string Inherited from BaseActorVersion.versionNumber --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorVersionSourceFile.md # ActorVersionSourceFile ## Index[**](#Index) ### Properties * [**content](#content) * [**format](#format) * [**name](#name) ## Properties[**](#Properties) ### [**](#content)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L114)content **content: string ### [**](#format)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L113)format **format: TEXT | BASE64 ### [**](#name)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L112)name **name: string --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorVersionSourceFiles.md # ActorVersionSourceFiles ### Hierarchy * [BaseActorVersion](https://docs.apify.com/api/client/js/api/client/js/reference/interface/BaseActorVersion.md)\ * *ActorVersionSourceFiles* ## Index[**](#Index) ### Properties * [**applyEnvVarsToBuild](#applyEnvVarsToBuild) * [**buildTag](#buildTag) * [**envVars](#envVars) * [**sourceFiles](#sourceFiles) * [**sourceType](#sourceType) * [**versionNumber](#versionNumber) ## Properties[**](#Properties) ### [**](#applyEnvVarsToBuild)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L103)optionalinheritedapplyEnvVarsToBuild **applyEnvVarsToBuild? : boolean Inherited from BaseActorVersion.applyEnvVarsToBuild ### [**](#buildTag)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L104)optionalinheritedbuildTag **buildTag? : string Inherited from BaseActorVersion.buildTag ### [**](#envVars)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L102)optionalinheritedenvVars **envVars? : [ActorEnvironmentVariable](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorEnvironmentVariable.md)\[] Inherited from BaseActorVersion.envVars ### [**](#sourceFiles)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L108)sourceFiles **sourceFiles: [ActorVersionSourceFile](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorVersionSourceFile.md)\[] ### [**](#sourceType)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L101)inheritedsourceType **sourceType: SourceFiles Inherited from BaseActorVersion.sourceType ### [**](#versionNumber)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L100)optionalinheritedversionNumber **versionNumber? : string Inherited from BaseActorVersion.versionNumber --- # Source: https://docs.apify.com/api/client/js/reference/interface/ActorVersionTarball.md # ActorVersionTarball ### Hierarchy * [BaseActorVersion](https://docs.apify.com/api/client/js/api/client/js/reference/interface/BaseActorVersion.md)\ * *ActorVersionTarball* ## Index[**](#Index) ### Properties * [**applyEnvVarsToBuild](#applyEnvVarsToBuild) * [**buildTag](#buildTag) * [**envVars](#envVars) * [**sourceType](#sourceType) * [**tarballUrl](#tarballUrl) * [**versionNumber](#versionNumber) ## Properties[**](#Properties) ### [**](#applyEnvVarsToBuild)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L103)optionalinheritedapplyEnvVarsToBuild **applyEnvVarsToBuild? : boolean Inherited from BaseActorVersion.applyEnvVarsToBuild ### [**](#buildTag)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L104)optionalinheritedbuildTag **buildTag? : string Inherited from BaseActorVersion.buildTag ### [**](#envVars)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L102)optionalinheritedenvVars **envVars? : [ActorEnvironmentVariable](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorEnvironmentVariable.md)\[] Inherited from BaseActorVersion.envVars ### [**](#sourceType)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L101)inheritedsourceType **sourceType: Tarball Inherited from BaseActorVersion.sourceType ### [**](#tarballUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L122)tarballUrl **tarballUrl: string ### [**](#versionNumber)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L100)optionalinheritedversionNumber **versionNumber? : string Inherited from BaseActorVersion.versionNumber --- # Source: https://docs.apify.com/sdk/python/reference/class/AddRequestsResponse.md # AddRequestsResponse Model for a response to add requests to a queue. Contains detailed information about the processing results when adding multiple requests to a queue. This includes which requests were successfully processed and which ones encountered issues during processing. ## Index[**](#Index) ### Properties * [**model\_config](https://docs.apify.com/sdk/python/sdk/python/reference/class/AddRequestsResponse.md#model_config) * [**processed\_requests](https://docs.apify.com/sdk/python/sdk/python/reference/class/AddRequestsResponse.md#processed_requests) * [**unprocessed\_requests](https://docs.apify.com/sdk/python/sdk/python/reference/class/AddRequestsResponse.md#unprocessed_requests) ## Properties[**](#Properties) ### [**](#model_config)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L173)model\_config **model\_config: Undefined ### [**](#processed_requests)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L175)processed\_requests **processed\_requests: list\[[ProcessedRequest](https://crawlee.dev/python/api/class/ProcessedRequest)] Successfully processed requests, including information about whether they were already present in the queue and whether they had been handled previously. ### [**](#unprocessed_requests)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L179)unprocessed\_requests **unprocessed\_requests: list\[[UnprocessedRequest](https://crawlee.dev/python/api/class/UnprocessedRequest)] Requests that could not be processed, typically due to validation errors or other issues. --- # Source: https://docs.apify.com/sdk/python/reference/class/AliasResolver.md # AliasResolver Class for handling aliases. The purpose of this is class is to ensure that alias storages are created with correct id. This is achieved by using default kvs as a storage for global mapping of aliases to storage ids. Same mapping is also kept in memory to avoid unnecessary calls to API and also have limited support of alias storages when not running on Apify platform. When on Apify platform, the storages created with alias are accessible by the same alias even after migration or reboot. ## Index[**](#Index) ### Methods * [**\_\_aenter\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/AliasResolver.md#__aenter__) * [**\_\_aexit\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/AliasResolver.md#__aexit__) * [**\_\_init\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/AliasResolver.md#__init__) * [**resolve\_id](https://docs.apify.com/sdk/python/sdk/python/reference/class/AliasResolver.md#resolve_id) * [**store\_mapping](https://docs.apify.com/sdk/python/sdk/python/reference/class/AliasResolver.md#store_mapping) ## Methods[**](#Methods) ### [**](#__aenter__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_alias_resolving.py#L144)\_\_aenter\_\_ * **async **\_\_aenter\_\_**(): [AliasResolver](https://docs.apify.com/sdk/python/sdk/python/reference/class/AliasResolver.md) - Context manager to prevent race condition in alias creation. *** #### Returns [AliasResolver](https://docs.apify.com/sdk/python/sdk/python/reference/class/AliasResolver.md) ### [**](#__aexit__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_alias_resolving.py#L150)\_\_aexit\_\_ * **async **\_\_aexit\_\_**(exc\_type, exc\_value, exc\_traceback): None - #### Parameters * ##### exc\_type: type\[BaseException] | None * ##### exc\_value: BaseException | None * ##### exc\_traceback: TracebackType | None #### Returns None ### [**](#__init__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_alias_resolving.py#L133)\_\_init\_\_ * ****\_\_init\_\_**(storage\_type, alias, configuration): None - #### Parameters * ##### storage\_type: Literal\[Dataset, KeyValueStore, RequestQueue] * ##### alias: str * ##### configuration: [Configuration](https://docs.apify.com/sdk/python/sdk/python/reference/class/Configuration.md) #### Returns None ### [**](#resolve_id)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_alias_resolving.py#L198)resolve\_id * **async **resolve\_id**(): str | None - Get id of the aliased storage. *** #### Returns str | None ### [**](#store_mapping)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_alias_resolving.py#L206)store\_mapping * **async **store\_mapping**(storage\_id): None - Add alias and related storage id to the mapping in default kvs and local in-memory mapping. *** #### Parameters * ##### storage\_id: str #### Returns None --- # Source: https://docs.apify.com/api/client/python/reference/class/ApifyApiError.md # Source: https://docs.apify.com/api/client/js/reference/class/ApifyApiError.md # ApifyApiError An `ApifyApiError` is thrown for successful HTTP requests that reach the API, but the API responds with an error response. Typically, those are rate limit errors and internal errors, which are automatically retried, or validation errors, which are thrown immediately, because a correction by the user is needed. ### Hierarchy * Error * *ApifyApiError* ## Index[**](#Index) ### Properties * [**attempt](#attempt) * [**cause](#cause) * [**clientMethod](#clientMethod) * [**data](#data) * [**httpMethod](#httpMethod) * [**message](#message) * [**name](#name) * [**originalStack](#originalStack) * [**path](#path) * [**stack](#stack) * [**statusCode](#statusCode) * [**type](#type) * [**stackTraceLimit](#stackTraceLimit) ### Methods * [**captureStackTrace](#captureStackTrace) * [**prepareStackTrace](#prepareStackTrace) ## Properties[**](#Properties) ### [**](#attempt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_api_error.ts#L46)attempt **attempt: number Number of the API call attempt. ### [**](#cause)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/website/node_modules/typescript/src/lib.es2022.error.d.ts#L24)externaloptionalinheritedcause **cause? : unknown Inherited from Error.cause ### [**](#clientMethod)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_api_error.ts#L31)clientMethod **clientMethod: string The invoked resource client and the method. Known issue: Sometimes it displays as `unknown` because it can't be parsed from a stack trace. ### [**](#data)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_api_error.ts#L67)optionaldata **data? : Record\ Additional data provided by the API about the error ### [**](#httpMethod)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_api_error.ts#L51)optionalhttpMethod **httpMethod? : string HTTP method of the API call. ### [**](#message)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/website/node_modules/typescript/src/lib.es5.d.ts#L1077)externalinheritedmessage **message: string Inherited from Error.message ### [**](#name)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_api_error.ts#L25)name **name: string Overrides Error.name ### [**](#originalStack)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_api_error.ts#L62)originalStack **originalStack: string Original stack trace of the exception. It is replaced by a more informative stack with API call information. ### [**](#path)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_api_error.ts#L56)optionalpath **path? : string Full path of the API endpoint (URL excluding origin). ### [**](#stack)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/website/node_modules/typescript/src/lib.es5.d.ts#L1078)externaloptionalinheritedstack **stack? : string Inherited from Error.stack ### [**](#statusCode)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_api_error.ts#L36)statusCode **statusCode: number HTTP status code of the error. ### [**](#type)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_api_error.ts#L41)optionaltype **type? : string The type of the error, as returned by the API. ### [**](#stackTraceLimit)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/globals.d.ts#L68)staticexternalinheritedstackTraceLimit **stackTraceLimit: number Inherited from Error.stackTraceLimit The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured *after* the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. ## Methods[**](#Methods) ### [**](#captureStackTrace)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/globals.d.ts#L52)staticexternalinheritedcaptureStackTrace * ****captureStackTrace**(targetObject, constructorOpt): void - Inherited from Error.captureStackTrace Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ``` const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ``` function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` *** #### Parameters * ##### externaltargetObject: object * ##### externaloptionalconstructorOpt: Function #### Returns void ### [**](#prepareStackTrace)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/globals.d.ts#L56)staticexternalinheritedprepareStackTrace * ****prepareStackTrace**(err, stackTraces): any - Inherited from Error.prepareStackTrace * **@see** *** #### Parameters * ##### externalerr: Error * ##### externalstackTraces: CallSite\[] #### Returns any --- # Source: https://docs.apify.com/sdk/python/reference/class/ApifyCacheStorage.md # ApifyCacheStorage A Scrapy cache storage that uses the Apify `KeyValueStore` to store responses. It can be set as a storage for Scrapy's built-in `HttpCacheMiddleware`, which caches responses to requests. See HTTPCache middleware settings (prefixed with `HTTPCACHE_`) in the Scrapy documentation for more information. Requires the asyncio Twisted reactor to be installed. ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyCacheStorage.md#__init__) * [**close\_spider](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyCacheStorage.md#close_spider) * [**open\_spider](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyCacheStorage.md#open_spider) * [**retrieve\_response](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyCacheStorage.md#retrieve_response) * [**store\_response](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyCacheStorage.md#store_response) ## Methods[**](#Methods) ### [**](#__init__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/scrapy/extensions/_httpcache.py#L38)\_\_init\_\_ * ****\_\_init\_\_**(settings): None - #### Parameters * ##### settings: BaseSettings #### Returns None ### [**](#close_spider)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/scrapy/extensions/_httpcache.py#L69)close\_spider * ****close\_spider**(\_, current\_time): None - Close the cache storage for a spider. *** #### Parameters * ##### \_: Spider * ##### optionalcurrent\_time: int | None = None #### Returns None ### [**](#open_spider)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/scrapy/extensions/_httpcache.py#L46)open\_spider * ****open\_spider**(spider): None - Open the cache storage for a spider. *** #### Parameters * ##### spider: Spider #### Returns None ### [**](#retrieve_response)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/scrapy/extensions/_httpcache.py#L112)retrieve\_response * ****retrieve\_response**(\_, request, current\_time): Response | None - Retrieve a response from the cache storage. *** #### Parameters * ##### \_: Spider * ##### request: Request * ##### optionalcurrent\_time: int | None = None #### Returns Response | None ### [**](#store_response)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/scrapy/extensions/_httpcache.py#L144)store\_response * ****store\_response**(\_, request, response): None - Store a response in the cache storage. *** #### Parameters * ##### \_: Spider * ##### request: Request * ##### response: Response #### Returns None --- # Source: https://docs.apify.com/sdk/js/reference/class/ApifyClient.md # Source: https://docs.apify.com/api/client/python/reference/class/ApifyClient.md # Source: https://docs.apify.com/api/client/js/reference/class/ApifyClient.md # ApifyClient The official JavaScript client for the Apify API. Provides programmatic access to all Apify platform resources including Actors, runs, datasets, key-value stores, request queues, and more. Works in both Node.js and browser environments. * **@example** ``` import { ApifyClient } from 'apify-client'; const client = new ApifyClient({ token: 'my-token' }); // Start an Actor and wait for it to finish const run = await client.actor('my-actor-id').call(); // Fetch dataset items const { items } = await client.dataset(run.defaultDatasetId).listItems(); ``` * **@see** ## Index[**](#Index) ### Constructors * [**constructor](#constructor) ### Properties * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**logger](#logger) * [**publicBaseUrl](#publicBaseUrl) * [**stats](#stats) * [**token](#token) ### Methods * [**actor](#actor) * [**actors](#actors) * [**build](#build) * [**builds](#builds) * [**dataset](#dataset) * [**datasets](#datasets) * [**keyValueStore](#keyValueStore) * [**keyValueStores](#keyValueStores) * [**log](#log) * [**requestQueue](#requestQueue) * [**requestQueues](#requestQueues) * [**run](#run) * [**runs](#runs) * [**schedule](#schedule) * [**schedules](#schedules) * [**setStatusMessage](#setStatusMessage) * [**store](#store) * [**task](#task) * [**tasks](#tasks) * [**user](#user) * [**webhook](#webhook) * [**webhookDispatch](#webhookDispatch) * [**webhookDispatches](#webhookDispatches) * [**webhooks](#webhooks) ## Constructors[**](#Constructors) ### [**](#constructor)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L72)constructor * ****new ApifyClient**(options): [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) - #### Parameters * ##### options: [ApifyClientOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ApifyClientOptions.md) = {} #### Returns [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) ## Properties[**](#Properties) ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L60)baseUrl **baseUrl: string ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L70)httpClient **httpClient: HttpClient ### [**](#logger)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L68)logger **logger: Log ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L62)publicBaseUrl **publicBaseUrl: string ### [**](#stats)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L66)stats **stats: Statistics ### [**](#token)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L64)optionaltoken **token? : string ## Methods[**](#Methods) ### [**](#actor)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L155)actor * ****actor**(id): [ActorClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ActorClient.md) - Returns a client for a specific Actor. Use this to get, update, delete, start, or call an Actor, as well as manage its builds, runs, versions, and webhooks. * **@see** * **@example** ``` // Call an Actor and wait for it to finish const run = await client.actor('apify/web-scraper').call({ url: 'https://example.com' }); ``` *** #### Parameters * ##### id: string Actor ID or username/name #### Returns [ActorClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ActorClient.md) A client for the specific Actor ### [**](#actors)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L135)actors * ****actors**(): [ActorCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ActorCollectionClient.md) - Returns a client for managing Actors in your account. Provides access to the Actor collection, allowing you to list, create, and search for Actors. * **@see** *** #### Returns [ActorCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ActorCollectionClient.md) A client for the Actors collection ### [**](#build)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L185)build * ****build**(id): [BuildClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/BuildClient.md) - Returns a client for a specific Actor build. Use this to get details about a build, wait for it to finish, or access its logs. * **@see** *** #### Parameters * ##### id: string Build ID #### Returns [BuildClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/BuildClient.md) A client for the specified build ### [**](#builds)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L172)builds * ****builds**(): [BuildCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/BuildCollectionClient.md) - Returns a client for managing Actor builds in your account. Lists all builds across all of your Actors. * **@see** *** #### Returns [BuildCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/BuildCollectionClient.md) A client for Actor builds collection ### [**](#dataset)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L229)dataset * ****dataset**\(id): [DatasetClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/DatasetClient.md)\ - Returns a client for a specific dataset. Use this to read, write, and manage items in the dataset. Datasets contain structured data stored as individual items (records). * **@see** * **@example** ``` // Push items to a dataset await client.dataset('my-dataset').pushItems([ { url: 'https://example.com', title: 'Example' }, { url: 'https://test.com', title: 'Test' } ]); // Retrieve items const { items } = await client.dataset('my-dataset').listItems(); ``` *** #### Parameters * ##### id: string Dataset ID or name #### Returns [DatasetClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/DatasetClient.md)\ A client for the specific Dataset ### [**](#datasets)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L202)datasets * ****datasets**(): [DatasetCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/DatasetCollectionClient.md) - Returns a client for managing datasets in your account. Datasets store structured data results from Actor runs. Use this to list or create datasets. * **@see** *** #### Returns [DatasetCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/DatasetCollectionClient.md) A client for the Datasets collection ### [**](#keyValueStore)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L271)keyValueStore * ****keyValueStore**(id): [KeyValueStoreClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/KeyValueStoreClient.md) - Returns a client for a specific key-value store. Use this to read, write, and delete records in the store. Key-value stores can hold any type of data including text, JSON, images, and other files. * **@see** * **@example** ``` // Save a record await client.keyValueStore('my-store').setRecord({ key: 'OUTPUT', value: { foo: 'bar' } }); // Get a record const record = await client.keyValueStore('my-store').getRecord('OUTPUT'); ``` *** #### Parameters * ##### id: string Key-value store ID or name #### Returns [KeyValueStoreClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/KeyValueStoreClient.md) A client for the specific key-value store ### [**](#keyValueStores)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L248)keyValueStores * ****keyValueStores**(): [KeyValueStoreCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/KeyValueStoreCollectionClient.md) - Returns a client for managing key-value stores in your account. Key-value stores are used to store arbitrary data records or files. * **@see** *** #### Returns [KeyValueStoreCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/KeyValueStoreCollectionClient.md) A client for the Key-value stores collection ### [**](#log)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L287)log * ****log**(buildOrRunId): [LogClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/LogClient.md) - Returns a client for accessing logs of an Actor build or run. * **@see** *** #### Parameters * ##### buildOrRunId: string Build ID or run ID #### Returns [LogClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/LogClient.md) A client for accessing logs ### [**](#requestQueue)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L329)requestQueue * ****requestQueue**(id, options): [RequestQueueClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/RequestQueueClient.md) - Returns a client for a specific request queue. Use this to add, retrieve, and manage requests in the queue. Request queues are used by web crawlers to manage URLs that need to be visited. * **@see** * **@example** ``` // Add requests to a queue const queue = client.requestQueue('my-queue'); await queue.addRequest({ url: 'https://example.com', uniqueKey: 'example' }); // Get and lock the next request const { items } = await queue.listAndLockHead({ lockSecs: 60 }); ``` *** #### Parameters * ##### id: string Request queue ID or name * ##### options: [RequestQueueUserOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueUserOptions.md) = {} Configuration options for the request queue client #### Returns [RequestQueueClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/RequestQueueClient.md) A client for the specific Request queue ### [**](#requestQueues)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L304)requestQueues * ****requestQueues**(): [RequestQueueCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/RequestQueueCollectionClient.md) - Returns a client for managing request queues in your account. Request queues store URLs to be crawled, along with their metadata. * **@see** *** #### Returns [RequestQueueCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/RequestQueueCollectionClient.md) A client for the Request queues collection ### [**](#run)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L380)run * ****run**(id): [RunClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/RunClient.md) - Returns a client for a specific Actor run. Use this to get details about a run, wait for it to finish, abort it, or access its dataset, key-value store, and request queue. * **@see** * **@example** ``` // Wait for a run to finish const run = await client.run('run-id').waitForFinish(); // Access run's dataset const { items } = await client.run('run-id').dataset().listItems(); ``` *** #### Parameters * ##### id: string Run ID #### Returns [RunClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/RunClient.md) A client for the specified run ### [**](#runs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L354)runs * ****runs**(): [RunCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/RunCollectionClient.md) - Returns a client for managing Actor runs in your account. Lists all runs across all of your Actors. * **@see** *** #### Returns [RunCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/RunCollectionClient.md) A client for the run collection ### [**](#schedule)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L446)schedule * ****schedule**(id): [ScheduleClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ScheduleClient.md) - Returns a client for a specific schedule. Use this to get, update, or delete a schedule. * **@see** *** #### Parameters * ##### id: string Schedule ID #### Returns [ScheduleClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ScheduleClient.md) A client for the specific Schedule ### [**](#schedules)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L433)schedules * ****schedules**(): [ScheduleCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ScheduleCollectionClient.md) - Returns a client for managing schedules in your account. Schedules automatically start Actor or task runs at specified times. * **@see** *** #### Returns [ScheduleCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ScheduleCollectionClient.md) A client for the Schedules collection ### [**](#setStatusMessage)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L553)setStatusMessage * ****setStatusMessage**(message, options): Promise\ - Sets a status message for the current Actor run. This is a convenience method that updates the status message of the run specified by the `ACTOR_RUN_ID` environment variable. Only works when called from within an Actor run. * **@throws** If `ACTOR_RUN_ID` environment variable is not set *** #### Parameters * ##### message: string The status message to set * ##### optionaloptions: SetStatusMessageOptions Additional options for the status message #### Returns Promise\ ### [**](#store)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L539)store * ****store**(): [StoreCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/StoreCollectionClient.md) - Returns a client for browsing Actors in Apify Store. Use this to search and retrieve information about public Actors. * **@see** *** #### Returns [StoreCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/StoreCollectionClient.md) A client for the Apify Store ### [**](#task)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L416)task * ****task**(id): [TaskClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/TaskClient.md) - Returns a client for a specific Actor task. Use this to get, update, delete, or run a task with pre-configured input. * **@see** * **@example** ``` // Run a task and wait for it to finish const run = await client.task('my-task').call(); ``` *** #### Parameters * ##### id: string Task ID or username/task-name #### Returns [TaskClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/TaskClient.md) A client for the specified task ### [**](#tasks)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L397)tasks * ****tasks**(): [TaskCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/TaskCollectionClient.md) - Returns a client for managing Actor tasks in your account. Tasks are pre-configured Actor runs with stored input that can be executed repeatedly. * **@see** *** #### Returns [TaskCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/TaskCollectionClient.md) A client for the task collection ### [**](#user)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L464)user * ****user**(id): [UserClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/UserClient.md) - Returns a client for accessing user data. By default, returns information about the current user (determined by the API token). * **@see** *** #### Parameters * ##### id: string = ME\_USER\_NAME\_PLACEHOLDER User ID or username. Defaults to 'me' (current user) #### Returns [UserClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/UserClient.md) A client for the user ### [**](#webhook)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L494)webhook * ****webhook**(id): [WebhookClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/WebhookClient.md) - Returns a client for a specific webhook. Use this to get, update, delete, or test a webhook. * **@see** *** #### Parameters * ##### id: string Webhook ID #### Returns [WebhookClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/WebhookClient.md) A client for the specific webhook ### [**](#webhookDispatch)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L522)webhookDispatch * ****webhookDispatch**(id): [WebhookDispatchClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/WebhookDispatchClient.md) - Returns a client for a specific webhook dispatch. * **@see** *** #### Parameters * ##### id: string Webhook dispatch ID #### Returns [WebhookDispatchClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/WebhookDispatchClient.md) A client for the specific webhook dispatch ### [**](#webhookDispatches)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L511)webhookDispatches * ****webhookDispatches**(): [WebhookDispatchCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/WebhookDispatchCollectionClient.md) - Returns a client for viewing webhook dispatches in your account. Webhook dispatches represent individual invocations of webhooks. * **@see** *** #### Returns [WebhookDispatchCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/WebhookDispatchCollectionClient.md) A client for the webhook dispatches collection ### [**](#webhooks)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L481)webhooks * ****webhooks**(): [WebhookCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/WebhookCollectionClient.md) - Returns a client for managing webhooks in your account. Webhooks notify external services when specific events occur (e.g., Actor run finishes). * **@see** *** #### Returns [WebhookCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/WebhookCollectionClient.md) A client for the Webhooks collection --- # Source: https://docs.apify.com/api/client/python/reference/class/ApifyClientAsync.md # ApifyClientAsync The asynchronous version of the Apify API client. ### Hierarchy * [\_BaseApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseApifyClient.md) * *ApifyClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#__init__) * [**actor](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#actor) * [**actors](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#actors) * [**build](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#build) * [**builds](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#builds) * [**dataset](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#dataset) * [**datasets](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#datasets) * [**key\_value\_store](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#key_value_store) * [**key\_value\_stores](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#key_value_stores) * [**log](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#log) * [**request\_queue](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#request_queue) * [**request\_queues](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#request_queues) * [**run](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#run) * [**runs](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#runs) * [**schedule](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#schedule) * [**schedules](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#schedules) * [**store](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#store) * [**task](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#task) * [**tasks](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#tasks) * [**user](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#user) * [**webhook](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#webhook) * [**webhook\_dispatch](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#webhook_dispatch) * [**webhook\_dispatches](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#webhook_dispatches) * [**webhooks](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#webhooks) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md#http_client) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L295)\_\_init\_\_ * ****\_\_init\_\_**(token, \*, api\_url, api\_public\_url, max\_retries, min\_delay\_between\_retries\_millis, timeout\_secs): None - Overrides [\_BaseApifyClient.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseApifyClient.md#__init__) Initialize a new instance. *** #### Parameters * ##### optionaltoken: str | None = None The Apify API token. * ##### optionalkeyword-onlyapi\_url: str | None = None The URL of the Apify API server to which to connect. Defaults to . It can be an internal URL that is not globally accessible, in such case `api_public_url` should be set as well. * ##### optionalkeyword-onlyapi\_public\_url: str | None = None The globally accessible URL of the Apify API server. It should be set only if the `api_url` is an internal URL that is not globally accessible. * ##### optionalkeyword-onlymax\_retries: int | None = 8 How many times to retry a failed request at most. * ##### optionalkeyword-onlymin\_delay\_between\_retries\_millis: int | None = 500 How long will the client wait between retrying requests (increases exponentially from this value). * ##### optionalkeyword-onlytimeout\_secs: int | None = DEFAULT\_TIMEOUT The socket timeout of the HTTP requests sent to the Apify API. #### Returns None ### [**](#actor)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L336)actor * ****actor**(actor\_id): [ActorClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md) - Retrieve the sub-client for manipulating a single Actor. *** #### Parameters * ##### actor\_id: str ID of the Actor to be manipulated. #### Returns [ActorClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md) ### [**](#actors)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L344)actors * ****actors**(): [ActorCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorCollectionClientAsync.md) - Retrieve the sub-client for manipulating Actors. *** #### Returns [ActorCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorCollectionClientAsync.md) ### [**](#build)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L348)build * ****build**(build\_id): [BuildClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildClientAsync.md) - Retrieve the sub-client for manipulating a single Actor build. *** #### Parameters * ##### build\_id: str ID of the Actor build to be manipulated. #### Returns [BuildClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildClientAsync.md) ### [**](#builds)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L356)builds * ****builds**(): [BuildCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildCollectionClientAsync.md) - Retrieve the sub-client for querying multiple builds of a user. *** #### Returns [BuildCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildCollectionClientAsync.md) ### [**](#dataset)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L372)dataset * ****dataset**(dataset\_id): [DatasetClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClientAsync.md) - Retrieve the sub-client for manipulating a single dataset. *** #### Parameters * ##### dataset\_id: str ID of the dataset to be manipulated. #### Returns [DatasetClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClientAsync.md) ### [**](#datasets)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L380)datasets * ****datasets**(): [DatasetCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetCollectionClientAsync.md) - Retrieve the sub-client for manipulating datasets. *** #### Returns [DatasetCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetCollectionClientAsync.md) ### [**](#key_value_store)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L384)key\_value\_store * ****key\_value\_store**(key\_value\_store\_id): [KeyValueStoreClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md) - Retrieve the sub-client for manipulating a single key-value store. *** #### Parameters * ##### key\_value\_store\_id: str ID of the key-value store to be manipulated. #### Returns [KeyValueStoreClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md) ### [**](#key_value_stores)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L392)key\_value\_stores * ****key\_value\_stores**(): [KeyValueStoreCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreCollectionClientAsync.md) - Retrieve the sub-client for manipulating key-value stores. *** #### Returns [KeyValueStoreCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreCollectionClientAsync.md) ### [**](#log)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L445)log * ****log**(build\_or\_run\_id): [LogClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogClientAsync.md) - Retrieve the sub-client for retrieving logs. *** #### Parameters * ##### build\_or\_run\_id: str ID of the Actor build or run for which to access the log. #### Returns [LogClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogClientAsync.md) ### [**](#request_queue)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L396)request\_queue * ****request\_queue**(request\_queue\_id, \*, client\_key): [RequestQueueClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md) - Retrieve the sub-client for manipulating a single request queue. *** #### Parameters * ##### request\_queue\_id: str ID of the request queue to be manipulated. * ##### optionalkeyword-onlyclient\_key: str | None = None A unique identifier of the client accessing the request queue. #### Returns [RequestQueueClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md) ### [**](#request_queues)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L405)request\_queues * ****request\_queues**(): [RequestQueueCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClientAsync.md) - Retrieve the sub-client for manipulating request queues. *** #### Returns [RequestQueueCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClientAsync.md) ### [**](#run)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L360)run * ****run**(run\_id): [RunClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md) - Retrieve the sub-client for manipulating a single Actor run. *** #### Parameters * ##### run\_id: str ID of the Actor run to be manipulated. #### Returns [RunClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md) ### [**](#runs)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L368)runs * ****runs**(): [RunCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunCollectionClientAsync.md) - Retrieve the sub-client for querying multiple Actor runs of a user. *** #### Returns [RunCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunCollectionClientAsync.md) ### [**](#schedule)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L433)schedule * ****schedule**(schedule\_id): [ScheduleClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleClientAsync.md) - Retrieve the sub-client for manipulating a single schedule. *** #### Parameters * ##### schedule\_id: str ID of the schedule to be manipulated. #### Returns [ScheduleClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleClientAsync.md) ### [**](#schedules)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L441)schedules * ****schedules**(): [ScheduleCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleCollectionClientAsync.md) - Retrieve the sub-client for manipulating schedules. *** #### Returns [ScheduleCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleCollectionClientAsync.md) ### [**](#store)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L473)store * ****store**(): [StoreCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/StoreCollectionClientAsync.md) - Retrieve the sub-client for Apify store. *** #### Returns [StoreCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/StoreCollectionClientAsync.md) ### [**](#task)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L453)task * ****task**(task\_id): [TaskClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskClientAsync.md) - Retrieve the sub-client for manipulating a single task. *** #### Parameters * ##### task\_id: str ID of the task to be manipulated. #### Returns [TaskClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskClientAsync.md) ### [**](#tasks)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L461)tasks * ****tasks**(): [TaskCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskCollectionClientAsync.md) - Retrieve the sub-client for manipulating tasks. *** #### Returns [TaskCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskCollectionClientAsync.md) ### [**](#user)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L465)user * ****user**(user\_id): [UserClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/UserClientAsync.md) - Retrieve the sub-client for querying users. *** #### Parameters * ##### optionaluser\_id: str | None = None ID of user to be queried. If None, queries the user belonging to the token supplied to the client. #### Returns [UserClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/UserClientAsync.md) ### [**](#webhook)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L409)webhook * ****webhook**(webhook\_id): [WebhookClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookClientAsync.md) - Retrieve the sub-client for manipulating a single webhook. *** #### Parameters * ##### webhook\_id: str ID of the webhook to be manipulated. #### Returns [WebhookClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookClientAsync.md) ### [**](#webhook_dispatch)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L421)webhook\_dispatch * ****webhook\_dispatch**(webhook\_dispatch\_id): [WebhookDispatchClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchClientAsync.md) - Retrieve the sub-client for accessing a single webhook dispatch. *** #### Parameters * ##### webhook\_dispatch\_id: str ID of the webhook dispatch to access. #### Returns [WebhookDispatchClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchClientAsync.md) ### [**](#webhook_dispatches)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L429)webhook\_dispatches * ****webhook\_dispatches**(): [WebhookDispatchCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchCollectionClientAsync.md) - Retrieve the sub-client for querying multiple webhook dispatches of a user. *** #### Returns [WebhookDispatchCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchCollectionClientAsync.md) ### [**](#webhooks)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L417)webhooks * ****webhooks**(): [WebhookCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookCollectionClientAsync.md) - Retrieve the sub-client for querying multiple webhooks of a user. *** #### Returns [WebhookCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookCollectionClientAsync.md) ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L293)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Overrides [\_BaseApifyClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseApifyClient.md#http_client) --- # Source: https://docs.apify.com/api/client/python/reference/class/ApifyClientError.md # ApifyClientError Base class for errors specific to the Apify API Client. ### Hierarchy * *ApifyClientError* * [ApifyApiError](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyApiError.md) * [InvalidResponseBodyError](https://docs.apify.com/api/client/python/api/client/python/reference/class/InvalidResponseBodyError.md) --- # Source: https://docs.apify.com/sdk/js/reference/interface/ApifyClientOptions.md # Source: https://docs.apify.com/api/client/js/reference/interface/ApifyClientOptions.md # ApifyClientOptions Configuration options for ApifyClient. ## Index[**](#Index) ### Properties * [**baseUrl](#baseUrl) * [**maxRetries](#maxRetries) * [**minDelayBetweenRetriesMillis](#minDelayBetweenRetriesMillis) * [**publicBaseUrl](#publicBaseUrl) * [**requestInterceptors](#requestInterceptors) * [**timeoutSecs](#timeoutSecs) * [**token](#token) * [**userAgentSuffix](#userAgentSuffix) ## Properties[**](#Properties) ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L570)optionalbaseUrl **baseUrl? : string = https\://api.apify.com ### [**](#maxRetries)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L574)optionalmaxRetries **maxRetries? : number = 8 ### [**](#minDelayBetweenRetriesMillis)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L576)optionalminDelayBetweenRetriesMillis **minDelayBetweenRetriesMillis? : number = 500 ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L572)optionalpublicBaseUrl **publicBaseUrl? : string = https\://api.apify.com ### [**](#requestInterceptors)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L578)optionalrequestInterceptors **requestInterceptors? : (undefined | null | (value) => ApifyRequestConfig | Promise\)\[] = \[] ### [**](#timeoutSecs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L580)optionaltimeoutSecs **timeoutSecs? : number = 360 ### [**](#token)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L581)optionaltoken **token? : string ### [**](#userAgentSuffix)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/apify_client.ts#L582)optionaluserAgentSuffix **userAgentSuffix? : string | string\[] --- # Source: https://docs.apify.com/sdk/python/reference/class/ApifyDatasetClient.md # ApifyDatasetClient An Apify platform implementation of the dataset client. ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyDatasetClient.md#__init__) * [**drop](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyDatasetClient.md#drop) * [**get\_data](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyDatasetClient.md#get_data) * [**get\_metadata](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyDatasetClient.md#get_metadata) * [**iterate\_items](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyDatasetClient.md#iterate_items) * [**open](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyDatasetClient.md#open) * [**purge](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyDatasetClient.md#purge) * [**push\_data](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyDatasetClient.md#push_data) ## Methods[**](#Methods) ### [**](#__init__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_dataset_client.py#L40)\_\_init\_\_ * ****\_\_init\_\_**(\*, api\_client, api\_public\_base\_url, lock): None - Initialize a new instance. Preferably use the `ApifyDatasetClient.open` class method to create a new instance. *** #### Parameters * ##### keyword-onlyapi\_client: DatasetClientAsync * ##### keyword-onlyapi\_public\_base\_url: str * ##### keyword-onlylock: asyncio.Lock #### Returns None ### [**](#drop)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_dataset_client.py#L125)drop * **async **drop**(): None - #### Returns None ### [**](#get_data)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_dataset_client.py#L148)get\_data * **async **get\_data**(\*, offset, limit, clean, desc, fields, omit, unwind, skip\_empty, skip\_hidden, flatten, view): DatasetItemsListPage - #### Parameters * ##### optionalkeyword-onlyoffset: int = 0 * ##### optionalkeyword-onlylimit: int | None = 999\_999\_999\_999 * ##### optionalkeyword-onlyclean: bool = False * ##### optionalkeyword-onlydesc: bool = False * ##### optionalkeyword-onlyfields: list\[str] | None = None * ##### optionalkeyword-onlyomit: list\[str] | None = None * ##### optionalkeyword-onlyunwind: list\[str] | None = None * ##### optionalkeyword-onlyskip\_empty: bool = False * ##### optionalkeyword-onlyskip\_hidden: bool = False * ##### optionalkeyword-onlyflatten: list\[str] | None = None * ##### optionalkeyword-onlyview: str | None = None #### Returns DatasetItemsListPage ### [**](#get_metadata)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_dataset_client.py#L66)get\_metadata * **async **get\_metadata**(): DatasetMetadata - #### Returns DatasetMetadata ### [**](#iterate_items)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_dataset_client.py#L179)iterate\_items * **async **iterate\_items**(\*, offset, limit, clean, desc, fields, omit, unwind, skip\_empty, skip\_hidden): AsyncIterator\[dict] - #### Parameters * ##### optionalkeyword-onlyoffset: int = 0 * ##### optionalkeyword-onlylimit: int | None = None * ##### optionalkeyword-onlyclean: bool = False * ##### optionalkeyword-onlydesc: bool = False * ##### optionalkeyword-onlyfields: list\[str] | None = None * ##### optionalkeyword-onlyomit: list\[str] | None = None * ##### optionalkeyword-onlyunwind: list\[str] | None = None * ##### optionalkeyword-onlyskip\_empty: bool = False * ##### optionalkeyword-onlyskip\_hidden: bool = False #### Returns AsyncIterator\[dict] ### [**](#open)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_dataset_client.py#L71)open * **async **open**(\*, id, name, alias, configuration): [ApifyDatasetClient](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyDatasetClient.md) - Open an Apify dataset client. This method creates and initializes a new instance of the Apify dataset client. It handles authentication, storage lookup/creation, and metadata retrieval. *** #### Parameters * ##### keyword-onlyid: str | None The ID of the dataset to open. If provided, searches for existing dataset by ID. Mutually exclusive with name and alias. * ##### keyword-onlyname: str | None The name of the dataset to open (global scope, persists across runs). Mutually exclusive with id and alias. * ##### keyword-onlyalias: str | None The alias of the dataset to open (run scope, creates unnamed storage). Mutually exclusive with id and name. * ##### keyword-onlyconfiguration: [Configuration](https://docs.apify.com/sdk/python/sdk/python/reference/class/Configuration.md) The configuration object containing API credentials and settings. Must include a valid `token` and `api_base_url`. May also contain a `default_dataset_id` for fallback when neither `id`, `name`, nor `alias` is provided. #### Returns [ApifyDatasetClient](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyDatasetClient.md) ### [**](#purge)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_dataset_client.py#L118)purge * **async **purge**(): None - #### Returns None ### [**](#push_data)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_dataset_client.py#L130)push\_data * **async **push\_data**(data): None - #### Parameters * ##### data: list\[Any] | dict\[str, Any] #### Returns None --- # Source: https://docs.apify.com/sdk/js/reference/interface/ApifyEnv.md # ApifyEnv Parsed representation of the Apify environment variables. This object is returned by the [Actor.getEnv](https://docs.apify.com/sdk/js/sdk/js/reference/class/Actor.md#getEnv) function. ## Index[**](#Index) ### Properties * [**actorBuildId](#actorBuildId) * [**actorBuildNumber](#actorBuildNumber) * [**actorEventsWsUrl](#actorEventsWsUrl) * [**actorId](#actorId) * [**actorMaxPaidDatasetItems](#actorMaxPaidDatasetItems) * [**actorRunId](#actorRunId) * [**actorTaskId](#actorTaskId) * [**apiBaseUrl](#apiBaseUrl) * [**apiPublicBaseUrl](#apiPublicBaseUrl) * [**containerPort](#containerPort) * [**containerUrl](#containerUrl) * [**dedicatedCpus](#dedicatedCpus) * [**defaultDatasetId](#defaultDatasetId) * [**defaultKeyValueStoreId](#defaultKeyValueStoreId) * [**defaultRequestQueueId](#defaultRequestQueueId) * [**disableOutdatedWarning](#disableOutdatedWarning) * [**fact](#fact) * [**headless](#headless) * [**chromeExecutablePath](#chromeExecutablePath) * [**inputKey](#inputKey) * [**inputSecretsPrivateKeyFile](#inputSecretsPrivateKeyFile) * [**inputSecretsPrivateKeyPassphrase](#inputSecretsPrivateKeyPassphrase) * [**isAtHome](#isAtHome) * [**localStorageDir](#localStorageDir) * [**logFormat](#logFormat) * [**logLevel](#logLevel) * [**memoryMbytes](#memoryMbytes) * [**metaOrigin](#metaOrigin) * [**proxyHostname](#proxyHostname) * [**proxyPassword](#proxyPassword) * [**proxyPort](#proxyPort) * [**proxyStatusUrl](#proxyStatusUrl) * [**sdkLatestVersion](#sdkLatestVersion) * [**startedAt](#startedAt) * [**systemInfoIntervalMillis](#systemInfoIntervalMillis) * [**timeoutAt](#timeoutAt) * [**token](#token) * [**userId](#userId) * [**workflowKey](#workflowKey) ## Properties[**](#Properties) ### [**](#actorBuildId)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1779)actorBuildId **actorBuildId: null | string ID of the Actor build used in the run. (ACTOR\_BUILD\_ID) ### [**](#actorBuildNumber)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1881)actorBuildNumber **actorBuildNumber: null | string ### [**](#actorEventsWsUrl)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1882)actorEventsWsUrl **actorEventsWsUrl: null | string ### [**](#actorId)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1764)actorId **actorId: null | string ID of the Actor (ACTOR\_ID) ### [**](#actorMaxPaidDatasetItems)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1883)actorMaxPaidDatasetItems **actorMaxPaidDatasetItems: null | number ### [**](#actorRunId)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1769)actorRunId **actorRunId: null | string ID of the Actor run (ACTOR\_RUN\_ID) ### [**](#actorTaskId)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1774)actorTaskId **actorTaskId: null | string ID of the Actor task (ACTOR\_TASK\_ID) ### [**](#apiBaseUrl)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1844)apiBaseUrl **apiBaseUrl: null | string ### [**](#apiPublicBaseUrl)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1845)apiPublicBaseUrl **apiPublicBaseUrl: null | string ### [**](#containerPort)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1884)containerPort **containerPort: null | number ### [**](#containerUrl)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1885)containerUrl **containerUrl: null | string ### [**](#dedicatedCpus)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1847)dedicatedCpus **dedicatedCpus: null | string ### [**](#defaultDatasetId)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1813)defaultDatasetId **defaultDatasetId: null | string ID of the dataset where input and output data of this Actor is stored (ACTOR\_DEFAULT\_DATASET\_ID) ### [**](#defaultKeyValueStoreId)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1807)defaultKeyValueStoreId **defaultKeyValueStoreId: null | string ID of the key-value store where input and output data of this Actor is stored (ACTOR\_DEFAULT\_KEY\_VALUE\_STORE\_ID) ### [**](#defaultRequestQueueId)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1886)defaultRequestQueueId **defaultRequestQueueId: null | string ### [**](#disableOutdatedWarning)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1848)disableOutdatedWarning **disableOutdatedWarning: null | 1 ### [**](#fact)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1849)fact **fact: null | string ### [**](#headless)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1825)headless **headless: null | string If set to "1", the web browsers inside the Actor should run in headless mode because there is no windowing system available. (APIFY\_HEADLESS) ### [**](#chromeExecutablePath)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1846)chromeExecutablePath **chromeExecutablePath: null | string ### [**](#inputKey)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1877)inputKey **inputKey: null | string The key of the input record in the Actor’s default key-value store (ACTOR\_INPUT\_KEY) ### [**](#inputSecretsPrivateKeyFile)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1850)inputSecretsPrivateKeyFile **inputSecretsPrivateKeyFile: null | string ### [**](#inputSecretsPrivateKeyPassphrase)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1851)inputSecretsPrivateKeyPassphrase **inputSecretsPrivateKeyPassphrase: null | string ### [**](#isAtHome)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1831)isAtHome **isAtHome: null | string Is set to "1" if the Actor is running on Apify servers. (APIFY\_IS\_AT\_HOME) ### [**](#localStorageDir)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1859)localStorageDir **localStorageDir: null | string Defines the path to a local directory where KeyValueStore, Dataset, and RequestQueue store their data. Typically, it is set to ./storage. If omitted, you should define the APIFY\_TOKEN environment variable instead. See more info on combination of this and APIFY\_TOKEN [here](https://docs.apify.com/sdk/js/sdk/js/docs/guides/environment-variables.md#combinations-of-apify_local_storage_dir-and-apify_token)(CRAWLEE\_STORAGE\_DIR) ### [**](#logFormat)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1866)logFormat **logFormat: null | string ### [**](#logLevel)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1865)logLevel **logLevel: null | string Specifies the minimum log level, which can be one of the following values (in order of severity): DEBUG, INFO, WARNING and ERROR (APIFY\_LOG\_LEVEL) ### [**](#memoryMbytes)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1819)memoryMbytes **memoryMbytes: null | number Amount of memory allocated for the Actor, in megabytes (ACTOR\_MEMORY\_MBYTES) ### [**](#metaOrigin)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1872)metaOrigin **metaOrigin: null | string Origin for the Actor run, i.e. how it was started. See [here](https://docs.apify.com/sdk/python/reference/enum/MetaOrigin) for more details. (APIFY\_META\_ORIGIN) ### [**](#proxyHostname)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1837)proxyHostname **proxyHostname: null | string ### [**](#proxyPassword)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1836)proxyPassword **proxyPassword: null | string The Apify Proxy password of the user who started the Actor. (APIFY\_PROXY\_PASSWORD) ### [**](#proxyPort)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1838)proxyPort **proxyPort: null | string ### [**](#proxyStatusUrl)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1843)proxyStatusUrl **proxyStatusUrl: null | string You can visit this page to troubleshoot your proxy connection. (APIFY\_PROXY\_STATUS\_URL) ### [**](#sdkLatestVersion)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1878)sdkLatestVersion **sdkLatestVersion: null | string ### [**](#startedAt)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1796)startedAt **startedAt: null | Date Date when the Actor was started (ACTOR\_STARTED\_AT) ### [**](#systemInfoIntervalMillis)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1879)systemInfoIntervalMillis **systemInfoIntervalMillis: null | string ### [**](#timeoutAt)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1801)timeoutAt **timeoutAt: null | Date Date when the Actor will time out (ACTOR\_TIMEOUT\_AT) ### [**](#token)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1791)token **token: null | string Authentication token representing privileges given to the Actor run, it can be passed to various Apify APIs (APIFY\_TOKEN) ### [**](#userId)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1785)userId **userId: null | string ID of the user who started the Actor - note that it might be different than the owner of the Actor (APIFY\_USER\_ID) ### [**](#workflowKey)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1880)workflowKey **workflowKey: null | string --- # Source: https://docs.apify.com/sdk/python/reference/class/ApifyEventManager.md # ApifyEventManager Event manager for the Apify platform. This class extends Crawlee's `EventManager` to provide Apify-specific functionality, including websocket connectivity to the Apify platform for receiving platform events. The event manager handles: * Registration and emission of events and their listeners. * Websocket connection to Apify platform events. * Processing and validation of platform messages. * Automatic event forwarding from the platform to local event listeners. This class should not be used directly. Use the `Actor.on` and `Actor.off` methods to interact with the event system. ## Index[**](#Index) ### Methods * [**\_\_aenter\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyEventManager.md#__aenter__) * [**\_\_aexit\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyEventManager.md#__aexit__) * [**\_\_init\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyEventManager.md#__init__) ## Methods[**](#Methods) ### [**](#__aenter__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_apify_event_manager.py#L70)\_\_aenter\_\_ * **async **\_\_aenter\_\_**(): Self - #### Returns Self ### [**](#__aexit__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_apify_event_manager.py#L88)\_\_aexit\_\_ * **async **\_\_aexit\_\_**(exc\_type, exc\_value, exc\_traceback): None - #### Parameters * ##### exc\_type: type\[BaseException] | None * ##### exc\_value: BaseException | None * ##### exc\_traceback: TracebackType | None #### Returns None ### [**](#__init__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_apify_event_manager.py#L48)\_\_init\_\_ * ****\_\_init\_\_**(configuration): None - Initialize a new instance. *** #### Parameters * ##### configuration: [Configuration](https://docs.apify.com/sdk/python/sdk/python/reference/class/Configuration.md) The Actor configuration for the event manager. #### Returns None --- # Source: https://docs.apify.com/sdk/python/reference/class/ApifyFileSystemKeyValueStoreClient.md # ApifyFileSystemKeyValueStoreClient Apify-specific implementation of the `FileSystemKeyValueStoreClient`. The only difference is that it overrides the `purge` method to delete all files in the key-value store directory, except for the metadata file and the `INPUT.json` file. ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyFileSystemKeyValueStoreClient.md#__init__) * [**get\_value](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyFileSystemKeyValueStoreClient.md#get_value) * [**open](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyFileSystemKeyValueStoreClient.md#open) * [**purge](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyFileSystemKeyValueStoreClient.md#purge) ## Methods[**](#Methods) ### [**](#__init__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_file_system/_key_value_store_client.py#L27)\_\_init\_\_ * ****\_\_init\_\_**(\*, metadata, path\_to\_kvs, lock): None - #### Parameters * ##### keyword-onlymetadata: KeyValueStoreMetadata * ##### keyword-onlypath\_to\_kvs: Path * ##### keyword-onlylock: asyncio.Lock #### Returns None ### [**](#get_value)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_file_system/_key_value_store_client.py#L89)get\_value * **async **get\_value**(\*, key): KeyValueStoreRecord | None - #### Parameters * ##### keyword-onlykey: str #### Returns KeyValueStoreRecord | None ### [**](#open)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_file_system/_key_value_store_client.py#L41)open * **async **open**(\*, id, name, alias, configuration): Self - #### Parameters * ##### keyword-onlyid: str | None * ##### keyword-onlyname: str | None * ##### keyword-onlyalias: str | None * ##### keyword-onlyconfiguration: CrawleeConfiguration #### Returns Self ### [**](#purge)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_file_system/_key_value_store_client.py#L67)purge * **async **purge**(): None - Purges the key-value store by deleting all its contents. It deletes all files in the key-value store directory, except for the metadata file and the input related file and its metadata. *** #### Returns None --- # Source: https://docs.apify.com/sdk/python/reference/class/ApifyFileSystemStorageClient.md # ApifyFileSystemStorageClient Apify-specific implementation of the file system storage client. The only difference is that it uses `ApifyFileSystemKeyValueStoreClient` for key-value stores, which overrides the `purge` method to delete all files in the key-value store directory except for the metadata file and the `INPUT.json` file. ## Index[**](#Index) ### Methods * [**create\_kvs\_client](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyFileSystemStorageClient.md#create_kvs_client) * [**get\_storage\_client\_cache\_key](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyFileSystemStorageClient.md#get_storage_client_cache_key) ## Methods[**](#Methods) ### [**](#create_kvs_client)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_file_system/_storage_client.py#L34)create\_kvs\_client * **async **create\_kvs\_client**(\*, id, name, alias, configuration): FileSystemKeyValueStoreClient - #### Parameters * ##### optionalkeyword-onlyid: str | None = None * ##### optionalkeyword-onlyname: str | None = None * ##### optionalkeyword-onlyalias: str | None = None * ##### optionalkeyword-onlyconfiguration: [Configuration](https://docs.apify.com/sdk/python/sdk/python/reference/class/Configuration.md) | None = None #### Returns FileSystemKeyValueStoreClient ### [**](#get_storage_client_cache_key)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_file_system/_storage_client.py#L27)get\_storage\_client\_cache\_key * ****get\_storage\_client\_cache\_key**(configuration): Hashable - #### Parameters * ##### configuration: [Configuration](https://docs.apify.com/sdk/python/sdk/python/reference/class/Configuration.md) #### Returns Hashable --- # Source: https://docs.apify.com/sdk/python/reference/class/ApifyHttpProxyMiddleware.md # ApifyHttpProxyMiddleware Apify HTTP proxy middleware for Scrapy. This middleware enhances request processing by adding a 'proxy' field to the request's meta and an authentication header. It draws inspiration from the `HttpProxyMiddleware` included by default in Scrapy projects. The proxy URL is sourced from the settings under the `APIFY_PROXY_SETTINGS` key. The value of this key, a dictionary, should be provided by the Actor input. An example of the proxy settings: proxy\_settings = {'useApifyProxy': true, 'apifyProxyGroups': \[]} ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyHttpProxyMiddleware.md#__init__) * [**from\_crawler](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyHttpProxyMiddleware.md#from_crawler) * [**process\_exception](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyHttpProxyMiddleware.md#process_exception) * [**process\_request](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyHttpProxyMiddleware.md#process_request) ## Methods[**](#Methods) ### [**](#__init__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/scrapy/middlewares/apify_proxy.py#L28)\_\_init\_\_ * ****\_\_init\_\_**(proxy\_settings): None - Create a new instance. *** #### Parameters * ##### proxy\_settings: dict Dictionary containing proxy settings, provided by the Actor input. #### Returns None ### [**](#from_crawler)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/scrapy/middlewares/apify_proxy.py#L39)from\_crawler * ****from\_crawler**(crawler): [ApifyHttpProxyMiddleware](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyHttpProxyMiddleware.md) - Create an instance of ApifyHttpProxyMiddleware from a Scrapy Crawler. *** #### Parameters * ##### crawler: Crawler Scrapy Crawler object. #### Returns [ApifyHttpProxyMiddleware](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyHttpProxyMiddleware.md) ### [**](#process_exception)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/scrapy/middlewares/apify_proxy.py#L89)process\_exception * ****process\_exception**(request, exception, spider): None - Process an exception that occurs during request processing. *** #### Parameters * ##### request: Request Scrapy Request object. * ##### exception: Exception Exception object. * ##### spider: Spider Scrapy Spider object. #### Returns None ### [**](#process_request)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/scrapy/middlewares/apify_proxy.py#L67)process\_request * **async **process\_request**(request, spider): None - Process a Scrapy request by assigning a new proxy. *** #### Parameters * ##### request: Request Scrapy Request object. * ##### spider: Spider Scrapy Spider object. #### Returns None --- # Source: https://docs.apify.com/sdk/python/reference/class/ApifyKeyValueStoreClient.md # ApifyKeyValueStoreClient An Apify platform implementation of the key-value store client. ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyKeyValueStoreClient.md#__init__) * [**delete\_value](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyKeyValueStoreClient.md#delete_value) * [**drop](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyKeyValueStoreClient.md#drop) * [**get\_metadata](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyKeyValueStoreClient.md#get_metadata) * [**get\_public\_url](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyKeyValueStoreClient.md#get_public_url) * [**get\_value](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyKeyValueStoreClient.md#get_value) * [**iterate\_keys](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyKeyValueStoreClient.md#iterate_keys) * [**open](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyKeyValueStoreClient.md#open) * [**purge](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyKeyValueStoreClient.md#purge) * [**record\_exists](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyKeyValueStoreClient.md#record_exists) * [**set\_value](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyKeyValueStoreClient.md#set_value) ## Methods[**](#Methods) ### [**](#__init__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_key_value_store_client.py#L29)\_\_init\_\_ * ****\_\_init\_\_**(\*, api\_client, api\_public\_base\_url, lock): None - Initialize a new instance. Preferably use the `ApifyKeyValueStoreClient.open` class method to create a new instance. *** #### Parameters * ##### keyword-onlyapi\_client: KeyValueStoreClientAsync * ##### keyword-onlyapi\_public\_base\_url: str * ##### keyword-onlylock: asyncio.Lock #### Returns None ### [**](#delete_value)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_key_value_store_client.py#L132)delete\_value * **async **delete\_value**(\*, key): None - #### Parameters * ##### keyword-onlykey: str #### Returns None ### [**](#drop)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_key_value_store_client.py#L113)drop * **async **drop**(): None - #### Returns None ### [**](#get_metadata)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_key_value_store_client.py#L55)get\_metadata * **async **get\_metadata**(): [ApifyKeyValueStoreMetadata](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyKeyValueStoreMetadata.md) - #### Returns [ApifyKeyValueStoreMetadata](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyKeyValueStoreMetadata.md) ### [**](#get_public_url)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_key_value_store_client.py#L174)get\_public\_url * **async **get\_public\_url**(\*, key): str - Get a URL for the given key that may be used to publicly access the value in the remote key-value store. *** #### Parameters * ##### keyword-onlykey: str The key for which the URL should be generated. #### Returns str ### [**](#get_value)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_key_value_store_client.py#L118)get\_value * **async **get\_value**(\*, key): KeyValueStoreRecord | None - #### Parameters * ##### keyword-onlykey: str #### Returns KeyValueStoreRecord | None ### [**](#iterate_keys)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_key_value_store_client.py#L137)iterate\_keys * **async **iterate\_keys**(\*, exclusive\_start\_key, limit): AsyncIterator\[KeyValueStoreRecordMetadata] - #### Parameters * ##### optionalkeyword-onlyexclusive\_start\_key: str | None = None * ##### optionalkeyword-onlylimit: int | None = None #### Returns AsyncIterator\[KeyValueStoreRecordMetadata] ### [**](#open)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_key_value_store_client.py#L60)open * **async **open**(\*, id, name, alias, configuration): [ApifyKeyValueStoreClient](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyKeyValueStoreClient.md) - Open an Apify key-value store client. This method creates and initializes a new instance of the Apify key-value store client. It handles authentication, storage lookup/creation, and metadata retrieval. *** #### Parameters * ##### keyword-onlyid: str | None The ID of the KVS to open. If provided, searches for existing KVS by ID. Mutually exclusive with name and alias. * ##### keyword-onlyname: str | None The name of the KVS to open (global scope, persists across runs). Mutually exclusive with id and alias. * ##### keyword-onlyalias: str | None The alias of the KVS to open (run scope, creates unnamed storage). Mutually exclusive with id and name. * ##### keyword-onlyconfiguration: [Configuration](https://docs.apify.com/sdk/python/sdk/python/reference/class/Configuration.md) The configuration object containing API credentials and settings. Must include a valid `token` and `api_base_url`. May also contain a `default_key_value_store_id` for fallback when neither `id`, `name`, nor `alias` is provided. #### Returns [ApifyKeyValueStoreClient](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyKeyValueStoreClient.md) ### [**](#purge)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_key_value_store_client.py#L106)purge * **async **purge**(): None - #### Returns None ### [**](#record_exists)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_key_value_store_client.py#L170)record\_exists * **async **record\_exists**(\*, key): bool - #### Parameters * ##### keyword-onlykey: str #### Returns bool ### [**](#set_value)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_key_value_store_client.py#L123)set\_value * **async **set\_value**(\*, key, value, content\_type): None - #### Parameters * ##### keyword-onlykey: str * ##### keyword-onlyvalue: Any * ##### optionalkeyword-onlycontent\_type: str | None = None #### Returns None --- # Source: https://docs.apify.com/sdk/python/reference/class/ApifyKeyValueStoreMetadata.md # ApifyKeyValueStoreMetadata Extended key-value store metadata model for Apify platform. Includes additional Apify-specific fields. ## Index[**](#Index) ### Properties * [**url\_signing\_secret\_key](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyKeyValueStoreMetadata.md#url_signing_secret_key) ## Properties[**](#Properties) ### [**](#url_signing_secret_key)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L21)url\_signing\_secret\_key **url\_signing\_secret\_key: str | None The secret key used for signing URLs for secure access to key-value store records. --- # Source: https://docs.apify.com/sdk/python/reference/class/ApifyRequestList.md # ApifyRequestList Extends crawlee RequestList. Method open is used to create RequestList from actor's requestListSources input. ## Index[**](#Index) ### Methods * [**open](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestList.md#open) ## Methods[**](#Methods) ### [**](#open)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/request_loaders/_apify_request_list.py#L48)open * **async **open**(name, request\_list\_sources\_input, http\_client): [ApifyRequestList](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestList.md) - Initialize a new instance from request list source input. *** #### Parameters * ##### optionalname: str | None = None Name of the returned RequestList. * ##### optionalrequest\_list\_sources\_input: list\[dict\[str, Any]] | None = None List of dicts with either url key or requestsFromUrl key. * ##### optionalhttp\_client: HttpClient | None = None Client that will be used to send get request to urls defined by value of requestsFromUrl keys. #### Returns [ApifyRequestList](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestList.md) --- # Source: https://docs.apify.com/sdk/python/reference/class/ApifyRequestQueueClient.md # ApifyRequestQueueClient Request queue client for the Apify platform. This client provides access to request queues stored on the Apify platform, supporting both single-consumer and multi-consumer scenarios. It manages local caching, request fetching, and state synchronization with the platform's API. ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueClient.md#__init__) * [**add\_batch\_of\_requests](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueClient.md#add_batch_of_requests) * [**drop](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueClient.md#drop) * [**fetch\_next\_request](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueClient.md#fetch_next_request) * [**get\_metadata](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueClient.md#get_metadata) * [**get\_request](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueClient.md#get_request) * [**is\_empty](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueClient.md#is_empty) * [**mark\_request\_as\_handled](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueClient.md#mark_request_as_handled) * [**open](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueClient.md#open) * [**purge](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueClient.md#purge) * [**reclaim\_request](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueClient.md#reclaim_request) ## Methods[**](#Methods) ### [**](#__init__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_client.py#L38)\_\_init\_\_ * ****\_\_init\_\_**(\*, api\_client, metadata, access): None - Initialize a new instance. Preferably use the `ApifyRequestQueueClient.open` class method to create a new instance. *** #### Parameters * ##### keyword-onlyapi\_client: RequestQueueClientAsync * ##### keyword-onlymetadata: RequestQueueMetadata * ##### optionalkeyword-onlyaccess: Literal\[single, shared] = 'single' #### Returns None ### [**](#add_batch_of_requests)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_client.py#L168)add\_batch\_of\_requests * **async **add\_batch\_of\_requests**(requests, \*, forefront): AddRequestsResponse - #### Parameters * ##### requests: Sequence\[Request] * ##### optionalkeyword-onlyforefront: bool = False #### Returns AddRequestsResponse ### [**](#drop)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_client.py#L164)drop * **async **drop**(): None - #### Returns None ### [**](#fetch_next_request)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_client.py#L177)fetch\_next\_request * **async **fetch\_next\_request**(): Request | None - #### Returns Request | None ### [**](#get_metadata)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_client.py#L70)get\_metadata * **async **get\_metadata**(): [ApifyRequestQueueMetadata](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueMetadata.md) - Retrieve current metadata about the request queue. This method fetches metadata from the Apify API and merges it with local estimations to provide the most up-to-date statistics. Local estimations are used to compensate for potential delays in API data propagation (typically a few seconds). *** #### Returns [ApifyRequestQueueMetadata](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueMetadata.md) ### [**](#get_request)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_client.py#L185)get\_request * **async **get\_request**(unique\_key): Request | None - #### Parameters * ##### unique\_key: str #### Returns Request | None ### [**](#is_empty)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_client.py#L198)is\_empty * **async **is\_empty**(): bool - #### Returns bool ### [**](#mark_request_as_handled)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_client.py#L181)mark\_request\_as\_handled * **async **mark\_request\_as\_handled**(request): ProcessedRequest | None - #### Parameters * ##### request: Request #### Returns ProcessedRequest | None ### [**](#open)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_client.py#L103)open * **async **open**(\*, id, name, alias, configuration, access): [ApifyRequestQueueClient](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueClient.md) - Open an Apify request queue client. This method creates and initializes a new request queue client instance, handling authentication, storage lookup or creation, metadata retrieval, and initialization of internal caching structures. *** #### Parameters * ##### keyword-onlyid: str | None ID of an existing request queue to open. Mutually exclusive with `name` and `alias`. * ##### keyword-onlyname: str | None Name of the request queue to open or create (persists across Actor runs). Mutually exclusive with `id` and `alias`. * ##### keyword-onlyalias: str | None Alias for the request queue (scoped to current Actor run, creates unnamed storage). Mutually exclusive with `id` and `name`. * ##### keyword-onlyconfiguration: [Configuration](https://docs.apify.com/sdk/python/sdk/python/reference/class/Configuration.md) Configuration object containing API credentials (`token`, `api_base_url`) and optionally a `default_request_queue_id` for fallback when no identifier is provided. * ##### optionalkeyword-onlyaccess: Literal\[single, shared] = 'single' Access mode controlling the client's behavior: * `single`: Optimized for single-consumer scenarios (lower API usage, better performance). * `shared`: Optimized for multi-consumer scenarios (more API calls, guaranteed consistency). #### Returns [ApifyRequestQueueClient](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueClient.md) ### [**](#purge)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_client.py#L157)purge * **async **purge**(): None - #### Returns None ### [**](#reclaim_request)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_client.py#L189)reclaim\_request * **async **reclaim\_request**(request, \*, forefront): ProcessedRequest | None - #### Parameters * ##### request: Request * ##### optionalkeyword-onlyforefront: bool = False #### Returns ProcessedRequest | None --- # Source: https://docs.apify.com/sdk/python/reference/class/ApifyRequestQueueMetadata.md # ApifyRequestQueueMetadata ## Index[**](#Index) ### Properties * [**stats](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueMetadata.md#stats) ## Properties[**](#Properties) ### [**](#stats)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L130)stats **stats: [RequestQueueStats](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestQueueStats.md) Additional statistics about the request queue. --- # Source: https://docs.apify.com/sdk/python/reference/class/ApifyRequestQueueSharedClient.md # ApifyRequestQueueSharedClient Internal request queue client implementation for multi-consumer scenarios on the Apify platform. This implementation is optimized for scenarios where multiple clients concurrently fetch and process requests from the same queue. It makes more frequent API calls to ensure consistency across all consumers and uses request locking to prevent duplicate processing. This class is used internally by `ApifyRequestQueueClient` when `access='shared'` is specified. Public methods are not individually documented as they implement the interface defined in `RequestQueueClient`. ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueSharedClient.md#__init__) * [**add\_batch\_of\_requests](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueSharedClient.md#add_batch_of_requests) * [**fetch\_next\_request](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueSharedClient.md#fetch_next_request) * [**get\_request](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueSharedClient.md#get_request) * [**is\_empty](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueSharedClient.md#is_empty) * [**mark\_request\_as\_handled](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueSharedClient.md#mark_request_as_handled) * [**reclaim\_request](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueSharedClient.md#reclaim_request) ## Methods[**](#Methods) ### [**](#__init__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_shared_client.py#L40)\_\_init\_\_ * ****\_\_init\_\_**(\*, api\_client, metadata, cache\_size, metadata\_getter): None - Initialize a new shared request queue client instance. Use `ApifyRequestQueueClient.open(access='shared')` instead of calling this directly. *** #### Parameters * ##### keyword-onlyapi\_client: RequestQueueClientAsync The Apify API client for request queue operations. * ##### keyword-onlymetadata: RequestQueueMetadata Initial metadata for the request queue. * ##### keyword-onlycache\_size: int Maximum number of requests to cache locally. * ##### keyword-onlymetadata\_getter: Callable\[\[], Coroutine\[Any, Any, [ApifyRequestQueueMetadata](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueMetadata.md)]] Async function to fetch current metadata from the API. #### Returns None ### [**](#add_batch_of_requests)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_shared_client.py#L82)add\_batch\_of\_requests * **async **add\_batch\_of\_requests**(requests, \*, forefront): AddRequestsResponse - Specific implementation of this method for the RQ shared access mode. *** #### Parameters * ##### requests: Sequence\[Request] * ##### optionalkeyword-onlyforefront: bool = False #### Returns AddRequestsResponse ### [**](#fetch_next_request)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_shared_client.py#L170)fetch\_next\_request * **async **fetch\_next\_request**(): Request | None - Specific implementation of this method for the RQ shared access mode. *** #### Returns Request | None ### [**](#get_request)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_shared_client.py#L166)get\_request * **async **get\_request**(unique\_key): Request | None - Specific implementation of this method for the RQ shared access mode. *** #### Parameters * ##### unique\_key: str #### Returns Request | None ### [**](#is_empty)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_shared_client.py#L288)is\_empty * **async **is\_empty**(): bool - Specific implementation of this method for the RQ shared access mode. *** #### Returns bool ### [**](#mark_request_as_handled)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_shared_client.py#L212)mark\_request\_as\_handled * **async **mark\_request\_as\_handled**(request): ProcessedRequest | None - Specific implementation of this method for the RQ shared access mode. *** #### Parameters * ##### request: Request #### Returns ProcessedRequest | None ### [**](#reclaim_request)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_shared_client.py#L244)reclaim\_request * **async **reclaim\_request**(request, \*, forefront): ProcessedRequest | None - Specific implementation of this method for the RQ shared access mode. *** #### Parameters * ##### request: Request * ##### optionalkeyword-onlyforefront: bool = False #### Returns ProcessedRequest | None --- # Source: https://docs.apify.com/sdk/python/reference/class/ApifyRequestQueueSingleClient.md # ApifyRequestQueueSingleClient Internal request queue client implementation for single-consumer scenarios on the Apify platform. This implementation minimizes API calls and resource usage by leveraging local caching and head estimation. It is designed for scenarios where only one client consumes requests from the queue at a time, though multiple producers may add requests concurrently. ### Usage constraints This client must operate within the following constraints to function correctly: * **Single consumer**: Only one client should be consuming (fetching) requests from the queue at any given time. * **Multiple producers allowed**: Multiple clients can add requests concurrently, but their forefront requests may not be prioritized immediately since this client relies on local head estimation. * **Append-only queue**: Requests should only be added to the queue, never deleted by other clients. Marking requests as handled is permitted. * **No external modifications**: Other producers can add new requests but should not modify existing ones, as modifications won't be reflected in the local cache. If these constraints are not met, the client may exhibit unpredictable behavior. This class is used internally by `ApifyRequestQueueClient` when `access='single'` is specified. Public methods are not individually documented as they implement the interface defined in `RequestQueueClient`. ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueSingleClient.md#__init__) * [**add\_batch\_of\_requests](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueSingleClient.md#add_batch_of_requests) * [**fetch\_next\_request](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueSingleClient.md#fetch_next_request) * [**get\_request](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueSingleClient.md#get_request) * [**is\_empty](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueSingleClient.md#is_empty) * [**mark\_request\_as\_handled](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueSingleClient.md#mark_request_as_handled) * [**reclaim\_request](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueSingleClient.md#reclaim_request) ## Methods[**](#Methods) ### [**](#__init__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_single_client.py#L52)\_\_init\_\_ * ****\_\_init\_\_**(\*, api\_client, metadata, cache\_size): None - Initialize a new single-consumer request queue client instance. Use `ApifyRequestQueueClient.open(access='single')` instead of calling this directly. *** #### Parameters * ##### keyword-onlyapi\_client: RequestQueueClientAsync The Apify API client for request queue operations. * ##### keyword-onlymetadata: RequestQueueMetadata Initial metadata for the request queue. * ##### keyword-onlycache\_size: int Maximum number of requests to cache locally. #### Returns None ### [**](#add_batch_of_requests)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_single_client.py#L98)add\_batch\_of\_requests * **async **add\_batch\_of\_requests**(requests, \*, forefront): AddRequestsResponse - Specific implementation of this method for the RQ single access mode. *** #### Parameters * ##### requests: Sequence\[Request] * ##### optionalkeyword-onlyforefront: bool = False #### Returns AddRequestsResponse ### [**](#fetch_next_request)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_single_client.py#L187)fetch\_next\_request * **async **fetch\_next\_request**(): Request | None - Specific implementation of this method for the RQ single access mode. *** #### Returns Request | None ### [**](#get_request)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_single_client.py#L183)get\_request * **async **get\_request**(unique\_key): Request | None - Specific implementation of this method for the RQ single access mode. *** #### Parameters * ##### unique\_key: str #### Returns Request | None ### [**](#is_empty)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_single_client.py#L272)is\_empty * **async **is\_empty**(): bool - Specific implementation of this method for the RQ single access mode. *** #### Returns bool ### [**](#mark_request_as_handled)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_single_client.py#L199)mark\_request\_as\_handled * **async **mark\_request\_as\_handled**(request): ProcessedRequest | None - Specific implementation of this method for the RQ single access mode. *** #### Parameters * ##### request: Request #### Returns ProcessedRequest | None ### [**](#reclaim_request)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_request_queue_single_client.py#L229)reclaim\_request * **async **reclaim\_request**(request, \*, forefront): ProcessedRequest | None - Specific implementation of this method for the RQ single access mode. *** #### Parameters * ##### request: Request * ##### optionalkeyword-onlyforefront: bool = False #### Returns ProcessedRequest | None --- # Source: https://docs.apify.com/sdk/python/reference/class/ApifyScheduler.md # ApifyScheduler A Scrapy scheduler that uses the Apify `RequestQueue` to manage requests. This scheduler requires the asyncio Twisted reactor to be installed. ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyScheduler.md#__init__) * [**close](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyScheduler.md#close) * [**enqueue\_request](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyScheduler.md#enqueue_request) * [**has\_pending\_requests](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyScheduler.md#has_pending_requests) * [**next\_request](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyScheduler.md#next_request) * [**open](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyScheduler.md#open) ## Methods[**](#Methods) ### [**](#__init__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/scrapy/scheduler.py#L30)\_\_init\_\_ * ****\_\_init\_\_**(): None - #### Returns None ### [**](#close)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/scrapy/scheduler.py#L69)close * ****close**(reason): None - Close the scheduler. Shut down the event loop and its thread gracefully. *** #### Parameters * ##### reason: str The reason for closing the spider. #### Returns None ### [**](#enqueue_request)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/scrapy/scheduler.py#L107)enqueue\_request * ****enqueue\_request**(request): bool - Add a request to the scheduler. This could be called from either from a spider or a downloader middleware (e.g. redirect, retry, ...). *** #### Parameters * ##### request: Request The request to add to the scheduler. #### Returns bool ### [**](#has_pending_requests)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/scrapy/scheduler.py#L90)has\_pending\_requests * ****has\_pending\_requests**(): bool - Check if the scheduler has any pending requests. *** #### Returns bool ### [**](#next_request)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/scrapy/scheduler.py#L141)next\_request * ****next\_request**(): Request | None - Fetch the next request from the scheduler. *** #### Returns Request | None ### [**](#open)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/scrapy/scheduler.py#L43)open * ****open**(spider): Deferred\[None] | None - Open the scheduler. *** #### Parameters * ##### spider: Spider The spider that the scheduler is associated with. #### Returns Deferred\[None] | None --- # Source: https://docs.apify.com/sdk/python/reference/class/ApifyStorageClient.md # ApifyStorageClient Apify platform implementation of the storage client. This storage client provides access to datasets, key-value stores, and request queues that persist data to the Apify platform. Each storage type is implemented with its own specific Apify client that stores data in the cloud, making it accessible from anywhere. The communication with the Apify platform is handled via the Apify API client for Python, which is an HTTP API wrapper. For maximum efficiency and performance of the storage clients, various caching mechanisms are used to minimize the number of API calls made to the Apify platform. Data can be inspected and manipulated through the Apify console web interface or via the Apify API. The request queue client supports two access modes controlled by the `request_queue_access` parameter: ### Single mode The `single` mode is optimized for scenarios with only one consumer. It minimizes API calls, making it faster and more cost-efficient compared to the `shared` mode. This option is ideal when a single Actor is responsible for consuming the entire request queue. Using multiple consumers simultaneously may lead to inconsistencies or unexpected behavior. In this mode, multiple producers can safely add new requests, but forefront requests may not be processed immediately, as the client relies on local head estimation instead of frequent forefront fetching. Requests can also be added or marked as handled by other clients, but they must not be deleted or modified, since such changes would not be reflected in the local cache. If a request is already fully cached locally, marking it as handled by another client will be ignored by this client. This does not cause errors but can occasionally result in reprocessing a request that was already handled elsewhere. If the request was not yet cached locally, marking it as handled poses no issue. ### Shared mode The `shared` mode is designed for scenarios with multiple concurrent consumers. It ensures proper synchronization and consistency across clients, at the cost of higher API usage and slightly worse performance. This mode is safe for concurrent access from multiple processes, including Actors running in parallel on the Apify platform. It should be used when multiple consumers need to process requests from the same queue simultaneously. ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyStorageClient.md#__init__) * [**create\_dataset\_client](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyStorageClient.md#create_dataset_client) * [**create\_kvs\_client](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyStorageClient.md#create_kvs_client) * [**create\_rq\_client](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyStorageClient.md#create_rq_client) * [**get\_storage\_client\_cache\_key](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyStorageClient.md#get_storage_client_cache_key) ## Methods[**](#Methods) ### [**](#__init__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_storage_client.py#L66)\_\_init\_\_ * ****\_\_init\_\_**(\*, request\_queue\_access): None - Initialize a new instance. *** #### Parameters * ##### optionalkeyword-onlyrequest\_queue\_access: Literal\[single, shared] = 'single' Defines how the request queue client behaves. Use `single` mode for a single consumer. It has fewer API calls, meaning better performance and lower costs. If you need multiple concurrent consumers use `shared` mode, but expect worse performance and higher costs due to the additional overhead. #### Returns None ### [**](#create_dataset_client)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_storage_client.py#L78)create\_dataset\_client * **async **create\_dataset\_client**(\*, id, name, alias, configuration): [ApifyDatasetClient](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyDatasetClient.md) - #### Parameters * ##### optionalkeyword-onlyid: str | None = None * ##### optionalkeyword-onlyname: str | None = None * ##### optionalkeyword-onlyalias: str | None = None * ##### optionalkeyword-onlyconfiguration: CrawleeConfiguration | None = None #### Returns [ApifyDatasetClient](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyDatasetClient.md) ### [**](#create_kvs_client)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_storage_client.py#L93)create\_kvs\_client * **async **create\_kvs\_client**(\*, id, name, alias, configuration): [ApifyKeyValueStoreClient](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyKeyValueStoreClient.md) - #### Parameters * ##### optionalkeyword-onlyid: str | None = None * ##### optionalkeyword-onlyname: str | None = None * ##### optionalkeyword-onlyalias: str | None = None * ##### optionalkeyword-onlyconfiguration: CrawleeConfiguration | None = None #### Returns [ApifyKeyValueStoreClient](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyKeyValueStoreClient.md) ### [**](#create_rq_client)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_storage_client.py#L108)create\_rq\_client * **async **create\_rq\_client**(\*, id, name, alias, configuration): [ApifyRequestQueueClient](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueClient.md) - #### Parameters * ##### optionalkeyword-onlyid: str | None = None * ##### optionalkeyword-onlyname: str | None = None * ##### optionalkeyword-onlyalias: str | None = None * ##### optionalkeyword-onlyconfiguration: CrawleeConfiguration | None = None #### Returns [ApifyRequestQueueClient](https://docs.apify.com/sdk/python/sdk/python/reference/class/ApifyRequestQueueClient.md) ### [**](#get_storage_client_cache_key)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_storage_client.py#L125)get\_storage\_client\_cache\_key * ****get\_storage\_client\_cache\_key**(configuration): Hashable - #### Parameters * ##### configuration: CrawleeConfiguration #### Returns Hashable --- # Source: https://docs.apify.com/sdk/python/reference/class/AsyncThread.md # AsyncThread Class for running an asyncio event loop in a separate thread. This allows running asynchronous coroutines from synchronous code by executingthem on an event loop that runs in its own dedicated thread. ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/AsyncThread.md#__init__) * [**close](https://docs.apify.com/sdk/python/sdk/python/reference/class/AsyncThread.md#close) * [**run\_coro](https://docs.apify.com/sdk/python/sdk/python/reference/class/AsyncThread.md#run_coro) ## Methods[**](#Methods) ### [**](#__init__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/scrapy/_async_thread.py#L23)\_\_init\_\_ * ****\_\_init\_\_**(): None - #### Returns None ### [**](#close)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/scrapy/_async_thread.py#L70)close * ****close**(timeout): None - Close the event loop and its thread gracefully. This method cancels all pending tasks, stops the event loop, and waits for the thread to exit. If the thread does not exit within the given timeout, a forced shutdown is attempted. *** #### Parameters * ##### optionaltimeout: timedelta = timedelta(seconds=60) The maximum number of seconds to wait for the event loop thread to exit. #### Returns None ### [**](#run_coro)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/scrapy/_async_thread.py#L33)run\_coro * ****run\_coro**(coro, timeout): Any - Run a coroutine on an event loop running in a separate thread. This method schedules the coroutine to run on the event loop and blocks until the coroutine completes or the specified timeout is reached. *** #### Parameters * ##### coro: Coroutine The coroutine to run. * ##### optionaltimeout: timedelta = timedelta(seconds=60) The maximum number of seconds to wait for the coroutine to finish. #### Returns Any --- # Source: https://docs.apify.com/api/client/js/reference/interface/BaseActorVersion.md # BaseActorVersion \ ### Hierarchy * *BaseActorVersion* * [ActorVersionSourceFiles](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorVersionSourceFiles.md) * [ActorVersionGitRepo](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorVersionGitRepo.md) * [ActorVersionTarball](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorVersionTarball.md) * [ActorVersionGitHubGist](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorVersionGitHubGist.md) ## Index[**](#Index) ### Properties * [**applyEnvVarsToBuild](#applyEnvVarsToBuild) * [**buildTag](#buildTag) * [**envVars](#envVars) * [**sourceType](#sourceType) * [**versionNumber](#versionNumber) ## Properties[**](#Properties) ### [**](#applyEnvVarsToBuild)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L103)optionalapplyEnvVarsToBuild **applyEnvVarsToBuild? : boolean ### [**](#buildTag)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L104)optionalbuildTag **buildTag? : string ### [**](#envVars)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L102)optionalenvVars **envVars? : [ActorEnvironmentVariable](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorEnvironmentVariable.md)\[] ### [**](#sourceType)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L101)sourceType **sourceType: SourceType ### [**](#versionNumber)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor_version.ts#L100)optionalversionNumber **versionNumber? : string --- # Source: https://docs.apify.com/api/client/python/reference/class/BaseClient.md # BaseClient Base class for sub-clients. ### Hierarchy * [\_BaseBaseClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md) * *BaseClient* * [ResourceCollectionClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClient.md) * [ResourceClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClient.md) ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClient.md#__init__) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClient.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClient.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClient.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClient.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClient.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L56)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) The ApifyClient instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) The HTTPClient instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L53)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L54)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/python/reference/class/BaseClientAsync.md # BaseClientAsync Base class for async sub-clients. ### Hierarchy * [\_BaseBaseClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md) * *BaseClientAsync* * [ResourceCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md) * [ResourceClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md) ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#__init__) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L97)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/python/reference/class/BatchAddRequestsResult.md # BatchAddRequestsResult Result of the batch add requests operation. ## Index[**](#Index) ### Properties * [**processedRequests](https://docs.apify.com/api/client/python/api/client/python/reference/class/BatchAddRequestsResult.md#processedRequests) * [**unprocessedRequests](https://docs.apify.com/api/client/python/api/client/python/reference/class/BatchAddRequestsResult.md#unprocessedRequests) ## Properties[**](#Properties) ### [**](#processedRequests)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/request_queue.py#L44)processedRequests **processedRequests: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[dict] List of successfully added requests. ### [**](#unprocessedRequests)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/request_queue.py#L45)unprocessedRequests **unprocessedRequests: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[dict] List of requests that failed to be added. --- # Source: https://docs.apify.com/api/client/js/reference/interface/Build.md # Build Represents an Actor build. Builds compile Actor source code and prepare it for execution. Each build has a unique ID and can be tagged (e.g., 'latest', 'beta') for easy reference. ## Index[**](#Index) ### Properties * [**actId](#actId) * [**actorDefinition](#actorDefinition) * [**buildNumber](#buildNumber) * [**finishedAt](#finishedAt) * [**id](#id) * [**inputSchema](#inputSchema) * [**meta](#meta) * [**options](#options) * [**readme](#readme) * [**startedAt](#startedAt) * [**stats](#stats) * [**status](#status) * [**usage](#usage) * [**usageTotalUsd](#usageTotalUsd) * [**usageUsd](#usageUsd) * [**userId](#userId) ## Properties[**](#Properties) ### [**](#actId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L221)actId **actId: string ### [**](#actorDefinition)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L241)optionalactorDefinition **actorDefinition? : [ActorDefinition](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorDefinition.md) ### [**](#buildNumber)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L237)buildNumber **buildNumber: string ### [**](#finishedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L224)optionalfinishedAt **finishedAt? : Date ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L220)id **id: string ### [**](#inputSchema)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L232)optionalinputSchema **inputSchema? : string * **@deprecated** This property is deprecated in favor of `actorDefinition.input`. ### [**](#meta)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L226)meta **meta: [BuildMeta](https://docs.apify.com/api/client/js/api/client/js/reference/interface/BuildMeta.md) ### [**](#options)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L228)optionaloptions **options? : [BuildOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/BuildOptions.md) ### [**](#readme)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L236)optionalreadme **readme? : string * **@deprecated** This property is deprecated in favor of `actorDefinition.readme`. ### [**](#startedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L223)startedAt **startedAt: Date ### [**](#stats)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L227)optionalstats **stats? : [BuildStats](https://docs.apify.com/api/client/js/api/client/js/reference/interface/BuildStats.md) ### [**](#status)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L225)status **status: SUCCEEDED | FAILED | ABORTED | TIMED-OUT ### [**](#usage)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L238)optionalusage **usage? : [BuildUsage](https://docs.apify.com/api/client/js/api/client/js/reference/interface/BuildUsage.md) ### [**](#usageTotalUsd)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L239)optionalusageTotalUsd **usageTotalUsd? : number ### [**](#usageUsd)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L240)optionalusageUsd **usageUsd? : [BuildUsage](https://docs.apify.com/api/client/js/api/client/js/reference/interface/BuildUsage.md) ### [**](#userId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L222)userId **userId: string --- # Source: https://docs.apify.com/api/client/python/reference/class/BuildClient.md # Source: https://docs.apify.com/api/client/js/reference/class/BuildClient.md # BuildClient Client for managing a specific Actor build. Builds are created when an Actor is built from source code. This client provides methods to get build details, wait for the build to finish, abort it, and access its logs. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const buildClient = client.build('my-build-id'); // Get build details const build = await buildClient.get(); // Wait for the build to finish const finishedBuild = await buildClient.waitForFinish(); // Access build logs const log = await buildClient.log().get(); ``` * **@see** ### Hierarchy * ResourceClient * *BuildClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**abort](#abort) * [**delete](#delete) * [**get](#get) * [**getOpenApiDefinition](#getOpenApiDefinition) * [**log](#log) * [**waitForFinish](#waitForFinish) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceClient.url ## Methods[**](#Methods) ### [**](#abort)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L87)abort * ****abort**(): Promise<[Build](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Build.md)> - Aborts the Actor build. Stops the build process immediately. The build will have an `ABORTED` status. * **@see** * **@example** ``` await client.build('build-id').abort(); ``` *** #### Returns Promise<[Build](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Build.md)> The updated Build object with `ABORTED` status ### [**](#delete)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L102)delete * ****delete**(): Promise\ - Deletes the Actor build. * **@see** *** #### Returns Promise\ ### [**](#get)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L63)get * ****get**(options): Promise\ - Gets the Actor build object from the Apify API. * **@see** * **@example** ``` // Get build status immediately const build = await client.build('build-id').get(); console.log(`Status: ${build.status}`); // Wait up to 60 seconds for build to finish const build = await client.build('build-id').get({ waitForFinish: 60 }); ``` *** #### Parameters * ##### options: [BuildClientGetOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/BuildClientGetOptions.md) = {} Get options #### Returns Promise\ The Build object, or `undefined` if it does not exist ### [**](#getOpenApiDefinition)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L112)getOpenApiDefinition * ****getOpenApiDefinition**(): Promise<[OpenApiDefinition](https://docs.apify.com/api/client/js/api/client/js/reference/interface/OpenApiDefinition.md)> - Retrieves the OpenAPI definition for the Actor build. * **@see** *** #### Returns Promise<[OpenApiDefinition](https://docs.apify.com/api/client/js/api/client/js/reference/interface/OpenApiDefinition.md)> The OpenAPI definition object. ### [**](#log)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L176)log * ****log**(): [LogClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/LogClient.md) - Returns a client for accessing the log of this Actor build. * **@see** * **@example** ``` // Get build log const log = await client.build('build-id').log().get(); console.log(log); ``` *** #### Returns [LogClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/LogClient.md) A client for accessing the build's log ### [**](#waitForFinish)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L152)waitForFinish * ****waitForFinish**(options): Promise<[Build](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Build.md)> - Waits for the Actor build to finish and returns the finished Build object. The promise resolves when the build reaches a terminal state (`SUCCEEDED`, `FAILED`, `ABORTED`, or `TIMED-OUT`). If `waitSecs` is provided and the timeout is reached, the promise resolves with the unfinished Build object (status will be `RUNNING` or `READY`). The promise is NOT rejected based on build status. Unlike the `waitForFinish` parameter in get, this method can wait indefinitely by polling the build status. It uses the `waitForFinish` parameter internally (max 60s per call) and continuously polls until the build finishes or the timeout is reached. This is useful when you need to immediately start a run after a build finishes. * **@example** ``` // Wait indefinitely for build to finish const build = await client.build('build-id').waitForFinish(); console.log(`Build finished with status: ${build.status}`); // Start a run immediately after build succeeds const build = await client.build('build-id').waitForFinish(); if (build.status === 'SUCCEEDED') { const run = await client.actor('my-actor').start(); } ``` *** #### Parameters * ##### options: [BuildClientWaitForFinishOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/BuildClientWaitForFinishOptions.md) = {} Wait options #### Returns Promise<[Build](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Build.md)> The Build object (finished or still building if timeout was reached) --- # Source: https://docs.apify.com/api/client/python/reference/class/BuildClientAsync.md # BuildClientAsync Async sub-client for manipulating a single Actor build. ### Hierarchy * [ActorJobBaseClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorJobBaseClientAsync.md) * *BuildClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildClientAsync.md#__init__) * [**abort](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildClientAsync.md#abort) * [**delete](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildClientAsync.md#delete) * [**get](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildClientAsync.md#get) * [**get\_open\_api\_definition](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildClientAsync.md#get_open_api_definition) * [**log](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildClientAsync.md#log) * [**wait\_for\_finish](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildClientAsync.md#wait_for_finish) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/build.py#L88)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ActorJobBaseClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorJobBaseClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#abort)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/build.py#L102)abort * **async **abort**(): dict - Abort the Actor build which is starting or currently running and return its details. *** #### Returns dict ### [**](#delete)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/build.py#L112)delete * **async **delete**(): None - Delete the build. *** #### Returns None ### [**](#get)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/build.py#L92)get * **async **get**(): dict | None - Return information about the Actor build. *** #### Returns dict | None ### [**](#get_open_api_definition)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/build.py#L119)get\_open\_api\_definition * **async **get\_open\_api\_definition**(): dict | None - Return OpenAPI definition of the Actor's build. *** #### Returns dict | None ### [**](#log)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/build.py#L148)log * ****log**(): [LogClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogClientAsync.md) - Get the client for the log of the Actor build. *** #### Returns [LogClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogClientAsync.md) ### [**](#wait_for_finish)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/build.py#L136)wait\_for\_finish * **async **wait\_for\_finish**(\*, wait\_secs): dict | None - Wait synchronously until the build finishes or the server times out. *** #### Parameters * ##### optionalkeyword-onlywait\_secs: int | None = None How long does the client wait for build to finish. None for indefinite. #### Returns dict | None ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/js/reference/interface/BuildClientGetOptions.md # BuildClientGetOptions Options for getting a Build. ## Index[**](#Index) ### Properties * [**waitForFinish](#waitForFinish) ## Properties[**](#Properties) ### [**](#waitForFinish)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L189)optionalwaitForFinish **waitForFinish? : number --- # Source: https://docs.apify.com/api/client/js/reference/interface/BuildClientWaitForFinishOptions.md # BuildClientWaitForFinishOptions Options for waiting for a Build to finish. ## Index[**](#Index) ### Properties * [**waitSecs](#waitSecs) ## Properties[**](#Properties) ### [**](#waitSecs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L201)optionalwaitSecs **waitSecs? : number Maximum time to wait for the build to finish, in seconds. If the limit is reached, the returned promise is resolved to a build object that will have status `READY` or `RUNNING`. If `waitSecs` omitted, the function waits indefinitely. --- # Source: https://docs.apify.com/api/client/python/reference/class/BuildCollectionClient.md # Source: https://docs.apify.com/api/client/js/reference/class/BuildCollectionClient.md # BuildCollectionClient Client for managing the collection of Actor builds. Provides methods to list Actor builds across all Actors or for a specific Actor. To access an individual build, use the `build()` method on the main ApifyClient. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); // List all builds const buildsClient = client.builds(); const { items } = await buildsClient.list(); // List builds for a specific Actor const actorBuildsClient = client.actor('my-actor-id').builds(); const { items: actorBuilds } = await actorBuildsClient.list(); ``` * **@see** ### Hierarchy * ResourceCollectionClient * *BuildCollectionClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**list](#list) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceCollectionClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceCollectionClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceCollectionClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceCollectionClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceCollectionClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceCollectionClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceCollectionClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceCollectionClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceCollectionClient.url ## Methods[**](#Methods) ### [**](#list)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build_collection.ts#L60)list * ****list**(options): PaginatedIterator<[BuildCollectionClientListItem](https://docs.apify.com/api/client/js/api/client/js/reference.md#BuildCollectionClientListItem)> - Lists all Actor builds. 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 * ##### options: [BuildCollectionClientListOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/BuildCollectionClientListOptions.md) = {} Pagination and sorting options. #### Returns PaginatedIterator<[BuildCollectionClientListItem](https://docs.apify.com/api/client/js/api/client/js/reference.md#BuildCollectionClientListItem)> A paginated iterator of Actor builds. --- # Source: https://docs.apify.com/api/client/python/reference/class/BuildCollectionClientAsync.md # BuildCollectionClientAsync Async sub-client for listing Actor builds. ### Hierarchy * [ResourceCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md) * *BuildCollectionClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildCollectionClientAsync.md#__init__) * [**list](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildCollectionClientAsync.md#list) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildCollectionClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildCollectionClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildCollectionClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildCollectionClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildCollectionClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/build_collection.py#L47)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceCollectionClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#list)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/build_collection.py#L51)list * **async **list**(\*, limit, offset, desc): [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] - List all Actor builds. List all Actor builds, either of a single Actor, or all user's Actors, depending on where this client was initialized from. *** #### Parameters * ##### optionalkeyword-onlylimit: int | None = None How many builds to retrieve. * ##### optionalkeyword-onlyoffset: int | None = None What build to include as first when retrieving the list. * ##### optionalkeyword-onlydesc: bool | None = None Whether to sort the builds in descending order based on their start date. #### Returns [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/js/reference/interface/BuildCollectionClientListOptions.md # BuildCollectionClientListOptions ### Hierarchy * PaginationOptions * *BuildCollectionClientListOptions* ## Index[**](#Index) ### Properties * [**chunkSize](#chunkSize) * [**desc](#desc) * [**limit](#limit) * [**offset](#offset) ## Properties[**](#Properties) ### [**](#chunkSize)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L258)optionalinheritedchunkSize **chunkSize? : number Inherited from PaginationOptions.chunkSize Maximum number of items returned in one API response. Relevant in the context of asyncIterator, the iterator will fetch results in chunks of this size from API and yield them one by one. It will stop fetching once the limit is reached or once all items from API have been fetched. Chunk size is usually limited by API. Minimum of those two limits will be used. ### [**](#desc)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build_collection.ts#L75)optionaldesc **desc? : boolean ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L251)optionalinheritedlimit **limit? : number Inherited from PaginationOptions.limit Maximum number of entries requested. ### [**](#offset)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L249)optionalinheritedoffset **offset? : number Inherited from PaginationOptions.offset Position of the first returned entry. --- # Source: https://docs.apify.com/api/client/js/reference/interface/BuildMeta.md # BuildMeta Metadata about how a Build was initiated. ## Index[**](#Index) ### Properties * [**clientIp](#clientIp) * [**origin](#origin) * [**userAgent](#userAgent) ## Properties[**](#Properties) ### [**](#clientIp)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L209)clientIp **clientIp: string ### [**](#origin)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L208)origin **origin: string ### [**](#userAgent)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L210)userAgent **userAgent: string --- # Source: https://docs.apify.com/api/client/js/reference/interface/BuildOptions.md # BuildOptions Configuration options used for an Actor build. ## Index[**](#Index) ### Properties * [**betaPackages](#betaPackages) * [**diskMbytes](#diskMbytes) * [**memoryMbytes](#memoryMbytes) * [**useCache](#useCache) ## Properties[**](#Properties) ### [**](#betaPackages)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L265)optionalbetaPackages **betaPackages? : boolean ### [**](#diskMbytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L267)optionaldiskMbytes **diskMbytes? : number ### [**](#memoryMbytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L266)optionalmemoryMbytes **memoryMbytes? : number ### [**](#useCache)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L264)optionaluseCache **useCache? : boolean --- # Source: https://docs.apify.com/api/client/js/reference/interface/BuildStats.md # BuildStats Runtime statistics for an Actor build. ## Index[**](#Index) ### Properties * [**computeUnits](#computeUnits) * [**durationMillis](#durationMillis) * [**runTimeSecs](#runTimeSecs) ## Properties[**](#Properties) ### [**](#computeUnits)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L257)computeUnits **computeUnits: number ### [**](#durationMillis)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L255)durationMillis **durationMillis: number ### [**](#runTimeSecs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L256)runTimeSecs **runTimeSecs: number --- # Source: https://docs.apify.com/api/client/js/reference/interface/BuildUsage.md # BuildUsage Resource usage for an Actor build. ## Index[**](#Index) ### Properties * [**ACTOR\_COMPUTE\_UNITS](#ACTOR_COMPUTE_UNITS) ## Properties[**](#Properties) ### [**](#ACTOR_COMPUTE_UNITS)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L248)optionalACTOR\_COMPUTE\_UNITS **ACTOR\_COMPUTE\_UNITS? : number --- # Source: https://docs.apify.com/sdk/python/reference/class/CachedRequest.md # CachedRequest Pydantic model for cached request information. Only internal structure. ## Index[**](#Index) ### Properties * [**hydrated](https://docs.apify.com/sdk/python/sdk/python/reference/class/CachedRequest.md#hydrated) * [**id](https://docs.apify.com/sdk/python/sdk/python/reference/class/CachedRequest.md#id) * [**lock\_expires\_at](https://docs.apify.com/sdk/python/sdk/python/reference/class/CachedRequest.md#lock_expires_at) * [**was\_already\_handled](https://docs.apify.com/sdk/python/sdk/python/reference/class/CachedRequest.md#was_already_handled) ## Properties[**](#Properties) ### [**](#hydrated)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L103)hydrated **hydrated: Request | None The hydrated request object (the original one). ### [**](#id)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L97)id **id: str Id of the request. ### [**](#lock_expires_at)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L106)lock\_expires\_at **lock\_expires\_at: datetime | None The expiration time of the lock on the request. ### [**](#was_already_handled)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L100)was\_already\_handled **was\_already\_handled: bool Whether the request was already handled. --- # Source: https://docs.apify.com/sdk/js/reference/interface/CallOptions.md # CallOptions ### Hierarchy * ActorCallOptions * *CallOptions* ## Index[**](#Index) ### Properties * [**build](#build) * [**contentType](#contentType) * [**maxItems](#maxItems) * [**memory](#memory) * [**timeout](#timeout) * [**token](#token) * [**waitSecs](#waitSecs) * [**webhooks](#webhooks) ## Properties[**](#Properties) ### [**](#build)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/apify-client/src/resource_clients/actor.d.ts#L137)externaloptionalinheritedbuild **build? : string Inherited from ActorCallOptions.build Tag or number of the actor build to run (e.g. `beta` or `1.2.345`). If not provided, the run uses build tag or number from the default actor run configuration (typically `latest`). ### [**](#contentType)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/apify-client/src/resource_clients/actor.d.ts#L144)externaloptionalinheritedcontentType **contentType? : string Inherited from ActorCallOptions.contentType Content type for the `input`. If not specified, `input` is expected to be an object that will be stringified to JSON and content type set to `application/json; charset=utf-8`. If `options.contentType` is specified, then `input` must be a `String` or `Buffer`. ### [**](#maxItems)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/apify-client/src/resource_clients/actor.d.ts#L173)externaloptionalinheritedmaxItems **maxItems? : number Inherited from ActorCallOptions.maxItems Specifies maximum number of items that the actor run should return. This is used by pay per result actors to limit the maximum number of results that will be charged to customer. Value can be accessed in actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. ### [**](#memory)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/apify-client/src/resource_clients/actor.d.ts#L149)externaloptionalinheritedmemory **memory? : number Inherited from ActorCallOptions.memory Memory in megabytes which will be allocated for the new actor run. If not provided, the run uses memory of the default actor run configuration. ### [**](#timeout)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/apify-client/src/resource_clients/actor.d.ts#L154)externaloptionalinheritedtimeout **timeout? : number Inherited from ActorCallOptions.timeout Timeout for the actor run in seconds. Zero value means there is no timeout. If not provided, the run uses timeout of the default actor run configuration. ### [**](#token)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1895)optionaltoken **token? : string User API token that is used to run the Actor. By default, it is taken from the `APIFY_TOKEN` environment variable. ### [**](#waitSecs)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/apify-client/src/resource_clients/actor.d.ts#L176)externaloptionalinheritedwaitSecs **waitSecs? : number Inherited from ActorCallOptions.waitSecs ### [**](#webhooks)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/apify-client/src/resource_clients/actor.d.ts#L167)externaloptionalinheritedwebhooks **webhooks? : readonly WebhookUpdateData\[] Inherited from ActorCallOptions.webhooks Specifies optional webhooks associated with the actor run, which can be used to receive a notification e.g. when the actor finished or failed, see [ad hook webhooks documentation](https://docs.apify.com/webhooks/ad-hoc-webhooks) for detailed description. --- # Source: https://docs.apify.com/sdk/js/reference/interface/CallTaskOptions.md # CallTaskOptions ### Hierarchy * TaskCallOptions * *CallTaskOptions* ## Index[**](#Index) ### Properties * [**build](#build) * [**maxItems](#maxItems) * [**memory](#memory) * [**timeout](#timeout) * [**token](#token) * [**waitSecs](#waitSecs) * [**webhooks](#webhooks) ## Properties[**](#Properties) ### [**](#build)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/apify-client/src/resource_clients/actor.d.ts#L137)externaloptionalinheritedbuild **build? : string Inherited from TaskCallOptions.build Tag or number of the actor build to run (e.g. `beta` or `1.2.345`). If not provided, the run uses build tag or number from the default actor run configuration (typically `latest`). ### [**](#maxItems)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/apify-client/src/resource_clients/actor.d.ts#L173)externaloptionalinheritedmaxItems **maxItems? : number Inherited from TaskCallOptions.maxItems Specifies maximum number of items that the actor run should return. This is used by pay per result actors to limit the maximum number of results that will be charged to customer. Value can be accessed in actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. ### [**](#memory)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/apify-client/src/resource_clients/actor.d.ts#L149)externaloptionalinheritedmemory **memory? : number Inherited from TaskCallOptions.memory Memory in megabytes which will be allocated for the new actor run. If not provided, the run uses memory of the default actor run configuration. ### [**](#timeout)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/apify-client/src/resource_clients/actor.d.ts#L154)externaloptionalinheritedtimeout **timeout? : number Inherited from TaskCallOptions.timeout Timeout for the actor run in seconds. Zero value means there is no timeout. If not provided, the run uses timeout of the default actor run configuration. ### [**](#token)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1902)optionaltoken **token? : string User API token that is used to run the Actor. By default, it is taken from the `APIFY_TOKEN` environment variable. ### [**](#waitSecs)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/apify-client/src/resource_clients/task.d.ts#L87)externaloptionalinheritedwaitSecs **waitSecs? : number Inherited from TaskCallOptions.waitSecs ### [**](#webhooks)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/apify-client/src/resource_clients/actor.d.ts#L167)externaloptionalinheritedwebhooks **webhooks? : readonly WebhookUpdateData\[] Inherited from TaskCallOptions.webhooks Specifies optional webhooks associated with the actor run, which can be used to receive a notification e.g. when the actor finished or failed, see [ad hook webhooks documentation](https://docs.apify.com/webhooks/ad-hoc-webhooks) for detailed description. --- # Source: https://docs.apify.com/sdk/js/reference/interface/ChargeOptions.md # ChargeOptions ## Index[**](#Index) ### Properties * [**count](#count) * [**eventName](#eventName) ## Properties[**](#Properties) ### [**](#count)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/charging.ts#L294)optionalcount **count? : number ### [**](#eventName)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/charging.ts#L293)eventName **eventName: string --- # Source: https://docs.apify.com/sdk/python/reference/class/ChargeResult.md # Source: https://docs.apify.com/sdk/js/reference/interface/ChargeResult.md # ChargeResult ## Index[**](#Index) ### Properties * [**eventChargeLimitReached](#eventChargeLimitReached) * [**chargeableWithinLimit](#chargeableWithinLimit) * [**chargedCount](#chargedCount) ## Properties[**](#Properties) ### [**](#eventChargeLimitReached)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/charging.ts#L298)eventChargeLimitReached **eventChargeLimitReached: boolean ### [**](#chargeableWithinLimit)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/charging.ts#L300)chargeableWithinLimit **chargeableWithinLimit: Record\ ### [**](#chargedCount)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/charging.ts#L299)chargedCount **chargedCount: number --- # Source: https://docs.apify.com/sdk/python/reference/class/ChargingManager.md # Source: https://docs.apify.com/sdk/js/reference/class/ChargingManager.md # ChargingManager Handles pay-per-event charging. ## Index[**](#Index) ### Constructors * [**constructor](#constructor) ### Methods * [**calculateMaxEventChargeCountWithinLimit](#calculateMaxEventChargeCountWithinLimit) * [**getChargedEventCount](#getChargedEventCount) * [**getMaxTotalChargeUsd](#getMaxTotalChargeUsd) * [**getPricingInfo](#getPricingInfo) * [**charge](#charge) * [**init](#init) ## Constructors[**](#Constructors) ### [**](#constructor)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/charging.ts#L28)constructor * ****new ChargingManager**(configuration, apifyClient): [ChargingManager](https://docs.apify.com/sdk/js/sdk/js/reference/class/ChargingManager.md) - #### Parameters * ##### configuration: [Configuration](https://docs.apify.com/sdk/js/sdk/js/reference/class/Configuration.md) * ##### apifyClient: [ApifyClient](https://docs.apify.com/sdk/js/sdk/js/reference/class/ApifyClient.md) #### Returns [ChargingManager](https://docs.apify.com/sdk/js/sdk/js/reference/class/ChargingManager.md) ## Methods[**](#Methods) ### [**](#calculateMaxEventChargeCountWithinLimit)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/charging.ts#L264)calculateMaxEventChargeCountWithinLimit * ****calculateMaxEventChargeCountWithinLimit**(eventName): number - How many events of a given type can still be charged for before reaching the limit; If the event is not registered, returns Infinity (free of charge) *** #### Parameters * ##### eventName: string #### Returns number ### [**](#getChargedEventCount)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/charging.ts#L230)getChargedEventCount * ****getChargedEventCount**(eventName): number - Get the number of events with given name that the Actor has charged for so far. *** #### Parameters * ##### eventName: string #### Returns number ### [**](#getMaxTotalChargeUsd)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/charging.ts#L241)getMaxTotalChargeUsd * ****getMaxTotalChargeUsd**(): number - Get the maximum amount of money that the Actor is allowed to charge. *** #### Returns number ### [**](#getPricingInfo)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/charging.ts#L129)getPricingInfo * ****getPricingInfo**(): [ActorPricingInfo](https://docs.apify.com/sdk/js/sdk/js/reference/interface/ActorPricingInfo.md) - Get information about the pricing for this Actor. *** #### Returns [ActorPricingInfo](https://docs.apify.com/sdk/js/sdk/js/reference/interface/ActorPricingInfo.md) ### [**](#charge)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/charging.ts#L149)charge * ****charge**(options): Promise<[ChargeResult](https://docs.apify.com/sdk/js/sdk/js/reference/interface/ChargeResult.md)> - Charge for a specified number of events - sub-operations of the Actor. *** #### Parameters * ##### options: [ChargeOptions](https://docs.apify.com/sdk/js/sdk/js/reference/interface/ChargeOptions.md) The name of the event to charge for and the number of events to be charged. #### Returns Promise<[ChargeResult](https://docs.apify.com/sdk/js/sdk/js/reference/interface/ChargeResult.md)> ### [**](#init)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/charging.ts#L57)init * ****init**(): Promise\ - Initialize the ChargingManager by loading pricing information and charging state via Apify API. *** #### Returns Promise\ --- # Source: https://docs.apify.com/sdk/python/reference/class/ChargingManagerImplementation.md # ChargingManagerImplementation Implementation of the `ChargingManager` Protocol - this is only meant to be instantiated internally. ### Hierarchy * [ChargingManager](https://docs.apify.com/sdk/python/sdk/python/reference/class/ChargingManager.md) * *ChargingManagerImplementation* ## Index[**](#Index) ### Methods * [**\_\_aenter\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/ChargingManagerImplementation.md#__aenter__) * [**\_\_aexit\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/ChargingManagerImplementation.md#__aexit__) * [**\_\_init\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/ChargingManagerImplementation.md#__init__) * [**calculate\_max\_event\_charge\_count\_within\_limit](https://docs.apify.com/sdk/python/sdk/python/reference/class/ChargingManagerImplementation.md#calculate_max_event_charge_count_within_limit) * [**calculate\_total\_charged\_amount](https://docs.apify.com/sdk/python/sdk/python/reference/class/ChargingManagerImplementation.md#calculate_total_charged_amount) * [**charge](https://docs.apify.com/sdk/python/sdk/python/reference/class/ChargingManagerImplementation.md#charge) * [**get\_charged\_event\_count](https://docs.apify.com/sdk/python/sdk/python/reference/class/ChargingManagerImplementation.md#get_charged_event_count) * [**get\_max\_total\_charge\_usd](https://docs.apify.com/sdk/python/sdk/python/reference/class/ChargingManagerImplementation.md#get_max_total_charge_usd) * [**get\_pricing\_info](https://docs.apify.com/sdk/python/sdk/python/reference/class/ChargingManagerImplementation.md#get_pricing_info) ### Properties * [**LOCAL\_CHARGING\_LOG\_DATASET\_NAME](https://docs.apify.com/sdk/python/sdk/python/reference/class/ChargingManagerImplementation.md#LOCAL_CHARGING_LOG_DATASET_NAME) ## Methods[**](#Methods) ### [**](#__aenter__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/_charging.py#L140)\_\_aenter\_\_ * **async **\_\_aenter\_\_**(): None - Initialize the charging manager - this is called by the `Actor` class and shouldn't be invoked manually. *** #### Returns None ### [**](#__aexit__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/_charging.py#L192)\_\_aexit\_\_ * **async **\_\_aexit\_\_**(exc\_type, exc\_value, exc\_traceback): None - #### Parameters * ##### exc\_type: type\[BaseException] | None * ##### exc\_value: BaseException | None * ##### exc\_traceback: TracebackType | None #### Returns None ### [**](#__init__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/_charging.py#L123)\_\_init\_\_ * ****\_\_init\_\_**(configuration, client): None - #### Parameters * ##### configuration: [Configuration](https://docs.apify.com/sdk/python/sdk/python/reference/class/Configuration.md) * ##### client: ApifyClientAsync #### Returns None ### [**](#calculate_max_event_charge_count_within_limit)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/_charging.py#L301)calculate\_max\_event\_charge\_count\_within\_limit * ****calculate\_max\_event\_charge\_count\_within\_limit**(event\_name): int | None - Overrides [ChargingManager.calculate\_max\_event\_charge\_count\_within\_limit](https://docs.apify.com/sdk/python/sdk/python/reference/class/ChargingManager.md#calculate_max_event_charge_count_within_limit) Calculate how many instances of an event can be charged before we reach the configured limit. *** #### Parameters * ##### event\_name: str Name of the inspected event. #### Returns int | None ### [**](#calculate_total_charged_amount)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/_charging.py#L294)calculate\_total\_charged\_amount * ****calculate\_total\_charged\_amount**(): Decimal - Overrides [ChargingManager.calculate\_total\_charged\_amount](https://docs.apify.com/sdk/python/sdk/python/reference/class/ChargingManager.md#calculate_total_charged_amount) Calculate the total amount of money charged for pay-per-event events so far. *** #### Returns Decimal ### [**](#charge)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/_charging.py#L204)charge * **async **charge**(event\_name, count): [ChargeResult](https://docs.apify.com/sdk/python/sdk/python/reference/class/ChargeResult.md) - Overrides [ChargingManager.charge](https://docs.apify.com/sdk/python/sdk/python/reference/class/ChargingManager.md#charge) Charge for a specified number of events - sub-operations of the Actor. This is relevant only for the pay-per-event pricing model. *** #### Parameters * ##### event\_name: str Name of the event to be charged for. * ##### optionalcount: int = 1 Number of events to charge for. #### Returns [ChargeResult](https://docs.apify.com/sdk/python/sdk/python/reference/class/ChargeResult.md) ### [**](#get_charged_event_count)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/_charging.py#L331)get\_charged\_event\_count * ****get\_charged\_event\_count**(event\_name): int - Overrides [ChargingManager.get\_charged\_event\_count](https://docs.apify.com/sdk/python/sdk/python/reference/class/ChargingManager.md#get_charged_event_count) Get the number of events with the given name that were charged so far. *** #### Parameters * ##### event\_name: str Name of the inspected event. #### Returns int ### [**](#get_max_total_charge_usd)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/_charging.py#L336)get\_max\_total\_charge\_usd * ****get\_max\_total\_charge\_usd**(): Decimal - Overrides [ChargingManager.get\_max\_total\_charge\_usd](https://docs.apify.com/sdk/python/sdk/python/reference/class/ChargingManager.md#get_max_total_charge_usd) Get the configured maximum total charge for this Actor run. *** #### Returns Decimal ### [**](#get_pricing_info)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/_charging.py#L318)get\_pricing\_info * ****get\_pricing\_info**(): [ActorPricingInfo](https://docs.apify.com/sdk/python/sdk/python/reference/class/ActorPricingInfo.md) - Overrides [ChargingManager.get\_pricing\_info](https://docs.apify.com/sdk/python/sdk/python/reference/class/ChargingManager.md#get_pricing_info) Retrieve detailed information about the effective pricing of the current Actor run. This can be used for instance when your code needs to support multiple pricing models in transition periods. *** #### Returns [ActorPricingInfo](https://docs.apify.com/sdk/python/sdk/python/reference/class/ActorPricingInfo.md) ## Properties[**](#Properties) ### [**](#LOCAL_CHARGING_LOG_DATASET_NAME)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/_charging.py#L121)LOCAL\_CHARGING\_LOG\_DATASET\_NAME **LOCAL\_CHARGING\_LOG\_DATASET\_NAME: Undefined --- # Source: https://docs.apify.com/sdk/python/reference/class/ChargingStateItem.md # ChargingStateItem ## Index[**](#Index) ### Properties * [**charge\_count](https://docs.apify.com/sdk/python/sdk/python/reference/class/ChargingStateItem.md#charge_count) * [**total\_charged\_amount](https://docs.apify.com/sdk/python/sdk/python/reference/class/ChargingStateItem.md#total_charged_amount) ## Properties[**](#Properties) ### [**](#charge_count)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/_charging.py#L374)charge\_count **charge\_count: int ### [**](#total_charged_amount)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/_charging.py#L375)total\_charged\_amount **total\_charged\_amount: Decimal --- # Source: https://docs.apify.com/sdk/python/reference/class/Configuration.md # Source: https://docs.apify.com/sdk/js/reference/class/Configuration.md # Configuration `Configuration` is a value object holding the SDK configuration. We can use it in two ways: 1. When using `Actor` class, we can get the instance configuration via `sdk.config` ``` import { Actor } from 'apify'; import { BasicCrawler } from 'crawlee'; const sdk = new Actor({ token: '123' }); console.log(sdk.config.get('token')); // '123' const crawler = new BasicCrawler({ // ... crawler options }, sdk.config); ``` 2. To get the global configuration (singleton instance). It will respect the environment variables. ``` import { BasicCrawler, Configuration } from 'crawlee'; // Get the global configuration const config = Configuration.getGlobalConfig(); // Set the 'persistStateIntervalMillis' option // of global configuration to 30 seconds config.set('persistStateIntervalMillis', 30_000); // No need to pass the configuration to the crawler, // as it's using the global configuration by default const crawler = new BasicCrawler(); ``` ## Supported Configuration Options | Key | Environment Variable | Default Value | | :--------------------------- | :------------------------------------ | :------------ | | `memoryMbytes` | `ACTOR_MEMORY_MBYTES` | - | | `headless` | `APIFY_HEADLESS` | - | | `persistStateIntervalMillis` | `APIFY_PERSIST_STATE_INTERVAL_MILLIS` | `60e3` | | `token` | `APIFY_TOKEN` | - | | `isAtHome` | `APIFY_IS_AT_HOME` | - | | `defaultDatasetId` | `ACTOR_DEFAULT_DATASET_ID` | `'default'` | | `defaultKeyValueStoreId` | `ACTOR_DEFAULT_KEY_VALUE_STORE_ID` | `'default'` | | `defaultRequestQueueId` | `ACTOR_DEFAULT_REQUEST_QUEUE_ID` | `'default'` | ## Advanced Configuration Options | Key | Environment Variable | Default Value | | :-------------------------- | :----------------------------------- | :------------------------- | | `actorEventsWsUrl` | `ACTOR_EVENTS_WEBSOCKET_URL` | - | | `actorId` | `ACTOR_ID` | - | | `actorRunId` | `ACTOR_RUN_ID` | - | | `actorTaskId` | `ACTOR_TASK_ID` | - | | `apiBaseUrl` | `APIFY_API_BASE_URL` | `'https://api.apify.com'` | | `containerPort` | `ACTOR_WEB_SERVER_PORT` | `4321` | | `containerUrl` | `ACTOR_WEB_SERVER_URL` | `'http://localhost:4321'` | | `inputKey` | `ACTOR_INPUT_KEY` | `'INPUT'` | | `metamorphAfterSleepMillis` | `APIFY_METAMORPH_AFTER_SLEEP_MILLIS` | `300e3` | | `metaOrigin` | `APIFY_META_ORIGIN` | - | | `proxyHostname` | `APIFY_PROXY_HOSTNAME` | `'proxy.apify.com'` | | `proxyPassword` | `APIFY_PROXY_PASSWORD` | - | | `proxyPort` | `APIFY_PROXY_PORT` | `8000` | | `proxyStatusUrl` | `APIFY_PROXY_STATUS_URL` | `'http://proxy.apify.com'` | | `userId` | `APIFY_USER_ID` | - | | `xvfb` | `APIFY_XVFB` | - | | `standbyPort` | `ACTOR_STANDBY_PORT` | `4321` | | `standbyUrl` | `ACTOR_STANDBY_URL` | - | | `chromeExecutablePath` | `APIFY_CHROME_EXECUTABLE_PATH` | - | | `defaultBrowserPath` | `APIFY_DEFAULT_BROWSER_PATH` | - | ### Hierarchy * Configuration * *Configuration* ## Index[**](#Index) ### Constructors * [**constructor](#constructor) ### Properties * [**storageManagers](#storageManagers) * [**globalConfig](#globalConfig) ### Methods * [**get](#get) * [**getEventManager](#getEventManager) * [**set](#set) * [**useEventManager](#useEventManager) * [**useStorageClient](#useStorageClient) * [**getEventManager](#getEventManager) * [**getGlobalConfig](#getGlobalConfig) * [**getStorageClient](#getStorageClient) * [**resetGlobalState](#resetGlobalState) * [**set](#set) * [**useStorageClient](#useStorageClient) ## Constructors[**](#Constructors) ### [**](#constructor)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L241)externalconstructor * ****new Configuration**(options): [Configuration](https://docs.apify.com/sdk/js/sdk/js/reference/class/Configuration.md) - Inherited from CoreConfiguration.constructor Creates new `Configuration` instance with provided options. Env vars will have precedence over those. *** #### Parameters * ##### externaloptionaloptions: ConfigurationOptions #### Returns [Configuration](https://docs.apify.com/sdk/js/sdk/js/reference/class/Configuration.md) ## Properties[**](#Properties) ### [**](#storageManagers)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L237)externalreadonlyinheritedstorageManagers **storageManagers: Map\> Inherited from CoreConfiguration.storageManagers ### [**](#globalConfig)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L116)staticoptionalglobalConfig **globalConfig? : [Configuration](https://docs.apify.com/sdk/js/sdk/js/reference/class/Configuration.md) Overrides CoreConfiguration.globalConfig * **@inheritDoc** ## Methods[**](#Methods) ### [**](#get)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L206)get * ****get**\(key, defaultValue): U - Overrides CoreConfiguration.get * **@inheritDoc** *** #### Parameters * ##### key: T * ##### optionaldefaultValue: U #### Returns U ### [**](#getEventManager)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L269)externalinheritedgetEventManager * ****getEventManager**(): EventManager - Inherited from CoreConfiguration.getEventManager #### Returns EventManager ### [**](#set)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L213)set * ****set**(key, value): void - Overrides CoreConfiguration.set * **@inheritDoc** *** #### Parameters * ##### key: keyof [ConfigurationOptions](https://docs.apify.com/sdk/js/sdk/js/reference/interface/ConfigurationOptions.md) * ##### optionalvalue: any #### Returns void ### [**](#useEventManager)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L277)externalinheriteduseEventManager * ****useEventManager**(events): void - Inherited from CoreConfiguration.useEventManager #### Parameters * ##### externalevents: EventManager #### Returns void ### [**](#useStorageClient)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L275)externalinheriteduseStorageClient * ****useStorageClient**(client): void - Inherited from CoreConfiguration.useStorageClient #### Parameters * ##### externalclient: StorageClient #### Returns void ### [**](#getEventManager)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L289)staticexternalinheritedgetEventManager * ****getEventManager**(): EventManager - Inherited from CoreConfiguration.getEventManager Gets default EventManager instance. *** #### Returns EventManager ### [**](#getGlobalConfig)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L220)staticgetGlobalConfig * ****getGlobalConfig**(): [Configuration](https://docs.apify.com/sdk/js/sdk/js/reference/class/Configuration.md) - Overrides CoreConfiguration.getGlobalConfig * **@inheritDoc** *** #### Returns [Configuration](https://docs.apify.com/sdk/js/sdk/js/reference/class/Configuration.md) ### [**](#getStorageClient)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L285)staticexternalinheritedgetStorageClient * ****getStorageClient**(): StorageClient - Inherited from CoreConfiguration.getStorageClient Gets default StorageClient instance. *** #### Returns StorageClient ### [**](#resetGlobalState)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L233)staticresetGlobalState * ****resetGlobalState**(): void - Overrides CoreConfiguration.resetGlobalState Resets global configuration instance. The default instance holds configuration based on env vars, if we want to change them, we need to first reset the global state. Used mainly for testing purposes. *** #### Returns void ### [**](#set)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L258)staticexternalinheritedset * ****set**(key, value): void - Inherited from CoreConfiguration.set Sets value for given option. Only affects the global `Configuration` instance, the value will not be propagated down to the env var. To reset a value, we can omit the `value` argument or pass `undefined` there. *** #### Parameters * ##### externalkey: keyof ConfigurationOptions * ##### externaloptionalvalue: any #### Returns void ### [**](#useStorageClient)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L276)staticexternalinheriteduseStorageClient * ****useStorageClient**(client): void - Inherited from CoreConfiguration.useStorageClient #### Parameters * ##### externalclient: StorageClient #### Returns void --- # Source: https://docs.apify.com/sdk/js/reference/interface/ConfigurationOptions.md # ConfigurationOptions ### Hierarchy * ConfigurationOptions * *ConfigurationOptions* ## Index[**](#Index) ### Properties * [**actorEventsWsUrl](#actorEventsWsUrl) * [**actorId](#actorId) * [**actorRunId](#actorRunId) * [**actorTaskId](#actorTaskId) * [**apiBaseUrl](#apiBaseUrl) * [**apiPublicBaseUrl](#apiPublicBaseUrl) * [**availableMemoryRatio](#availableMemoryRatio) * [**containerized](#containerized) * [**containerPort](#containerPort) * [**containerUrl](#containerUrl) * [**defaultBrowserPath](#defaultBrowserPath) * [**defaultDatasetId](#defaultDatasetId) * [**defaultKeyValueStoreId](#defaultKeyValueStoreId) * [**defaultRequestQueueId](#defaultRequestQueueId) * [**disableBrowserSandbox](#disableBrowserSandbox) * [**eventManager](#eventManager) * [**headless](#headless) * [**chromeExecutablePath](#chromeExecutablePath) * [**inputKey](#inputKey) * [**inputSecretsPrivateKeyFile](#inputSecretsPrivateKeyFile) * [**inputSecretsPrivateKeyPassphrase](#inputSecretsPrivateKeyPassphrase) * [**isAtHome](#isAtHome) * [**logLevel](#logLevel) * [**maxTotalChargeUsd](#maxTotalChargeUsd) * [**maxUsedCpuRatio](#maxUsedCpuRatio) * [**memoryMbytes](#memoryMbytes) * [**metamorphAfterSleepMillis](#metamorphAfterSleepMillis) * [**metaOrigin](#metaOrigin) * [**persistStateIntervalMillis](#persistStateIntervalMillis) * [**persistStorage](#persistStorage) * [**proxyHostname](#proxyHostname) * [**proxyPassword](#proxyPassword) * [**proxyPort](#proxyPort) * [**proxyStatusUrl](#proxyStatusUrl) * [**purgeOnStart](#purgeOnStart) * [**standbyPort](#standbyPort) * [**standbyUrl](#standbyUrl) * [**storageClient](#storageClient) * [**storageClientOptions](#storageClientOptions) * [**systemInfoIntervalMillis](#systemInfoIntervalMillis) * [**systemInfoV2](#systemInfoV2) * [**testPayPerEvent](#testPayPerEvent) * [**token](#token) * [**useChargingLogDataset](#useChargingLogDataset) * [**userId](#userId) * [**xvfb](#xvfb) ## Properties[**](#Properties) ### [**](#actorEventsWsUrl)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L13)optionalactorEventsWsUrl **actorEventsWsUrl? : string ### [**](#actorId)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L15)optionalactorId **actorId? : string ### [**](#actorRunId)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L16)optionalactorRunId **actorRunId? : string ### [**](#actorTaskId)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L17)optionalactorTaskId **actorTaskId? : string ### [**](#apiBaseUrl)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L18)optionalapiBaseUrl **apiBaseUrl? : string ### [**](#apiPublicBaseUrl)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L21)optionalapiPublicBaseUrl **apiPublicBaseUrl? : string ### [**](#availableMemoryRatio)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L66)externaloptionalinheritedavailableMemoryRatio **availableMemoryRatio? : number = 0.25 Inherited from CoreConfigurationOptions.availableMemoryRatio Sets the ratio, defining the amount of system memory that could be used by the AutoscaledPool. When the memory usage is more than the provided ratio, the memory is considered overloaded. Alternative to `CRAWLEE_AVAILABLE_MEMORY_RATIO` environment variable. ### [**](#containerized)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L150)externaloptionalinheritedcontainerized **containerized? : boolean Inherited from CoreConfigurationOptions.containerized Used in place of `isContainerized()` when collecting system metrics. Alternative to `CRAWLEE_CONTAINERIZED` environment variable. ### [**](#containerPort)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L22)optionalcontainerPort **containerPort? : number ### [**](#containerUrl)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L23)optionalcontainerUrl **containerUrl? : string ### [**](#defaultBrowserPath)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L119)externaloptionalinheriteddefaultBrowserPath **defaultBrowserPath? : string Inherited from CoreConfigurationOptions.defaultBrowserPath Defines a path to default browser executable. Alternative to `CRAWLEE_DEFAULT_BROWSER_PATH` environment variable. ### [**](#defaultDatasetId)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L31)externaloptionalinheriteddefaultDatasetId **defaultDatasetId? : string = ‘default’ Inherited from CoreConfigurationOptions.defaultDatasetId Default dataset id. Alternative to `CRAWLEE_DEFAULT_DATASET_ID` environment variable. ### [**](#defaultKeyValueStoreId)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L45)externaloptionalinheriteddefaultKeyValueStoreId **defaultKeyValueStoreId? : string = ‘default’ Inherited from CoreConfigurationOptions.defaultKeyValueStoreId Default key-value store id. Alternative to `CRAWLEE_DEFAULT_KEY_VALUE_STORE_ID` environment variable. ### [**](#defaultRequestQueueId)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L52)externaloptionalinheriteddefaultRequestQueueId **defaultRequestQueueId? : string = ‘default’ Inherited from CoreConfigurationOptions.defaultRequestQueueId Default request queue id. Alternative to `CRAWLEE_DEFAULT_REQUEST_QUEUE_ID` environment variable. ### [**](#disableBrowserSandbox)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L125)externaloptionalinheriteddisableBrowserSandbox **disableBrowserSandbox? : boolean Inherited from CoreConfigurationOptions.disableBrowserSandbox Defines whether to disable browser sandbox by adding `--no-sandbox` flag to `launchOptions`. Alternative to `CRAWLEE_DISABLE_BROWSER_SANDBOX` environment variable. ### [**](#eventManager)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L19)externaloptionalinheritedeventManager **eventManager? : EventManager = EventManager Inherited from CoreConfigurationOptions.eventManager Defines the Event Manager to be used. ### [**](#headless)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L100)externaloptionalinheritedheadless **headless? : boolean = true Inherited from CoreConfigurationOptions.headless Defines whether web browsers launched by Crawlee will run in the headless mode. Alternative to `CRAWLEE_HEADLESS` environment variable. ### [**](#chromeExecutablePath)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L113)externaloptionalinheritedchromeExecutablePath **chromeExecutablePath? : string Inherited from CoreConfigurationOptions.chromeExecutablePath Defines a path to Chrome executable. Alternative to `CRAWLEE_CHROME_EXECUTABLE_PATH` environment variable. ### [**](#inputKey)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L93)externaloptionalinheritedinputKey **inputKey? : string = ‘INPUT’ Inherited from CoreConfigurationOptions.inputKey Defines the default input key, i.e. the key that is used to get the crawler input value from the default [KeyValueStore](https://docs.apify.com/sdk/js/sdk/js/reference/class/KeyValueStore.md) associated with the current crawler run. Alternative to `CRAWLEE_INPUT_KEY` environment variable. ### [**](#inputSecretsPrivateKeyFile)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L36)optionalinputSecretsPrivateKeyFile **inputSecretsPrivateKeyFile? : string ### [**](#inputSecretsPrivateKeyPassphrase)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L35)optionalinputSecretsPrivateKeyPassphrase **inputSecretsPrivateKeyPassphrase? : string ### [**](#isAtHome)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L33)optionalisAtHome **isAtHome? : boolean ### [**](#logLevel)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L132)externaloptionalinheritedlogLevel **logLevel? : [LogLevel](https://docs.apify.com/sdk/js/sdk/js/reference/enum/LogLevel.md) | (radix) => string | (fractionDigits) => string | (fractionDigits) => string | (precision) => string | () => number | ({ (locales, options): string; (locales, options): string }) = [LogLevel](https://docs.apify.com/sdk/js/sdk/js/reference/enum/LogLevel.md) | (radix) => string | (fractionDigits) => string | (fractionDigits) => string | (precision) => string | () => number | ({ (locales, options): string; (locales, options): string }) Inherited from CoreConfigurationOptions.logLevel Sets the log level to the given value. Alternative to `CRAWLEE_LOG_LEVEL` environment variable. ### [**](#maxTotalChargeUsd)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L37)optionalmaxTotalChargeUsd **maxTotalChargeUsd? : number ### [**](#maxUsedCpuRatio)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L58)externaloptionalinheritedmaxUsedCpuRatio **maxUsedCpuRatio? : number = 0.95 Inherited from CoreConfigurationOptions.maxUsedCpuRatio Sets the ratio, defining the maximum CPU usage. When the CPU usage is higher than the provided ratio, the CPU is considered overloaded. ### [**](#memoryMbytes)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L73)externaloptionalinheritedmemoryMbytes **memoryMbytes? : number Inherited from CoreConfigurationOptions.memoryMbytes Sets the amount of system memory in megabytes to be used by the AutoscaledPool. By default, the maximum memory is set to one quarter of total system memory. Alternative to `CRAWLEE_MEMORY_MBYTES` environment variable. ### [**](#metamorphAfterSleepMillis)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L12)optionalmetamorphAfterSleepMillis **metamorphAfterSleepMillis? : number ### [**](#metaOrigin)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L38)optionalmetaOrigin **metaOrigin? : DEVELOPMENT | WEB | API | SCHEDULER | TEST | WEBHOOK | ACTOR | CLI | STANDBY ### [**](#persistStateIntervalMillis)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L80)externaloptionalinheritedpersistStateIntervalMillis **persistStateIntervalMillis? : number = 60\_000 Inherited from CoreConfigurationOptions.persistStateIntervalMillis Defines the interval of emitting the `persistState` event. Alternative to `CRAWLEE_PERSIST_STATE_INTERVAL_MILLIS` environment variable. ### [**](#persistStorage)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L138)externaloptionalinheritedpersistStorage **persistStorage? : boolean Inherited from CoreConfigurationOptions.persistStorage Defines whether the storage client used should persist the data it stores. Alternative to `CRAWLEE_PERSIST_STORAGE` environment variable. ### [**](#proxyHostname)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L24)optionalproxyHostname **proxyHostname? : string ### [**](#proxyPassword)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L25)optionalproxyPassword **proxyPassword? : string ### [**](#proxyPort)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L26)optionalproxyPort **proxyPort? : number ### [**](#proxyStatusUrl)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L27)optionalproxyStatusUrl **proxyStatusUrl? : string ### [**](#purgeOnStart)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L38)externaloptionalinheritedpurgeOnStart **purgeOnStart? : boolean = true Inherited from CoreConfigurationOptions.purgeOnStart Defines whether to purge the default storage folders before starting the crawler run. Alternative to `CRAWLEE_PURGE_ON_START` environment variable. ### [**](#standbyPort)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L31)optionalstandbyPort **standbyPort? : number * **@deprecated** use `containerPort` instead ### [**](#standbyUrl)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L32)optionalstandbyUrl **standbyUrl? : string ### [**](#storageClient)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L14)externaloptionalinheritedstorageClient **storageClient? : StorageClient = StorageClient Inherited from CoreConfigurationOptions.storageClient Defines storage client to be used. ### [**](#storageClientOptions)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L24)externaloptionalinheritedstorageClientOptions **storageClientOptions? : Dictionary Inherited from CoreConfigurationOptions.storageClientOptions Could be used to adjust the storage client behavior e.g. MemoryStorageOptions could be used to adjust the MemoryStorage behavior. ### [**](#systemInfoIntervalMillis)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L85)externaloptionalinheritedsystemInfoIntervalMillis **systemInfoIntervalMillis? : number = 1\_000 Inherited from CoreConfigurationOptions.systemInfoIntervalMillis Defines the interval of emitting the `systemInfo` event. ### [**](#systemInfoV2)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L144)externaloptionalinheritedsystemInfoV2 **systemInfoV2? : boolean Inherited from CoreConfigurationOptions.systemInfoV2 Defines whether to use the systemInfoV2 metric collection experiment. Alternative to `CRAWLEE_SYSTEM_INFO_V2` environment variable. ### [**](#testPayPerEvent)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L39)optionaltestPayPerEvent **testPayPerEvent? : boolean ### [**](#token)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L14)optionaltoken **token? : string ### [**](#useChargingLogDataset)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L40)optionaluseChargingLogDataset **useChargingLogDataset? : boolean ### [**](#userId)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L34)optionaluserId **userId? : string ### [**](#xvfb)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/configuration.d.ts#L107)externaloptionalinheritedxvfb **xvfb? : boolean = false Inherited from CoreConfigurationOptions.xvfb Defines whether to run X virtual framebuffer on the web browsers launched by Crawlee. Alternative to `CRAWLEE_XVFB` environment variable. --- # Source: https://docs.apify.com/api/client/js/reference/interface/Current.md # Current ## Index[**](#Index) ### Properties * [**activeActorJobCount](#activeActorJobCount) * [**actorCount](#actorCount) * [**actorMemoryGbytes](#actorMemoryGbytes) * [**actorTaskCount](#actorTaskCount) * [**monthlyActorComputeUnits](#monthlyActorComputeUnits) * [**monthlyExternalDataTransferGbytes](#monthlyExternalDataTransferGbytes) * [**monthlyProxySerps](#monthlyProxySerps) * [**monthlyResidentialProxyGbytes](#monthlyResidentialProxyGbytes) * [**monthlyUsageUsd](#monthlyUsageUsd) * [**teamAccountSeatCount](#teamAccountSeatCount) ## Properties[**](#Properties) ### [**](#activeActorJobCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L299)activeActorJobCount **activeActorJobCount: number ### [**](#actorCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L297)actorCount **actorCount: number ### [**](#actorMemoryGbytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L296)actorMemoryGbytes **actorMemoryGbytes: number ### [**](#actorTaskCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L298)actorTaskCount **actorTaskCount: number ### [**](#monthlyActorComputeUnits)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L292)monthlyActorComputeUnits **monthlyActorComputeUnits: number ### [**](#monthlyExternalDataTransferGbytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L293)monthlyExternalDataTransferGbytes **monthlyExternalDataTransferGbytes: number ### [**](#monthlyProxySerps)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L294)monthlyProxySerps **monthlyProxySerps: number ### [**](#monthlyResidentialProxyGbytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L295)monthlyResidentialProxyGbytes **monthlyResidentialProxyGbytes: number ### [**](#monthlyUsageUsd)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L291)monthlyUsageUsd **monthlyUsageUsd: number ### [**](#teamAccountSeatCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L300)teamAccountSeatCount **teamAccountSeatCount: number --- # Source: https://docs.apify.com/sdk/python/reference/class/Dataset.md # Source: https://docs.apify.com/sdk/js/reference/class/Dataset.md # Source: https://docs.apify.com/api/client/js/reference/interface/Dataset.md # Dataset Represents a dataset storage on the Apify platform. Datasets store structured data as a sequence of items (records). Each item is a JSON object. Datasets are useful for storing results from web scraping, crawling, or data processing tasks. ## Index[**](#Index) ### Properties * [**accessedAt](#accessedAt) * [**actId](#actId) * [**actRunId](#actRunId) * [**cleanItemCount](#cleanItemCount) * [**createdAt](#createdAt) * [**fields](#fields) * [**generalAccess](#generalAccess) * [**id](#id) * [**itemCount](#itemCount) * [**itemsPublicUrl](#itemsPublicUrl) * [**modifiedAt](#modifiedAt) * [**name](#name) * [**stats](#stats) * [**title](#title) * [**urlSigningSecretKey](#urlSigningSecretKey) * [**userId](#userId) * [**username](#username) ## Properties[**](#Properties) ### [**](#accessedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L422)accessedAt **accessedAt: Date ### [**](#actId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L425)optionalactId **actId? : string ### [**](#actRunId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L426)optionalactRunId **actRunId? : string ### [**](#cleanItemCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L424)cleanItemCount **cleanItemCount: number ### [**](#createdAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L420)createdAt **createdAt: Date ### [**](#fields)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L428)fields **fields: string\[] ### [**](#generalAccess)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L429)optionalgeneralAccess **generalAccess? : null | STORAGE\_GENERAL\_ACCESS ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L415)id **id: string ### [**](#itemCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L423)itemCount **itemCount: number ### [**](#itemsPublicUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L431)itemsPublicUrl **itemsPublicUrl: string ### [**](#modifiedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L421)modifiedAt **modifiedAt: Date ### [**](#name)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L416)optionalname **name? : string ### [**](#stats)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L427)stats **stats: [DatasetStats](https://docs.apify.com/api/client/js/api/client/js/reference/interface/DatasetStats.md) ### [**](#title)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L417)optionaltitle **title? : string ### [**](#urlSigningSecretKey)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L430)optionalurlSigningSecretKey **urlSigningSecretKey? : null | string ### [**](#userId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L418)userId **userId: string ### [**](#username)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L419)optionalusername **username? : string --- # Source: https://docs.apify.com/api/client/python/reference/class/DatasetClient.md # Source: https://docs.apify.com/api/client/js/reference/class/DatasetClient.md # DatasetClient \ Client for managing a specific Dataset. Datasets store structured data results from Actor runs. This client provides methods to push items, list and retrieve items, download items in various formats (JSON, CSV, Excel, etc.), and manage the dataset. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const datasetClient = client.dataset('my-dataset-id'); // Push items to the dataset await datasetClient.pushItems([ { url: 'https://example.com', title: 'Example' }, { url: 'https://test.com', title: 'Test' } ]); // List all items const { items } = await datasetClient.listItems(); // Download items as CSV const buffer = await datasetClient.downloadItems('csv'); ``` * **@see** ### Hierarchy * ResourceClient * *DatasetClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**createItemsPublicUrl](#createItemsPublicUrl) * [**delete](#delete) * [**downloadItems](#downloadItems) * [**get](#get) * [**getStatistics](#getStatistics) * [**listItems](#listItems) * [**pushItems](#pushItems) * [**update](#update) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceClient.url ## Methods[**](#Methods) ### [**](#createItemsPublicUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L356)createItemsPublicUrl * ****createItemsPublicUrl**(options): Promise\ - Generates a public URL for accessing dataset items. If the client has permission to access the dataset's URL signing key, the URL will include a cryptographic signature allowing access without authentication. This is useful for sharing dataset results with external services or users. * **@example** ``` // Create a URL that expires in 1 hour with specific fields const url = await client.dataset('my-dataset').createItemsPublicUrl({ expiresInSecs: 3600, fields: ['url', 'title'], limit: 100 }); console.log(`Share this URL: ${url}`); // Create a permanent public URL for clean items only const url = await client.dataset('my-dataset').createItemsPublicUrl({ clean: true, skipEmpty: true }); ``` *** #### Parameters * ##### options: [DatasetClientCreateItemsUrlOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/DatasetClientCreateItemsUrlOptions.md) = {} URL generation options (extends all options from listItems) #### Returns Promise\ A public URL string for accessing the dataset items ### [**](#delete)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L88)delete * ****delete**(): Promise\ - Deletes the dataset. * **@see** *** #### Returns Promise\ ### [**](#downloadItems)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L212)downloadItems * ****downloadItems**(format, options): Promise\ - Downloads dataset items in a specific format. Unlike listItems which returns a [PaginatedList](https://docs.apify.com/api/client/js/api/client/js/reference/interface/PaginatedList.md) with an array of individual dataset items, this method returns the items serialized to the provided format (JSON, CSV, Excel, etc.) as a Buffer. Useful for exporting data for further processing. * **@see** * **@example** ``` // Download as CSV with BOM for Excel compatibility const csvBuffer = await client.dataset('my-dataset').downloadItems('csv', { bom: true }); require('fs').writeFileSync('output.csv', csvBuffer); // Download as Excel with custom options const xlsxBuffer = await client.dataset('my-dataset').downloadItems('xlsx', { fields: ['url', 'title', 'price'], skipEmpty: true, limit: 1000 }); // Download as XML with custom element names const xmlBuffer = await client.dataset('my-dataset').downloadItems('xml', { xmlRoot: 'products', xmlRow: 'product' }); ``` *** #### Parameters * ##### format: [DownloadItemsFormat](https://docs.apify.com/api/client/js/api/client/js/reference/enum/DownloadItemsFormat.md) Output format: `'json'`, `'jsonl'`, `'csv'`, `'xlsx'`, `'xml'`, `'rss'`, or `'html'` * ##### options: [DatasetClientDownloadItemsOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/DatasetClientDownloadItemsOptions.md) = {} Download and formatting options (extends all options from listItems) #### Returns Promise\ Buffer containing the serialized data in the specified format ### [**](#get)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L66)get * ****get**(): Promise\ - Gets the dataset object from the Apify API. * **@see** *** #### Returns Promise\ The Dataset object, or `undefined` if it does not exist ### [**](#getStatistics)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L309)getStatistics * ****getStatistics**(): Promise\ - Gets statistical information about the dataset. Returns statistics for each field in the dataset, including information about data types, null counts, and value ranges. * **@see** *** #### Returns Promise\ Dataset statistics, or `undefined` if not available ### [**](#listItems)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L136)listItems * ****listItems**(options): PaginatedIterator\ - Lists items in the dataset. Returns a paginated list of dataset items. You can use pagination parameters to retrieve specific subsets of items, and various filtering and formatting options to customize the output. * **@see** * **@example** ``` // Get first 100 items const { items, total } = await client.dataset('my-dataset').listItems({ limit: 100 }); console.log(`Retrieved ${items.length} of ${total} total items`); // Get items with specific fields only const { items } = await client.dataset('my-dataset').listItems({ fields: ['url', 'title'], skipEmpty: true, limit: 50 }); // Get items in descending order with pagination const { items } = await client.dataset('my-dataset').listItems({ desc: true, offset: 100, limit: 50 }); ``` *** #### Parameters * ##### options: [DatasetClientListItemOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/DatasetClientListItemOptions.md) = {} Options for listing items #### Returns PaginatedIterator\ A paginated list with `items`, `total` count, `offset`, `count`, and `limit` ### [**](#pushItems)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L284)pushItems * ****pushItems**(items): Promise\ - Stores one or more items into the dataset. Items can be objects, strings, or arrays thereof. Each item will be stored as a separate record in the dataset. Objects are automatically serialized to JSON. If you provide an array, all items will be stored in order. This method is idempotent - calling it multiple times with the same data will not create duplicates, but will append items each time. * **@see** * **@example** ``` // Store a single object await client.dataset('my-dataset').pushItems({ url: 'https://example.com', title: 'Example Page', extractedAt: new Date() }); // Store multiple items at once await client.dataset('my-dataset').pushItems([ { url: 'https://example.com', title: 'Example' }, { url: 'https://test.com', title: 'Test' }, { url: 'https://demo.com', title: 'Demo' } ]); // Store string items await client.dataset('my-dataset').pushItems(['item1', 'item2', 'item3']); ``` *** #### Parameters * ##### items: string | Data | string\[] | Data\[] A single item (object or string) or an array of items to store. Objects are automatically stringified to JSON. Strings are stored as-is. #### Returns Promise\ ### [**](#update)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L77)update * ****update**(newFields): Promise<[Dataset](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Dataset.md)> - Updates the dataset with specified fields. * **@see** *** #### Parameters * ##### newFields: [DatasetClientUpdateOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/DatasetClientUpdateOptions.md) Fields to update in the dataset #### Returns Promise<[Dataset](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Dataset.md)> The updated Dataset object --- # Source: https://docs.apify.com/api/client/python/reference/class/DatasetClientAsync.md # DatasetClientAsync Async sub-client for manipulating a single dataset. ### Hierarchy * [ResourceClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md) * *DatasetClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClientAsync.md#__init__) * [**create\_items\_public\_url](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClientAsync.md#create_items_public_url) * [**delete](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClientAsync.md#delete) * [**get](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClientAsync.md#get) * [**get\_items\_as\_bytes](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClientAsync.md#get_items_as_bytes) * [**get\_statistics](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClientAsync.md#get_statistics) * [**iterate\_items](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClientAsync.md#iterate_items) * [**list\_items](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClientAsync.md#list_items) * [**push\_items](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClientAsync.md#push_items) * [**stream\_items](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClientAsync.md#stream_items) * [**update](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClientAsync.md#update) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/dataset.py#L647)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#create_items_public_url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/dataset.py#L1101)create\_items\_public\_url * **async **create\_items\_public\_url**(\*, offset, limit, clean, desc, fields, omit, unwind, skip\_empty, skip\_hidden, flatten, view, expires\_in\_secs): str - Generate a URL that can be used to access dataset items. If the client has permission to access the dataset's URL signing key, the URL will include a signature to verify its authenticity. You can optionally control how long the signed URL should be valid using the `expires_in_secs` option. This value sets the expiration duration in seconds from the time the URL is generated. If not provided, the URL will not expire. Any other options (like `limit` or `offset`) will be included as query parameters in the URL. *** #### Parameters * ##### optionalkeyword-onlyoffset: int | None = None * ##### optionalkeyword-onlylimit: int | None = None * ##### optionalkeyword-onlyclean: bool | None = None * ##### optionalkeyword-onlydesc: bool | None = None * ##### optionalkeyword-onlyfields: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[str] | None = None * ##### optionalkeyword-onlyomit: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[str] | None = None * ##### optionalkeyword-onlyunwind: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[str] | None = None * ##### optionalkeyword-onlyskip\_empty: bool | None = None * ##### optionalkeyword-onlyskip\_hidden: bool | None = None * ##### optionalkeyword-onlyflatten: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[str] | None = None * ##### optionalkeyword-onlyview: str | None = None * ##### optionalkeyword-onlyexpires\_in\_secs: int | None = None #### Returns str ### [**](#delete)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/dataset.py#L680)delete * **async **delete**(): None - Delete the dataset. *** #### Returns None ### [**](#get)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/dataset.py#L651)get * **async **get**(): dict | None - Retrieve the dataset. *** #### Returns dict | None ### [**](#get_items_as_bytes)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/dataset.py#L860)get\_items\_as\_bytes * **async **get\_items\_as\_bytes**(\*, item\_format, offset, limit, desc, clean, bom, delimiter, fields, omit, unwind, skip\_empty, skip\_header\_row, skip\_hidden, xml\_root, xml\_row, flatten, signature): bytes - Get the items in the dataset as raw bytes. *** #### Parameters * ##### optionalkeyword-onlyitem\_format: str = 'json' Format of the results, possible values are: json, jsonl, csv, html, xlsx, xml and rss. The default value is json. * ##### optionalkeyword-onlyoffset: int | None = None Number of items that should be skipped at the start. The default value is 0. * ##### optionalkeyword-onlylimit: int | None = None Maximum number of items to return. By default there is no limit. * ##### optionalkeyword-onlydesc: bool | None = None By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to True. * ##### optionalkeyword-onlyclean: bool | None = None If True, returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The clean parameter is just a shortcut for skip\_hidden=True and skip\_empty=True parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the limit value. * ##### optionalkeyword-onlybom: bool | None = None All text responses are encoded in UTF-8 encoding. By default, csv files are prefixed with the UTF-8 Byte Order Mark (BOM), while json, jsonl, xml, html and rss files are not. If you want to override this default behavior, specify bom=True query parameter to include the BOM or bom=False to skip it. * ##### optionalkeyword-onlydelimiter: str | None = None A delimiter character for CSV files. The default delimiter is a simple comma (,). * ##### optionalkeyword-onlyfields: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[str] | None = None A list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the fields parameter. You can use this feature to effectively fix the output format. You can use this feature to effectively fix the output format. * ##### optionalkeyword-onlyomit: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[str] | None = None A list of fields which should be omitted from the items. * ##### optionalkeyword-onlyunwind: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[str] | None = None A list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object, then the item gets preserved as it is. Note that the unwound items ignore the desc parameter. * ##### optionalkeyword-onlyskip\_empty: bool | None = None If True, then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. * ##### optionalkeyword-onlyskip\_header\_row: bool | None = None If True, then header row in the csv format is skipped. * ##### optionalkeyword-onlyskip\_hidden: bool | None = None If True, then hidden fields are skipped from the output, i.e. fields starting with the # character. * ##### optionalkeyword-onlyxml\_root: str | None = None Overrides default root element name of xml output. By default the root element is items. * ##### optionalkeyword-onlyxml\_row: str | None = None Overrides default element name that wraps each page or page function result object in xml output. By default the element name is item. * ##### optionalkeyword-onlyflatten: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[str] | None = None A list of fields that should be flattened. * ##### optionalkeyword-onlysignature: str | None = None Signature used to access the items. #### Returns bytes ### [**](#get_statistics)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/dataset.py#L1080)get\_statistics * **async **get\_statistics**(): dict | None - Get the dataset statistics. *** #### Returns dict | None ### [**](#iterate_items)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/dataset.py#L776)iterate\_items * **async **iterate\_items**(\*, offset, limit, clean, desc, fields, omit, unwind, skip\_empty, skip\_hidden, signature): AsyncIterator\[dict] - Iterate over the items in the dataset. *** #### Parameters * ##### optionalkeyword-onlyoffset: int = 0 Number of items that should be skipped at the start. The default value is 0. * ##### optionalkeyword-onlylimit: int | None = None Maximum number of items to return. By default there is no limit. * ##### optionalkeyword-onlyclean: bool | None = None If True, returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The clean parameter is just a shortcut for skip\_hidden=True and skip\_empty=True parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the limit value. * ##### optionalkeyword-onlydesc: bool | None = None By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to True. * ##### optionalkeyword-onlyfields: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[str] | None = None A list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the fields parameter. You can use this feature to effectively fix the output format. * ##### optionalkeyword-onlyomit: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[str] | None = None A list of fields which should be omitted from the items. * ##### optionalkeyword-onlyunwind: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[str] | None = None A list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object, then the item gets preserved as it is. Note that the unwound items ignore the desc parameter. * ##### optionalkeyword-onlyskip\_empty: bool | None = None If True, then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. * ##### optionalkeyword-onlyskip\_hidden: bool | None = None If True, then hidden fields are skipped from the output, i.e. fields starting with the # character. * ##### optionalkeyword-onlysignature: str | None = None Signature used to access the items. #### Returns AsyncIterator\[dict] ### [**](#list_items)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/dataset.py#L687)list\_items * **async **list\_items**(\*, offset, limit, clean, desc, fields, omit, unwind, skip\_empty, skip\_hidden, flatten, view, signature): [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md) - List the items of the dataset. *** #### Parameters * ##### optionalkeyword-onlyoffset: int | None = None Number of items that should be skipped at the start. The default value is 0. * ##### optionalkeyword-onlylimit: int | None = None Maximum number of items to return. By default there is no limit. * ##### optionalkeyword-onlyclean: bool | None = None If True, returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The clean parameter is just a shortcut for skip\_hidden=True and skip\_empty=True parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the limit value. * ##### optionalkeyword-onlydesc: bool | None = None By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to True. * ##### optionalkeyword-onlyfields: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[str] | None = None A list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the fields parameter. You can use this feature to effectively fix the output format. * ##### optionalkeyword-onlyomit: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[str] | None = None A list of fields which should be omitted from the items. * ##### optionalkeyword-onlyunwind: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[str] | None = None A list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object, then the item gets preserved as it is. Note that the unwound items ignore the desc parameter. * ##### optionalkeyword-onlyskip\_empty: bool | None = None If True, then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. * ##### optionalkeyword-onlyskip\_hidden: bool | None = None If True, then hidden fields are skipped from the output, i.e. fields starting with the # character. * ##### optionalkeyword-onlyflatten: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[str] | None = None A list of fields that should be flattened. * ##### optionalkeyword-onlyview: str | None = None Name of the dataset view to be used. * ##### optionalkeyword-onlysignature: str | None = None Signature used to access the items. #### Returns [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md) ### [**](#push_items)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/dataset.py#L1053)push\_items * **async **push\_items**(items): None - Push items to the dataset. *** #### Parameters * ##### items: [JSONSerializable](https://docs.apify.com/api/client/python/api/client/python/reference.md#JSONSerializable) The items which to push in the dataset. Either a stringified JSON, a dictionary, or a list of strings or dictionaries. #### Returns None ### [**](#stream_items)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/dataset.py#L956)stream\_items * **async **stream\_items**(\*, item\_format, offset, limit, desc, clean, bom, delimiter, fields, omit, unwind, skip\_empty, skip\_header\_row, skip\_hidden, xml\_root, xml\_row, signature): AsyncIterator\[impit.Response] - Retrieve the items in the dataset as a stream. *** #### Parameters * ##### optionalkeyword-onlyitem\_format: str = 'json' Format of the results, possible values are: json, jsonl, csv, html, xlsx, xml and rss. The default value is json. * ##### optionalkeyword-onlyoffset: int | None = None Number of items that should be skipped at the start. The default value is 0. * ##### optionalkeyword-onlylimit: int | None = None Maximum number of items to return. By default there is no limit. * ##### optionalkeyword-onlydesc: bool | None = None By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to True. * ##### optionalkeyword-onlyclean: bool | None = None If True, returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The clean parameter is just a shortcut for skip\_hidden=True and skip\_empty=True parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the limit value. * ##### optionalkeyword-onlybom: bool | None = None All text responses are encoded in UTF-8 encoding. By default, csv files are prefixed with the UTF-8 Byte Order Mark (BOM), while json, jsonl, xml, html and rss files are not. If you want to override this default behavior, specify bom=True query parameter to include the BOM or bom=False to skip it. * ##### optionalkeyword-onlydelimiter: str | None = None A delimiter character for CSV files. The default delimiter is a simple comma (,). * ##### optionalkeyword-onlyfields: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[str] | None = None A list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the fields parameter. You can use this feature to effectively fix the output format. You can use this feature to effectively fix the output format. * ##### optionalkeyword-onlyomit: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[str] | None = None A list of fields which should be omitted from the items. * ##### optionalkeyword-onlyunwind: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[str] | None = None A list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object, then the item gets preserved as it is. Note that the unwound items ignore the desc parameter. * ##### optionalkeyword-onlyskip\_empty: bool | None = None If True, then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. * ##### optionalkeyword-onlyskip\_header\_row: bool | None = None If True, then header row in the csv format is skipped. * ##### optionalkeyword-onlyskip\_hidden: bool | None = None If True, then hidden fields are skipped from the output, i.e. fields starting with the # character. * ##### optionalkeyword-onlyxml\_root: str | None = None Overrides default root element name of xml output. By default the root element is items. * ##### optionalkeyword-onlyxml\_row: str | None = None Overrides default element name that wraps each page or page function result object in xml output. By default the element name is item. * ##### optionalkeyword-onlysignature: str | None = None Signature used to access the items. #### Returns AsyncIterator\[impit.Response] ### [**](#update)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/dataset.py#L661)update * **async **update**(\*, name, general\_access): dict - Update the dataset with specified fields. *** #### Parameters * ##### optionalkeyword-onlyname: str | None = None The new name for the dataset. * ##### optionalkeyword-onlygeneral\_access: StorageGeneralAccess | None = None Determines how others can access the dataset. #### Returns dict ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/js/reference/interface/DatasetClientCreateItemsUrlOptions.md # DatasetClientCreateItemsUrlOptions Options for creating a public URL to access dataset items. Extends [DatasetClientListItemOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/DatasetClientListItemOptions.md) with URL expiration control. ### Hierarchy * [DatasetClientListItemOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/DatasetClientListItemOptions.md) * *DatasetClientCreateItemsUrlOptions* ## Index[**](#Index) ### Properties * [**chunkSize](#chunkSize) * [**clean](#clean) * [**desc](#desc) * [**expiresInSecs](#expiresInSecs) * [**fields](#fields) * [**flatten](#flatten) * [**limit](#limit) * [**offset](#offset) * [**omit](#omit) * [**signature](#signature) * [**skipEmpty](#skipEmpty) * [**skipHidden](#skipHidden) * [**unwind](#unwind) * [**view](#view) ## Properties[**](#Properties) ### [**](#chunkSize)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L258)optionalinheritedchunkSize **chunkSize? : number Inherited from DatasetClientListItemOptions.chunkSize Maximum number of items returned in one API response. Relevant in the context of asyncIterator, the iterator will fetch results in chunks of this size from API and yield them one by one. It will stop fetching once the limit is reached or once all items from API have been fetched. Chunk size is usually limited by API. Minimum of those two limits will be used. ### [**](#clean)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L460)optionalinheritedclean **clean? : boolean Inherited from DatasetClientListItemOptions.clean ### [**](#desc)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L461)optionalinheriteddesc **desc? : boolean Inherited from DatasetClientListItemOptions.desc ### [**](#expiresInSecs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L478)optionalexpiresInSecs **expiresInSecs? : number ### [**](#fields)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L463)optionalinheritedfields **fields? : string\[] Inherited from DatasetClientListItemOptions.fields ### [**](#flatten)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L462)optionalinheritedflatten **flatten? : string\[] Inherited from DatasetClientListItemOptions.flatten ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L251)optionalinheritedlimit **limit? : number Inherited from DatasetClientListItemOptions.limit Maximum number of entries requested. ### [**](#offset)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L249)optionalinheritedoffset **offset? : number Inherited from DatasetClientListItemOptions.offset Position of the first returned entry. ### [**](#omit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L464)optionalinheritedomit **omit? : string\[] Inherited from DatasetClientListItemOptions.omit ### [**](#signature)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L469)optionalinheritedsignature **signature? : string Inherited from DatasetClientListItemOptions.signature ### [**](#skipEmpty)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L465)optionalinheritedskipEmpty **skipEmpty? : boolean Inherited from DatasetClientListItemOptions.skipEmpty ### [**](#skipHidden)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L466)optionalinheritedskipHidden **skipHidden? : boolean Inherited from DatasetClientListItemOptions.skipHidden ### [**](#unwind)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L467)optionalinheritedunwind **unwind? : string | string\[] Inherited from DatasetClientListItemOptions.unwind ### [**](#view)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L468)optionalinheritedview **view? : string Inherited from DatasetClientListItemOptions.view --- # Source: https://docs.apify.com/api/client/js/reference/interface/DatasetClientDownloadItemsOptions.md # DatasetClientDownloadItemsOptions Options for downloading dataset items in a specific format. Extends [DatasetClientListItemOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/DatasetClientListItemOptions.md) with format-specific options. ### Hierarchy * [DatasetClientListItemOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/DatasetClientListItemOptions.md) * *DatasetClientDownloadItemsOptions* ## Index[**](#Index) ### Properties * [**attachment](#attachment) * [**bom](#bom) * [**chunkSize](#chunkSize) * [**clean](#clean) * [**delimiter](#delimiter) * [**desc](#desc) * [**fields](#fields) * [**flatten](#flatten) * [**limit](#limit) * [**offset](#offset) * [**omit](#omit) * [**signature](#signature) * [**skipEmpty](#skipEmpty) * [**skipHeaderRow](#skipHeaderRow) * [**skipHidden](#skipHidden) * [**unwind](#unwind) * [**view](#view) * [**xmlRoot](#xmlRoot) * [**xmlRow](#xmlRow) ## Properties[**](#Properties) ### [**](#attachment)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L502)optionalattachment **attachment? : boolean ### [**](#bom)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L503)optionalbom **bom? : boolean ### [**](#chunkSize)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L258)optionalinheritedchunkSize **chunkSize? : number Inherited from DatasetClientListItemOptions.chunkSize Maximum number of items returned in one API response. Relevant in the context of asyncIterator, the iterator will fetch results in chunks of this size from API and yield them one by one. It will stop fetching once the limit is reached or once all items from API have been fetched. Chunk size is usually limited by API. Minimum of those two limits will be used. ### [**](#clean)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L460)optionalinheritedclean **clean? : boolean Inherited from DatasetClientListItemOptions.clean ### [**](#delimiter)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L504)optionaldelimiter **delimiter? : string ### [**](#desc)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L461)optionalinheriteddesc **desc? : boolean Inherited from DatasetClientListItemOptions.desc ### [**](#fields)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L463)optionalinheritedfields **fields? : string\[] Inherited from DatasetClientListItemOptions.fields ### [**](#flatten)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L462)optionalinheritedflatten **flatten? : string\[] Inherited from DatasetClientListItemOptions.flatten ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L251)optionalinheritedlimit **limit? : number Inherited from DatasetClientListItemOptions.limit Maximum number of entries requested. ### [**](#offset)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L249)optionalinheritedoffset **offset? : number Inherited from DatasetClientListItemOptions.offset Position of the first returned entry. ### [**](#omit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L464)optionalinheritedomit **omit? : string\[] Inherited from DatasetClientListItemOptions.omit ### [**](#signature)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L469)optionalinheritedsignature **signature? : string Inherited from DatasetClientListItemOptions.signature ### [**](#skipEmpty)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L465)optionalinheritedskipEmpty **skipEmpty? : boolean Inherited from DatasetClientListItemOptions.skipEmpty ### [**](#skipHeaderRow)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L505)optionalskipHeaderRow **skipHeaderRow? : boolean ### [**](#skipHidden)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L466)optionalinheritedskipHidden **skipHidden? : boolean Inherited from DatasetClientListItemOptions.skipHidden ### [**](#unwind)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L467)optionalinheritedunwind **unwind? : string | string\[] Inherited from DatasetClientListItemOptions.unwind ### [**](#view)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L468)optionalinheritedview **view? : string Inherited from DatasetClientListItemOptions.view ### [**](#xmlRoot)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L506)optionalxmlRoot **xmlRoot? : string ### [**](#xmlRow)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L507)optionalxmlRow **xmlRow? : string --- # Source: https://docs.apify.com/api/client/js/reference/interface/DatasetClientListItemOptions.md # DatasetClientListItemOptions Options for listing items from a dataset. Provides various filtering, pagination, and transformation options to customize the output format and content of retrieved items. ### Hierarchy * PaginationOptions * *DatasetClientListItemOptions* * [DatasetClientCreateItemsUrlOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/DatasetClientCreateItemsUrlOptions.md) * [DatasetClientDownloadItemsOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/DatasetClientDownloadItemsOptions.md) ## Index[**](#Index) ### Properties * [**chunkSize](#chunkSize) * [**clean](#clean) * [**desc](#desc) * [**fields](#fields) * [**flatten](#flatten) * [**limit](#limit) * [**offset](#offset) * [**omit](#omit) * [**signature](#signature) * [**skipEmpty](#skipEmpty) * [**skipHidden](#skipHidden) * [**unwind](#unwind) * [**view](#view) ## Properties[**](#Properties) ### [**](#chunkSize)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L258)optionalinheritedchunkSize **chunkSize? : number Inherited from PaginationOptions.chunkSize Maximum number of items returned in one API response. Relevant in the context of asyncIterator, the iterator will fetch results in chunks of this size from API and yield them one by one. It will stop fetching once the limit is reached or once all items from API have been fetched. Chunk size is usually limited by API. Minimum of those two limits will be used. ### [**](#clean)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L460)optionalclean **clean? : boolean ### [**](#desc)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L461)optionaldesc **desc? : boolean ### [**](#fields)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L463)optionalfields **fields? : string\[] ### [**](#flatten)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L462)optionalflatten **flatten? : string\[] ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L251)optionalinheritedlimit **limit? : number Inherited from PaginationOptions.limit Maximum number of entries requested. ### [**](#offset)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L249)optionalinheritedoffset **offset? : number Inherited from PaginationOptions.offset Position of the first returned entry. ### [**](#omit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L464)optionalomit **omit? : string\[] ### [**](#signature)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L469)optionalsignature **signature? : string ### [**](#skipEmpty)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L465)optionalskipEmpty **skipEmpty? : boolean ### [**](#skipHidden)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L466)optionalskipHidden **skipHidden? : boolean ### [**](#unwind)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L467)optionalunwind **unwind? : string | string\[] ### [**](#view)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L468)optionalview **view? : string --- # Source: https://docs.apify.com/api/client/js/reference/interface/DatasetClientUpdateOptions.md # DatasetClientUpdateOptions Options for updating a dataset. ## Index[**](#Index) ### Properties * [**generalAccess](#generalAccess) * [**name](#name) * [**title](#title) ## Properties[**](#Properties) ### [**](#generalAccess)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L450)optionalgeneralAccess **generalAccess? : null | STORAGE\_GENERAL\_ACCESS ### [**](#name)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L448)optionalname **name? : null | string ### [**](#title)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L449)optionaltitle **title? : string --- # Source: https://docs.apify.com/api/client/python/reference/class/DatasetCollectionClient.md # Source: https://docs.apify.com/api/client/js/reference/class/DatasetCollectionClient.md # DatasetCollectionClient Client for managing the collection of datasets in your account. Datasets store structured data results from Actor runs. This client provides methods to list, create, or get datasets by name. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const datasetsClient = client.datasets(); // List all datasets const { items } = await datasetsClient.list(); // Get or create a dataset by name const dataset = await datasetsClient.getOrCreate('my-dataset'); ``` * **@see** ### Hierarchy * ResourceCollectionClient * *DatasetCollectionClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**getOrCreate](#getOrCreate) * [**list](#list) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceCollectionClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceCollectionClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceCollectionClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceCollectionClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceCollectionClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceCollectionClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceCollectionClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceCollectionClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceCollectionClient.url ## Methods[**](#Methods) ### [**](#getOrCreate)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset_collection.ts#L83)getOrCreate * ****getOrCreate**(name, options): Promise<[Dataset](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Dataset.md)> - Gets or creates a dataset with the specified name. * **@see** *** #### Parameters * ##### optionalname: string Name of the dataset. If not provided, a default dataset is used. * ##### optionaloptions: [DatasetCollectionClientGetOrCreateOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/DatasetCollectionClientGetOrCreateOptions.md) Additional options like schema. #### Returns Promise<[Dataset](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Dataset.md)> The dataset object. ### [**](#list)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset_collection.ts#L59)list * ****list**(options): Promise<[DatasetCollectionClientListResult](https://docs.apify.com/api/client/js/api/client/js/reference.md#DatasetCollectionClientListResult)> & AsyncIterable<[Dataset](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Dataset.md), any, any> - Lists all Datasets. 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 * ##### options: [DatasetCollectionClientListOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/DatasetCollectionClientListOptions.md) = {} Pagination options. #### Returns Promise<[DatasetCollectionClientListResult](https://docs.apify.com/api/client/js/api/client/js/reference.md#DatasetCollectionClientListResult)> & AsyncIterable<[Dataset](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Dataset.md), any, any> A paginated iterator of Datasets. --- # Source: https://docs.apify.com/api/client/python/reference/class/DatasetCollectionClientAsync.md # DatasetCollectionClientAsync Async sub-client for manipulating datasets. ### Hierarchy * [ResourceCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md) * *DatasetCollectionClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetCollectionClientAsync.md#__init__) * [**get\_or\_create](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetCollectionClientAsync.md#get_or_create) * [**list](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetCollectionClientAsync.md#list) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetCollectionClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetCollectionClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetCollectionClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetCollectionClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetCollectionClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/dataset_collection.py#L60)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceCollectionClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#get_or_create)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/dataset_collection.py#L87)get\_or\_create * **async **get\_or\_create**(\*, name, schema): dict - Retrieve a named dataset, or create a new one when it doesn't exist. *** #### Parameters * ##### optionalkeyword-onlyname: str | None = None The name of the dataset to retrieve or create. * ##### optionalkeyword-onlyschema: dict | None = None The schema of the dataset. #### Returns dict ### [**](#list)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/dataset_collection.py#L64)list * **async **list**(\*, unnamed, limit, offset, desc): [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] - List the available datasets. *** #### Parameters * ##### optionalkeyword-onlyunnamed: bool | None = None Whether to include unnamed datasets in the list. * ##### optionalkeyword-onlylimit: int | None = None How many datasets to retrieve. * ##### optionalkeyword-onlyoffset: int | None = None What dataset to include as first when retrieving the list. * ##### optionalkeyword-onlydesc: bool | None = None Whether to sort the datasets in descending order based on their modification date. #### Returns [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/js/reference/interface/DatasetCollectionClientGetOrCreateOptions.md # DatasetCollectionClientGetOrCreateOptions ## Index[**](#Index) ### Properties * [**schema](#schema) ## Properties[**](#Properties) ### [**](#schema)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset_collection.ts#L97)optionalschema **schema? : Record\ --- # Source: https://docs.apify.com/api/client/js/reference/interface/DatasetCollectionClientListOptions.md # DatasetCollectionClientListOptions ### Hierarchy * PaginationOptions * *DatasetCollectionClientListOptions* ## Index[**](#Index) ### Properties * [**chunkSize](#chunkSize) * [**desc](#desc) * [**limit](#limit) * [**offset](#offset) * [**unnamed](#unnamed) ## Properties[**](#Properties) ### [**](#chunkSize)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L258)optionalinheritedchunkSize **chunkSize? : number Inherited from PaginationOptions.chunkSize Maximum number of items returned in one API response. Relevant in the context of asyncIterator, the iterator will fetch results in chunks of this size from API and yield them one by one. It will stop fetching once the limit is reached or once all items from API have been fetched. Chunk size is usually limited by API. Minimum of those two limits will be used. ### [**](#desc)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset_collection.ts#L93)optionaldesc **desc? : boolean ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L251)optionalinheritedlimit **limit? : number Inherited from PaginationOptions.limit Maximum number of entries requested. ### [**](#offset)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L249)optionalinheritedoffset **offset? : number Inherited from PaginationOptions.offset Position of the first returned entry. ### [**](#unnamed)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset_collection.ts#L92)optionalunnamed **unnamed? : boolean --- # Source: https://docs.apify.com/sdk/js/reference/interface/DatasetConsumer.md # externalDatasetConsumer \ User-function used in the `Dataset.forEach()` API. ### Callable * ****DatasetConsumer**(item, index): Awaitable\ *** * #### Parameters * ##### externalitem: Data Current [Dataset](https://docs.apify.com/sdk/js/sdk/js/reference/class/Dataset.md) entry being processed. * ##### externalindex: number Position of current [Dataset](https://docs.apify.com/sdk/js/sdk/js/reference/class/Dataset.md) entry. #### Returns Awaitable\ --- # Source: https://docs.apify.com/sdk/js/reference/interface/DatasetContent.md # externalDatasetContent \ ## Index[**](#Index) ### Properties * [**count](#count) * [**desc](#desc) * [**items](#items) * [**limit](#limit) * [**offset](#offset) * [**total](#total) ## Properties[**](#Properties) ### [**](#count)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/dataset.d.ts#L420)externalcount **count: number Count of dataset entries returned in this set. ### [**](#desc)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/dataset.d.ts#L428)externaloptionaldesc **desc? : boolean Should the results be in descending order. ### [**](#items)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/dataset.d.ts#L426)externalitems **items: Data\[] Dataset entries based on chosen format parameter. ### [**](#limit)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/dataset.d.ts#L424)externallimit **limit: number Maximum number of dataset entries requested. ### [**](#offset)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/dataset.d.ts#L422)externaloffset **offset: number Position of the first returned entry in the dataset. ### [**](#total)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/dataset.d.ts#L418)externaltotal **total: number Total count of entries in the dataset. --- # Source: https://docs.apify.com/sdk/js/reference/interface/DatasetDataOptions.md # externalDatasetDataOptions ## Index[**](#Index) ### Properties * [**clean](#clean) * [**desc](#desc) * [**fields](#fields) * [**limit](#limit) * [**offset](#offset) * [**skipEmpty](#skipEmpty) * [**skipHidden](#skipHidden) * [**unwind](#unwind) ## Properties[**](#Properties) ### [**](#clean)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/dataset.d.ts#L56)externaloptionalclean **clean? : boolean = false If `true` then the function returns only non-empty items and skips hidden fields (i.e. fields starting with `#` character). Note that the `clean` parameter is a shortcut for `skipHidden: true` and `skipEmpty: true` options. ### [**](#desc)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/dataset.d.ts#L41)externaloptionaldesc **desc? : boolean = false If `true` then the objects are sorted by `createdAt` in descending order. Otherwise they are sorted in ascending order. ### [**](#fields)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/dataset.d.ts#L45)externaloptionalfields **fields? : string\[] An array of field names that will be included in the result. If omitted, all fields are included in the results. ### [**](#limit)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/dataset.d.ts#L35)externaloptionallimit **limit? : number = 250000 Maximum number of array elements to return. ### [**](#offset)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/dataset.d.ts#L30)externaloptionaloffset **offset? : number = 0 Number of array elements that should be skipped at the start. ### [**](#skipEmpty)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/dataset.d.ts#L67)externaloptionalskipEmpty **skipEmpty? : boolean = false If `true` then the function doesn't return empty items. Note that in this case the returned number of items might be lower than limit parameter and pagination must be done using the `limit` value. ### [**](#skipHidden)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/dataset.d.ts#L61)externaloptionalskipHidden **skipHidden? : boolean = false If `true` then the function doesn't return hidden fields (fields starting with "#" character). ### [**](#unwind)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/dataset.d.ts#L50)externaloptionalunwind **unwind? : string Specifies a name of the field in the result objects that will be used to unwind the resulting objects. By default, the results are returned as they are. --- # Source: https://docs.apify.com/sdk/python/reference/class/DatasetItemsListPage.md # DatasetItemsListPage Model for a single page of dataset items returned from a collection list method. ## Index[**](#Index) ### Properties * [**count](https://docs.apify.com/sdk/python/sdk/python/reference/class/DatasetItemsListPage.md#count) * [**desc](https://docs.apify.com/sdk/python/sdk/python/reference/class/DatasetItemsListPage.md#desc) * [**limit](https://docs.apify.com/sdk/python/sdk/python/reference/class/DatasetItemsListPage.md#limit) * [**model\_config](https://docs.apify.com/sdk/python/sdk/python/reference/class/DatasetItemsListPage.md#model_config) * [**offset](https://docs.apify.com/sdk/python/sdk/python/reference/class/DatasetItemsListPage.md#offset) * [**total](https://docs.apify.com/sdk/python/sdk/python/reference/class/DatasetItemsListPage.md#total) ## Properties[**](#Properties) ### [**](#count)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L115)count **count: int The number of objects returned on this page. ### [**](#desc)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L127)desc **desc: bool Indicates if the returned list is in descending order. ### [**](#limit)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L121)limit **limit: int The maximum number of objects to return, as specified in the API call. ### [**](#model_config)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L113)model\_config **model\_config: Undefined ### [**](#offset)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L118)offset **offset: int The starting position of the first object returned, as specified in the API call. ### [**](#total)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L124)total **total: int The total number of objects that match the criteria of the API call. --- # Source: https://docs.apify.com/sdk/js/reference/interface/DatasetIteratorOptions.md # externalDatasetIteratorOptions ### Hierarchy * Omit<[DatasetDataOptions](https://docs.apify.com/sdk/js/sdk/js/reference/interface/DatasetDataOptions.md), offset | limit | clean | skipHidden | skipEmpty> * *DatasetIteratorOptions* ## Index[**](#Index) ### Properties * [**desc](#desc) * [**fields](#fields) * [**unwind](#unwind) ## Properties[**](#Properties) ### [**](#desc)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/dataset.d.ts#L41)externaloptionalinheriteddesc **desc? : boolean = false Inherited from Omit.desc If `true` then the objects are sorted by `createdAt` in descending order. Otherwise they are sorted in ascending order. ### [**](#fields)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/dataset.d.ts#L45)externaloptionalinheritedfields **fields? : string\[] Inherited from Omit.fields An array of field names that will be included in the result. If omitted, all fields are included in the results. ### [**](#unwind)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/dataset.d.ts#L50)externaloptionalinheritedunwind **unwind? : string Inherited from Omit.unwind Specifies a name of the field in the result objects that will be used to unwind the resulting objects. By default, the results are returned as they are. --- # Source: https://docs.apify.com/sdk/js/reference/interface/DatasetMapper.md # externalDatasetMapper \ User-function used in the `Dataset.map()` API. ### Callable * ****DatasetMapper**(item, index): Awaitable\ *** * User-function used in the `Dataset.map()` API. *** #### Parameters * ##### externalitem: Data Current [Dataset](https://docs.apify.com/sdk/js/sdk/js/reference/class/Dataset.md) entry being processed. * ##### externalindex: number Position of current [Dataset](https://docs.apify.com/sdk/js/sdk/js/reference/class/Dataset.md) entry. #### Returns Awaitable\ --- # Source: https://docs.apify.com/sdk/python/reference/class/DatasetMetadata.md # DatasetMetadata Model for a dataset metadata. ### Hierarchy * [StorageMetadata](https://crawlee.dev/python/api/class/StorageMetadata) * *DatasetMetadata* ## Index[**](#Index) ### Properties * [**accessed\_at](https://docs.apify.com/sdk/python/sdk/python/reference/class/DatasetMetadata.md#accessed_at) * [**created\_at](https://docs.apify.com/sdk/python/sdk/python/reference/class/DatasetMetadata.md#created_at) * [**id](https://docs.apify.com/sdk/python/sdk/python/reference/class/DatasetMetadata.md#id) * [**item\_count](https://docs.apify.com/sdk/python/sdk/python/reference/class/DatasetMetadata.md#item_count) * [**model\_config](https://docs.apify.com/sdk/python/sdk/python/reference/class/DatasetMetadata.md#model_config) * [**modified\_at](https://docs.apify.com/sdk/python/sdk/python/reference/class/DatasetMetadata.md#modified_at) * [**name](https://docs.apify.com/sdk/python/sdk/python/reference/class/DatasetMetadata.md#name) ## Properties[**](#Properties) ### [**](#accessed_at)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L31)accessed\_at **accessed\_at: Annotated\[datetime, Field(alias='accessedAt')] Inherited from [StorageMetadata.accessed\_at](https://crawlee.dev/python/api/class/StorageMetadata#accessed_at) The timestamp when the storage was last accessed. ### [**](#created_at)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L34)created\_at **created\_at: Annotated\[datetime, Field(alias='createdAt')] Inherited from [StorageMetadata.created\_at](https://crawlee.dev/python/api/class/StorageMetadata#created_at) The timestamp when the storage was created. ### [**](#id)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L25)id **id: Annotated\[str, Field(alias='id')] Inherited from [StorageMetadata.id](https://crawlee.dev/python/api/class/StorageMetadata#id) The unique identifier of the storage. ### [**](#item_count)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L47)item\_count **item\_count: int The number of items in the dataset. ### [**](#model_config)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L45)model\_config **model\_config: Undefined Overrides [StorageMetadata.model\_config](https://crawlee.dev/python/api/class/StorageMetadata#model_config) ### [**](#modified_at)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L37)modified\_at **modified\_at: Annotated\[datetime, Field(alias='modifiedAt')] Inherited from [StorageMetadata.modified\_at](https://crawlee.dev/python/api/class/StorageMetadata#modified_at) The timestamp when the storage was last modified. ### [**](#name)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L28)name **name: Annotated\[str | None, Field(alias='name', default=None)] Inherited from [StorageMetadata.name](https://crawlee.dev/python/api/class/StorageMetadata#name) The name of the storage. --- # Source: https://docs.apify.com/sdk/js/reference/interface/DatasetOptions.md # externalDatasetOptions ## Index[**](#Index) ### Properties * [**client](#client) * [**id](#id) * [**name](#name) ## Properties[**](#Properties) ### [**](#client)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/dataset.d.ts#L414)externalclient **client: StorageClient ### [**](#id)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/dataset.d.ts#L412)externalid **id: string ### [**](#name)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/dataset.d.ts#L413)externaloptionalname **name? : string --- # Source: https://docs.apify.com/sdk/js/reference/interface/DatasetReducer.md # externalDatasetReducer \ User-function used in the `Dataset.reduce()` API. ### Callable * ****DatasetReducer**(memo, item, index): Awaitable\ *** * #### Parameters * ##### externalmemo: T Previous state of the reduction. * ##### externalitem: Data Current [Dataset](https://docs.apify.com/sdk/js/sdk/js/reference/class/Dataset.md) entry being processed. * ##### externalindex: number Position of current [Dataset](https://docs.apify.com/sdk/js/sdk/js/reference/class/Dataset.md) entry. #### Returns Awaitable\ --- # Source: https://docs.apify.com/api/client/js/reference/interface/DatasetStatistics.md # DatasetStatistics Statistical information about dataset fields. Provides insights into the data structure and content of the dataset. ## Index[**](#Index) ### Properties * [**fieldStatistics](#fieldStatistics) ## Properties[**](#Properties) ### [**](#fieldStatistics)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L516)fieldStatistics **fieldStatistics: Record\ --- # Source: https://docs.apify.com/api/client/js/reference/interface/DatasetStats.md # DatasetStats Statistics about dataset usage and storage. ## Index[**](#Index) ### Properties * [**deleteCount](#deleteCount) * [**readCount](#readCount) * [**storageBytes](#storageBytes) * [**writeCount](#writeCount) ## Properties[**](#Properties) ### [**](#deleteCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L440)optionaldeleteCount **deleteCount? : number ### [**](#readCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L438)optionalreadCount **readCount? : number ### [**](#storageBytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L441)optionalstorageBytes **storageBytes? : number ### [**](#writeCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L439)optionalwriteCount **writeCount? : number --- # Source: https://docs.apify.com/sdk/python/reference/class/DeprecatedEvent.md # DeprecatedEvent ## Index[**](#Index) ### Properties * [**data](https://docs.apify.com/sdk/python/sdk/python/reference/class/DeprecatedEvent.md#data) * [**name](https://docs.apify.com/sdk/python/sdk/python/reference/class/DeprecatedEvent.md#name) ## Properties[**](#Properties) ### [**](#data)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L93)data **data: dict\[str, Any] ### [**](#name)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L92)name **name: Literal\[cpuInfo] --- # Source: https://docs.apify.com/api/client/js/reference/enum/DownloadItemsFormat.md # DownloadItemsFormat Supported formats for downloading dataset items. ## Index[**](#Index) ### Enumeration Members * [**CSV](#CSV) * [**HTML](#HTML) * [**JSON](#JSON) * [**JSONL](#JSONL) * [**RSS](#RSS) * [**XLSX](#XLSX) * [**XML](#XML) ## Enumeration Members[**](<#Enumeration Members>) ### [**](#CSV)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L489)CSV **CSV: csv ### [**](#HTML)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L488)HTML **HTML: html ### [**](#JSON)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L485)JSON **JSON: json ### [**](#JSONL)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L486)JSONL **JSONL: jsonl ### [**](#RSS)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L491)RSS **RSS: rss ### [**](#XLSX)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L490)XLSX **XLSX: xlsx ### [**](#XML)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L487)XML **XML: xml --- # Source: https://docs.apify.com/sdk/python/reference/enum/Event.md # Event Names of all possible events that can be emitted using an `EventManager`. ## Index[**](#Index) ### Enumeration members * [**ABORTING](https://docs.apify.com/sdk/python/sdk/python/reference/enum/Event.md#ABORTING) * [**BROWSER\_CLOSED](https://docs.apify.com/sdk/python/sdk/python/reference/enum/Event.md#BROWSER_CLOSED) * [**BROWSER\_LAUNCHED](https://docs.apify.com/sdk/python/sdk/python/reference/enum/Event.md#BROWSER_LAUNCHED) * [**BROWSER\_RETIRED](https://docs.apify.com/sdk/python/sdk/python/reference/enum/Event.md#BROWSER_RETIRED) * [**CRAWLER\_STATUS](https://docs.apify.com/sdk/python/sdk/python/reference/enum/Event.md#CRAWLER_STATUS) * [**EXIT](https://docs.apify.com/sdk/python/sdk/python/reference/enum/Event.md#EXIT) * [**MIGRATING](https://docs.apify.com/sdk/python/sdk/python/reference/enum/Event.md#MIGRATING) * [**PAGE\_CLOSED](https://docs.apify.com/sdk/python/sdk/python/reference/enum/Event.md#PAGE_CLOSED) * [**PAGE\_CREATED](https://docs.apify.com/sdk/python/sdk/python/reference/enum/Event.md#PAGE_CREATED) * [**PERSIST\_STATE](https://docs.apify.com/sdk/python/sdk/python/reference/enum/Event.md#PERSIST_STATE) * [**SESSION\_RETIRED](https://docs.apify.com/sdk/python/sdk/python/reference/enum/Event.md#SESSION_RETIRED) * [**SYSTEM\_INFO](https://docs.apify.com/sdk/python/sdk/python/reference/enum/Event.md#SYSTEM_INFO) ## Enumeration members[**](<#Enumeration members>) ### [**](#ABORTING)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_types.py#L22)ABORTING **ABORTING: 'aborting' ### [**](#BROWSER_CLOSED)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_types.py#L31)BROWSER\_CLOSED **BROWSER\_CLOSED: 'browserClosed' ### [**](#BROWSER_LAUNCHED)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_types.py#L29)BROWSER\_LAUNCHED **BROWSER\_LAUNCHED: 'browserLaunched' ### [**](#BROWSER_RETIRED)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_types.py#L30)BROWSER\_RETIRED **BROWSER\_RETIRED: 'browserRetired' ### [**](#CRAWLER_STATUS)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_types.py#L36)CRAWLER\_STATUS **CRAWLER\_STATUS: 'crawlerStatus' ### [**](#EXIT)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_types.py#L23)EXIT **EXIT: 'exit' ### [**](#MIGRATING)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_types.py#L21)MIGRATING **MIGRATING: 'migrating' ### [**](#PAGE_CLOSED)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_types.py#L33)PAGE\_CLOSED **PAGE\_CLOSED: 'pageClosed' ### [**](#PAGE_CREATED)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_types.py#L32)PAGE\_CREATED **PAGE\_CREATED: 'pageCreated' ### [**](#PERSIST_STATE)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_types.py#L19)PERSIST\_STATE **PERSIST\_STATE: 'persistState' ### [**](#SESSION_RETIRED)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_types.py#L26)SESSION\_RETIRED **SESSION\_RETIRED: 'sessionRetired' ### [**](#SYSTEM_INFO)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_types.py#L20)SYSTEM\_INFO **SYSTEM\_INFO: 'systemInfo' --- # Source: https://docs.apify.com/sdk/python/reference/class/EventAbortingData.md # EventAbortingData Data for the aborting event. ## Index[**](#Index) ### Properties * [**model\_config](https://docs.apify.com/sdk/python/sdk/python/reference/class/EventAbortingData.md#model_config) ## Properties[**](#Properties) ### [**](#model_config)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_types.py#L76)model\_config **model\_config: Undefined --- # Source: https://docs.apify.com/sdk/python/reference/class/EventExitData.md # EventExitData Data for the exit event. ## Index[**](#Index) ### Properties * [**model\_config](https://docs.apify.com/sdk/python/sdk/python/reference/class/EventExitData.md#model_config) ## Properties[**](#Properties) ### [**](#model_config)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_types.py#L83)model\_config **model\_config: Undefined --- # Source: https://docs.apify.com/sdk/python/reference/class/EventManager.md # EventManager Manage events and their listeners, enabling registration, emission, and execution control. It allows for registering event listeners, emitting events, and ensuring all listeners complete their execution. Built on top of `pyee.asyncio.AsyncIOEventEmitter`. It implements additional features such as waiting for all listeners to complete and emitting `PersistState` events at regular intervals. ### Hierarchy * *EventManager* * [LocalEventManager](https://crawlee.dev/python/api/class/LocalEventManager) ## Index[**](#Index) ### Methods * [**\_\_aenter\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/EventManager.md#__aenter__) * [**\_\_aexit\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/EventManager.md#__aexit__) * [**\_\_init\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/EventManager.md#__init__) * [**emit](https://docs.apify.com/sdk/python/sdk/python/reference/class/EventManager.md#emit) * [**off](https://docs.apify.com/sdk/python/sdk/python/reference/class/EventManager.md#off) * [**on](https://docs.apify.com/sdk/python/sdk/python/reference/class/EventManager.md#on) * [**wait\_for\_all\_listeners\_to\_complete](https://docs.apify.com/sdk/python/sdk/python/reference/class/EventManager.md#wait_for_all_listeners_to_complete) ### Properties * [**active](https://docs.apify.com/sdk/python/sdk/python/reference/class/EventManager.md#active) ## Methods[**](#Methods) ### [**](#__aenter__)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_event_manager.py#L104)\_\_aenter\_\_ * **async **\_\_aenter\_\_**(): [EventManager](https://crawlee.dev/python/api/class/EventManager) - Initialize the event manager upon entering the async context. *** #### Returns [EventManager](https://crawlee.dev/python/api/class/EventManager) ### [**](#__aexit__)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_event_manager.py#L117)\_\_aexit\_\_ * **async **\_\_aexit\_\_**(exc\_type, exc\_value, exc\_traceback): None - Close the local event manager upon exiting the async context. This will stop listening for the events, and it will wait for all the event listeners to finish. *** #### Parameters * ##### exc\_type: [type](https://crawlee.dev/python/api/class/SitemapSource#type)\[BaseException] | None * ##### exc\_value: BaseException | None * ##### exc\_traceback: TracebackType | None #### Returns None ### [**](#__init__)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_event_manager.py#L63)\_\_init\_\_ * ****\_\_init\_\_**(\*, persist\_state\_interval, close\_timeout): None - Initialize a new instance. *** #### Parameters * ##### optionalkeyword-onlypersist\_state\_interval: timedelta = timedelta(minutes=1) Interval between emitted `PersistState` events to maintain state persistence. * ##### optionalkeyword-onlyclose\_timeout: timedelta | None = None Optional timeout for canceling pending event listeners if they exceed this duration. #### Returns None ### [**](#emit)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_event_manager.py#L239)emit * ****emit**(\*: , event: [Event](https://crawlee.dev/python/api/enum/Event), event\_data: [EventData](https://crawlee.dev/python/api#EventData)): None * ****emit**(\*: , event: Literal\[Event.PERSIST\_STATE], event\_data: [EventPersistStateData](https://crawlee.dev/python/api/class/EventPersistStateData)): None * ****emit**(\*: , event: Literal\[Event.SYSTEM\_INFO], event\_data: [EventSystemInfoData](https://crawlee.dev/python/api/class/EventSystemInfoData)): None * ****emit**(\*: , event: Literal\[Event.MIGRATING], event\_data: [EventMigratingData](https://crawlee.dev/python/api/class/EventMigratingData)): None * ****emit**(\*: , event: Literal\[Event.ABORTING], event\_data: [EventAbortingData](https://crawlee.dev/python/api/class/EventAbortingData)): None * ****emit**(\*: , event: Literal\[Event.EXIT], event\_data: [EventExitData](https://crawlee.dev/python/api/class/EventExitData)): None * ****emit**(\*: , event: Literal\[Event.CRAWLER\_STATUS], event\_data: [EventCrawlerStatusData](https://crawlee.dev/python/api/class/EventCrawlerStatusData)): None * ****emit**(\*: , event: [Event](https://crawlee.dev/python/api/enum/Event), event\_data: Any): None - Emit an event with the associated data to all registered listeners. *** #### Parameters * ##### keyword-onlyevent: [Event](https://crawlee.dev/python/api/enum/Event) The event which will be emitted. * ##### keyword-onlyevent\_data: [EventData](https://crawlee.dev/python/api#EventData) The data which will be passed to the event listeners. #### Returns None ### [**](#off)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_event_manager.py#L207)off * ****off**(\*, event, listener): None - Remove a specific listener or all listeners for an event. *** #### Parameters * ##### keyword-onlyevent: [Event](https://crawlee.dev/python/api/enum/Event) The Actor event for which to remove listeners. * ##### optionalkeyword-onlylistener: [EventListener](https://crawlee.dev/python/api#EventListener)\[Any] | None = None The listener which is supposed to be removed. If not passed, all listeners of this event are removed. #### Returns None ### [**](#on)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_event_manager.py#L157)on * ****on**(\*: , event: [Event](https://crawlee.dev/python/api/enum/Event), listener: [EventListener](https://crawlee.dev/python/api#EventListener)\[Any]): None * ****on**(\*: , event: Literal\[Event.PERSIST\_STATE], listener: [EventListener](https://crawlee.dev/python/api#EventListener)\[[EventPersistStateData](https://crawlee.dev/python/api/class/EventPersistStateData)]): None * ****on**(\*: , event: Literal\[Event.SYSTEM\_INFO], listener: [EventListener](https://crawlee.dev/python/api#EventListener)\[[EventSystemInfoData](https://crawlee.dev/python/api/class/EventSystemInfoData)]): None * ****on**(\*: , event: Literal\[Event.MIGRATING], listener: [EventListener](https://crawlee.dev/python/api#EventListener)\[[EventMigratingData](https://crawlee.dev/python/api/class/EventMigratingData)]): None * ****on**(\*: , event: Literal\[Event.ABORTING], listener: [EventListener](https://crawlee.dev/python/api#EventListener)\[[EventAbortingData](https://crawlee.dev/python/api/class/EventAbortingData)]): None * ****on**(\*: , event: Literal\[Event.EXIT], listener: [EventListener](https://crawlee.dev/python/api#EventListener)\[[EventExitData](https://crawlee.dev/python/api/class/EventExitData)]): None * ****on**(\*: , event: Literal\[Event.CRAWLER\_STATUS], listener: [EventListener](https://crawlee.dev/python/api#EventListener)\[[EventCrawlerStatusData](https://crawlee.dev/python/api/class/EventCrawlerStatusData)]): None * ****on**(\*: , event: [Event](https://crawlee.dev/python/api/enum/Event), listener: [EventListener](https://crawlee.dev/python/api#EventListener)\[None]): None - Register an event listener for a specific event. *** #### Parameters * ##### keyword-onlyevent: [Event](https://crawlee.dev/python/api/enum/Event) The event for which to listen to. * ##### keyword-onlylistener: [EventListener](https://crawlee.dev/python/api#EventListener)\[Any] The function (sync or async) which is to be called when the event is emitted. #### Returns None ### [**](#wait_for_all_listeners_to_complete)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_event_manager.py#L249)wait\_for\_all\_listeners\_to\_complete * **async **wait\_for\_all\_listeners\_to\_complete**(\*, timeout): None - Wait for all currently executing event listeners to complete. *** #### Parameters * ##### optionalkeyword-onlytimeout: timedelta | None = None The maximum time to wait for the event listeners to finish. If they do not complete within the specified timeout, they will be canceled. #### Returns None ## Properties[**](#Properties) ### [**](#active)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_event_manager.py#L100)active **active: bool Indicate whether the context is active. --- # Source: https://docs.apify.com/sdk/python/reference/class/EventMigratingData.md # EventMigratingData Data for the migrating event. ## Index[**](#Index) ### Properties * [**model\_config](https://docs.apify.com/sdk/python/sdk/python/reference/class/EventMigratingData.md#model_config) * [**time\_remaining](https://docs.apify.com/sdk/python/sdk/python/reference/class/EventMigratingData.md#time_remaining) ## Properties[**](#Properties) ### [**](#model_config)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_types.py#L65)model\_config **model\_config: Undefined ### [**](#time_remaining)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_types.py#L69)time\_remaining **time\_remaining: [timedelta\_secs](https://crawlee.dev/python/api#timedelta_secs) | None --- # Source: https://docs.apify.com/sdk/python/reference/class/EventPersistStateData.md # EventPersistStateData Data for the persist state event. ## Index[**](#Index) ### Properties * [**is\_migrating](https://docs.apify.com/sdk/python/sdk/python/reference/class/EventPersistStateData.md#is_migrating) * [**model\_config](https://docs.apify.com/sdk/python/sdk/python/reference/class/EventPersistStateData.md#model_config) ## Properties[**](#Properties) ### [**](#is_migrating)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_types.py#L45)is\_migrating **is\_migrating: bool ### [**](#model_config)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_types.py#L43)model\_config **model\_config: Undefined --- # Source: https://docs.apify.com/sdk/python/reference/class/EventSystemInfoData.md # EventSystemInfoData Data for the system info event. ## Index[**](#Index) ### Properties * [**cpu\_info](https://docs.apify.com/sdk/python/sdk/python/reference/class/EventSystemInfoData.md#cpu_info) * [**memory\_info](https://docs.apify.com/sdk/python/sdk/python/reference/class/EventSystemInfoData.md#memory_info) * [**model\_config](https://docs.apify.com/sdk/python/sdk/python/reference/class/EventSystemInfoData.md#model_config) ## Properties[**](#Properties) ### [**](#cpu_info)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_types.py#L54)cpu\_info **cpu\_info: [CpuInfo](https://crawlee.dev/python/api/class/CpuInfo) ### [**](#memory_info)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_types.py#L55)memory\_info **memory\_info: [MemoryUsageInfo](https://crawlee.dev/python/api/class/MemoryUsageInfo) ### [**](#model_config)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_types.py#L52)model\_config **model\_config: Undefined --- # Source: https://docs.apify.com/sdk/python/reference/class/EventWithoutData.md # EventWithoutData ## Index[**](#Index) ### Properties * [**data](https://docs.apify.com/sdk/python/sdk/python/reference/class/EventWithoutData.md#data) * [**name](https://docs.apify.com/sdk/python/sdk/python/reference/class/EventWithoutData.md#name) ## Properties[**](#Properties) ### [**](#data)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L87)data **data: Any ### [**](#name)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L79)name **name: Literal\[Event.SESSION\_RETIRED, Event.BROWSER\_LAUNCHED, Event.BROWSER\_RETIRED, Event.BROWSER\_CLOSED, Event.PAGE\_CREATED, Event.PAGE\_CLOSED] --- # Source: https://docs.apify.com/sdk/python/reference/class/ExitEvent.md # ExitEvent ## Index[**](#Index) ### Properties * [**data](https://docs.apify.com/sdk/python/sdk/python/reference/class/ExitEvent.md#data) * [**name](https://docs.apify.com/sdk/python/sdk/python/reference/class/ExitEvent.md#name) ## Properties[**](#Properties) ### [**](#data)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L74)data **data: EventExitData ### [**](#name)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L73)name **name: Literal\[Event.EXIT] --- # Source: https://docs.apify.com/sdk/js/reference/interface/ExitOptions.md # ExitOptions ### Hierarchy * *ExitOptions* * [MainOptions](https://docs.apify.com/sdk/js/sdk/js/reference/interface/MainOptions.md) ## Index[**](#Index) ### Properties * [**exit](#exit) * [**exitCode](#exitCode) * [**statusMessage](#statusMessage) * [**timeoutSecs](#timeoutSecs) ## Properties[**](#Properties) ### [**](#exit)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1981)optionalexit **exit? : boolean Call `process.exit()`? Defaults to true ### [**](#exitCode)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1979)optionalexitCode **exitCode? : number Exit code, defaults to 0 ### [**](#statusMessage)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1972)optionalstatusMessage **statusMessage? : string Exit with given status message ### [**](#timeoutSecs)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1977)optionaltimeoutSecs **timeoutSecs? : number = 30 Amount of time, in seconds, to wait for all event handlers to finish before exiting the process. --- # Source: https://docs.apify.com/api/client/js/reference/interface/FieldStatistics.md # FieldStatistics Statistics for a single field in a dataset. ## Index[**](#Index) ### Properties * [**emptyCount](#emptyCount) * [**max](#max) * [**min](#min) * [**nullCount](#nullCount) ## Properties[**](#Properties) ### [**](#emptyCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L526)optionalemptyCount **emptyCount? : number ### [**](#max)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L524)optionalmax **max? : number ### [**](#min)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L523)optionalmin **min? : number ### [**](#nullCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/dataset.ts#L525)optionalnullCount **nullCount? : number --- # Source: https://docs.apify.com/sdk/python/reference/class/FileSystemStorageClient.md # FileSystemStorageClient File system implementation of the storage client. This storage client provides access to datasets, key-value stores, and request queues that persist data to the local file system. Each storage type is implemented with its own specific file system client that stores data in a structured directory hierarchy. Data is stored in JSON format in predictable file paths, making it easy to inspect and manipulate the stored data outside of the Crawlee application if needed. All data persists between program runs but is limited to access from the local machine where the files are stored. Warning: This storage client is not safe for concurrent access from multiple crawler processes. Use it only when running a single crawler process at a time. ### Hierarchy * [StorageClient](https://crawlee.dev/python/api/class/StorageClient) * *FileSystemStorageClient* ## Index[**](#Index) ### Methods * [**create\_dataset\_client](https://docs.apify.com/sdk/python/sdk/python/reference/class/FileSystemStorageClient.md#create_dataset_client) * [**create\_kvs\_client](https://docs.apify.com/sdk/python/sdk/python/reference/class/FileSystemStorageClient.md#create_kvs_client) * [**create\_rq\_client](https://docs.apify.com/sdk/python/sdk/python/reference/class/FileSystemStorageClient.md#create_rq_client) * [**get\_rate\_limit\_errors](https://docs.apify.com/sdk/python/sdk/python/reference/class/FileSystemStorageClient.md#get_rate_limit_errors) * [**get\_storage\_client\_cache\_key](https://docs.apify.com/sdk/python/sdk/python/reference/class/FileSystemStorageClient.md#get_storage_client_cache_key) ## Methods[**](#Methods) ### [**](#create_dataset_client)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_file_system/_storage_client.py#L43)create\_dataset\_client * **async **create\_dataset\_client**(\*, id, name, alias, configuration): [DatasetClient](https://crawlee.dev/python/api/class/DatasetClient) - Overrides [StorageClient.create\_dataset\_client](https://crawlee.dev/python/api/class/StorageClient#create_dataset_client) Create a dataset client. *** #### Parameters * ##### optionalkeyword-onlyid: str | None = None * ##### optionalkeyword-onlyname: str | None = None * ##### optionalkeyword-onlyalias: str | None = None * ##### optionalkeyword-onlyconfiguration: [Configuration](https://crawlee.dev/python/api/class/Configuration) | None = None #### Returns [DatasetClient](https://crawlee.dev/python/api/class/DatasetClient) ### [**](#create_kvs_client)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_file_system/_storage_client.py#L57)create\_kvs\_client * **async **create\_kvs\_client**(\*, id, name, alias, configuration): [KeyValueStoreClient](https://crawlee.dev/python/api/class/KeyValueStoreClient) - Overrides [StorageClient.create\_kvs\_client](https://crawlee.dev/python/api/class/StorageClient#create_kvs_client) Create a key-value store client. *** #### Parameters * ##### optionalkeyword-onlyid: str | None = None * ##### optionalkeyword-onlyname: str | None = None * ##### optionalkeyword-onlyalias: str | None = None * ##### optionalkeyword-onlyconfiguration: [Configuration](https://crawlee.dev/python/api/class/Configuration) | None = None #### Returns [KeyValueStoreClient](https://crawlee.dev/python/api/class/KeyValueStoreClient) ### [**](#create_rq_client)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_file_system/_storage_client.py#L71)create\_rq\_client * **async **create\_rq\_client**(\*, id, name, alias, configuration): [RequestQueueClient](https://crawlee.dev/python/api/class/RequestQueueClient) - Overrides [StorageClient.create\_rq\_client](https://crawlee.dev/python/api/class/StorageClient#create_rq_client) Create a request queue client. *** #### Parameters * ##### optionalkeyword-onlyid: str | None = None * ##### optionalkeyword-onlyname: str | None = None * ##### optionalkeyword-onlyalias: str | None = None * ##### optionalkeyword-onlyconfiguration: [Configuration](https://crawlee.dev/python/api/class/Configuration) | None = None #### Returns [RequestQueueClient](https://crawlee.dev/python/api/class/RequestQueueClient) ### [**](#get_rate_limit_errors)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_base/_storage_client.py#L74)get\_rate\_limit\_errors * ****get\_rate\_limit\_errors**(): dict\[int, int] - Inherited from [StorageClient.get\_rate\_limit\_errors](https://crawlee.dev/python/api/class/StorageClient#get_rate_limit_errors) Return statistics about rate limit errors encountered by the HTTP client in storage client. *** #### Returns dict\[int, int] ### [**](#get_storage_client_cache_key)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_file_system/_storage_client.py#L38)get\_storage\_client\_cache\_key * ****get\_storage\_client\_cache\_key**(configuration): Hashable - Overrides [StorageClient.get\_storage\_client\_cache\_key](https://crawlee.dev/python/api/class/StorageClient#get_storage_client_cache_key) Return a cache key that can differentiate between different storages of this and other clients. Can be based on configuration or on the client itself. By default, returns a module and name of the client class. *** #### Parameters * ##### configuration: [Configuration](https://crawlee.dev/python/api/class/Configuration) #### Returns Hashable --- # Source: https://docs.apify.com/sdk/python/reference/class/FlatPricePerMonthActorPricingInfo.md # Source: https://docs.apify.com/api/client/js/reference/interface/FlatPricePerMonthActorPricingInfo.md # FlatPricePerMonthActorPricingInfo Pricing information for Actors with a flat monthly subscription fee. ### Hierarchy * CommonActorPricingInfo * *FlatPricePerMonthActorPricingInfo* ## Index[**](#Index) ### Properties * [**apifyMarginPercentage](#apifyMarginPercentage) * [**createdAt](#createdAt) * [**notifiedAboutChangeAt](#notifiedAboutChangeAt) * [**notifiedAboutFutureChangeAt](#notifiedAboutFutureChangeAt) * [**pricePerUnitUsd](#pricePerUnitUsd) * [**pricingModel](#pricingModel) * [**reasonForChange](#reasonForChange) * [**startedAt](#startedAt) * [**trialMinutes](#trialMinutes) ## Properties[**](#Properties) ### [**](#apifyMarginPercentage)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L846)inheritedapifyMarginPercentage **apifyMarginPercentage: number Inherited from CommonActorPricingInfo.apifyMarginPercentage In \[0, 1], fraction of pricePerUnitUsd that goes to Apify ### [**](#createdAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L848)inheritedcreatedAt **createdAt: Date Inherited from CommonActorPricingInfo.createdAt When this pricing info record has been created ### [**](#notifiedAboutChangeAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L852)optionalinheritednotifiedAboutChangeAt **notifiedAboutChangeAt? : Date Inherited from CommonActorPricingInfo.notifiedAboutChangeAt ### [**](#notifiedAboutFutureChangeAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L851)optionalinheritednotifiedAboutFutureChangeAt **notifiedAboutFutureChangeAt? : Date Inherited from CommonActorPricingInfo.notifiedAboutFutureChangeAt ### [**](#pricePerUnitUsd)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L871)pricePerUnitUsd **pricePerUnitUsd: number Monthly flat price in USD ### [**](#pricingModel)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L867)pricingModel **pricingModel: FLAT\_PRICE\_PER\_MONTH ### [**](#reasonForChange)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L853)optionalinheritedreasonForChange **reasonForChange? : string Inherited from CommonActorPricingInfo.reasonForChange ### [**](#startedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L850)inheritedstartedAt **startedAt: Date Inherited from CommonActorPricingInfo.startedAt Since when is this pricing info record effective for a given Actor ### [**](#trialMinutes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L869)optionaltrialMinutes **trialMinutes? : number For how long this Actor can be used for free in trial period --- # Source: https://docs.apify.com/sdk/python/reference/class/FreeActorPricingInfo.md # Source: https://docs.apify.com/api/client/js/reference/interface/FreeActorPricingInfo.md # FreeActorPricingInfo Pricing information for free Actors. ### Hierarchy * CommonActorPricingInfo * *FreeActorPricingInfo* ## Index[**](#Index) ### Properties * [**apifyMarginPercentage](#apifyMarginPercentage) * [**createdAt](#createdAt) * [**notifiedAboutChangeAt](#notifiedAboutChangeAt) * [**notifiedAboutFutureChangeAt](#notifiedAboutFutureChangeAt) * [**pricingModel](#pricingModel) * [**reasonForChange](#reasonForChange) * [**startedAt](#startedAt) ## Properties[**](#Properties) ### [**](#apifyMarginPercentage)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L846)inheritedapifyMarginPercentage **apifyMarginPercentage: number Inherited from CommonActorPricingInfo.apifyMarginPercentage In \[0, 1], fraction of pricePerUnitUsd that goes to Apify ### [**](#createdAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L848)inheritedcreatedAt **createdAt: Date Inherited from CommonActorPricingInfo.createdAt When this pricing info record has been created ### [**](#notifiedAboutChangeAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L852)optionalinheritednotifiedAboutChangeAt **notifiedAboutChangeAt? : Date Inherited from CommonActorPricingInfo.notifiedAboutChangeAt ### [**](#notifiedAboutFutureChangeAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L851)optionalinheritednotifiedAboutFutureChangeAt **notifiedAboutFutureChangeAt? : Date Inherited from CommonActorPricingInfo.notifiedAboutFutureChangeAt ### [**](#pricingModel)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L860)pricingModel **pricingModel: FREE ### [**](#reasonForChange)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L853)optionalinheritedreasonForChange **reasonForChange? : string Inherited from CommonActorPricingInfo.reasonForChange ### [**](#startedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L850)inheritedstartedAt **startedAt: Date Inherited from CommonActorPricingInfo.startedAt Since when is this pricing info record effective for a given Actor --- # Source: https://docs.apify.com/api/client/js/reference/interface/GetStreamedLogOptions.md # GetStreamedLogOptions Options for getting a streamed log. ## Index[**](#Index) ### Properties * [**fromStart](#fromStart) * [**toLog](#toLog) ## Properties[**](#Properties) ### [**](#fromStart)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L478)optionalfromStart **fromStart? : boolean ### [**](#toLog)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L477)optionaltoLog **toLog? : null | Log | default --- # Source: https://docs.apify.com/api/client/python/reference/class/HTTPClient.md # HTTPClient ### Hierarchy * [\_BaseHTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseHTTPClient.md) * *HTTPClient* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md#__init__) * [**call](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md#call) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_http_client.py#L33)\_\_init\_\_ * ****\_\_init\_\_**(\*, token, max\_retries, min\_delay\_between\_retries\_millis, timeout\_secs, stats): None - Inherited from [\_BaseHTTPClient.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseHTTPClient.md#__init__) #### Parameters * ##### optionalkeyword-onlytoken: str | None = None * ##### optionalkeyword-onlymax\_retries: int = 8 * ##### optionalkeyword-onlymin\_delay\_between\_retries\_millis: int = 500 * ##### optionalkeyword-onlytimeout\_secs: int = 360 * ##### optionalkeyword-onlystats: [Statistics](https://docs.apify.com/api/client/python/api/client/python/reference/class/Statistics.md) | None = None #### Returns None ### [**](#call)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_http_client.py#L141)call * ****call**(\*, method, url, headers, params, data, json, stream, timeout\_secs): impit.Response - #### Parameters * ##### keyword-onlymethod: str * ##### keyword-onlyurl: str * ##### optionalkeyword-onlyheaders: dict | None = None * ##### optionalkeyword-onlyparams: dict | None = None * ##### optionalkeyword-onlydata: Any = None * ##### optionalkeyword-onlyjson: [JSONSerializable](https://docs.apify.com/api/client/python/api/client/python/reference.md#JSONSerializable) | None = None * ##### optionalkeyword-onlystream: bool | None = None * ##### optionalkeyword-onlytimeout\_secs: int | None = None #### Returns impit.Response --- # Source: https://docs.apify.com/api/client/python/reference/class/HTTPClientAsync.md # HTTPClientAsync ### Hierarchy * [\_BaseHTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseHTTPClient.md) * *HTTPClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md#__init__) * [**call](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md#call) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_http_client.py#L33)\_\_init\_\_ * ****\_\_init\_\_**(\*, token, max\_retries, min\_delay\_between\_retries\_millis, timeout\_secs, stats): None - Inherited from [\_BaseHTTPClient.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseHTTPClient.md#__init__) #### Parameters * ##### optionalkeyword-onlytoken: str | None = None * ##### optionalkeyword-onlymax\_retries: int = 8 * ##### optionalkeyword-onlymin\_delay\_between\_retries\_millis: int = 500 * ##### optionalkeyword-onlytimeout\_secs: int = 360 * ##### optionalkeyword-onlystats: [Statistics](https://docs.apify.com/api/client/python/api/client/python/reference/class/Statistics.md) | None = None #### Returns None ### [**](#call)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_http_client.py#L220)call * **async **call**(\*, method, url, headers, params, data, json, stream, timeout\_secs): impit.Response - #### Parameters * ##### keyword-onlymethod: str * ##### keyword-onlyurl: str * ##### optionalkeyword-onlyheaders: dict | None = None * ##### optionalkeyword-onlyparams: dict | None = None * ##### optionalkeyword-onlydata: Any = None * ##### optionalkeyword-onlyjson: [JSONSerializable](https://docs.apify.com/api/client/python/api/client/python/reference.md#JSONSerializable) | None = None * ##### optionalkeyword-onlystream: bool | None = None * ##### optionalkeyword-onlytimeout\_secs: int | None = None #### Returns impit.Response --- # Source: https://docs.apify.com/sdk/js/reference/interface/InitOptions.md # InitOptions ### Hierarchy * *InitOptions* * [MainOptions](https://docs.apify.com/sdk/js/sdk/js/reference/interface/MainOptions.md) ## Index[**](#Index) ### Properties * [**storage](#storage) ## Properties[**](#Properties) ### [**](#storage)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1748)optionalstorage **storage? : StorageClient --- # Source: https://docs.apify.com/api/client/python/reference/class/InvalidResponseBodyError.md # Source: https://docs.apify.com/api/client/js/reference/class/InvalidResponseBodyError.md # InvalidResponseBodyError This error exists for the quite common situation, where only a partial JSON response is received and an attempt to parse the JSON throws an error. In most cases this can be resolved by retrying the request. We do that by identifying this error in HttpClient. The properties mimic AxiosError for easier integration in HttpClient error handling. ### Hierarchy * Error * *InvalidResponseBodyError* ## Index[**](#Index) ### Constructors * [**constructor](#constructor) ### Properties * [**cause](#cause) * [**code](#code) * [**message](#message) * [**name](#name) * [**response](#response) * [**stack](#stack) * [**stackTraceLimit](#stackTraceLimit) ### Methods * [**captureStackTrace](#captureStackTrace) * [**prepareStackTrace](#prepareStackTrace) ## Constructors[**](#Constructors) ### [**](#constructor)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/interceptors.ts#L24)constructor * ****new InvalidResponseBodyError**(response, cause): [InvalidResponseBodyError](https://docs.apify.com/api/client/js/api/client/js/reference/class/InvalidResponseBodyError.md) - Overrides Error.constructor #### Parameters * ##### response: AxiosResponse\ * ##### cause: Error #### Returns [InvalidResponseBodyError](https://docs.apify.com/api/client/js/api/client/js/reference/class/InvalidResponseBodyError.md) ## Properties[**](#Properties) ### [**](#cause)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/interceptors.ts#L22)cause **cause: Error Overrides Error.cause ### [**](#code)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/interceptors.ts#L18)code **code: string ### [**](#message)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/website/node_modules/typescript/src/lib.es5.d.ts#L1077)externalinheritedmessage **message: string Inherited from Error.message ### [**](#name)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/website/node_modules/typescript/src/lib.es5.d.ts#L1076)externalinheritedname **name: string Inherited from Error.name ### [**](#response)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/interceptors.ts#L20)response **response: AxiosResponse\ ### [**](#stack)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/website/node_modules/typescript/src/lib.es5.d.ts#L1078)externaloptionalinheritedstack **stack? : string Inherited from Error.stack ### [**](#stackTraceLimit)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/globals.d.ts#L68)staticexternalinheritedstackTraceLimit **stackTraceLimit: number Inherited from Error.stackTraceLimit The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured *after* the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. ## Methods[**](#Methods) ### [**](#captureStackTrace)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/globals.d.ts#L52)staticexternalinheritedcaptureStackTrace * ****captureStackTrace**(targetObject, constructorOpt): void - Inherited from Error.captureStackTrace Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ``` const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ``` function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` *** #### Parameters * ##### externaltargetObject: object * ##### externaloptionalconstructorOpt: Function #### Returns void ### [**](#prepareStackTrace)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/globals.d.ts#L56)staticexternalinheritedprepareStackTrace * ****prepareStackTrace**(err, stackTraces): any - Inherited from Error.prepareStackTrace * **@see** *** #### Parameters * ##### externalerr: Error * ##### externalstackTraces: CallSite\[] #### Returns any --- # Source: https://docs.apify.com/sdk/js/reference/interface/KeyConsumer.md # externalKeyConsumer User-function used in the [KeyValueStore.forEachKey](https://docs.apify.com/sdk/js/sdk/js/reference/class/KeyValueStore.md#forEachKey) method. ### Callable * ****KeyConsumer**(key, index, info): Awaitable\ *** * #### Parameters * ##### externalkey: string Current [KeyValueStore](https://docs.apify.com/sdk/js/sdk/js/reference/class/KeyValueStore.md) key being processed. * ##### externalindex: number Position of the current key in [KeyValueStore](https://docs.apify.com/sdk/js/sdk/js/reference/class/KeyValueStore.md). * ##### externalinfo: { size: number } Information about the current [KeyValueStore](https://docs.apify.com/sdk/js/sdk/js/reference/class/KeyValueStore.md) entry. * ##### externalsize: number Size of the value associated with the current key in bytes. #### Returns Awaitable\ --- # Source: https://docs.apify.com/api/client/js/reference/interface/KeyValueClientCreateKeysUrlOptions.md # KeyValueClientCreateKeysUrlOptions Options for creating a public URL to list keys in a Key-Value Store. Extends [KeyValueClientListKeysOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueClientListKeysOptions.md) with URL expiration control. ### Hierarchy * [KeyValueClientListKeysOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueClientListKeysOptions.md) * *KeyValueClientCreateKeysUrlOptions* ## Index[**](#Index) ### Properties * [**collection](#collection) * [**exclusiveStartKey](#exclusiveStartKey) * [**expiresInSecs](#expiresInSecs) * [**limit](#limit) * [**prefix](#prefix) * [**signature](#signature) ## Properties[**](#Properties) ### [**](#collection)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L558)optionalinheritedcollection **collection? : string Inherited from KeyValueClientListKeysOptions.collection ### [**](#exclusiveStartKey)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L557)optionalinheritedexclusiveStartKey **exclusiveStartKey? : string Inherited from KeyValueClientListKeysOptions.exclusiveStartKey ### [**](#expiresInSecs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L569)optionalexpiresInSecs **expiresInSecs? : number ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L556)optionalinheritedlimit **limit? : number Inherited from KeyValueClientListKeysOptions.limit ### [**](#prefix)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L559)optionalinheritedprefix **prefix? : string Inherited from KeyValueClientListKeysOptions.prefix ### [**](#signature)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L560)optionalinheritedsignature **signature? : string Inherited from KeyValueClientListKeysOptions.signature --- # Source: https://docs.apify.com/api/client/js/reference/interface/KeyValueClientGetRecordOptions.md # KeyValueClientGetRecordOptions Options for retrieving a record from a Key-Value Store. ## Index[**](#Index) ### Properties * [**buffer](#buffer) * [**signature](#signature) * [**stream](#stream) ## Properties[**](#Properties) ### [**](#buffer)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L599)optionalbuffer **buffer? : boolean ### [**](#signature)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L601)optionalsignature **signature? : string ### [**](#stream)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L600)optionalstream **stream? : boolean --- # Source: https://docs.apify.com/api/client/js/reference/interface/KeyValueClientListKeysOptions.md # KeyValueClientListKeysOptions Options for listing keys in a Key-Value Store. ### Hierarchy * *KeyValueClientListKeysOptions* * [KeyValueClientCreateKeysUrlOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueClientCreateKeysUrlOptions.md) ## Index[**](#Index) ### Properties * [**collection](#collection) * [**exclusiveStartKey](#exclusiveStartKey) * [**limit](#limit) * [**prefix](#prefix) * [**signature](#signature) ## Properties[**](#Properties) ### [**](#collection)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L558)optionalcollection **collection? : string ### [**](#exclusiveStartKey)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L557)optionalexclusiveStartKey **exclusiveStartKey? : string ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L556)optionallimit **limit? : number ### [**](#prefix)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L559)optionalprefix **prefix? : string ### [**](#signature)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L560)optionalsignature **signature? : string --- # Source: https://docs.apify.com/api/client/js/reference/interface/KeyValueClientListKeysResult.md # KeyValueClientListKeysResult Result of listing keys in a Key-Value Store. Contains paginated list of keys with metadata and pagination information. ## Index[**](#Index) ### Properties * [**count](#count) * [**exclusiveStartKey](#exclusiveStartKey) * [**isTruncated](#isTruncated) * [**items](#items) * [**limit](#limit) * [**nextExclusiveStartKey](#nextExclusiveStartKey) ## Properties[**](#Properties) ### [**](#count)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L578)count **count: number ### [**](#exclusiveStartKey)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L580)exclusiveStartKey **exclusiveStartKey: string ### [**](#isTruncated)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L581)isTruncated **isTruncated: boolean ### [**](#items)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L583)items **items: [KeyValueListItem](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueListItem.md)\[] ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L579)limit **limit: number ### [**](#nextExclusiveStartKey)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L582)nextExclusiveStartKey **nextExclusiveStartKey: string --- # Source: https://docs.apify.com/api/client/js/reference/interface/KeyValueClientUpdateOptions.md # KeyValueClientUpdateOptions Options for updating a Key-Value Store. ## Index[**](#Index) ### Properties * [**generalAccess](#generalAccess) * [**name](#name) * [**title](#title) ## Properties[**](#Properties) ### [**](#generalAccess)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L549)optionalgeneralAccess **generalAccess? : null | STORAGE\_GENERAL\_ACCESS ### [**](#name)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L547)optionalname **name? : null | string ### [**](#title)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L548)optionaltitle **title? : string --- # Source: https://docs.apify.com/api/client/js/reference/interface/KeyValueListItem.md # KeyValueListItem Metadata about a single key in a Key-Value Store. ## Index[**](#Index) ### Properties * [**key](#key) * [**recordPublicUrl](#recordPublicUrl) * [**size](#size) ## Properties[**](#Properties) ### [**](#key)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L590)key **key: string ### [**](#recordPublicUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L592)recordPublicUrl **recordPublicUrl: string ### [**](#size)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L591)size **size: number --- # Source: https://docs.apify.com/sdk/python/reference/class/KeyValueStore.md # Source: https://docs.apify.com/sdk/js/reference/class/KeyValueStore.md # Source: https://docs.apify.com/api/client/js/reference/interface/KeyValueStore.md # KeyValueStore Represents a Key-Value Store storage on the Apify platform. Key-value stores are used to store arbitrary data records or files. Each record is identified by a unique key and can contain any data - JSON objects, strings, binary files, etc. ## Index[**](#Index) ### Properties * [**accessedAt](#accessedAt) * [**actId](#actId) * [**actRunId](#actRunId) * [**createdAt](#createdAt) * [**generalAccess](#generalAccess) * [**id](#id) * [**keysPublicUrl](#keysPublicUrl) * [**modifiedAt](#modifiedAt) * [**name](#name) * [**stats](#stats) * [**title](#title) * [**urlSigningSecretKey](#urlSigningSecretKey) * [**userId](#userId) * [**username](#username) ## Properties[**](#Properties) ### [**](#accessedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L523)accessedAt **accessedAt: Date ### [**](#actId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L524)optionalactId **actId? : string ### [**](#actRunId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L525)optionalactRunId **actRunId? : string ### [**](#createdAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L521)createdAt **createdAt: Date ### [**](#generalAccess)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L527)optionalgeneralAccess **generalAccess? : null | STORAGE\_GENERAL\_ACCESS ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L516)id **id: string ### [**](#keysPublicUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L529)keysPublicUrl **keysPublicUrl: string ### [**](#modifiedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L522)modifiedAt **modifiedAt: Date ### [**](#name)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L517)optionalname **name? : string ### [**](#stats)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L526)optionalstats **stats? : [KeyValueStoreStats](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueStoreStats.md) ### [**](#title)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L518)optionaltitle **title? : string ### [**](#urlSigningSecretKey)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L528)optionalurlSigningSecretKey **urlSigningSecretKey? : null | string ### [**](#userId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L519)userId **userId: string ### [**](#username)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L520)optionalusername **username? : string --- # Source: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreClient.md # Source: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreClient.md # KeyValueStoreClient Client for managing a specific key-value store. Key-value stores are used to store arbitrary data records or files. Each record is identified by a unique key and can contain any type of data. This client provides methods to get, set, and delete records, list keys, and manage the store. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const storeClient = client.keyValueStore('my-store-id'); // Set a record await storeClient.setRecord({ key: 'OUTPUT', value: { foo: 'bar' }, contentType: 'application/json' }); // Get a record const record = await storeClient.getRecord('OUTPUT'); // List all keys const { items } = await storeClient.listKeys(); ``` * **@see** ### Hierarchy * ResourceClient * *KeyValueStoreClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**createKeysPublicUrl](#createKeysPublicUrl) * [**delete](#delete) * [**deleteRecord](#deleteRecord) * [**get](#get) * [**getRecord](#getRecord) * [**getRecordPublicUrl](#getRecordPublicUrl) * [**listKeys](#listKeys) * [**recordExists](#recordExists) * [**setRecord](#setRecord) * [**update](#update) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceClient.url ## Methods[**](#Methods) ### [**](#createKeysPublicUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L250)createKeysPublicUrl * ****createKeysPublicUrl**(options): Promise\ - Generates a public URL for accessing the list of keys in the key-value store. If the client has permission to access the key-value store's URL signing key, the URL will include a cryptographic signature which allows access without authentication. * **@example** ``` // Create a URL that expires in 1 hour const url = await client.keyValueStore('my-store').createKeysPublicUrl({ expiresInSecs: 3600, prefix: 'image-' }); console.log(`Share this URL: ${url}`); ``` *** #### Parameters * ##### options: [KeyValueClientCreateKeysUrlOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueClientCreateKeysUrlOptions.md) = {} URL generation options (extends all options from listKeys) #### Returns Promise\ A public URL string for accessing the keys list ### [**](#delete)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L100)delete * ****delete**(): Promise\ - Deletes the key-value store. * **@see** *** #### Returns Promise\ ### [**](#deleteRecord)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L497)deleteRecord * ****deleteRecord**(key): Promise\ - Deletes a record from the key-value store. * **@see** * **@example** ``` await client.keyValueStore('my-store').deleteRecord('temp-data'); ``` *** #### Parameters * ##### key: string The record key to delete #### Returns Promise\ ### [**](#get)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L75)get * ****get**(): Promise\ - Gets the key-value store object from the Apify API. * **@see** *** #### Returns Promise\ The KeyValueStore object, or `undefined` if it does not exist ### [**](#getRecord)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L326)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L328)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L333)getRecord * ****getRecord**(key): Promise\> * ****getRecord**\(key, options): Promise\>> - You can use the `buffer` option to get the value in a Buffer (Node.js) or ArrayBuffer (browser) format. In Node.js (not in browser) you can also use the `stream` option to get a Readable stream. When the record does not exist, the function resolves to `undefined`. It does NOT resolve to a `KeyValueStore` record with an `undefined` value. * **@see** *** #### Parameters * ##### key: string #### Returns Promise\> ### [**](#getRecordPublicUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L213)getRecordPublicUrl * ****getRecordPublicUrl**(key): Promise\ - Generates a public URL for accessing a specific record in the key-value store. If the client has permission to access the key-value store's URL signing key, the URL will include a cryptographic signature for authenticated access without requiring an API token. * **@example** ``` const url = await client.keyValueStore('my-store').getRecordPublicUrl('OUTPUT'); console.log(`Public URL: ${url}`); // You can now share this URL or use it in a browser ``` *** #### Parameters * ##### key: string The record key #### Returns Promise\ A public URL string for accessing the record ### [**](#listKeys)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L139)listKeys * ****listKeys**(options): Promise<[KeyValueClientListKeysResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueClientListKeysResult.md)> & AsyncIterable<[KeyValueListItem](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueListItem.md), any, any> - Lists all keys in the key-value store. Returns a paginated list of all record keys in the store. Use pagination parameters to retrieve large lists efficiently. * **@see** * **@example** ``` // List all keys const { items, isTruncated } = await client.keyValueStore('my-store').listKeys(); items.forEach(item => console.log(`${item.key}: ${item.size} bytes`)); // List keys with prefix const { items } = await client.keyValueStore('my-store').listKeys({ prefix: 'user-' }); // Paginate through all keys let exclusiveStartKey; do { const result = await client.keyValueStore('my-store').listKeys({ limit: 100, exclusiveStartKey }); // Process result.items... exclusiveStartKey = result.nextExclusiveStartKey; } while (result.isTruncated); ``` *** #### Parameters * ##### options: [KeyValueClientListKeysOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueClientListKeysOptions.md) = {} Listing options #### Returns Promise<[KeyValueClientListKeysResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueClientListKeysResult.md)> & AsyncIterable<[KeyValueListItem](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueListItem.md), any, any> Object containing `items` array of key metadata, pagination info (`count`, `limit`, `isTruncated`, `nextExclusiveStartKey`) ### [**](#recordExists)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L299)recordExists * ****recordExists**(key): Promise\ - Tests whether a record with the given key exists in the key-value store without retrieving its value. This is more efficient than getRecord when you only need to check for existence. * **@see** * **@example** ``` const exists = await client.keyValueStore('my-store').recordExists('OUTPUT'); if (exists) { console.log('OUTPUT record exists'); } ``` *** #### Parameters * ##### key: string The record key to check #### Returns Promise\ `true` if the record exists, `false` if it does not ### [**](#setRecord)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L433)setRecord * ****setRecord**(record, options): Promise\ - Stores a record in the key-value store. The record value can be any JSON-serializable object, a string, or a Buffer/Stream. The content type is automatically determined based on the value type, but can be overridden using the `contentType` property. **Note about streams:** If the value is a stream object (has `.pipe` and `.on` methods), the upload cannot be retried on failure or follow redirects. For reliable uploads, buffer the entire stream into memory first. * **@see** * **@example** ``` // Store JSON object await client.keyValueStore('my-store').setRecord({ key: 'OUTPUT', value: { crawledUrls: 100, items: [...] } }); // Store text await client.keyValueStore('my-store').setRecord({ key: 'README', value: 'This is my readme text', contentType: 'text/plain' }); // Store binary data const imageBuffer = await fetchImageBuffer(); await client.keyValueStore('my-store').setRecord({ key: 'screenshot.png', value: imageBuffer, contentType: 'image/png' }); ``` *** #### Parameters * ##### record: [KeyValueStoreRecord](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueStoreRecord.md)\ The record to store * ##### options: [KeyValueStoreRecordOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueStoreRecordOptions.md) = {} Storage options #### Returns Promise\ ### [**](#update)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L89)update * ****update**(newFields): Promise<[KeyValueStore](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueStore.md)> - Updates the key-value store with specified fields. * **@see** *** #### Parameters * ##### newFields: [KeyValueClientUpdateOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueClientUpdateOptions.md) Fields to update in the key-value store #### Returns Promise<[KeyValueStore](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueStore.md)> The updated KeyValueStore object --- # Source: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreClientAsync.md # KeyValueStoreClientAsync Async sub-client for manipulating a single key-value store. ### Hierarchy * [ResourceClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md) * *KeyValueStoreClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md#__init__) * [**create\_keys\_public\_url](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md#create_keys_public_url) * [**delete](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md#delete) * [**delete\_record](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md#delete_record) * [**get](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md#get) * [**get\_record](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md#get_record) * [**get\_record\_as\_bytes](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md#get_record_as_bytes) * [**get\_record\_public\_url](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md#get_record_public_url) * [**list\_keys](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md#list_keys) * [**record\_exists](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md#record_exists) * [**set\_record](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md#set_record) * [**stream\_record](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md#stream_record) * [**update](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md#update) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/key_value_store.py#L357)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#create_keys_public_url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/key_value_store.py#L629)create\_keys\_public\_url * **async **create\_keys\_public\_url**(\*, limit, exclusive\_start\_key, collection, prefix, expires\_in\_secs): str - Generate a URL that can be used to access key-value store keys. If the client has permission to access the key-value store's URL signing key, the URL will include a signature to verify its authenticity. You can optionally control how long the signed URL should be valid using the `expires_in_secs` option. This value sets the expiration duration in seconds from the time the URL is generated. If not provided, the URL will not expire. Any other options (like `limit` or `prefix`) will be included as query parameters in the URL. *** #### Parameters * ##### optionalkeyword-onlylimit: int | None = None * ##### optionalkeyword-onlyexclusive\_start\_key: str | None = None * ##### optionalkeyword-onlycollection: str | None = None * ##### optionalkeyword-onlyprefix: str | None = None * ##### optionalkeyword-onlyexpires\_in\_secs: int | None = None #### Returns str ### [**](#delete)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/key_value_store.py#L390)delete * **async **delete**(): None - Delete the key-value store. *** #### Returns None ### [**](#delete_record)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/key_value_store.py#L584)delete\_record * **async **delete\_record**(key): None - Delete the specified record from the key-value store. *** #### Parameters * ##### key: str The key of the record which to delete. #### Returns None ### [**](#get)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/key_value_store.py#L361)get * **async **get**(): dict | None - Retrieve the key-value store. *** #### Returns dict | None ### [**](#get_record)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/key_value_store.py#L437)get\_record * **async **get\_record**(key, signature): dict | None - Retrieve the given record from the key-value store. *** #### Parameters * ##### key: str Key of the record to retrieve. * ##### optionalsignature: str | None = None Signature used to access the items. #### Returns dict | None ### [**](#get_record_as_bytes)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/key_value_store.py#L492)get\_record\_as\_bytes * **async **get\_record\_as\_bytes**(key, signature): dict | None - Retrieve the given record from the key-value store, without parsing it. *** #### Parameters * ##### key: str Key of the record to retrieve. * ##### optionalsignature: str | None = None Signature used to access the items. #### Returns dict | None ### [**](#get_record_public_url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/key_value_store.py#L599)get\_record\_public\_url * **async **get\_record\_public\_url**(key): str - Generate a URL that can be used to access key-value store record. If the client has permission to access the key-value store's URL signing key, the URL will include a signature to verify its authenticity. *** #### Parameters * ##### key: str The key for which the URL should be generated. #### Returns str ### [**](#list_keys)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/key_value_store.py#L397)list\_keys * **async **list\_keys**(\*, limit, exclusive\_start\_key, collection, prefix, signature): dict - List the keys in the key-value store. *** #### Parameters * ##### optionalkeyword-onlylimit: int | None = None Number of keys to be returned. Maximum value is 1000. * ##### optionalkeyword-onlyexclusive\_start\_key: str | None = None All keys up to this one (including) are skipped from the result. * ##### optionalkeyword-onlycollection: str | None = None The name of the collection in store schema to list keys from. * ##### optionalkeyword-onlyprefix: str | None = None The prefix of the keys to be listed. * ##### optionalkeyword-onlysignature: str | None = None Signature used to access the items. #### Returns dict ### [**](#record_exists)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/key_value_store.py#L467)record\_exists * **async **record\_exists**(key): bool - Check if given record is present in the key-value store. *** #### Parameters * ##### key: str Key of the record to check. #### Returns bool ### [**](#set_record)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/key_value_store.py#L557)set\_record * **async **set\_record**(key, value, content\_type): None - Set a value to the given record in the key-value store. *** #### Parameters * ##### key: str The key of the record to save the value to. * ##### value: Any The value to save into the record. * ##### optionalcontent\_type: str | None = None The content type of the saved value. #### Returns None ### [**](#stream_record)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/key_value_store.py#L523)stream\_record * **async **stream\_record**(key, signature): AsyncIterator\[dict | None] - Retrieve the given record from the key-value store, as a stream. *** #### Parameters * ##### key: str Key of the record to retrieve. * ##### optionalsignature: str | None = None Signature used to access the items. #### Returns AsyncIterator\[dict | None] ### [**](#update)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/key_value_store.py#L371)update * **async **update**(\*, name, general\_access): dict - Update the key-value store with specified fields. *** #### Parameters * ##### optionalkeyword-onlyname: str | None = None The new name for key-value store. * ##### optionalkeyword-onlygeneral\_access: StorageGeneralAccess | None = None Determines how others can access the key-value store. #### Returns dict ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreCollectionClient.md # Source: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreCollectionClient.md # KeyValueStoreCollectionClient Client for managing the collection of Key-value stores in your account. Key-value stores are used to store arbitrary data records or files. This client provides methods to list, create, or get key-value stores by name. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const storesClient = client.keyValueStores(); // List all key-value stores const { items } = await storesClient.list(); // Get or create a key-value store by name const store = await storesClient.getOrCreate('my-store'); ``` * **@see** ### Hierarchy * ResourceCollectionClient * *KeyValueStoreCollectionClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**getOrCreate](#getOrCreate) * [**list](#list) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceCollectionClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceCollectionClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceCollectionClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceCollectionClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceCollectionClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceCollectionClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceCollectionClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceCollectionClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceCollectionClient.url ## Methods[**](#Methods) ### [**](#getOrCreate)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store_collection.ts#L83)getOrCreate * ****getOrCreate**(name, options): Promise<[KeyValueStore](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueStore.md)> - Gets or creates a key-value store with the specified name. * **@see** *** #### Parameters * ##### optionalname: string Name of the key-value store. If not provided, a default store is used. * ##### optionaloptions: [KeyValueStoreCollectionClientGetOrCreateOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueStoreCollectionClientGetOrCreateOptions.md) Additional options like schema. #### Returns Promise<[KeyValueStore](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueStore.md)> The key-value store object. ### [**](#list)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store_collection.ts#L59)list * ****list**(options): Promise<[KeyValueStoreCollectionListResult](https://docs.apify.com/api/client/js/api/client/js/reference.md#KeyValueStoreCollectionListResult)> & AsyncIterable<[KeyValueStore](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueStore.md), any, any> - Lists all Key-value stores. 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 * ##### options: [KeyValueStoreCollectionClientListOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueStoreCollectionClientListOptions.md) = {} Pagination options. #### Returns Promise<[KeyValueStoreCollectionListResult](https://docs.apify.com/api/client/js/api/client/js/reference.md#KeyValueStoreCollectionListResult)> & AsyncIterable<[KeyValueStore](https://docs.apify.com/api/client/js/api/client/js/reference/interface/KeyValueStore.md), any, any> A paginated iterator of Key-value stores. --- # Source: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreCollectionClientAsync.md # KeyValueStoreCollectionClientAsync Async sub-client for manipulating key-value stores. ### Hierarchy * [ResourceCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md) * *KeyValueStoreCollectionClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreCollectionClientAsync.md#__init__) * [**get\_or\_create](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreCollectionClientAsync.md#get_or_create) * [**list](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreCollectionClientAsync.md#list) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreCollectionClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreCollectionClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreCollectionClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreCollectionClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreCollectionClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/key_value_store_collection.py#L65)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceCollectionClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#get_or_create)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/key_value_store_collection.py#L92)get\_or\_create * **async **get\_or\_create**(\*, name, schema): dict - Retrieve a named key-value store, or create a new one when it doesn't exist. *** #### Parameters * ##### optionalkeyword-onlyname: str | None = None The name of the key-value store to retrieve or create. * ##### optionalkeyword-onlyschema: dict | None = None The schema of the key-value store. #### Returns dict ### [**](#list)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/key_value_store_collection.py#L69)list * **async **list**(\*, unnamed, limit, offset, desc): [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] - List the available key-value stores. *** #### Parameters * ##### optionalkeyword-onlyunnamed: bool | None = None Whether to include unnamed key-value stores in the list. * ##### optionalkeyword-onlylimit: int | None = None How many key-value stores to retrieve. * ##### optionalkeyword-onlyoffset: int | None = None What key-value store to include as first when retrieving the list. * ##### optionalkeyword-onlydesc: bool | None = None Whether to sort the key-value stores in descending order based on their modification date. #### Returns [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/js/reference/interface/KeyValueStoreCollectionClientGetOrCreateOptions.md # KeyValueStoreCollectionClientGetOrCreateOptions ## Index[**](#Index) ### Properties * [**schema](#schema) ## Properties[**](#Properties) ### [**](#schema)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store_collection.ts#L100)optionalschema **schema? : Record\ --- # Source: https://docs.apify.com/api/client/js/reference/interface/KeyValueStoreCollectionClientListOptions.md # KeyValueStoreCollectionClientListOptions ### Hierarchy * PaginationOptions * *KeyValueStoreCollectionClientListOptions* ## Index[**](#Index) ### Properties * [**chunkSize](#chunkSize) * [**desc](#desc) * [**limit](#limit) * [**offset](#offset) * [**unnamed](#unnamed) ## Properties[**](#Properties) ### [**](#chunkSize)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L258)optionalinheritedchunkSize **chunkSize? : number Inherited from PaginationOptions.chunkSize Maximum number of items returned in one API response. Relevant in the context of asyncIterator, the iterator will fetch results in chunks of this size from API and yield them one by one. It will stop fetching once the limit is reached or once all items from API have been fetched. Chunk size is usually limited by API. Minimum of those two limits will be used. ### [**](#desc)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store_collection.ts#L96)optionaldesc **desc? : boolean ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L251)optionalinheritedlimit **limit? : number Inherited from PaginationOptions.limit Maximum number of entries requested. ### [**](#offset)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L249)optionalinheritedoffset **offset? : number Inherited from PaginationOptions.offset Position of the first returned entry. ### [**](#unnamed)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store_collection.ts#L95)optionalunnamed **unnamed? : boolean --- # Source: https://docs.apify.com/sdk/js/reference/interface/KeyValueStoreIteratorOptions.md # externalKeyValueStoreIteratorOptions ## Index[**](#Index) ### Properties * [**exclusiveStartKey](#exclusiveStartKey) ## Properties[**](#Properties) ### [**](#exclusiveStartKey)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/key_value_store.d.ts#L396)externaloptionalexclusiveStartKey **exclusiveStartKey? : string All keys up to this one (including) are skipped from the result. --- # Source: https://docs.apify.com/sdk/python/reference/class/KeyValueStoreKeyInfo.md # KeyValueStoreKeyInfo Model for a key-value store key info. Only internal structure. ## Index[**](#Index) ### Properties * [**key](https://docs.apify.com/sdk/python/sdk/python/reference/class/KeyValueStoreKeyInfo.md#key) * [**model\_config](https://docs.apify.com/sdk/python/sdk/python/reference/class/KeyValueStoreKeyInfo.md#model_config) * [**size](https://docs.apify.com/sdk/python/sdk/python/reference/class/KeyValueStoreKeyInfo.md#size) ## Properties[**](#Properties) ### [**](#key)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L71)key **key: str ### [**](#model_config)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L69)model\_config **model\_config: Undefined ### [**](#size)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L72)size **size: int --- # Source: https://docs.apify.com/sdk/python/reference/class/KeyValueStoreListKeysPage.md # KeyValueStoreListKeysPage Model for listing keys in the key-value store. Only internal structure. ## Index[**](#Index) ### Properties * [**count](https://docs.apify.com/sdk/python/sdk/python/reference/class/KeyValueStoreListKeysPage.md#count) * [**exclusive\_start\_key](https://docs.apify.com/sdk/python/sdk/python/reference/class/KeyValueStoreListKeysPage.md#exclusive_start_key) * [**is\_truncated](https://docs.apify.com/sdk/python/sdk/python/reference/class/KeyValueStoreListKeysPage.md#is_truncated) * [**items](https://docs.apify.com/sdk/python/sdk/python/reference/class/KeyValueStoreListKeysPage.md#items) * [**limit](https://docs.apify.com/sdk/python/sdk/python/reference/class/KeyValueStoreListKeysPage.md#limit) * [**model\_config](https://docs.apify.com/sdk/python/sdk/python/reference/class/KeyValueStoreListKeysPage.md#model_config) * [**next\_exclusive\_start\_key](https://docs.apify.com/sdk/python/sdk/python/reference/class/KeyValueStoreListKeysPage.md#next_exclusive_start_key) ## Properties[**](#Properties) ### [**](#count)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L83)count **count: int ### [**](#exclusive_start_key)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L87)exclusive\_start\_key **exclusive\_start\_key: str | None ### [**](#is_truncated)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L85)is\_truncated **is\_truncated: bool ### [**](#items)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L86)items **items: list\[[KeyValueStoreKeyInfo](https://docs.apify.com/sdk/python/sdk/python/reference/class/KeyValueStoreKeyInfo.md)] ### [**](#limit)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L84)limit **limit: int ### [**](#model_config)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L81)model\_config **model\_config: Undefined ### [**](#next_exclusive_start_key)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L88)next\_exclusive\_start\_key **next\_exclusive\_start\_key: str | None --- # Source: https://docs.apify.com/sdk/python/reference/class/KeyValueStoreMetadata.md # KeyValueStoreMetadata Model for a key-value store metadata. ### Hierarchy * [StorageMetadata](https://crawlee.dev/python/api/class/StorageMetadata) * *KeyValueStoreMetadata* ## Index[**](#Index) ### Properties * [**accessed\_at](https://docs.apify.com/sdk/python/sdk/python/reference/class/KeyValueStoreMetadata.md#accessed_at) * [**created\_at](https://docs.apify.com/sdk/python/sdk/python/reference/class/KeyValueStoreMetadata.md#created_at) * [**id](https://docs.apify.com/sdk/python/sdk/python/reference/class/KeyValueStoreMetadata.md#id) * [**model\_config](https://docs.apify.com/sdk/python/sdk/python/reference/class/KeyValueStoreMetadata.md#model_config) * [**modified\_at](https://docs.apify.com/sdk/python/sdk/python/reference/class/KeyValueStoreMetadata.md#modified_at) * [**name](https://docs.apify.com/sdk/python/sdk/python/reference/class/KeyValueStoreMetadata.md#name) ## Properties[**](#Properties) ### [**](#accessed_at)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L31)accessed\_at **accessed\_at: Annotated\[datetime, Field(alias='accessedAt')] Inherited from [StorageMetadata.accessed\_at](https://crawlee.dev/python/api/class/StorageMetadata#accessed_at) The timestamp when the storage was last accessed. ### [**](#created_at)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L34)created\_at **created\_at: Annotated\[datetime, Field(alias='createdAt')] Inherited from [StorageMetadata.created\_at](https://crawlee.dev/python/api/class/StorageMetadata#created_at) The timestamp when the storage was created. ### [**](#id)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L25)id **id: Annotated\[str, Field(alias='id')] Inherited from [StorageMetadata.id](https://crawlee.dev/python/api/class/StorageMetadata#id) The unique identifier of the storage. ### [**](#model_config)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L55)model\_config **model\_config: Undefined Overrides [StorageMetadata.model\_config](https://crawlee.dev/python/api/class/StorageMetadata#model_config) ### [**](#modified_at)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L37)modified\_at **modified\_at: Annotated\[datetime, Field(alias='modifiedAt')] Inherited from [StorageMetadata.modified\_at](https://crawlee.dev/python/api/class/StorageMetadata#modified_at) The timestamp when the storage was last modified. ### [**](#name)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L28)name **name: Annotated\[str | None, Field(alias='name', default=None)] Inherited from [StorageMetadata.name](https://crawlee.dev/python/api/class/StorageMetadata#name) The name of the storage. --- # Source: https://docs.apify.com/sdk/js/reference/interface/KeyValueStoreOptions.md # externalKeyValueStoreOptions ## Index[**](#Index) ### Properties * [**client](#client) * [**id](#id) * [**name](#name) * [**storageObject](#storageObject) ## Properties[**](#Properties) ### [**](#client)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/key_value_store.d.ts#L383)externalclient **client: StorageClient ### [**](#id)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/key_value_store.d.ts#L381)externalid **id: string ### [**](#name)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/key_value_store.d.ts#L382)externaloptionalname **name? : string ### [**](#storageObject)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/key_value_store.d.ts#L384)externaloptionalstorageObject **storageObject? : Record\ --- # Source: https://docs.apify.com/sdk/python/reference/class/KeyValueStoreRecord.md # Source: https://docs.apify.com/api/client/js/reference/interface/KeyValueStoreRecord.md # KeyValueStoreRecord \ Represents a record (key-value pair) in a Key-Value Store. ## Index[**](#Index) ### Properties * [**contentType](#contentType) * [**key](#key) * [**value](#value) ## Properties[**](#Properties) ### [**](#contentType)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L612)optionalcontentType **contentType? : string ### [**](#key)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L610)key **key: string ### [**](#value)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L611)value **value: T --- # Source: https://docs.apify.com/sdk/python/reference/class/KeyValueStoreRecordMetadata.md # KeyValueStoreRecordMetadata Model for a key-value store record metadata. ### Hierarchy * *KeyValueStoreRecordMetadata* * [KeyValueStoreRecord](https://crawlee.dev/python/api/class/KeyValueStoreRecord) ## Index[**](#Index) ### Properties * [**content\_type](https://docs.apify.com/sdk/python/sdk/python/reference/class/KeyValueStoreRecordMetadata.md#content_type) * [**key](https://docs.apify.com/sdk/python/sdk/python/reference/class/KeyValueStoreRecordMetadata.md#key) * [**model\_config](https://docs.apify.com/sdk/python/sdk/python/reference/class/KeyValueStoreRecordMetadata.md#model_config) * [**size](https://docs.apify.com/sdk/python/sdk/python/reference/class/KeyValueStoreRecordMetadata.md#size) ## Properties[**](#Properties) ### [**](#content_type)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L89)content\_type **content\_type: str The MIME type of the record. Describe the format and type of data stored in the record, following the MIME specification. ### [**](#key)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L83)key **key: str The key of the record. A unique identifier for the record in the key-value store. ### [**](#model_config)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L81)model\_config **model\_config: Undefined ### [**](#size)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L95)size **size: int | None The size of the record in bytes. --- # Source: https://docs.apify.com/api/client/js/reference/interface/KeyValueStoreRecordOptions.md # KeyValueStoreRecordOptions Options for storing a record in a Key-Value Store. ## Index[**](#Index) ### Properties * [**doNotRetryTimeouts](#doNotRetryTimeouts) * [**timeoutSecs](#timeoutSecs) ## Properties[**](#Properties) ### [**](#doNotRetryTimeouts)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L620)optionaldoNotRetryTimeouts **doNotRetryTimeouts? : boolean ### [**](#timeoutSecs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L619)optionaltimeoutSecs **timeoutSecs? : number --- # Source: https://docs.apify.com/api/client/js/reference/interface/KeyValueStoreStats.md # KeyValueStoreStats Statistics about Key-Value Store usage and storage. ## Index[**](#Index) ### Properties * [**deleteCount](#deleteCount) * [**listCount](#listCount) * [**readCount](#readCount) * [**storageBytes](#storageBytes) * [**writeCount](#writeCount) ## Properties[**](#Properties) ### [**](#deleteCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L538)optionaldeleteCount **deleteCount? : number ### [**](#listCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L539)optionallistCount **listCount? : number ### [**](#readCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L536)optionalreadCount **readCount? : number ### [**](#storageBytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L540)optionalstorageBytes **storageBytes? : number ### [**](#writeCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/key_value_store.ts#L537)optionalwriteCount **writeCount? : number --- # Source: https://docs.apify.com/api/client/js/reference/interface/Limits.md # Limits ## Index[**](#Index) ### Properties * [**dataRetentionDays](#dataRetentionDays) * [**maxActorCount](#maxActorCount) * [**maxActorMemoryGbytes](#maxActorMemoryGbytes) * [**maxActorTaskCount](#maxActorTaskCount) * [**maxConcurrentActorJobs](#maxConcurrentActorJobs) * [**maxMonthlyActorComputeUnits](#maxMonthlyActorComputeUnits) * [**maxMonthlyExternalDataTransferGbytes](#maxMonthlyExternalDataTransferGbytes) * [**maxMonthlyProxySerps](#maxMonthlyProxySerps) * [**maxMonthlyResidentialProxyGbytes](#maxMonthlyResidentialProxyGbytes) * [**maxMonthlyUsageUsd](#maxMonthlyUsageUsd) * [**maxTeamAccountSeatCount](#maxTeamAccountSeatCount) ## Properties[**](#Properties) ### [**](#dataRetentionDays)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L285)dataRetentionDays **dataRetentionDays: number ### [**](#maxActorCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L281)maxActorCount **maxActorCount: number ### [**](#maxActorMemoryGbytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L280)maxActorMemoryGbytes **maxActorMemoryGbytes: number ### [**](#maxActorTaskCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L282)maxActorTaskCount **maxActorTaskCount: number ### [**](#maxConcurrentActorJobs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L283)maxConcurrentActorJobs **maxConcurrentActorJobs: number ### [**](#maxMonthlyActorComputeUnits)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L276)maxMonthlyActorComputeUnits **maxMonthlyActorComputeUnits: number ### [**](#maxMonthlyExternalDataTransferGbytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L277)maxMonthlyExternalDataTransferGbytes **maxMonthlyExternalDataTransferGbytes: number ### [**](#maxMonthlyProxySerps)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L278)maxMonthlyProxySerps **maxMonthlyProxySerps: number ### [**](#maxMonthlyResidentialProxyGbytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L279)maxMonthlyResidentialProxyGbytes **maxMonthlyResidentialProxyGbytes: number ### [**](#maxMonthlyUsageUsd)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L275)maxMonthlyUsageUsd **maxMonthlyUsageUsd: number ### [**](#maxTeamAccountSeatCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L284)maxTeamAccountSeatCount **maxTeamAccountSeatCount: number --- # Source: https://docs.apify.com/api/client/python/reference/class/ListPage.md # ListPage A single page of items returned from a list() method. ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md#__init__) ### Properties * [**count](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md#count) * [**desc](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md#desc) * [**items](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md#items) * [**limit](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md#limit) * [**offset](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md#offset) * [**total](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md#total) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_types.py#L34)\_\_init\_\_ * ****\_\_init\_\_**(data): None - Initialize a ListPage instance from the API response data. *** #### Parameters * ##### data: dict #### Returns None ## Properties[**](#Properties) ### [**](#count)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_types.py#L19)count **count: int Count of the returned objects on this page. ### [**](#desc)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_types.py#L31)desc **desc: bool Whether the listing is descending or not. ### [**](#items)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_types.py#L16)items **items: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[[T](https://docs.apify.com/api/client/python/api/client/python/reference.md#T)] List of returned objects on this page. ### [**](#limit)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_types.py#L25)limit **limit: int The offset of the first object specified in the API call ### [**](#offset)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_types.py#L22)offset **offset: int The limit on the number of returned objects offset specified in the API call. ### [**](#total)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_types.py#L28)total **total: int Total number of objects matching the API call criteria. --- # Source: https://docs.apify.com/sdk/python/reference/class/LocalEventManager.md # LocalEventManager Event manager for local environments. It extends the `EventManager` to emit `SystemInfo` events at regular intervals. The `LocalEventManager` is intended to be used in local environments, where the system metrics are required managing the `Snapshotter` and `AutoscaledPool`. ### Hierarchy * [EventManager](https://crawlee.dev/python/api/class/EventManager) * *LocalEventManager* ## Index[**](#Index) ### Methods * [**\_\_aenter\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/LocalEventManager.md#__aenter__) * [**\_\_aexit\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/LocalEventManager.md#__aexit__) * [**\_\_init\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/LocalEventManager.md#__init__) * [**emit](https://docs.apify.com/sdk/python/sdk/python/reference/class/LocalEventManager.md#emit) * [**from\_config](https://docs.apify.com/sdk/python/sdk/python/reference/class/LocalEventManager.md#from_config) * [**off](https://docs.apify.com/sdk/python/sdk/python/reference/class/LocalEventManager.md#off) * [**on](https://docs.apify.com/sdk/python/sdk/python/reference/class/LocalEventManager.md#on) * [**wait\_for\_all\_listeners\_to\_complete](https://docs.apify.com/sdk/python/sdk/python/reference/class/LocalEventManager.md#wait_for_all_listeners_to_complete) ### Properties * [**active](https://docs.apify.com/sdk/python/sdk/python/reference/class/LocalEventManager.md#active) ## Methods[**](#Methods) ### [**](#__aenter__)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_local_event_manager.py#L72)\_\_aenter\_\_ * **async **\_\_aenter\_\_**(): [LocalEventManager](https://crawlee.dev/python/api/class/LocalEventManager) - Overrides [EventManager.\_\_aenter\_\_](https://crawlee.dev/python/api/class/EventManager#__aenter__) Initialize the local event manager upon entering the async context. It starts emitting system info events at regular intervals. *** #### Returns [LocalEventManager](https://crawlee.dev/python/api/class/LocalEventManager) ### [**](#__aexit__)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_local_event_manager.py#L81)\_\_aexit\_\_ * **async **\_\_aexit\_\_**(exc\_type, exc\_value, exc\_traceback): None - Overrides [EventManager.\_\_aexit\_\_](https://crawlee.dev/python/api/class/EventManager#__aexit__) Close the local event manager upon exiting the async context. It stops emitting system info events and closes the event manager. *** #### Parameters * ##### exc\_type: [type](https://crawlee.dev/python/api/class/SitemapSource#type)\[BaseException] | None * ##### exc\_value: BaseException | None * ##### exc\_traceback: TracebackType | None #### Returns None ### [**](#__init__)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_local_event_manager.py#L34)\_\_init\_\_ * ****\_\_init\_\_**(system\_info\_interval, \*, persist\_state\_interval, close\_timeout): None - Overrides [EventManager.\_\_init\_\_](https://crawlee.dev/python/api/class/EventManager#__init__) Initialize a new instance. In most cases, you should use the `from_config` constructor to create a new instance based on the provided configuration. *** #### Parameters * ##### optionalsystem\_info\_interval: timedelta = timedelta(seconds=1) Interval at which `SystemInfo` events are emitted. * ##### keyword-onlyoptionalpersist\_state\_interval: timedelta Interval between emitted `PersistState` events to maintain state persistence. * ##### keyword-onlyoptionalclose\_timeout: timedelta | None Optional timeout for canceling pending event listeners if they exceed this duration. #### Returns None ### [**](#emit)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_event_manager.py#L239)emit * ****emit**(\*: , event: [Event](https://crawlee.dev/python/api/enum/Event), event\_data: [EventData](https://crawlee.dev/python/api#EventData)): None * ****emit**(\*: , event: Literal\[Event.PERSIST\_STATE], event\_data: [EventPersistStateData](https://crawlee.dev/python/api/class/EventPersistStateData)): None * ****emit**(\*: , event: Literal\[Event.SYSTEM\_INFO], event\_data: [EventSystemInfoData](https://crawlee.dev/python/api/class/EventSystemInfoData)): None * ****emit**(\*: , event: Literal\[Event.MIGRATING], event\_data: [EventMigratingData](https://crawlee.dev/python/api/class/EventMigratingData)): None * ****emit**(\*: , event: Literal\[Event.ABORTING], event\_data: [EventAbortingData](https://crawlee.dev/python/api/class/EventAbortingData)): None * ****emit**(\*: , event: Literal\[Event.EXIT], event\_data: [EventExitData](https://crawlee.dev/python/api/class/EventExitData)): None * ****emit**(\*: , event: Literal\[Event.CRAWLER\_STATUS], event\_data: [EventCrawlerStatusData](https://crawlee.dev/python/api/class/EventCrawlerStatusData)): None * ****emit**(\*: , event: [Event](https://crawlee.dev/python/api/enum/Event), event\_data: Any): None - Inherited from [EventManager.emit](https://crawlee.dev/python/api/class/EventManager#emit) Emit an event with the associated data to all registered listeners. *** #### Parameters * ##### keyword-onlyevent: [Event](https://crawlee.dev/python/api/enum/Event) The event which will be emitted. * ##### keyword-onlyevent\_data: [EventData](https://crawlee.dev/python/api#EventData) The data which will be passed to the event listeners. #### Returns None ### [**](#from_config)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_local_event_manager.py#L59)from\_config * ****from\_config**(config): [LocalEventManager](https://crawlee.dev/python/api/class/LocalEventManager) - Initialize a new instance based on the provided `Configuration`. *** #### Parameters * ##### optionalconfig: [Configuration](https://crawlee.dev/python/api/class/Configuration) | None = None The `Configuration` instance. Uses the global (default) one if not provided. #### Returns [LocalEventManager](https://crawlee.dev/python/api/class/LocalEventManager) ### [**](#off)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_event_manager.py#L207)off * ****off**(\*, event, listener): None - Inherited from [EventManager.off](https://crawlee.dev/python/api/class/EventManager#off) Remove a specific listener or all listeners for an event. *** #### Parameters * ##### keyword-onlyevent: [Event](https://crawlee.dev/python/api/enum/Event) The Actor event for which to remove listeners. * ##### optionalkeyword-onlylistener: EventListener\[Any] | None = None The listener which is supposed to be removed. If not passed, all listeners of this event are removed. #### Returns None ### [**](#on)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_event_manager.py#L157)on * ****on**(\*: , event: [Event](https://crawlee.dev/python/api/enum/Event), listener: EventListener\[Any]): None * ****on**(\*: , event: Literal\[Event.PERSIST\_STATE], listener: EventListener\[EventPersistStateData]): None * ****on**(\*: , event: Literal\[Event.SYSTEM\_INFO], listener: EventListener\[EventSystemInfoData]): None * ****on**(\*: , event: Literal\[Event.MIGRATING], listener: EventListener\[EventMigratingData]): None * ****on**(\*: , event: Literal\[Event.ABORTING], listener: EventListener\[EventAbortingData]): None * ****on**(\*: , event: Literal\[Event.EXIT], listener: EventListener\[EventExitData]): None * ****on**(\*: , event: Literal\[Event.CRAWLER\_STATUS], listener: EventListener\[EventCrawlerStatusData]): None * ****on**(\*: , event: [Event](https://crawlee.dev/python/api/enum/Event), listener: EventListener\[None]): None - Inherited from [EventManager.on](https://crawlee.dev/python/api/class/EventManager#on) Register an event listener for a specific event. *** #### Parameters * ##### keyword-onlyevent: [Event](https://crawlee.dev/python/api/enum/Event) The event for which to listen to. * ##### keyword-onlylistener: EventListener\[Any] The function (sync or async) which is to be called when the event is emitted. #### Returns None ### [**](#wait_for_all_listeners_to_complete)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_event_manager.py#L249)wait\_for\_all\_listeners\_to\_complete * **async **wait\_for\_all\_listeners\_to\_complete**(\*, timeout): None - Inherited from [EventManager.wait\_for\_all\_listeners\_to\_complete](https://crawlee.dev/python/api/class/EventManager#wait_for_all_listeners_to_complete) Wait for all currently executing event listeners to complete. *** #### Parameters * ##### optionalkeyword-onlytimeout: timedelta | None = None The maximum time to wait for the event listeners to finish. If they do not complete within the specified timeout, they will be canceled. #### Returns None ## Properties[**](#Properties) ### [**](#active)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/events/_event_manager.py#L100)active **active: bool Inherited from [EventManager.active](https://crawlee.dev/python/api/class/EventManager#active) Indicate whether the context is active. --- # Source: https://docs.apify.com/sdk/js/reference/class/Log.md # externalLog The log instance enables level aware logging of messages and we advise to use it instead of `console.log()` and its aliases in most development scenarios. A very useful use case for `log` is using `log.debug` liberally throughout the codebase to get useful logging messages only when appropriate log level is set and keeping the console tidy in production environments. The available logging levels are, in this order: `DEBUG`, `INFO`, `WARNING`, `ERROR`, `OFF` and can be referenced from the `log.LEVELS` constant, such as `log.LEVELS.ERROR`. To log messages to the system console, use the `log.level(message)` invocation, such as `log.debug('this is a debug message')`. To prevent writing of messages above a certain log level to the console, simply set the appropriate level. The default log level is `INFO`, which means that `DEBUG` messages will not be printed, unless enabled. **Example:** ``` import log from '@apify/log'; // importing from the Apify SDK or Crawlee is also supported: // import { log } from 'apify'; // import { log } from 'crawlee'; log.info('Information message', { someData: 123 }); // prints message log.debug('Debug message', { debugData: 'hello' }); // doesn't print anything log.setLevel(log.LEVELS.DEBUG); log.debug('Debug message'); // prints message log.setLevel(log.LEVELS.ERROR); log.debug('Debug message'); // doesn't print anything log.info('Info message'); // doesn't print anything log.error('Error message', { errorDetails: 'This is bad!' }); // prints message try { throw new Error('Not good!'); } catch (e) { log.exception(e, 'Exception occurred', { errorDetails: 'This is really bad!' }); // prints message } log.setOptions({ prefix: 'My actor' }); log.info('I am running!'); // prints "My actor: I am running" const childLog = log.child({ prefix: 'Crawler' }); log.info('I am crawling!'); // prints "My actor:Crawler: I am crawling" ``` Another very useful way of setting the log level is by setting the `APIFY_LOG_LEVEL` environment variable, such as `APIFY_LOG_LEVEL=DEBUG`. This way, no code changes are necessary to turn on your debug messages and start debugging right away. To add timestamps to your logs, you can override the default logger settings: ``` log.setOptions({ logger: new log.LoggerText({ skipTime: false }), }); ``` You can customize your logging further by extending or replacing the default logger instances with your own implementations. ## Index[**](#Index) ### Constructors * [**constructor](#constructor) ### Properties * [**LEVELS](#LEVELS) ### Methods * [**debug](#debug) * [**deprecated](#deprecated) * [**error](#error) * [**exception](#exception) * [**getLevel](#getLevel) * [**getOptions](#getOptions) * [**child](#child) * [**info](#info) * [**internal](#internal) * [**perf](#perf) * [**setLevel](#setLevel) * [**setOptions](#setOptions) * [**softFail](#softFail) * [**warning](#warning) * [**warningOnce](#warningOnce) ## Constructors[**](#Constructors) ### [**](#constructor)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L136)externalconstructor * ****new Log**(options): [Log](https://docs.apify.com/sdk/js/sdk/js/reference/class/Log.md) - #### Parameters * ##### externaloptionaloptions: Partial<[LoggerOptions](https://docs.apify.com/sdk/js/sdk/js/reference/interface/LoggerOptions.md)> #### Returns [Log](https://docs.apify.com/sdk/js/sdk/js/reference/class/Log.md) ## Properties[**](#Properties) ### [**](#LEVELS)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L133)externalreadonlyLEVELS **LEVELS: typeof [LogLevel](https://docs.apify.com/sdk/js/sdk/js/reference/enum/LogLevel.md) Map of available log levels that's useful for easy setting of appropriate log levels. Each log level is represented internally by a number. Eg. `log.LEVELS.DEBUG === 5`. ## Methods[**](#Methods) ### [**](#debug)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L195)externaldebug * ****debug**(message, data): void - Logs a `DEBUG` message. By default, it will not be written to the console. To see `DEBUG` messages in the console, set the log level to `DEBUG` either using the `log.setLevel(log.LEVELS.DEBUG)` method or using the environment variable `APIFY_LOG_LEVEL=DEBUG`. Data are stringified and appended to the message. *** #### Parameters * ##### externalmessage: string * ##### externaloptionaldata: AdditionalData #### Returns void ### [**](#deprecated)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L204)externaldeprecated * ****deprecated**(message): void - Logs given message only once as WARNING. It's used to warn user that some feature he is using has been deprecated. *** #### Parameters * ##### externalmessage: string #### Returns void ### [**](#error)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L173)externalerror * ****error**(message, data): void - Logs an `ERROR` message. Use this method to log error messages that are not directly connected to an exception. For logging exceptions, use the `log.exception` method. *** #### Parameters * ##### externalmessage: string * ##### externaloptionaldata: AdditionalData #### Returns void ### [**](#exception)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L178)externalexception * ****exception**(exception, message, data): void - Logs an `ERROR` level message with a nicely formatted exception. Note that the exception is the first parameter here and an additional message is only optional. *** #### Parameters * ##### externalexception: Error * ##### externalmessage: string * ##### externaloptionaldata: AdditionalData #### Returns void ### [**](#getLevel)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L144)externalgetLevel * ****getLevel**(): number - Returns the currently selected logging level. This is useful for checking whether a message will actually be printed to the console before one actually performs a resource intensive operation to construct the message, such as querying a DB for some metadata that need to be added. If the log level is not high enough at the moment, it doesn't make sense to execute the query. *** #### Returns number ### [**](#getOptions)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L164)externalgetOptions * ****getOptions**(): Required<[LoggerOptions](https://docs.apify.com/sdk/js/sdk/js/reference/interface/LoggerOptions.md)> - Returns the logger configuration. *** #### Returns Required<[LoggerOptions](https://docs.apify.com/sdk/js/sdk/js/reference/interface/LoggerOptions.md)> ### [**](#child)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L168)externalchild * ****child**(options): [Log](https://docs.apify.com/sdk/js/sdk/js/reference/class/Log.md) - Creates a new instance of logger that inherits settings from a parent logger. *** #### Parameters * ##### externaloptions: Partial<[LoggerOptions](https://docs.apify.com/sdk/js/sdk/js/reference/interface/LoggerOptions.md)> #### Returns [Log](https://docs.apify.com/sdk/js/sdk/js/reference/class/Log.md) ### [**](#info)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L188)externalinfo * ****info**(message, data): void - Logs an `INFO` message. `INFO` is the default log level so info messages will be always logged, unless the log level is changed. Data are stringified and appended to the message. *** #### Parameters * ##### externalmessage: string * ##### externaloptionaldata: AdditionalData #### Returns void ### [**](#internal)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L156)externalinternal * ****internal**(level, message, data, exception): void - #### Parameters * ##### externallevel: [LogLevel](https://docs.apify.com/sdk/js/sdk/js/reference/enum/LogLevel.md) * ##### externalmessage: string * ##### externaloptionaldata: any * ##### externaloptionalexception: any #### Returns void ### [**](#perf)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L196)externalperf * ****perf**(message, data): void - #### Parameters * ##### externalmessage: string * ##### externaloptionaldata: AdditionalData #### Returns void ### [**](#setLevel)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L155)externalsetLevel * ****setLevel**(level): void - Sets the log level to the given value, preventing messages from less important log levels from being printed to the console. Use in conjunction with the `log.LEVELS` constants such as ``` log.setLevel(log.LEVELS.DEBUG); ``` Default log level is INFO. *** #### Parameters * ##### externallevel: [LogLevel](https://docs.apify.com/sdk/js/sdk/js/reference/enum/LogLevel.md) #### Returns void ### [**](#setOptions)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L160)externalsetOptions * ****setOptions**(options): void - Configures logger. *** #### Parameters * ##### externaloptions: Partial<[LoggerOptions](https://docs.apify.com/sdk/js/sdk/js/reference/interface/LoggerOptions.md)> #### Returns void ### [**](#softFail)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L179)externalsoftFail * ****softFail**(message, data): void - #### Parameters * ##### externalmessage: string * ##### externaloptionaldata: AdditionalData #### Returns void ### [**](#warning)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L183)externalwarning * ****warning**(message, data): void - Logs a `WARNING` level message. Data are stringified and appended to the message. *** #### Parameters * ##### externalmessage: string * ##### externaloptionaldata: AdditionalData #### Returns void ### [**](#warningOnce)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L200)externalwarningOnce * ****warningOnce**(message): void - Logs a `WARNING` level message only once. *** #### Parameters * ##### externalmessage: string #### Returns void --- # Source: https://docs.apify.com/api/client/python/reference/class/LogClient.md # Source: https://docs.apify.com/api/client/js/reference/class/LogClient.md # LogClient Client for accessing Actor run or build logs. Provides methods to retrieve logs as text or stream them in real-time. Logs can be accessed for both running and finished Actor runs and builds. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const runClient = client.run('my-run-id'); // Get the log content const log = await runClient.log().get(); console.log(log); // Stream the log in real-time const stream = await runClient.log().stream(); stream.on('line', (line) => console.log(line)); ``` * **@see** ### Hierarchy * ResourceClient * *LogClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**get](#get) * [**stream](#stream) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceClient.url ## Methods[**](#Methods) ### [**](#get)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/log.ts#L56)get * ****get**(options): Promise\ - Retrieves the log as a string. * **@see** *** #### Parameters * ##### options: [LogOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/LogOptions.md) = {} Log retrieval options. #### Returns Promise\ The log content as a string, or `undefined` if it does not exist. ### [**](#stream)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/log.ts#L81)stream * ****stream**(options): Promise\ - Retrieves the log as a Readable stream. Only works in Node.js. * **@see** *** #### Parameters * ##### options: [LogOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/LogOptions.md) = {} Log retrieval options. #### Returns Promise\ The log content as a Readable stream, or `undefined` if it does not exist. --- # Source: https://docs.apify.com/api/client/python/reference/class/LogClientAsync.md # LogClientAsync Async sub-client for manipulating logs. ### Hierarchy * [ResourceClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md) * *LogClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogClientAsync.md#__init__) * [**get](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogClientAsync.md#get) * [**get\_as\_bytes](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogClientAsync.md#get_as_bytes) * [**stream](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogClientAsync.md#stream) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L118)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#get)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L122)get * **async **get**(\*, raw): str | None - Retrieve the log as text. *** #### Parameters * ##### optionalkeyword-onlyraw: bool = False If true, the log will include formatting. For example, coloring character sequences. #### Returns str | None ### [**](#get_as_bytes)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L147)get\_as\_bytes * **async **get\_as\_bytes**(\*, raw): bytes | None - Retrieve the log as raw bytes. *** #### Parameters * ##### optionalkeyword-onlyraw: bool = False If true, the log will include formatting. For example, coloring character sequences. #### Returns bytes | None ### [**](#stream)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L173)stream * **async **stream**(\*, raw): AsyncIterator\[impit.Response | None] - Retrieve the log as a stream. *** #### Parameters * ##### optionalkeyword-onlyraw: bool = False If true, the log will include formatting. For example, coloring character sequences. #### Returns AsyncIterator\[impit.Response | None] ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/python/reference/class/LogContext.md # LogContext ## Index[**](#Index) ### Properties * [**attempt](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogContext.md#attempt) * [**client\_method](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogContext.md#client_method) * [**method](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogContext.md#method) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogContext.md#resource_id) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogContext.md#url) ## Properties[**](#Properties) ### [**](#attempt)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_logging.py#L27)attempt **attempt: ContextVar\[int | None] ### [**](#client_method)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_logging.py#L28)client\_method **client\_method: ContextVar\[str | None] ### [**](#method)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_logging.py#L29)method **method: ContextVar\[str | None] ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_logging.py#L30)resource\_id **resource\_id: ContextVar\[str | None] ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_logging.py#L31)url **url: ContextVar\[str | None] --- # Source: https://docs.apify.com/sdk/js/reference/enum/LogLevel.md # externalLogLevel ## Index[**](#Index) ### Enumeration Members * [**DEBUG](#DEBUG) * [**ERROR](#ERROR) * [**INFO](#INFO) * [**OFF](#OFF) * [**PERF](#PERF) * [**SOFT\_FAIL](#SOFT_FAIL) * [**WARNING](#WARNING) ## Enumeration Members[**](<#Enumeration Members>) ### [**](#DEBUG)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L9)externalDEBUG **DEBUG: 5 ### [**](#ERROR)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L5)externalERROR **ERROR: 1 ### [**](#INFO)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L8)externalINFO **INFO: 4 ### [**](#OFF)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L4)externalOFF **OFF: 0 ### [**](#PERF)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L10)externalPERF **PERF: 6 ### [**](#SOFT_FAIL)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L6)externalSOFT\_FAIL **SOFT\_FAIL: 2 ### [**](#WARNING)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L7)externalWARNING **WARNING: 3 --- # Source: https://docs.apify.com/api/client/js/reference/interface/LogOptions.md # LogOptions ## Index[**](#Index) ### Properties * [**raw](#raw) ## Properties[**](#Properties) ### [**](#raw)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/log.ts#L107)optionalraw **raw? : boolean = false --- # Source: https://docs.apify.com/sdk/js/reference/class/Logger.md # externalLogger This is an abstract class that should be extended by custom logger classes. this.\_log() method must be implemented by them. ### Hierarchy * EventEmitter * *Logger* * [LoggerJson](https://docs.apify.com/sdk/js/sdk/js/reference/class/LoggerJson.md) * [LoggerText](https://docs.apify.com/sdk/js/sdk/js/reference/class/LoggerText.md) ## Index[**](#Index) ### Constructors * [**constructor](#constructor) ### Properties * [**captureRejections](#captureRejections) * [**captureRejectionSymbol](#captureRejectionSymbol) * [**defaultMaxListeners](#defaultMaxListeners) * [**errorMonitor](#errorMonitor) ### Methods * [**\_log](#_log) * [**\_outputWithConsole](#_outputWithConsole) * [**\[captureRejectionSymbol\]](#\[captureRejectionSymbol]) * [**addListener](#addListener) * [**emit](#emit) * [**eventNames](#eventNames) * [**getMaxListeners](#getMaxListeners) * [**getOptions](#getOptions) * [**listenerCount](#listenerCount) * [**listeners](#listeners) * [**log](#log) * [**off](#off) * [**on](#on) * [**once](#once) * [**prependListener](#prependListener) * [**prependOnceListener](#prependOnceListener) * [**rawListeners](#rawListeners) * [**removeAllListeners](#removeAllListeners) * [**removeListener](#removeListener) * [**setMaxListeners](#setMaxListeners) * [**setOptions](#setOptions) * [**addAbortListener](#addAbortListener) * [**getEventListeners](#getEventListeners) * [**getMaxListeners](#getMaxListeners) * [**listenerCount](#listenerCount) * [**on](#on) * [**once](#once) * [**setMaxListeners](#setMaxListeners) ## Constructors[**](#Constructors) ### [**](#constructor)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L33)externalconstructor * ****new Logger**(options): [Logger](https://docs.apify.com/sdk/js/sdk/js/reference/class/Logger.md) - Overrides EventEmitter.constructor #### Parameters * ##### externaloptions: Record\ #### Returns [Logger](https://docs.apify.com/sdk/js/sdk/js/reference/class/Logger.md) ## Properties[**](#Properties) ### [**](#captureRejections)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L459)staticexternalinheritedcaptureRejections **captureRejections: boolean Inherited from EventEmitter.captureRejections Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) Change the default `captureRejections` option on all new `EventEmitter` objects. * **@since** v13.4.0, v12.16.0 ### [**](#captureRejectionSymbol)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L452)staticexternalreadonlyinheritedcaptureRejectionSymbol **captureRejectionSymbol: typeof captureRejectionSymbol Inherited from EventEmitter.captureRejectionSymbol Value: `Symbol.for('nodejs.rejection')` See how to write a custom `rejection handler`. * **@since** v13.4.0, v12.16.0 ### [**](#defaultMaxListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L498)staticexternalinheriteddefaultMaxListeners **defaultMaxListeners: number Inherited from EventEmitter.defaultMaxListeners By default, a maximum of `10` listeners can be registered for any single event. This limit can be changed for individual `EventEmitter` instances using the `emitter.setMaxListeners(n)` method. To change the default for *all*`EventEmitter` instances, the `events.defaultMaxListeners` property can be used. If this value is not a positive number, a `RangeError` is thrown. Take caution when setting the `events.defaultMaxListeners` because the change affects *all* `EventEmitter` instances, including those created before the change is made. However, calling `emitter.setMaxListeners(n)` still has precedence over `events.defaultMaxListeners`. This is not a hard limit. The `EventEmitter` instance will allow more listeners to be added but will output a trace warning to stderr indicating that a "possible EventEmitter memory leak" has been detected. For any single `EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` methods can be used to temporarily avoid this warning: ``` import { EventEmitter } from 'node:events'; const emitter = new EventEmitter(); emitter.setMaxListeners(emitter.getMaxListeners() + 1); emitter.once('event', () => { // do stuff emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); }); ``` The `--trace-warnings` command-line flag can be used to display the stack trace for such warnings. The emitted warning can be inspected with `process.on('warning')` and will have the additional `emitter`, `type`, and `count` properties, referring to the event emitter instance, the event's name and the number of attached listeners, respectively. Its `name` property is set to `'MaxListenersExceededWarning'`. * **@since** v0.11.2 ### [**](#errorMonitor)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L445)staticexternalreadonlyinheritederrorMonitor **errorMonitor: typeof errorMonitor Inherited from EventEmitter.errorMonitor This symbol shall be used to install a listener for only monitoring `'error'` events. Listeners installed using this symbol are called before the regular `'error'` listeners are called. Installing a listener using this symbol does not change the behavior once an `'error'` event is emitted. Therefore, the process will still crash if no regular `'error'` listener is installed. * **@since** v13.6.0, v12.17.0 ## Methods[**](#Methods) ### [**](#_log)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L37)external\_log * ****\_log**(level, message, data, exception, opts): void - #### Parameters * ##### externallevel: [LogLevel](https://docs.apify.com/sdk/js/sdk/js/reference/enum/LogLevel.md) * ##### externalmessage: string * ##### externaloptionaldata: any * ##### externaloptionalexception: unknown * ##### externaloptionalopts: Record\ #### Returns void ### [**](#_outputWithConsole)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L36)external\_outputWithConsole * ****\_outputWithConsole**(level, line): void - #### Parameters * ##### externallevel: [LogLevel](https://docs.apify.com/sdk/js/sdk/js/reference/enum/LogLevel.md) * ##### externalline: string #### Returns void ### [**](#\[captureRejectionSymbol])[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L136)externaloptionalinherited\[captureRejectionSymbol] * ****\[captureRejectionSymbol]**\(error, event, ...args): void - Inherited from EventEmitter.\[captureRejectionSymbol] #### Parameters * ##### externalerror: Error * ##### externalevent: string | symbol * ##### externalrest...args: AnyRest #### Returns void ### [**](#addListener)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L597)externalinheritedaddListener * ****addListener**\(eventName, listener): this - Inherited from EventEmitter.addListener Alias for `emitter.on(eventName, listener)`. * **@since** v0.1.26 *** #### Parameters * ##### externaleventName: string | symbol * ##### externallistener: (...args) => void #### Returns this ### [**](#emit)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L859)externalinheritedemit * ****emit**\(eventName, ...args): boolean - Inherited from EventEmitter.emit Synchronously calls each of the listeners registered for the event named `eventName`, in the order they were registered, passing the supplied arguments to each. Returns `true` if the event had listeners, `false` otherwise. ``` import { EventEmitter } from 'node:events'; const myEmitter = new EventEmitter(); // First listener myEmitter.on('event', function firstListener() { console.log('Helloooo! first listener'); }); // Second listener myEmitter.on('event', function secondListener(arg1, arg2) { console.log(`event with parameters ${arg1}, ${arg2} in second listener`); }); // Third listener myEmitter.on('event', function thirdListener(...args) { const parameters = args.join(', '); console.log(`event with parameters ${parameters} in third listener`); }); console.log(myEmitter.listeners('event')); myEmitter.emit('event', 1, 2, 3, 4, 5); // Prints: // [ // [Function: firstListener], // [Function: secondListener], // [Function: thirdListener] // ] // Helloooo! first listener // event with parameters 1, 2 in second listener // event with parameters 1, 2, 3, 4, 5 in third listener ``` * **@since** v0.1.26 *** #### Parameters * ##### externaleventName: string | symbol * ##### externalrest...args: AnyRest #### Returns boolean ### [**](#eventNames)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L922)externalinheritedeventNames * ****eventNames**(): (string | symbol)\[] - Inherited from EventEmitter.eventNames Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or `Symbol`s. ``` import { EventEmitter } from 'node:events'; const myEE = new EventEmitter(); myEE.on('foo', () => {}); myEE.on('bar', () => {}); const sym = Symbol('symbol'); myEE.on(sym, () => {}); console.log(myEE.eventNames()); // Prints: [ 'foo', 'bar', Symbol(symbol) ] ``` * **@since** v6.0.0 *** #### Returns (string | symbol)\[] ### [**](#getMaxListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L774)externalinheritedgetMaxListeners * ****getMaxListeners**(): number - Inherited from EventEmitter.getMaxListeners Returns the current max listener value for the `EventEmitter` which is either set by `emitter.setMaxListeners(n)` or defaults to defaultMaxListeners. * **@since** v1.0.0 *** #### Returns number ### [**](#getOptions)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L35)externalgetOptions * ****getOptions**(): Record\ - #### Returns Record\ ### [**](#listenerCount)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L868)externalinheritedlistenerCount * ****listenerCount**\(eventName, listener): number - Inherited from EventEmitter.listenerCount Returns the number of listeners listening for the event named `eventName`. If `listener` is provided, it will return how many times the listener is found in the list of the listeners of the event. * **@since** v3.2.0 *** #### Parameters * ##### externaleventName: string | symbol The name of the event being listened for * ##### externaloptionallistener: Function The event handler function #### Returns number ### [**](#listeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L787)externalinheritedlisteners * ****listeners**\(eventName): Function\[] - Inherited from EventEmitter.listeners Returns a copy of the array of listeners for the event named `eventName`. ``` server.on('connection', (stream) => { console.log('someone connected!'); }); console.log(util.inspect(server.listeners('connection'))); // Prints: [ [Function] ] ``` * **@since** v0.1.26 *** #### Parameters * ##### externaleventName: string | symbol #### Returns Function\[] ### [**](#log)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L38)externallog * ****log**(level, message, ...args): void - #### Parameters * ##### externallevel: [LogLevel](https://docs.apify.com/sdk/js/sdk/js/reference/enum/LogLevel.md) * ##### externalmessage: string * ##### externalrest...args: any\[] #### Returns void ### [**](#off)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L747)externalinheritedoff * ****off**\(eventName, listener): this - Inherited from EventEmitter.off Alias for `emitter.removeListener()`. * **@since** v10.0.0 *** #### Parameters * ##### externaleventName: string | symbol * ##### externallistener: (...args) => void #### Returns this ### [**](#on)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L629)externalinheritedon * ****on**\(eventName, listener): this - Inherited from EventEmitter.on Adds the `listener` function to the end of the listeners array for the event named `eventName`. No checks are made to see if the `listener` has already been added. Multiple calls passing the same combination of `eventName` and `listener` will result in the `listener` being added, and called, multiple times. ``` server.on('connection', (stream) => { console.log('someone connected!'); }); ``` Returns a reference to the `EventEmitter`, so that calls can be chained. By default, event listeners are invoked in the order they are added. The `emitter.prependListener()` method can be used as an alternative to add the event listener to the beginning of the listeners array. ``` import { EventEmitter } from 'node:events'; const myEE = new EventEmitter(); myEE.on('foo', () => console.log('a')); myEE.prependListener('foo', () => console.log('b')); myEE.emit('foo'); // Prints: // b // a ``` * **@since** v0.1.101 *** #### Parameters * ##### externaleventName: string | symbol The name of the event. * ##### externallistener: (...args) => void The callback function #### Returns this ### [**](#once)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L659)externalinheritedonce * ****once**\(eventName, listener): this - Inherited from EventEmitter.once Adds a **one-time** `listener` function for the event named `eventName`. The next time `eventName` is triggered, this listener is removed and then invoked. ``` server.once('connection', (stream) => { console.log('Ah, we have our first user!'); }); ``` Returns a reference to the `EventEmitter`, so that calls can be chained. By default, event listeners are invoked in the order they are added. The `emitter.prependOnceListener()` method can be used as an alternative to add the event listener to the beginning of the listeners array. ``` import { EventEmitter } from 'node:events'; const myEE = new EventEmitter(); myEE.once('foo', () => console.log('a')); myEE.prependOnceListener('foo', () => console.log('b')); myEE.emit('foo'); // Prints: // b // a ``` * **@since** v0.3.0 *** #### Parameters * ##### externaleventName: string | symbol The name of the event. * ##### externallistener: (...args) => void The callback function #### Returns this ### [**](#prependListener)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L886)externalinheritedprependListener * ****prependListener**\(eventName, listener): this - Inherited from EventEmitter.prependListener Adds the `listener` function to the *beginning* of the listeners array for the event named `eventName`. No checks are made to see if the `listener` has already been added. Multiple calls passing the same combination of `eventName` and `listener` will result in the `listener` being added, and called, multiple times. ``` server.prependListener('connection', (stream) => { console.log('someone connected!'); }); ``` Returns a reference to the `EventEmitter`, so that calls can be chained. * **@since** v6.0.0 *** #### Parameters * ##### externaleventName: string | symbol The name of the event. * ##### externallistener: (...args) => void The callback function #### Returns this ### [**](#prependOnceListener)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L902)externalinheritedprependOnceListener * ****prependOnceListener**\(eventName, listener): this - Inherited from EventEmitter.prependOnceListener Adds a **one-time**`listener` function for the event named `eventName` to the *beginning* of the listeners array. The next time `eventName` is triggered, this listener is removed, and then invoked. ``` server.prependOnceListener('connection', (stream) => { console.log('Ah, we have our first user!'); }); ``` Returns a reference to the `EventEmitter`, so that calls can be chained. * **@since** v6.0.0 *** #### Parameters * ##### externaleventName: string | symbol The name of the event. * ##### externallistener: (...args) => void The callback function #### Returns this ### [**](#rawListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L818)externalinheritedrawListeners * ****rawListeners**\(eventName): Function\[] - Inherited from EventEmitter.rawListeners Returns a copy of the array of listeners for the event named `eventName`, including any wrappers (such as those created by `.once()`). ``` import { EventEmitter } from 'node:events'; const emitter = new EventEmitter(); emitter.once('log', () => console.log('log once')); // Returns a new Array with a function `onceWrapper` which has a property // `listener` which contains the original listener bound above const listeners = emitter.rawListeners('log'); const logFnWrapper = listeners[0]; // Logs "log once" to the console and does not unbind the `once` event logFnWrapper.listener(); // Logs "log once" to the console and removes the listener logFnWrapper(); emitter.on('log', () => console.log('log persistently')); // Will return a new Array with a single function bound by `.on()` above const newListeners = emitter.rawListeners('log'); // Logs "log persistently" twice newListeners[0](); emitter.emit('log'); ``` * **@since** v9.4.0 *** #### Parameters * ##### externaleventName: string | symbol #### Returns Function\[] ### [**](#removeAllListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L758)externalinheritedremoveAllListeners * ****removeAllListeners**(eventName): this - Inherited from EventEmitter.removeAllListeners Removes all listeners, or those of the specified `eventName`. It is bad practice to remove listeners added elsewhere in the code, particularly when the `EventEmitter` instance was created by some other component or module (e.g. sockets or file streams). Returns a reference to the `EventEmitter`, so that calls can be chained. * **@since** v0.1.26 *** #### Parameters * ##### externaloptionaleventName: string | symbol #### Returns this ### [**](#removeListener)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L742)externalinheritedremoveListener * ****removeListener**\(eventName, listener): this - Inherited from EventEmitter.removeListener Removes the specified `listener` from the listener array for the event named `eventName`. ``` const callback = (stream) => { console.log('someone connected!'); }; server.on('connection', callback); // ... server.removeListener('connection', callback); ``` `removeListener()` will remove, at most, one instance of a listener from the listener array. If any single listener has been added multiple times to the listener array for the specified `eventName`, then `removeListener()` must be called multiple times to remove each instance. Once an event is emitted, all listeners attached to it at the time of emitting are called in order. This implies that any `removeListener()` or `removeAllListeners()` calls *after* emitting and *before* the last listener finishes execution will not remove them from`emit()` in progress. Subsequent events behave as expected. ``` import { EventEmitter } from 'node:events'; class MyEmitter extends EventEmitter {} const myEmitter = new MyEmitter(); const callbackA = () => { console.log('A'); myEmitter.removeListener('event', callbackB); }; const callbackB = () => { console.log('B'); }; myEmitter.on('event', callbackA); myEmitter.on('event', callbackB); // callbackA removes listener callbackB but it will still be called. // Internal listener array at time of emit [callbackA, callbackB] myEmitter.emit('event'); // Prints: // A // B // callbackB is now removed. // Internal listener array [callbackA] myEmitter.emit('event'); // Prints: // A ``` Because listeners are managed using an internal array, calling this will change the position indices of any listener registered *after* the listener being removed. This will not impact the order in which listeners are called, but it means that any copies of the listener array as returned by the `emitter.listeners()` method will need to be recreated. When a single function has been added as a handler multiple times for a single event (as in the example below), `removeListener()` will remove the most recently added instance. In the example the `once('ping')` listener is removed: ``` import { EventEmitter } from 'node:events'; const ee = new EventEmitter(); function pong() { console.log('pong'); } ee.on('ping', pong); ee.once('ping', pong); ee.removeListener('ping', pong); ee.emit('ping'); ee.emit('ping'); ``` Returns a reference to the `EventEmitter`, so that calls can be chained. * **@since** v0.1.26 *** #### Parameters * ##### externaleventName: string | symbol * ##### externallistener: (...args) => void #### Returns this ### [**](#setMaxListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L768)externalinheritedsetMaxListeners * ****setMaxListeners**(n): this - Inherited from EventEmitter.setMaxListeners By default `EventEmitter`s will print a warning if more than `10` listeners are added for a particular event. This is a useful default that helps finding memory leaks. The `emitter.setMaxListeners()` method allows the limit to be modified for this specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) to indicate an unlimited number of listeners. Returns a reference to the `EventEmitter`, so that calls can be chained. * **@since** v0.3.5 *** #### Parameters * ##### externaln: number #### Returns this ### [**](#setOptions)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L34)externalsetOptions * ****setOptions**(options): void - #### Parameters * ##### externaloptions: Record\ #### Returns void ### [**](#addAbortListener)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L437)staticexternalinheritedaddAbortListener * ****addAbortListener**(signal, resource): Disposable - Inherited from EventEmitter.addAbortListener experimental Listens once to the `abort` event on the provided `signal`. Listening to the `abort` event on abort signals is unsafe and may lead to resource leaks since another third party with the signal can call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change this since it would violate the web standard. Additionally, the original API makes it easy to forget to remove listeners. This API allows safely using `AbortSignal`s in Node.js APIs by solving these two issues by listening to the event such that `stopImmediatePropagation` does not prevent the listener from running. Returns a disposable so that it may be unsubscribed from more easily. ``` import { addAbortListener } from 'node:events'; function example(signal) { let disposable; try { signal.addEventListener('abort', (e) => e.stopImmediatePropagation()); disposable = addAbortListener(signal, (e) => { // Do something when signal is aborted. }); } finally { disposable?.[Symbol.dispose](); } } ``` * **@since** v20.5.0 *** #### Parameters * ##### externalsignal: AbortSignal * ##### externalresource: (event) => void #### Returns Disposable Disposable that removes the `abort` listener. ### [**](#getEventListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L358)staticexternalinheritedgetEventListeners * ****getEventListeners**(emitter, name): Function\[] - Inherited from EventEmitter.getEventListeners Returns a copy of the array of listeners for the event named `eventName`. For `EventEmitter`s this behaves exactly the same as calling `.listeners` on the emitter. For `EventTarget`s this is the only way to get the event listeners for the event target. This is useful for debugging and diagnostic purposes. ``` import { getEventListeners, EventEmitter } from 'node:events'; { const ee = new EventEmitter(); const listener = () => console.log('Events are fun'); ee.on('foo', listener); console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ] } { const et = new EventTarget(); const listener = () => console.log('Events are fun'); et.addEventListener('foo', listener); console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ] } ``` * **@since** v15.2.0, v14.17.0 *** #### Parameters * ##### externalemitter: EventEmitter\ | EventTarget * ##### externalname: string | symbol #### Returns Function\[] ### [**](#getMaxListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L387)staticexternalinheritedgetMaxListeners * ****getMaxListeners**(emitter): number - Inherited from EventEmitter.getMaxListeners Returns the currently set max amount of listeners. For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on the emitter. For `EventTarget`s this is the only way to get the max event listeners for the event target. If the number of event handlers on a single EventTarget exceeds the max set, the EventTarget will print a warning. ``` import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events'; { const ee = new EventEmitter(); console.log(getMaxListeners(ee)); // 10 setMaxListeners(11, ee); console.log(getMaxListeners(ee)); // 11 } { const et = new EventTarget(); console.log(getMaxListeners(et)); // 10 setMaxListeners(11, et); console.log(getMaxListeners(et)); // 11 } ``` * **@since** v19.9.0 *** #### Parameters * ##### externalemitter: EventEmitter\ | EventTarget #### Returns number ### [**](#listenerCount)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L330)staticexternalinheritedlistenerCount * ****listenerCount**(emitter, eventName): number - Inherited from EventEmitter.listenerCount A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`. ``` import { EventEmitter, listenerCount } from 'node:events'; const myEmitter = new EventEmitter(); myEmitter.on('event', () => {}); myEmitter.on('event', () => {}); console.log(listenerCount(myEmitter, 'event')); // Prints: 2 ``` * **@since** v0.9.12 * **@deprecated** Since v3.2.0 - Use `listenerCount` instead. *** #### Parameters * ##### externalemitter: EventEmitter\ The emitter to query * ##### externaleventName: string | symbol The event name #### Returns number ### [**](#on)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L303)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L308)staticexternalinheritedon * ****on**(emitter, eventName, options): AsyncIterator\ * ****on**(emitter, eventName, options): AsyncIterator\ - Inherited from EventEmitter.on ``` import { on, EventEmitter } from 'node:events'; import process from 'node:process'; const ee = new EventEmitter(); // Emit later on process.nextTick(() => { ee.emit('foo', 'bar'); ee.emit('foo', 42); }); for await (const event of on(ee, 'foo')) { // The execution of this inner block is synchronous and it // processes one event at a time (even with await). Do not use // if concurrent execution is required. console.log(event); // prints ['bar'] [42] } // Unreachable here ``` Returns an `AsyncIterator` that iterates `eventName` events. It will throw if the `EventEmitter` emits `'error'`. It removes all listeners when exiting the loop. The `value` returned by each iteration is an array composed of the emitted event arguments. An `AbortSignal` can be used to cancel waiting on events: ``` import { on, EventEmitter } from 'node:events'; import process from 'node:process'; const ac = new AbortController(); (async () => { const ee = new EventEmitter(); // Emit later on process.nextTick(() => { ee.emit('foo', 'bar'); ee.emit('foo', 42); }); for await (const event of on(ee, 'foo', { signal: ac.signal })) { // The execution of this inner block is synchronous and it // processes one event at a time (even with await). Do not use // if concurrent execution is required. console.log(event); // prints ['bar'] [42] } // Unreachable here })(); process.nextTick(() => ac.abort()); ``` Use the `close` option to specify an array of event names that will end the iteration: ``` import { on, EventEmitter } from 'node:events'; import process from 'node:process'; const ee = new EventEmitter(); // Emit later on process.nextTick(() => { ee.emit('foo', 'bar'); ee.emit('foo', 42); ee.emit('close'); }); for await (const event of on(ee, 'foo', { close: ['close'] })) { console.log(event); // prints ['bar'] [42] } // the loop will exit after 'close' is emitted console.log('done'); // prints 'done' ``` * **@since** v13.6.0, v12.16.0 *** #### Parameters * ##### externalemitter: EventEmitter\ * ##### externaleventName: string | symbol * ##### externaloptionaloptions: StaticEventEmitterIteratorOptions #### Returns AsyncIterator\ An `AsyncIterator` that iterates `eventName` events emitted by the `emitter` ### [**](#once)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L217)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L222)staticexternalinheritedonce * ****once**(emitter, eventName, options): Promise\ * ****once**(emitter, eventName, options): Promise\ - Inherited from EventEmitter.once Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given event or that is rejected if the `EventEmitter` emits `'error'` while waiting. The `Promise` will resolve with an array of all the arguments emitted to the given event. This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event semantics and does not listen to the `'error'` event. ``` import { once, EventEmitter } from 'node:events'; import process from 'node:process'; const ee = new EventEmitter(); process.nextTick(() => { ee.emit('myevent', 42); }); const [value] = await once(ee, 'myevent'); console.log(value); const err = new Error('kaboom'); process.nextTick(() => { ee.emit('error', err); }); try { await once(ee, 'myevent'); } catch (err) { console.error('error happened', err); } ``` The special handling of the `'error'` event is only used when `events.once()` is used to wait for another event. If `events.once()` is used to wait for the '`error'` event itself, then it is treated as any other kind of event without special handling: ``` import { EventEmitter, once } from 'node:events'; const ee = new EventEmitter(); once(ee, 'error') .then(([err]) => console.log('ok', err.message)) .catch((err) => console.error('error', err.message)); ee.emit('error', new Error('boom')); // Prints: ok boom ``` An `AbortSignal` can be used to cancel waiting for the event: ``` import { EventEmitter, once } from 'node:events'; const ee = new EventEmitter(); const ac = new AbortController(); async function foo(emitter, event, signal) { try { await once(emitter, event, { signal }); console.log('event emitted!'); } catch (error) { if (error.name === 'AbortError') { console.error('Waiting for the event was canceled!'); } else { console.error('There was an error', error.message); } } } foo(ee, 'foo', ac.signal); ac.abort(); // Abort waiting for the event ee.emit('foo'); // Prints: Waiting for the event was canceled! ``` * **@since** v11.13.0, v10.16.0 *** #### Parameters * ##### externalemitter: EventEmitter\ * ##### externaleventName: string | symbol * ##### externaloptionaloptions: StaticEventEmitterOptions #### Returns Promise\ ### [**](#setMaxListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L402)staticexternalinheritedsetMaxListeners * ****setMaxListeners**(n, ...eventTargets): void - Inherited from EventEmitter.setMaxListeners ``` import { setMaxListeners, EventEmitter } from 'node:events'; const target = new EventTarget(); const emitter = new EventEmitter(); setMaxListeners(5, target, emitter); ``` * **@since** v15.4.0 *** #### Parameters * ##### externaloptionaln: number A non-negative number. The maximum number of listeners per `EventTarget` event. * ##### externalrest...eventTargets: (EventEmitter\ | EventTarget)\[] Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} objects. #### Returns void --- # Source: https://docs.apify.com/api/client/js/reference/class/LoggerActorRedirect.md # LoggerActorRedirect Logger for redirected actor logs. ### Hierarchy * Logger * *LoggerActorRedirect* ## Index[**](#Index) ### Constructors * [**constructor](#constructor) ### Properties * [**captureRejections](#captureRejections) * [**captureRejectionSymbol](#captureRejectionSymbol) * [**defaultMaxListeners](#defaultMaxListeners) * [**errorMonitor](#errorMonitor) ### Methods * [**\_log](#_log) * [**\_outputWithConsole](#_outputWithConsole) * [**\[captureRejectionSymbol\]](#\[captureRejectionSymbol]) * [**addListener](#addListener) * [**emit](#emit) * [**eventNames](#eventNames) * [**getMaxListeners](#getMaxListeners) * [**getOptions](#getOptions) * [**listenerCount](#listenerCount) * [**listeners](#listeners) * [**log](#log) * [**off](#off) * [**on](#on) * [**once](#once) * [**prependListener](#prependListener) * [**prependOnceListener](#prependOnceListener) * [**rawListeners](#rawListeners) * [**removeAllListeners](#removeAllListeners) * [**removeListener](#removeListener) * [**setMaxListeners](#setMaxListeners) * [**setOptions](#setOptions) * [**addAbortListener](#addAbortListener) * [**getEventListeners](#getEventListeners) * [**getMaxListeners](#getMaxListeners) * [**listenerCount](#listenerCount) * [**on](#on) * [**once](#once) * [**setMaxListeners](#setMaxListeners) ## Constructors[**](#Constructors) ### [**](#constructor)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/log.ts#L114)constructor * ****new LoggerActorRedirect**(options): [LoggerActorRedirect](https://docs.apify.com/api/client/js/api/client/js/reference/class/LoggerActorRedirect.md) - Overrides Logger.constructor #### Parameters * ##### options: {} = {} #### Returns [LoggerActorRedirect](https://docs.apify.com/api/client/js/api/client/js/reference/class/LoggerActorRedirect.md) ## Properties[**](#Properties) ### [**](#captureRejections)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L425)staticexternalinheritedcaptureRejections **captureRejections: boolean Inherited from Logger.captureRejections Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) Change the default `captureRejections` option on all new `EventEmitter` objects. * **@since** v13.4.0, v12.16.0 ### [**](#captureRejectionSymbol)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L418)staticexternalreadonlyinheritedcaptureRejectionSymbol **captureRejectionSymbol: typeof captureRejectionSymbol Inherited from Logger.captureRejectionSymbol Value: `Symbol.for('nodejs.rejection')` See how to write a custom `rejection handler`. * **@since** v13.4.0, v12.16.0 ### [**](#defaultMaxListeners)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L464)staticexternalinheriteddefaultMaxListeners **defaultMaxListeners: number Inherited from Logger.defaultMaxListeners By default, a maximum of `10` listeners can be registered for any single event. This limit can be changed for individual `EventEmitter` instances using the `emitter.setMaxListeners(n)` method. To change the default for *all*`EventEmitter` instances, the `events.defaultMaxListeners` property can be used. If this value is not a positive number, a `RangeError` is thrown. Take caution when setting the `events.defaultMaxListeners` because the change affects *all* `EventEmitter` instances, including those created before the change is made. However, calling `emitter.setMaxListeners(n)` still has precedence over `events.defaultMaxListeners`. This is not a hard limit. The `EventEmitter` instance will allow more listeners to be added but will output a trace warning to stderr indicating that a "possible EventEmitter memory leak" has been detected. For any single `EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` methods can be used to temporarily avoid this warning: ``` import { EventEmitter } from 'node:events'; const emitter = new EventEmitter(); emitter.setMaxListeners(emitter.getMaxListeners() + 1); emitter.once('event', () => { // do stuff emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); }); ``` The `--trace-warnings` command-line flag can be used to display the stack trace for such warnings. The emitted warning can be inspected with `process.on('warning')` and will have the additional `emitter`, `type`, and `count` properties, referring to the event emitter instance, the event's name and the number of attached listeners, respectively. Its `name` property is set to `'MaxListenersExceededWarning'`. * **@since** v0.11.2 ### [**](#errorMonitor)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L411)staticexternalreadonlyinheritederrorMonitor **errorMonitor: typeof errorMonitor Inherited from Logger.errorMonitor This symbol shall be used to install a listener for only monitoring `'error'` events. Listeners installed using this symbol are called before the regular `'error'` listeners are called. Installing a listener using this symbol does not change the behavior once an `'error'` event is emitted. Therefore, the process will still crash if no regular `'error'` listener is installed. * **@since** v13.6.0, v12.17.0 ## Methods[**](#Methods) ### [**](#_log)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/log.ts#L118)\_log * ****\_log**(level, message, data, exception, opts): undefined | string - Overrides Logger.\_log #### Parameters * ##### level: LogLevel * ##### message: string * ##### optionaldata: any * ##### optionalexception: unknown * ##### opts: Record\ = {} #### Returns undefined | string ### [**](#_outputWithConsole)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@apify/log/src/index.d.ts#L49)externalinherited\_outputWithConsole * ****\_outputWithConsole**(level, line): void - Inherited from Logger.\_outputWithConsole #### Parameters * ##### externallevel: LogLevel * ##### externalline: string #### Returns void ### [**](#\[captureRejectionSymbol])[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L103)externaloptionalinherited\[captureRejectionSymbol] * ****\[captureRejectionSymbol]**\(error, event, ...args): void - Inherited from Logger.\[captureRejectionSymbol] #### Parameters * ##### externalerror: Error * ##### externalevent: string | symbol * ##### externalrest...args: AnyRest #### Returns void ### [**](#addListener)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L642)externalinheritedaddListener * ****addListener**\(eventName, listener): this - Inherited from Logger.addListener Alias for `emitter.on(eventName, listener)`. * **@since** v0.1.26 *** #### Parameters * ##### externaleventName: string | symbol * ##### externallistener: (...args) => void #### Returns this ### [**](#emit)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L904)externalinheritedemit * ****emit**\(eventName, ...args): boolean - Inherited from Logger.emit Synchronously calls each of the listeners registered for the event named `eventName`, in the order they were registered, passing the supplied arguments to each. Returns `true` if the event had listeners, `false` otherwise. ``` import { EventEmitter } from 'node:events'; const myEmitter = new EventEmitter(); // First listener myEmitter.on('event', function firstListener() { console.log('Helloooo! first listener'); }); // Second listener myEmitter.on('event', function secondListener(arg1, arg2) { console.log(`event with parameters ${arg1}, ${arg2} in second listener`); }); // Third listener myEmitter.on('event', function thirdListener(...args) { const parameters = args.join(', '); console.log(`event with parameters ${parameters} in third listener`); }); console.log(myEmitter.listeners('event')); myEmitter.emit('event', 1, 2, 3, 4, 5); // Prints: // [ // [Function: firstListener], // [Function: secondListener], // [Function: thirdListener] // ] // Helloooo! first listener // event with parameters 1, 2 in second listener // event with parameters 1, 2, 3, 4, 5 in third listener ``` * **@since** v0.1.26 *** #### Parameters * ##### externaleventName: string | symbol * ##### externalrest...args: AnyRest #### Returns boolean ### [**](#eventNames)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L967)externalinheritedeventNames * ****eventNames**(): (string | symbol)\[] - Inherited from Logger.eventNames Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or `Symbol`s. ``` import { EventEmitter } from 'node:events'; const myEE = new EventEmitter(); myEE.on('foo', () => {}); myEE.on('bar', () => {}); const sym = Symbol('symbol'); myEE.on(sym, () => {}); console.log(myEE.eventNames()); // Prints: [ 'foo', 'bar', Symbol(symbol) ] ``` * **@since** v6.0.0 *** #### Returns (string | symbol)\[] ### [**](#getMaxListeners)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L819)externalinheritedgetMaxListeners * ****getMaxListeners**(): number - Inherited from Logger.getMaxListeners Returns the current max listener value for the `EventEmitter` which is either set by `emitter.setMaxListeners(n)` or defaults to EventEmitter.defaultMaxListeners. * **@since** v1.0.0 *** #### Returns number ### [**](#getOptions)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@apify/log/src/index.d.ts#L48)externalinheritedgetOptions * ****getOptions**(): Record\ - Inherited from Logger.getOptions #### Returns Record\ ### [**](#listenerCount)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L913)externalinheritedlistenerCount * ****listenerCount**\(eventName, listener): number - Inherited from Logger.listenerCount Returns the number of listeners listening for the event named `eventName`. If `listener` is provided, it will return how many times the listener is found in the list of the listeners of the event. * **@since** v3.2.0 *** #### Parameters * ##### externaleventName: string | symbol The name of the event being listened for * ##### externaloptionallistener: Function The event handler function #### Returns number ### [**](#listeners)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L832)externalinheritedlisteners * ****listeners**\(eventName): Function\[] - Inherited from Logger.listeners Returns a copy of the array of listeners for the event named `eventName`. ``` server.on('connection', (stream) => { console.log('someone connected!'); }); console.log(util.inspect(server.listeners('connection'))); // Prints: [ [Function] ] ``` * **@since** v0.1.26 *** #### Parameters * ##### externaleventName: string | symbol #### Returns Function\[] ### [**](#log)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@apify/log/src/index.d.ts#L51)externalinheritedlog * ****log**(level, message, ...args): void - Inherited from Logger.log #### Parameters * ##### externallevel: LogLevel * ##### externalmessage: string * ##### externalrest...args: any\[] #### Returns void ### [**](#off)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L792)externalinheritedoff * ****off**\(eventName, listener): this - Inherited from Logger.off Alias for `emitter.removeListener()`. * **@since** v10.0.0 *** #### Parameters * ##### externaleventName: string | symbol * ##### externallistener: (...args) => void #### Returns this ### [**](#on)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L674)externalinheritedon * ****on**\(eventName, listener): this - Inherited from Logger.on Adds the `listener` function to the end of the listeners array for the event named `eventName`. No checks are made to see if the `listener` has already been added. Multiple calls passing the same combination of `eventName` and `listener` will result in the `listener` being added, and called, multiple times. ``` server.on('connection', (stream) => { console.log('someone connected!'); }); ``` Returns a reference to the `EventEmitter`, so that calls can be chained. By default, event listeners are invoked in the order they are added. The `emitter.prependListener()` method can be used as an alternative to add the event listener to the beginning of the listeners array. ``` import { EventEmitter } from 'node:events'; const myEE = new EventEmitter(); myEE.on('foo', () => console.log('a')); myEE.prependListener('foo', () => console.log('b')); myEE.emit('foo'); // Prints: // b // a ``` * **@since** v0.1.101 *** #### Parameters * ##### externaleventName: string | symbol The name of the event. * ##### externallistener: (...args) => void The callback function #### Returns this ### [**](#once)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L704)externalinheritedonce * ****once**\(eventName, listener): this - Inherited from Logger.once Adds a **one-time** `listener` function for the event named `eventName`. The next time `eventName` is triggered, this listener is removed and then invoked. ``` server.once('connection', (stream) => { console.log('Ah, we have our first user!'); }); ``` Returns a reference to the `EventEmitter`, so that calls can be chained. By default, event listeners are invoked in the order they are added. The `emitter.prependOnceListener()` method can be used as an alternative to add the event listener to the beginning of the listeners array. ``` import { EventEmitter } from 'node:events'; const myEE = new EventEmitter(); myEE.once('foo', () => console.log('a')); myEE.prependOnceListener('foo', () => console.log('b')); myEE.emit('foo'); // Prints: // b // a ``` * **@since** v0.3.0 *** #### Parameters * ##### externaleventName: string | symbol The name of the event. * ##### externallistener: (...args) => void The callback function #### Returns this ### [**](#prependListener)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L931)externalinheritedprependListener * ****prependListener**\(eventName, listener): this - Inherited from Logger.prependListener Adds the `listener` function to the *beginning* of the listeners array for the event named `eventName`. No checks are made to see if the `listener` has already been added. Multiple calls passing the same combination of `eventName` and `listener` will result in the `listener` being added, and called, multiple times. ``` server.prependListener('connection', (stream) => { console.log('someone connected!'); }); ``` Returns a reference to the `EventEmitter`, so that calls can be chained. * **@since** v6.0.0 *** #### Parameters * ##### externaleventName: string | symbol The name of the event. * ##### externallistener: (...args) => void The callback function #### Returns this ### [**](#prependOnceListener)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L947)externalinheritedprependOnceListener * ****prependOnceListener**\(eventName, listener): this - Inherited from Logger.prependOnceListener Adds a **one-time**`listener` function for the event named `eventName` to the *beginning* of the listeners array. The next time `eventName` is triggered, this listener is removed, and then invoked. ``` server.prependOnceListener('connection', (stream) => { console.log('Ah, we have our first user!'); }); ``` Returns a reference to the `EventEmitter`, so that calls can be chained. * **@since** v6.0.0 *** #### Parameters * ##### externaleventName: string | symbol The name of the event. * ##### externallistener: (...args) => void The callback function #### Returns this ### [**](#rawListeners)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L863)externalinheritedrawListeners * ****rawListeners**\(eventName): Function\[] - Inherited from Logger.rawListeners Returns a copy of the array of listeners for the event named `eventName`, including any wrappers (such as those created by `.once()`). ``` import { EventEmitter } from 'node:events'; const emitter = new EventEmitter(); emitter.once('log', () => console.log('log once')); // Returns a new Array with a function `onceWrapper` which has a property // `listener` which contains the original listener bound above const listeners = emitter.rawListeners('log'); const logFnWrapper = listeners[0]; // Logs "log once" to the console and does not unbind the `once` event logFnWrapper.listener(); // Logs "log once" to the console and removes the listener logFnWrapper(); emitter.on('log', () => console.log('log persistently')); // Will return a new Array with a single function bound by `.on()` above const newListeners = emitter.rawListeners('log'); // Logs "log persistently" twice newListeners[0](); emitter.emit('log'); ``` * **@since** v9.4.0 *** #### Parameters * ##### externaleventName: string | symbol #### Returns Function\[] ### [**](#removeAllListeners)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L803)externalinheritedremoveAllListeners * ****removeAllListeners**(eventName): this - Inherited from Logger.removeAllListeners Removes all listeners, or those of the specified `eventName`. It is bad practice to remove listeners added elsewhere in the code, particularly when the `EventEmitter` instance was created by some other component or module (e.g. sockets or file streams). Returns a reference to the `EventEmitter`, so that calls can be chained. * **@since** v0.1.26 *** #### Parameters * ##### externaloptionaleventName: string | symbol #### Returns this ### [**](#removeListener)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L787)externalinheritedremoveListener * ****removeListener**\(eventName, listener): this - Inherited from Logger.removeListener Removes the specified `listener` from the listener array for the event named `eventName`. ``` const callback = (stream) => { console.log('someone connected!'); }; server.on('connection', callback); // ... server.removeListener('connection', callback); ``` `removeListener()` will remove, at most, one instance of a listener from the listener array. If any single listener has been added multiple times to the listener array for the specified `eventName`, then `removeListener()` must be called multiple times to remove each instance. Once an event is emitted, all listeners attached to it at the time of emitting are called in order. This implies that any `removeListener()` or `removeAllListeners()` calls *after* emitting and *before* the last listener finishes execution will not remove them from`emit()` in progress. Subsequent events behave as expected. ``` import { EventEmitter } from 'node:events'; class MyEmitter extends EventEmitter {} const myEmitter = new MyEmitter(); const callbackA = () => { console.log('A'); myEmitter.removeListener('event', callbackB); }; const callbackB = () => { console.log('B'); }; myEmitter.on('event', callbackA); myEmitter.on('event', callbackB); // callbackA removes listener callbackB but it will still be called. // Internal listener array at time of emit [callbackA, callbackB] myEmitter.emit('event'); // Prints: // A // B // callbackB is now removed. // Internal listener array [callbackA] myEmitter.emit('event'); // Prints: // A ``` Because listeners are managed using an internal array, calling this will change the position indices of any listener registered *after* the listener being removed. This will not impact the order in which listeners are called, but it means that any copies of the listener array as returned by the `emitter.listeners()` method will need to be recreated. When a single function has been added as a handler multiple times for a single event (as in the example below), `removeListener()` will remove the most recently added instance. In the example the `once('ping')` listener is removed: ``` import { EventEmitter } from 'node:events'; const ee = new EventEmitter(); function pong() { console.log('pong'); } ee.on('ping', pong); ee.once('ping', pong); ee.removeListener('ping', pong); ee.emit('ping'); ee.emit('ping'); ``` Returns a reference to the `EventEmitter`, so that calls can be chained. * **@since** v0.1.26 *** #### Parameters * ##### externaleventName: string | symbol * ##### externallistener: (...args) => void #### Returns this ### [**](#setMaxListeners)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L813)externalinheritedsetMaxListeners * ****setMaxListeners**(n): this - Inherited from Logger.setMaxListeners By default `EventEmitter`s will print a warning if more than `10` listeners are added for a particular event. This is a useful default that helps finding memory leaks. The `emitter.setMaxListeners()` method allows the limit to be modified for this specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) to indicate an unlimited number of listeners. Returns a reference to the `EventEmitter`, so that calls can be chained. * **@since** v0.3.5 *** #### Parameters * ##### externaln: number #### Returns this ### [**](#setOptions)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@apify/log/src/index.d.ts#L47)externalinheritedsetOptions * ****setOptions**(options): void - Inherited from Logger.setOptions #### Parameters * ##### externaloptions: Record\ #### Returns void ### [**](#addAbortListener)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L403)staticexternalinheritedaddAbortListener * ****addAbortListener**(signal, resource): Disposable - Inherited from Logger.addAbortListener Listens once to the `abort` event on the provided `signal`. Listening to the `abort` event on abort signals is unsafe and may lead to resource leaks since another third party with the signal can call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change this since it would violate the web standard. Additionally, the original API makes it easy to forget to remove listeners. This API allows safely using `AbortSignal`s in Node.js APIs by solving these two issues by listening to the event such that `stopImmediatePropagation` does not prevent the listener from running. Returns a disposable so that it may be unsubscribed from more easily. ``` import { addAbortListener } from 'node:events'; function example(signal) { let disposable; try { signal.addEventListener('abort', (e) => e.stopImmediatePropagation()); disposable = addAbortListener(signal, (e) => { // Do something when signal is aborted. }); } finally { disposable?.[Symbol.dispose](); } } ``` * **@since** v20.5.0 *** #### Parameters * ##### externalsignal: AbortSignal * ##### externalresource: (event) => void #### Returns Disposable Disposable that removes the `abort` listener. ### [**](#getEventListeners)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L325)staticexternalinheritedgetEventListeners * ****getEventListeners**(emitter, name): Function\[] - Inherited from Logger.getEventListeners Returns a copy of the array of listeners for the event named `eventName`. For `EventEmitter`s this behaves exactly the same as calling `.listeners` on the emitter. For `EventTarget`s this is the only way to get the event listeners for the event target. This is useful for debugging and diagnostic purposes. ``` import { getEventListeners, EventEmitter } from 'node:events'; { const ee = new EventEmitter(); const listener = () => console.log('Events are fun'); ee.on('foo', listener); console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ] } { const et = new EventTarget(); const listener = () => console.log('Events are fun'); et.addEventListener('foo', listener); console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ] } ``` * **@since** v15.2.0, v14.17.0 *** #### Parameters * ##### externalemitter: EventEmitter\ | EventTarget * ##### externalname: string | symbol #### Returns Function\[] ### [**](#getMaxListeners)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L354)staticexternalinheritedgetMaxListeners * ****getMaxListeners**(emitter): number - Inherited from Logger.getMaxListeners Returns the currently set max amount of listeners. For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on the emitter. For `EventTarget`s this is the only way to get the max event listeners for the event target. If the number of event handlers on a single EventTarget exceeds the max set, the EventTarget will print a warning. ``` import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events'; { const ee = new EventEmitter(); console.log(getMaxListeners(ee)); // 10 setMaxListeners(11, ee); console.log(getMaxListeners(ee)); // 11 } { const et = new EventTarget(); console.log(getMaxListeners(et)); // 10 setMaxListeners(11, et); console.log(getMaxListeners(et)); // 11 } ``` * **@since** v19.9.0 *** #### Parameters * ##### externalemitter: EventEmitter\ | EventTarget #### Returns number ### [**](#listenerCount)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L297)staticexternalinheritedlistenerCount * ****listenerCount**(emitter, eventName): number - Inherited from Logger.listenerCount A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`. ``` import { EventEmitter, listenerCount } from 'node:events'; const myEmitter = new EventEmitter(); myEmitter.on('event', () => {}); myEmitter.on('event', () => {}); console.log(listenerCount(myEmitter, 'event')); // Prints: 2 ``` * **@since** v0.9.12 * **@deprecated** Since v3.2.0 - Use `listenerCount` instead. *** #### Parameters * ##### externalemitter: EventEmitter\ The emitter to query * ##### externaleventName: string | symbol The event name #### Returns number ### [**](#on)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L270)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L275)staticexternalinheritedon * ****on**(emitter, eventName, options): AsyncIterator\ * ****on**(emitter, eventName, options): AsyncIterator\ - Inherited from Logger.on ``` import { on, EventEmitter } from 'node:events'; import process from 'node:process'; const ee = new EventEmitter(); // Emit later on process.nextTick(() => { ee.emit('foo', 'bar'); ee.emit('foo', 42); }); for await (const event of on(ee, 'foo')) { // The execution of this inner block is synchronous and it // processes one event at a time (even with await). Do not use // if concurrent execution is required. console.log(event); // prints ['bar'] [42] } // Unreachable here ``` Returns an `AsyncIterator` that iterates `eventName` events. It will throw if the `EventEmitter` emits `'error'`. It removes all listeners when exiting the loop. The `value` returned by each iteration is an array composed of the emitted event arguments. An `AbortSignal` can be used to cancel waiting on events: ``` import { on, EventEmitter } from 'node:events'; import process from 'node:process'; const ac = new AbortController(); (async () => { const ee = new EventEmitter(); // Emit later on process.nextTick(() => { ee.emit('foo', 'bar'); ee.emit('foo', 42); }); for await (const event of on(ee, 'foo', { signal: ac.signal })) { // The execution of this inner block is synchronous and it // processes one event at a time (even with await). Do not use // if concurrent execution is required. console.log(event); // prints ['bar'] [42] } // Unreachable here })(); process.nextTick(() => ac.abort()); ``` Use the `close` option to specify an array of event names that will end the iteration: ``` import { on, EventEmitter } from 'node:events'; import process from 'node:process'; const ee = new EventEmitter(); // Emit later on process.nextTick(() => { ee.emit('foo', 'bar'); ee.emit('foo', 42); ee.emit('close'); }); for await (const event of on(ee, 'foo', { close: ['close'] })) { console.log(event); // prints ['bar'] [42] } // the loop will exit after 'close' is emitted console.log('done'); // prints 'done' ``` * **@since** v13.6.0, v12.16.0 *** #### Parameters * ##### externalemitter: EventEmitter\ * ##### externaleventName: string | symbol * ##### externaloptionaloptions: StaticEventEmitterIteratorOptions #### Returns AsyncIterator\ An `AsyncIterator` that iterates `eventName` events emitted by the `emitter` ### [**](#once)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L184)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L189)staticexternalinheritedonce * ****once**(emitter, eventName, options): Promise\ * ****once**(emitter, eventName, options): Promise\ - Inherited from Logger.once Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given event or that is rejected if the `EventEmitter` emits `'error'` while waiting. The `Promise` will resolve with an array of all the arguments emitted to the given event. This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event semantics and does not listen to the `'error'` event. ``` import { once, EventEmitter } from 'node:events'; import process from 'node:process'; const ee = new EventEmitter(); process.nextTick(() => { ee.emit('myevent', 42); }); const [value] = await once(ee, 'myevent'); console.log(value); const err = new Error('kaboom'); process.nextTick(() => { ee.emit('error', err); }); try { await once(ee, 'myevent'); } catch (err) { console.error('error happened', err); } ``` The special handling of the `'error'` event is only used when `events.once()` is used to wait for another event. If `events.once()` is used to wait for the '`error'` event itself, then it is treated as any other kind of event without special handling: ``` import { EventEmitter, once } from 'node:events'; const ee = new EventEmitter(); once(ee, 'error') .then(([err]) => console.log('ok', err.message)) .catch((err) => console.error('error', err.message)); ee.emit('error', new Error('boom')); // Prints: ok boom ``` An `AbortSignal` can be used to cancel waiting for the event: ``` import { EventEmitter, once } from 'node:events'; const ee = new EventEmitter(); const ac = new AbortController(); async function foo(emitter, event, signal) { try { await once(emitter, event, { signal }); console.log('event emitted!'); } catch (error) { if (error.name === 'AbortError') { console.error('Waiting for the event was canceled!'); } else { console.error('There was an error', error.message); } } } foo(ee, 'foo', ac.signal); ac.abort(); // Abort waiting for the event ee.emit('foo'); // Prints: Waiting for the event was canceled! ``` * **@since** v11.13.0, v10.16.0 *** #### Parameters * ##### externalemitter: EventEmitter\ * ##### externaleventName: string | symbol * ##### externaloptionaloptions: StaticEventEmitterOptions #### Returns Promise\ ### [**](#setMaxListeners)[**](https://undefined/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/node_modules/@types/node/events.d.ts#L369)staticexternalinheritedsetMaxListeners * ****setMaxListeners**(n, ...eventTargets): void - Inherited from Logger.setMaxListeners ``` import { setMaxListeners, EventEmitter } from 'node:events'; const target = new EventTarget(); const emitter = new EventEmitter(); setMaxListeners(5, target, emitter); ``` * **@since** v15.4.0 *** #### Parameters * ##### externaloptionaln: number A non-negative number. The maximum number of listeners per `EventTarget` event. * ##### externalrest...eventTargets: (EventEmitter\ | EventTarget)\[] Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} objects. #### Returns void --- # Source: https://docs.apify.com/sdk/js/reference/class/LoggerJson.md # externalLoggerJson This is an abstract class that should be extended by custom logger classes. this.\_log() method must be implemented by them. ### Hierarchy * [Logger](https://docs.apify.com/sdk/js/sdk/js/reference/class/Logger.md) * *LoggerJson* ## Index[**](#Index) ### Constructors * [**constructor](#constructor) ### Properties * [**captureRejections](#captureRejections) * [**captureRejectionSymbol](#captureRejectionSymbol) * [**defaultMaxListeners](#defaultMaxListeners) * [**errorMonitor](#errorMonitor) ### Methods * [**\_log](#_log) * [**\_outputWithConsole](#_outputWithConsole) * [**\[captureRejectionSymbol\]](#\[captureRejectionSymbol]) * [**addListener](#addListener) * [**emit](#emit) * [**eventNames](#eventNames) * [**getMaxListeners](#getMaxListeners) * [**getOptions](#getOptions) * [**listenerCount](#listenerCount) * [**listeners](#listeners) * [**log](#log) * [**off](#off) * [**on](#on) * [**once](#once) * [**prependListener](#prependListener) * [**prependOnceListener](#prependOnceListener) * [**rawListeners](#rawListeners) * [**removeAllListeners](#removeAllListeners) * [**removeListener](#removeListener) * [**setMaxListeners](#setMaxListeners) * [**setOptions](#setOptions) * [**addAbortListener](#addAbortListener) * [**getEventListeners](#getEventListeners) * [**getMaxListeners](#getMaxListeners) * [**listenerCount](#listenerCount) * [**on](#on) * [**once](#once) * [**setMaxListeners](#setMaxListeners) ## Constructors[**](#Constructors) ### [**](#constructor)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L241)externalconstructor * ****new LoggerJson**(options): [LoggerJson](https://docs.apify.com/sdk/js/sdk/js/reference/class/LoggerJson.md) - Overrides Logger.constructor #### Parameters * ##### externaloptionaloptions: {} #### Returns [LoggerJson](https://docs.apify.com/sdk/js/sdk/js/reference/class/LoggerJson.md) ## Properties[**](#Properties) ### [**](#captureRejections)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L459)staticexternalinheritedcaptureRejections **captureRejections: boolean Inherited from Logger.captureRejections Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) Change the default `captureRejections` option on all new `EventEmitter` objects. * **@since** v13.4.0, v12.16.0 ### [**](#captureRejectionSymbol)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L452)staticexternalreadonlyinheritedcaptureRejectionSymbol **captureRejectionSymbol: typeof captureRejectionSymbol Inherited from Logger.captureRejectionSymbol Value: `Symbol.for('nodejs.rejection')` See how to write a custom `rejection handler`. * **@since** v13.4.0, v12.16.0 ### [**](#defaultMaxListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L498)staticexternalinheriteddefaultMaxListeners **defaultMaxListeners: number Inherited from Logger.defaultMaxListeners By default, a maximum of `10` listeners can be registered for any single event. This limit can be changed for individual `EventEmitter` instances using the `emitter.setMaxListeners(n)` method. To change the default for *all*`EventEmitter` instances, the `events.defaultMaxListeners` property can be used. If this value is not a positive number, a `RangeError` is thrown. Take caution when setting the `events.defaultMaxListeners` because the change affects *all* `EventEmitter` instances, including those created before the change is made. However, calling `emitter.setMaxListeners(n)` still has precedence over `events.defaultMaxListeners`. This is not a hard limit. The `EventEmitter` instance will allow more listeners to be added but will output a trace warning to stderr indicating that a "possible EventEmitter memory leak" has been detected. For any single `EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` methods can be used to temporarily avoid this warning: ``` import { EventEmitter } from 'node:events'; const emitter = new EventEmitter(); emitter.setMaxListeners(emitter.getMaxListeners() + 1); emitter.once('event', () => { // do stuff emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); }); ``` The `--trace-warnings` command-line flag can be used to display the stack trace for such warnings. The emitted warning can be inspected with `process.on('warning')` and will have the additional `emitter`, `type`, and `count` properties, referring to the event emitter instance, the event's name and the number of attached listeners, respectively. Its `name` property is set to `'MaxListenersExceededWarning'`. * **@since** v0.11.2 ### [**](#errorMonitor)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L445)staticexternalreadonlyinheritederrorMonitor **errorMonitor: typeof errorMonitor Inherited from Logger.errorMonitor This symbol shall be used to install a listener for only monitoring `'error'` events. Listeners installed using this symbol are called before the regular `'error'` listeners are called. Installing a listener using this symbol does not change the behavior once an `'error'` event is emitted. Therefore, the process will still crash if no regular `'error'` listener is installed. * **@since** v13.6.0, v12.17.0 ## Methods[**](#Methods) ### [**](#_log)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L242)external\_log * ****\_log**(level, message, data, exception, opts): string - Overrides Logger.\_log #### Parameters * ##### externallevel: [LogLevel](https://docs.apify.com/sdk/js/sdk/js/reference/enum/LogLevel.md) * ##### externalmessage: string * ##### externaloptionaldata: any * ##### externaloptionalexception: unknown * ##### externaloptionalopts: Record\ #### Returns string ### [**](#_outputWithConsole)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L36)externalinherited\_outputWithConsole * ****\_outputWithConsole**(level, line): void - Inherited from Logger.\_outputWithConsole #### Parameters * ##### externallevel: [LogLevel](https://docs.apify.com/sdk/js/sdk/js/reference/enum/LogLevel.md) * ##### externalline: string #### Returns void ### [**](#\[captureRejectionSymbol])[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L136)externaloptionalinherited\[captureRejectionSymbol] * ****\[captureRejectionSymbol]**\(error, event, ...args): void - Inherited from Logger.\[captureRejectionSymbol] #### Parameters * ##### externalerror: Error * ##### externalevent: string | symbol * ##### externalrest...args: AnyRest #### Returns void ### [**](#addListener)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L597)externalinheritedaddListener * ****addListener**\(eventName, listener): this - Inherited from Logger.addListener Alias for `emitter.on(eventName, listener)`. * **@since** v0.1.26 *** #### Parameters * ##### externaleventName: string | symbol * ##### externallistener: (...args) => void #### Returns this ### [**](#emit)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L859)externalinheritedemit * ****emit**\(eventName, ...args): boolean - Inherited from Logger.emit Synchronously calls each of the listeners registered for the event named `eventName`, in the order they were registered, passing the supplied arguments to each. Returns `true` if the event had listeners, `false` otherwise. ``` import { EventEmitter } from 'node:events'; const myEmitter = new EventEmitter(); // First listener myEmitter.on('event', function firstListener() { console.log('Helloooo! first listener'); }); // Second listener myEmitter.on('event', function secondListener(arg1, arg2) { console.log(`event with parameters ${arg1}, ${arg2} in second listener`); }); // Third listener myEmitter.on('event', function thirdListener(...args) { const parameters = args.join(', '); console.log(`event with parameters ${parameters} in third listener`); }); console.log(myEmitter.listeners('event')); myEmitter.emit('event', 1, 2, 3, 4, 5); // Prints: // [ // [Function: firstListener], // [Function: secondListener], // [Function: thirdListener] // ] // Helloooo! first listener // event with parameters 1, 2 in second listener // event with parameters 1, 2, 3, 4, 5 in third listener ``` * **@since** v0.1.26 *** #### Parameters * ##### externaleventName: string | symbol * ##### externalrest...args: AnyRest #### Returns boolean ### [**](#eventNames)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L922)externalinheritedeventNames * ****eventNames**(): (string | symbol)\[] - Inherited from Logger.eventNames Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or `Symbol`s. ``` import { EventEmitter } from 'node:events'; const myEE = new EventEmitter(); myEE.on('foo', () => {}); myEE.on('bar', () => {}); const sym = Symbol('symbol'); myEE.on(sym, () => {}); console.log(myEE.eventNames()); // Prints: [ 'foo', 'bar', Symbol(symbol) ] ``` * **@since** v6.0.0 *** #### Returns (string | symbol)\[] ### [**](#getMaxListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L774)externalinheritedgetMaxListeners * ****getMaxListeners**(): number - Inherited from Logger.getMaxListeners Returns the current max listener value for the `EventEmitter` which is either set by `emitter.setMaxListeners(n)` or defaults to defaultMaxListeners. * **@since** v1.0.0 *** #### Returns number ### [**](#getOptions)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L35)externalinheritedgetOptions * ****getOptions**(): Record\ - Inherited from Logger.getOptions #### Returns Record\ ### [**](#listenerCount)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L868)externalinheritedlistenerCount * ****listenerCount**\(eventName, listener): number - Inherited from Logger.listenerCount Returns the number of listeners listening for the event named `eventName`. If `listener` is provided, it will return how many times the listener is found in the list of the listeners of the event. * **@since** v3.2.0 *** #### Parameters * ##### externaleventName: string | symbol The name of the event being listened for * ##### externaloptionallistener: Function The event handler function #### Returns number ### [**](#listeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L787)externalinheritedlisteners * ****listeners**\(eventName): Function\[] - Inherited from Logger.listeners Returns a copy of the array of listeners for the event named `eventName`. ``` server.on('connection', (stream) => { console.log('someone connected!'); }); console.log(util.inspect(server.listeners('connection'))); // Prints: [ [Function] ] ``` * **@since** v0.1.26 *** #### Parameters * ##### externaleventName: string | symbol #### Returns Function\[] ### [**](#log)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L38)externalinheritedlog * ****log**(level, message, ...args): void - Inherited from Logger.log #### Parameters * ##### externallevel: [LogLevel](https://docs.apify.com/sdk/js/sdk/js/reference/enum/LogLevel.md) * ##### externalmessage: string * ##### externalrest...args: any\[] #### Returns void ### [**](#off)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L747)externalinheritedoff * ****off**\(eventName, listener): this - Inherited from Logger.off Alias for `emitter.removeListener()`. * **@since** v10.0.0 *** #### Parameters * ##### externaleventName: string | symbol * ##### externallistener: (...args) => void #### Returns this ### [**](#on)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L629)externalinheritedon * ****on**\(eventName, listener): this - Inherited from Logger.on Adds the `listener` function to the end of the listeners array for the event named `eventName`. No checks are made to see if the `listener` has already been added. Multiple calls passing the same combination of `eventName` and `listener` will result in the `listener` being added, and called, multiple times. ``` server.on('connection', (stream) => { console.log('someone connected!'); }); ``` Returns a reference to the `EventEmitter`, so that calls can be chained. By default, event listeners are invoked in the order they are added. The `emitter.prependListener()` method can be used as an alternative to add the event listener to the beginning of the listeners array. ``` import { EventEmitter } from 'node:events'; const myEE = new EventEmitter(); myEE.on('foo', () => console.log('a')); myEE.prependListener('foo', () => console.log('b')); myEE.emit('foo'); // Prints: // b // a ``` * **@since** v0.1.101 *** #### Parameters * ##### externaleventName: string | symbol The name of the event. * ##### externallistener: (...args) => void The callback function #### Returns this ### [**](#once)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L659)externalinheritedonce * ****once**\(eventName, listener): this - Inherited from Logger.once Adds a **one-time** `listener` function for the event named `eventName`. The next time `eventName` is triggered, this listener is removed and then invoked. ``` server.once('connection', (stream) => { console.log('Ah, we have our first user!'); }); ``` Returns a reference to the `EventEmitter`, so that calls can be chained. By default, event listeners are invoked in the order they are added. The `emitter.prependOnceListener()` method can be used as an alternative to add the event listener to the beginning of the listeners array. ``` import { EventEmitter } from 'node:events'; const myEE = new EventEmitter(); myEE.once('foo', () => console.log('a')); myEE.prependOnceListener('foo', () => console.log('b')); myEE.emit('foo'); // Prints: // b // a ``` * **@since** v0.3.0 *** #### Parameters * ##### externaleventName: string | symbol The name of the event. * ##### externallistener: (...args) => void The callback function #### Returns this ### [**](#prependListener)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L886)externalinheritedprependListener * ****prependListener**\(eventName, listener): this - Inherited from Logger.prependListener Adds the `listener` function to the *beginning* of the listeners array for the event named `eventName`. No checks are made to see if the `listener` has already been added. Multiple calls passing the same combination of `eventName` and `listener` will result in the `listener` being added, and called, multiple times. ``` server.prependListener('connection', (stream) => { console.log('someone connected!'); }); ``` Returns a reference to the `EventEmitter`, so that calls can be chained. * **@since** v6.0.0 *** #### Parameters * ##### externaleventName: string | symbol The name of the event. * ##### externallistener: (...args) => void The callback function #### Returns this ### [**](#prependOnceListener)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L902)externalinheritedprependOnceListener * ****prependOnceListener**\(eventName, listener): this - Inherited from Logger.prependOnceListener Adds a **one-time**`listener` function for the event named `eventName` to the *beginning* of the listeners array. The next time `eventName` is triggered, this listener is removed, and then invoked. ``` server.prependOnceListener('connection', (stream) => { console.log('Ah, we have our first user!'); }); ``` Returns a reference to the `EventEmitter`, so that calls can be chained. * **@since** v6.0.0 *** #### Parameters * ##### externaleventName: string | symbol The name of the event. * ##### externallistener: (...args) => void The callback function #### Returns this ### [**](#rawListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L818)externalinheritedrawListeners * ****rawListeners**\(eventName): Function\[] - Inherited from Logger.rawListeners Returns a copy of the array of listeners for the event named `eventName`, including any wrappers (such as those created by `.once()`). ``` import { EventEmitter } from 'node:events'; const emitter = new EventEmitter(); emitter.once('log', () => console.log('log once')); // Returns a new Array with a function `onceWrapper` which has a property // `listener` which contains the original listener bound above const listeners = emitter.rawListeners('log'); const logFnWrapper = listeners[0]; // Logs "log once" to the console and does not unbind the `once` event logFnWrapper.listener(); // Logs "log once" to the console and removes the listener logFnWrapper(); emitter.on('log', () => console.log('log persistently')); // Will return a new Array with a single function bound by `.on()` above const newListeners = emitter.rawListeners('log'); // Logs "log persistently" twice newListeners[0](); emitter.emit('log'); ``` * **@since** v9.4.0 *** #### Parameters * ##### externaleventName: string | symbol #### Returns Function\[] ### [**](#removeAllListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L758)externalinheritedremoveAllListeners * ****removeAllListeners**(eventName): this - Inherited from Logger.removeAllListeners Removes all listeners, or those of the specified `eventName`. It is bad practice to remove listeners added elsewhere in the code, particularly when the `EventEmitter` instance was created by some other component or module (e.g. sockets or file streams). Returns a reference to the `EventEmitter`, so that calls can be chained. * **@since** v0.1.26 *** #### Parameters * ##### externaloptionaleventName: string | symbol #### Returns this ### [**](#removeListener)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L742)externalinheritedremoveListener * ****removeListener**\(eventName, listener): this - Inherited from Logger.removeListener Removes the specified `listener` from the listener array for the event named `eventName`. ``` const callback = (stream) => { console.log('someone connected!'); }; server.on('connection', callback); // ... server.removeListener('connection', callback); ``` `removeListener()` will remove, at most, one instance of a listener from the listener array. If any single listener has been added multiple times to the listener array for the specified `eventName`, then `removeListener()` must be called multiple times to remove each instance. Once an event is emitted, all listeners attached to it at the time of emitting are called in order. This implies that any `removeListener()` or `removeAllListeners()` calls *after* emitting and *before* the last listener finishes execution will not remove them from`emit()` in progress. Subsequent events behave as expected. ``` import { EventEmitter } from 'node:events'; class MyEmitter extends EventEmitter {} const myEmitter = new MyEmitter(); const callbackA = () => { console.log('A'); myEmitter.removeListener('event', callbackB); }; const callbackB = () => { console.log('B'); }; myEmitter.on('event', callbackA); myEmitter.on('event', callbackB); // callbackA removes listener callbackB but it will still be called. // Internal listener array at time of emit [callbackA, callbackB] myEmitter.emit('event'); // Prints: // A // B // callbackB is now removed. // Internal listener array [callbackA] myEmitter.emit('event'); // Prints: // A ``` Because listeners are managed using an internal array, calling this will change the position indices of any listener registered *after* the listener being removed. This will not impact the order in which listeners are called, but it means that any copies of the listener array as returned by the `emitter.listeners()` method will need to be recreated. When a single function has been added as a handler multiple times for a single event (as in the example below), `removeListener()` will remove the most recently added instance. In the example the `once('ping')` listener is removed: ``` import { EventEmitter } from 'node:events'; const ee = new EventEmitter(); function pong() { console.log('pong'); } ee.on('ping', pong); ee.once('ping', pong); ee.removeListener('ping', pong); ee.emit('ping'); ee.emit('ping'); ``` Returns a reference to the `EventEmitter`, so that calls can be chained. * **@since** v0.1.26 *** #### Parameters * ##### externaleventName: string | symbol * ##### externallistener: (...args) => void #### Returns this ### [**](#setMaxListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L768)externalinheritedsetMaxListeners * ****setMaxListeners**(n): this - Inherited from Logger.setMaxListeners By default `EventEmitter`s will print a warning if more than `10` listeners are added for a particular event. This is a useful default that helps finding memory leaks. The `emitter.setMaxListeners()` method allows the limit to be modified for this specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) to indicate an unlimited number of listeners. Returns a reference to the `EventEmitter`, so that calls can be chained. * **@since** v0.3.5 *** #### Parameters * ##### externaln: number #### Returns this ### [**](#setOptions)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L34)externalinheritedsetOptions * ****setOptions**(options): void - Inherited from Logger.setOptions #### Parameters * ##### externaloptions: Record\ #### Returns void ### [**](#addAbortListener)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L437)staticexternalinheritedaddAbortListener * ****addAbortListener**(signal, resource): Disposable - Inherited from Logger.addAbortListener experimental Listens once to the `abort` event on the provided `signal`. Listening to the `abort` event on abort signals is unsafe and may lead to resource leaks since another third party with the signal can call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change this since it would violate the web standard. Additionally, the original API makes it easy to forget to remove listeners. This API allows safely using `AbortSignal`s in Node.js APIs by solving these two issues by listening to the event such that `stopImmediatePropagation` does not prevent the listener from running. Returns a disposable so that it may be unsubscribed from more easily. ``` import { addAbortListener } from 'node:events'; function example(signal) { let disposable; try { signal.addEventListener('abort', (e) => e.stopImmediatePropagation()); disposable = addAbortListener(signal, (e) => { // Do something when signal is aborted. }); } finally { disposable?.[Symbol.dispose](); } } ``` * **@since** v20.5.0 *** #### Parameters * ##### externalsignal: AbortSignal * ##### externalresource: (event) => void #### Returns Disposable Disposable that removes the `abort` listener. ### [**](#getEventListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L358)staticexternalinheritedgetEventListeners * ****getEventListeners**(emitter, name): Function\[] - Inherited from Logger.getEventListeners Returns a copy of the array of listeners for the event named `eventName`. For `EventEmitter`s this behaves exactly the same as calling `.listeners` on the emitter. For `EventTarget`s this is the only way to get the event listeners for the event target. This is useful for debugging and diagnostic purposes. ``` import { getEventListeners, EventEmitter } from 'node:events'; { const ee = new EventEmitter(); const listener = () => console.log('Events are fun'); ee.on('foo', listener); console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ] } { const et = new EventTarget(); const listener = () => console.log('Events are fun'); et.addEventListener('foo', listener); console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ] } ``` * **@since** v15.2.0, v14.17.0 *** #### Parameters * ##### externalemitter: EventEmitter\ | EventTarget * ##### externalname: string | symbol #### Returns Function\[] ### [**](#getMaxListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L387)staticexternalinheritedgetMaxListeners * ****getMaxListeners**(emitter): number - Inherited from Logger.getMaxListeners Returns the currently set max amount of listeners. For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on the emitter. For `EventTarget`s this is the only way to get the max event listeners for the event target. If the number of event handlers on a single EventTarget exceeds the max set, the EventTarget will print a warning. ``` import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events'; { const ee = new EventEmitter(); console.log(getMaxListeners(ee)); // 10 setMaxListeners(11, ee); console.log(getMaxListeners(ee)); // 11 } { const et = new EventTarget(); console.log(getMaxListeners(et)); // 10 setMaxListeners(11, et); console.log(getMaxListeners(et)); // 11 } ``` * **@since** v19.9.0 *** #### Parameters * ##### externalemitter: EventEmitter\ | EventTarget #### Returns number ### [**](#listenerCount)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L330)staticexternalinheritedlistenerCount * ****listenerCount**(emitter, eventName): number - Inherited from Logger.listenerCount A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`. ``` import { EventEmitter, listenerCount } from 'node:events'; const myEmitter = new EventEmitter(); myEmitter.on('event', () => {}); myEmitter.on('event', () => {}); console.log(listenerCount(myEmitter, 'event')); // Prints: 2 ``` * **@since** v0.9.12 * **@deprecated** Since v3.2.0 - Use `listenerCount` instead. *** #### Parameters * ##### externalemitter: EventEmitter\ The emitter to query * ##### externaleventName: string | symbol The event name #### Returns number ### [**](#on)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L303)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L308)staticexternalinheritedon * ****on**(emitter, eventName, options): AsyncIterator\ * ****on**(emitter, eventName, options): AsyncIterator\ - Inherited from Logger.on ``` import { on, EventEmitter } from 'node:events'; import process from 'node:process'; const ee = new EventEmitter(); // Emit later on process.nextTick(() => { ee.emit('foo', 'bar'); ee.emit('foo', 42); }); for await (const event of on(ee, 'foo')) { // The execution of this inner block is synchronous and it // processes one event at a time (even with await). Do not use // if concurrent execution is required. console.log(event); // prints ['bar'] [42] } // Unreachable here ``` Returns an `AsyncIterator` that iterates `eventName` events. It will throw if the `EventEmitter` emits `'error'`. It removes all listeners when exiting the loop. The `value` returned by each iteration is an array composed of the emitted event arguments. An `AbortSignal` can be used to cancel waiting on events: ``` import { on, EventEmitter } from 'node:events'; import process from 'node:process'; const ac = new AbortController(); (async () => { const ee = new EventEmitter(); // Emit later on process.nextTick(() => { ee.emit('foo', 'bar'); ee.emit('foo', 42); }); for await (const event of on(ee, 'foo', { signal: ac.signal })) { // The execution of this inner block is synchronous and it // processes one event at a time (even with await). Do not use // if concurrent execution is required. console.log(event); // prints ['bar'] [42] } // Unreachable here })(); process.nextTick(() => ac.abort()); ``` Use the `close` option to specify an array of event names that will end the iteration: ``` import { on, EventEmitter } from 'node:events'; import process from 'node:process'; const ee = new EventEmitter(); // Emit later on process.nextTick(() => { ee.emit('foo', 'bar'); ee.emit('foo', 42); ee.emit('close'); }); for await (const event of on(ee, 'foo', { close: ['close'] })) { console.log(event); // prints ['bar'] [42] } // the loop will exit after 'close' is emitted console.log('done'); // prints 'done' ``` * **@since** v13.6.0, v12.16.0 *** #### Parameters * ##### externalemitter: EventEmitter\ * ##### externaleventName: string | symbol * ##### externaloptionaloptions: StaticEventEmitterIteratorOptions #### Returns AsyncIterator\ An `AsyncIterator` that iterates `eventName` events emitted by the `emitter` ### [**](#once)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L217)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L222)staticexternalinheritedonce * ****once**(emitter, eventName, options): Promise\ * ****once**(emitter, eventName, options): Promise\ - Inherited from Logger.once Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given event or that is rejected if the `EventEmitter` emits `'error'` while waiting. The `Promise` will resolve with an array of all the arguments emitted to the given event. This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event semantics and does not listen to the `'error'` event. ``` import { once, EventEmitter } from 'node:events'; import process from 'node:process'; const ee = new EventEmitter(); process.nextTick(() => { ee.emit('myevent', 42); }); const [value] = await once(ee, 'myevent'); console.log(value); const err = new Error('kaboom'); process.nextTick(() => { ee.emit('error', err); }); try { await once(ee, 'myevent'); } catch (err) { console.error('error happened', err); } ``` The special handling of the `'error'` event is only used when `events.once()` is used to wait for another event. If `events.once()` is used to wait for the '`error'` event itself, then it is treated as any other kind of event without special handling: ``` import { EventEmitter, once } from 'node:events'; const ee = new EventEmitter(); once(ee, 'error') .then(([err]) => console.log('ok', err.message)) .catch((err) => console.error('error', err.message)); ee.emit('error', new Error('boom')); // Prints: ok boom ``` An `AbortSignal` can be used to cancel waiting for the event: ``` import { EventEmitter, once } from 'node:events'; const ee = new EventEmitter(); const ac = new AbortController(); async function foo(emitter, event, signal) { try { await once(emitter, event, { signal }); console.log('event emitted!'); } catch (error) { if (error.name === 'AbortError') { console.error('Waiting for the event was canceled!'); } else { console.error('There was an error', error.message); } } } foo(ee, 'foo', ac.signal); ac.abort(); // Abort waiting for the event ee.emit('foo'); // Prints: Waiting for the event was canceled! ``` * **@since** v11.13.0, v10.16.0 *** #### Parameters * ##### externalemitter: EventEmitter\ * ##### externaleventName: string | symbol * ##### externaloptionaloptions: StaticEventEmitterOptions #### Returns Promise\ ### [**](#setMaxListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L402)staticexternalinheritedsetMaxListeners * ****setMaxListeners**(n, ...eventTargets): void - Inherited from Logger.setMaxListeners ``` import { setMaxListeners, EventEmitter } from 'node:events'; const target = new EventTarget(); const emitter = new EventEmitter(); setMaxListeners(5, target, emitter); ``` * **@since** v15.4.0 *** #### Parameters * ##### externaloptionaln: number A non-negative number. The maximum number of listeners per `EventTarget` event. * ##### externalrest...eventTargets: (EventEmitter\ | EventTarget)\[] Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} objects. #### Returns void --- # Source: https://docs.apify.com/sdk/js/reference/interface/LoggerOptions.md # externalLoggerOptions ## Index[**](#Index) ### Properties * [**data](#data) * [**level](#level) * [**logger](#logger) * [**maxDepth](#maxDepth) * [**maxStringLength](#maxStringLength) * [**prefix](#prefix) * [**suffix](#suffix) ## Properties[**](#Properties) ### [**](#data)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L61)externaloptionaldata **data? : Record\ Additional data to be added to each log line. ### [**](#level)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L46)externaloptionallevel **level? : number Sets the log level to the given value, preventing messages from less important log levels from being printed to the console. Use in conjunction with the `log.LEVELS` constants. ### [**](#logger)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L59)externaloptionallogger **logger? : [Logger](https://docs.apify.com/sdk/js/sdk/js/reference/class/Logger.md) Logger implementation to be used. Default one is log.LoggerText to log messages as easily readable strings. Optionally you can use `log.LoggerJson` that formats each log line as a JSON. ### [**](#maxDepth)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L48)externaloptionalmaxDepth **maxDepth? : number Max depth of data object that will be logged. Anything deeper than the limit will be stripped off. ### [**](#maxStringLength)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L50)externaloptionalmaxStringLength **maxStringLength? : number Max length of the string to be logged. Longer strings will be truncated. ### [**](#prefix)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L52)externaloptionalprefix **prefix? : null | string Prefix to be prepended the each logged line. ### [**](#suffix)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L54)externaloptionalsuffix **suffix? : null | string Suffix that will be appended the each logged line. --- # Source: https://docs.apify.com/sdk/js/reference/class/LoggerText.md # externalLoggerText This is an abstract class that should be extended by custom logger classes. this.\_log() method must be implemented by them. ### Hierarchy * [Logger](https://docs.apify.com/sdk/js/sdk/js/reference/class/Logger.md) * *LoggerText* ## Index[**](#Index) ### Constructors * [**constructor](#constructor) ### Properties * [**captureRejections](#captureRejections) * [**captureRejectionSymbol](#captureRejectionSymbol) * [**defaultMaxListeners](#defaultMaxListeners) * [**errorMonitor](#errorMonitor) ### Methods * [**\_log](#_log) * [**\_outputWithConsole](#_outputWithConsole) * [**\[captureRejectionSymbol\]](#\[captureRejectionSymbol]) * [**addListener](#addListener) * [**emit](#emit) * [**eventNames](#eventNames) * [**getMaxListeners](#getMaxListeners) * [**getOptions](#getOptions) * [**listenerCount](#listenerCount) * [**listeners](#listeners) * [**log](#log) * [**off](#off) * [**on](#on) * [**once](#once) * [**prependListener](#prependListener) * [**prependOnceListener](#prependOnceListener) * [**rawListeners](#rawListeners) * [**removeAllListeners](#removeAllListeners) * [**removeListener](#removeListener) * [**setMaxListeners](#setMaxListeners) * [**setOptions](#setOptions) * [**addAbortListener](#addAbortListener) * [**getEventListeners](#getEventListeners) * [**getMaxListeners](#getMaxListeners) * [**listenerCount](#listenerCount) * [**on](#on) * [**once](#once) * [**setMaxListeners](#setMaxListeners) ## Constructors[**](#Constructors) ### [**](#constructor)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L246)externalconstructor * ****new LoggerText**(options): [LoggerText](https://docs.apify.com/sdk/js/sdk/js/reference/class/LoggerText.md) - Overrides Logger.constructor #### Parameters * ##### externaloptionaloptions: {} #### Returns [LoggerText](https://docs.apify.com/sdk/js/sdk/js/reference/class/LoggerText.md) ## Properties[**](#Properties) ### [**](#captureRejections)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L459)staticexternalinheritedcaptureRejections **captureRejections: boolean Inherited from Logger.captureRejections Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) Change the default `captureRejections` option on all new `EventEmitter` objects. * **@since** v13.4.0, v12.16.0 ### [**](#captureRejectionSymbol)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L452)staticexternalreadonlyinheritedcaptureRejectionSymbol **captureRejectionSymbol: typeof captureRejectionSymbol Inherited from Logger.captureRejectionSymbol Value: `Symbol.for('nodejs.rejection')` See how to write a custom `rejection handler`. * **@since** v13.4.0, v12.16.0 ### [**](#defaultMaxListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L498)staticexternalinheriteddefaultMaxListeners **defaultMaxListeners: number Inherited from Logger.defaultMaxListeners By default, a maximum of `10` listeners can be registered for any single event. This limit can be changed for individual `EventEmitter` instances using the `emitter.setMaxListeners(n)` method. To change the default for *all*`EventEmitter` instances, the `events.defaultMaxListeners` property can be used. If this value is not a positive number, a `RangeError` is thrown. Take caution when setting the `events.defaultMaxListeners` because the change affects *all* `EventEmitter` instances, including those created before the change is made. However, calling `emitter.setMaxListeners(n)` still has precedence over `events.defaultMaxListeners`. This is not a hard limit. The `EventEmitter` instance will allow more listeners to be added but will output a trace warning to stderr indicating that a "possible EventEmitter memory leak" has been detected. For any single `EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` methods can be used to temporarily avoid this warning: ``` import { EventEmitter } from 'node:events'; const emitter = new EventEmitter(); emitter.setMaxListeners(emitter.getMaxListeners() + 1); emitter.once('event', () => { // do stuff emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); }); ``` The `--trace-warnings` command-line flag can be used to display the stack trace for such warnings. The emitted warning can be inspected with `process.on('warning')` and will have the additional `emitter`, `type`, and `count` properties, referring to the event emitter instance, the event's name and the number of attached listeners, respectively. Its `name` property is set to `'MaxListenersExceededWarning'`. * **@since** v0.11.2 ### [**](#errorMonitor)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L445)staticexternalreadonlyinheritederrorMonitor **errorMonitor: typeof errorMonitor Inherited from Logger.errorMonitor This symbol shall be used to install a listener for only monitoring `'error'` events. Listeners installed using this symbol are called before the regular `'error'` listeners are called. Installing a listener using this symbol does not change the behavior once an `'error'` event is emitted. Therefore, the process will still crash if no regular `'error'` listener is installed. * **@since** v13.6.0, v12.17.0 ## Methods[**](#Methods) ### [**](#_log)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L247)external\_log * ****\_log**(level, message, data, exception, opts): string - Overrides Logger.\_log #### Parameters * ##### externallevel: [LogLevel](https://docs.apify.com/sdk/js/sdk/js/reference/enum/LogLevel.md) * ##### externalmessage: string * ##### externaloptionaldata: any * ##### externaloptionalexception: unknown * ##### externaloptionalopts: Record\ #### Returns string ### [**](#_outputWithConsole)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L36)externalinherited\_outputWithConsole * ****\_outputWithConsole**(level, line): void - Inherited from Logger.\_outputWithConsole #### Parameters * ##### externallevel: [LogLevel](https://docs.apify.com/sdk/js/sdk/js/reference/enum/LogLevel.md) * ##### externalline: string #### Returns void ### [**](#\[captureRejectionSymbol])[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L136)externaloptionalinherited\[captureRejectionSymbol] * ****\[captureRejectionSymbol]**\(error, event, ...args): void - Inherited from Logger.\[captureRejectionSymbol] #### Parameters * ##### externalerror: Error * ##### externalevent: string | symbol * ##### externalrest...args: AnyRest #### Returns void ### [**](#addListener)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L597)externalinheritedaddListener * ****addListener**\(eventName, listener): this - Inherited from Logger.addListener Alias for `emitter.on(eventName, listener)`. * **@since** v0.1.26 *** #### Parameters * ##### externaleventName: string | symbol * ##### externallistener: (...args) => void #### Returns this ### [**](#emit)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L859)externalinheritedemit * ****emit**\(eventName, ...args): boolean - Inherited from Logger.emit Synchronously calls each of the listeners registered for the event named `eventName`, in the order they were registered, passing the supplied arguments to each. Returns `true` if the event had listeners, `false` otherwise. ``` import { EventEmitter } from 'node:events'; const myEmitter = new EventEmitter(); // First listener myEmitter.on('event', function firstListener() { console.log('Helloooo! first listener'); }); // Second listener myEmitter.on('event', function secondListener(arg1, arg2) { console.log(`event with parameters ${arg1}, ${arg2} in second listener`); }); // Third listener myEmitter.on('event', function thirdListener(...args) { const parameters = args.join(', '); console.log(`event with parameters ${parameters} in third listener`); }); console.log(myEmitter.listeners('event')); myEmitter.emit('event', 1, 2, 3, 4, 5); // Prints: // [ // [Function: firstListener], // [Function: secondListener], // [Function: thirdListener] // ] // Helloooo! first listener // event with parameters 1, 2 in second listener // event with parameters 1, 2, 3, 4, 5 in third listener ``` * **@since** v0.1.26 *** #### Parameters * ##### externaleventName: string | symbol * ##### externalrest...args: AnyRest #### Returns boolean ### [**](#eventNames)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L922)externalinheritedeventNames * ****eventNames**(): (string | symbol)\[] - Inherited from Logger.eventNames Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or `Symbol`s. ``` import { EventEmitter } from 'node:events'; const myEE = new EventEmitter(); myEE.on('foo', () => {}); myEE.on('bar', () => {}); const sym = Symbol('symbol'); myEE.on(sym, () => {}); console.log(myEE.eventNames()); // Prints: [ 'foo', 'bar', Symbol(symbol) ] ``` * **@since** v6.0.0 *** #### Returns (string | symbol)\[] ### [**](#getMaxListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L774)externalinheritedgetMaxListeners * ****getMaxListeners**(): number - Inherited from Logger.getMaxListeners Returns the current max listener value for the `EventEmitter` which is either set by `emitter.setMaxListeners(n)` or defaults to defaultMaxListeners. * **@since** v1.0.0 *** #### Returns number ### [**](#getOptions)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L35)externalinheritedgetOptions * ****getOptions**(): Record\ - Inherited from Logger.getOptions #### Returns Record\ ### [**](#listenerCount)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L868)externalinheritedlistenerCount * ****listenerCount**\(eventName, listener): number - Inherited from Logger.listenerCount Returns the number of listeners listening for the event named `eventName`. If `listener` is provided, it will return how many times the listener is found in the list of the listeners of the event. * **@since** v3.2.0 *** #### Parameters * ##### externaleventName: string | symbol The name of the event being listened for * ##### externaloptionallistener: Function The event handler function #### Returns number ### [**](#listeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L787)externalinheritedlisteners * ****listeners**\(eventName): Function\[] - Inherited from Logger.listeners Returns a copy of the array of listeners for the event named `eventName`. ``` server.on('connection', (stream) => { console.log('someone connected!'); }); console.log(util.inspect(server.listeners('connection'))); // Prints: [ [Function] ] ``` * **@since** v0.1.26 *** #### Parameters * ##### externaleventName: string | symbol #### Returns Function\[] ### [**](#log)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L38)externalinheritedlog * ****log**(level, message, ...args): void - Inherited from Logger.log #### Parameters * ##### externallevel: [LogLevel](https://docs.apify.com/sdk/js/sdk/js/reference/enum/LogLevel.md) * ##### externalmessage: string * ##### externalrest...args: any\[] #### Returns void ### [**](#off)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L747)externalinheritedoff * ****off**\(eventName, listener): this - Inherited from Logger.off Alias for `emitter.removeListener()`. * **@since** v10.0.0 *** #### Parameters * ##### externaleventName: string | symbol * ##### externallistener: (...args) => void #### Returns this ### [**](#on)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L629)externalinheritedon * ****on**\(eventName, listener): this - Inherited from Logger.on Adds the `listener` function to the end of the listeners array for the event named `eventName`. No checks are made to see if the `listener` has already been added. Multiple calls passing the same combination of `eventName` and `listener` will result in the `listener` being added, and called, multiple times. ``` server.on('connection', (stream) => { console.log('someone connected!'); }); ``` Returns a reference to the `EventEmitter`, so that calls can be chained. By default, event listeners are invoked in the order they are added. The `emitter.prependListener()` method can be used as an alternative to add the event listener to the beginning of the listeners array. ``` import { EventEmitter } from 'node:events'; const myEE = new EventEmitter(); myEE.on('foo', () => console.log('a')); myEE.prependListener('foo', () => console.log('b')); myEE.emit('foo'); // Prints: // b // a ``` * **@since** v0.1.101 *** #### Parameters * ##### externaleventName: string | symbol The name of the event. * ##### externallistener: (...args) => void The callback function #### Returns this ### [**](#once)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L659)externalinheritedonce * ****once**\(eventName, listener): this - Inherited from Logger.once Adds a **one-time** `listener` function for the event named `eventName`. The next time `eventName` is triggered, this listener is removed and then invoked. ``` server.once('connection', (stream) => { console.log('Ah, we have our first user!'); }); ``` Returns a reference to the `EventEmitter`, so that calls can be chained. By default, event listeners are invoked in the order they are added. The `emitter.prependOnceListener()` method can be used as an alternative to add the event listener to the beginning of the listeners array. ``` import { EventEmitter } from 'node:events'; const myEE = new EventEmitter(); myEE.once('foo', () => console.log('a')); myEE.prependOnceListener('foo', () => console.log('b')); myEE.emit('foo'); // Prints: // b // a ``` * **@since** v0.3.0 *** #### Parameters * ##### externaleventName: string | symbol The name of the event. * ##### externallistener: (...args) => void The callback function #### Returns this ### [**](#prependListener)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L886)externalinheritedprependListener * ****prependListener**\(eventName, listener): this - Inherited from Logger.prependListener Adds the `listener` function to the *beginning* of the listeners array for the event named `eventName`. No checks are made to see if the `listener` has already been added. Multiple calls passing the same combination of `eventName` and `listener` will result in the `listener` being added, and called, multiple times. ``` server.prependListener('connection', (stream) => { console.log('someone connected!'); }); ``` Returns a reference to the `EventEmitter`, so that calls can be chained. * **@since** v6.0.0 *** #### Parameters * ##### externaleventName: string | symbol The name of the event. * ##### externallistener: (...args) => void The callback function #### Returns this ### [**](#prependOnceListener)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L902)externalinheritedprependOnceListener * ****prependOnceListener**\(eventName, listener): this - Inherited from Logger.prependOnceListener Adds a **one-time**`listener` function for the event named `eventName` to the *beginning* of the listeners array. The next time `eventName` is triggered, this listener is removed, and then invoked. ``` server.prependOnceListener('connection', (stream) => { console.log('Ah, we have our first user!'); }); ``` Returns a reference to the `EventEmitter`, so that calls can be chained. * **@since** v6.0.0 *** #### Parameters * ##### externaleventName: string | symbol The name of the event. * ##### externallistener: (...args) => void The callback function #### Returns this ### [**](#rawListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L818)externalinheritedrawListeners * ****rawListeners**\(eventName): Function\[] - Inherited from Logger.rawListeners Returns a copy of the array of listeners for the event named `eventName`, including any wrappers (such as those created by `.once()`). ``` import { EventEmitter } from 'node:events'; const emitter = new EventEmitter(); emitter.once('log', () => console.log('log once')); // Returns a new Array with a function `onceWrapper` which has a property // `listener` which contains the original listener bound above const listeners = emitter.rawListeners('log'); const logFnWrapper = listeners[0]; // Logs "log once" to the console and does not unbind the `once` event logFnWrapper.listener(); // Logs "log once" to the console and removes the listener logFnWrapper(); emitter.on('log', () => console.log('log persistently')); // Will return a new Array with a single function bound by `.on()` above const newListeners = emitter.rawListeners('log'); // Logs "log persistently" twice newListeners[0](); emitter.emit('log'); ``` * **@since** v9.4.0 *** #### Parameters * ##### externaleventName: string | symbol #### Returns Function\[] ### [**](#removeAllListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L758)externalinheritedremoveAllListeners * ****removeAllListeners**(eventName): this - Inherited from Logger.removeAllListeners Removes all listeners, or those of the specified `eventName`. It is bad practice to remove listeners added elsewhere in the code, particularly when the `EventEmitter` instance was created by some other component or module (e.g. sockets or file streams). Returns a reference to the `EventEmitter`, so that calls can be chained. * **@since** v0.1.26 *** #### Parameters * ##### externaloptionaleventName: string | symbol #### Returns this ### [**](#removeListener)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L742)externalinheritedremoveListener * ****removeListener**\(eventName, listener): this - Inherited from Logger.removeListener Removes the specified `listener` from the listener array for the event named `eventName`. ``` const callback = (stream) => { console.log('someone connected!'); }; server.on('connection', callback); // ... server.removeListener('connection', callback); ``` `removeListener()` will remove, at most, one instance of a listener from the listener array. If any single listener has been added multiple times to the listener array for the specified `eventName`, then `removeListener()` must be called multiple times to remove each instance. Once an event is emitted, all listeners attached to it at the time of emitting are called in order. This implies that any `removeListener()` or `removeAllListeners()` calls *after* emitting and *before* the last listener finishes execution will not remove them from`emit()` in progress. Subsequent events behave as expected. ``` import { EventEmitter } from 'node:events'; class MyEmitter extends EventEmitter {} const myEmitter = new MyEmitter(); const callbackA = () => { console.log('A'); myEmitter.removeListener('event', callbackB); }; const callbackB = () => { console.log('B'); }; myEmitter.on('event', callbackA); myEmitter.on('event', callbackB); // callbackA removes listener callbackB but it will still be called. // Internal listener array at time of emit [callbackA, callbackB] myEmitter.emit('event'); // Prints: // A // B // callbackB is now removed. // Internal listener array [callbackA] myEmitter.emit('event'); // Prints: // A ``` Because listeners are managed using an internal array, calling this will change the position indices of any listener registered *after* the listener being removed. This will not impact the order in which listeners are called, but it means that any copies of the listener array as returned by the `emitter.listeners()` method will need to be recreated. When a single function has been added as a handler multiple times for a single event (as in the example below), `removeListener()` will remove the most recently added instance. In the example the `once('ping')` listener is removed: ``` import { EventEmitter } from 'node:events'; const ee = new EventEmitter(); function pong() { console.log('pong'); } ee.on('ping', pong); ee.once('ping', pong); ee.removeListener('ping', pong); ee.emit('ping'); ee.emit('ping'); ``` Returns a reference to the `EventEmitter`, so that calls can be chained. * **@since** v0.1.26 *** #### Parameters * ##### externaleventName: string | symbol * ##### externallistener: (...args) => void #### Returns this ### [**](#setMaxListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L768)externalinheritedsetMaxListeners * ****setMaxListeners**(n): this - Inherited from Logger.setMaxListeners By default `EventEmitter`s will print a warning if more than `10` listeners are added for a particular event. This is a useful default that helps finding memory leaks. The `emitter.setMaxListeners()` method allows the limit to be modified for this specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) to indicate an unlimited number of listeners. Returns a reference to the `EventEmitter`, so that calls can be chained. * **@since** v0.3.5 *** #### Parameters * ##### externaln: number #### Returns this ### [**](#setOptions)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@apify/log/src/index.d.ts#L34)externalinheritedsetOptions * ****setOptions**(options): void - Inherited from Logger.setOptions #### Parameters * ##### externaloptions: Record\ #### Returns void ### [**](#addAbortListener)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L437)staticexternalinheritedaddAbortListener * ****addAbortListener**(signal, resource): Disposable - Inherited from Logger.addAbortListener experimental Listens once to the `abort` event on the provided `signal`. Listening to the `abort` event on abort signals is unsafe and may lead to resource leaks since another third party with the signal can call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change this since it would violate the web standard. Additionally, the original API makes it easy to forget to remove listeners. This API allows safely using `AbortSignal`s in Node.js APIs by solving these two issues by listening to the event such that `stopImmediatePropagation` does not prevent the listener from running. Returns a disposable so that it may be unsubscribed from more easily. ``` import { addAbortListener } from 'node:events'; function example(signal) { let disposable; try { signal.addEventListener('abort', (e) => e.stopImmediatePropagation()); disposable = addAbortListener(signal, (e) => { // Do something when signal is aborted. }); } finally { disposable?.[Symbol.dispose](); } } ``` * **@since** v20.5.0 *** #### Parameters * ##### externalsignal: AbortSignal * ##### externalresource: (event) => void #### Returns Disposable Disposable that removes the `abort` listener. ### [**](#getEventListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L358)staticexternalinheritedgetEventListeners * ****getEventListeners**(emitter, name): Function\[] - Inherited from Logger.getEventListeners Returns a copy of the array of listeners for the event named `eventName`. For `EventEmitter`s this behaves exactly the same as calling `.listeners` on the emitter. For `EventTarget`s this is the only way to get the event listeners for the event target. This is useful for debugging and diagnostic purposes. ``` import { getEventListeners, EventEmitter } from 'node:events'; { const ee = new EventEmitter(); const listener = () => console.log('Events are fun'); ee.on('foo', listener); console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ] } { const et = new EventTarget(); const listener = () => console.log('Events are fun'); et.addEventListener('foo', listener); console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ] } ``` * **@since** v15.2.0, v14.17.0 *** #### Parameters * ##### externalemitter: EventEmitter\ | EventTarget * ##### externalname: string | symbol #### Returns Function\[] ### [**](#getMaxListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L387)staticexternalinheritedgetMaxListeners * ****getMaxListeners**(emitter): number - Inherited from Logger.getMaxListeners Returns the currently set max amount of listeners. For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on the emitter. For `EventTarget`s this is the only way to get the max event listeners for the event target. If the number of event handlers on a single EventTarget exceeds the max set, the EventTarget will print a warning. ``` import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events'; { const ee = new EventEmitter(); console.log(getMaxListeners(ee)); // 10 setMaxListeners(11, ee); console.log(getMaxListeners(ee)); // 11 } { const et = new EventTarget(); console.log(getMaxListeners(et)); // 10 setMaxListeners(11, et); console.log(getMaxListeners(et)); // 11 } ``` * **@since** v19.9.0 *** #### Parameters * ##### externalemitter: EventEmitter\ | EventTarget #### Returns number ### [**](#listenerCount)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L330)staticexternalinheritedlistenerCount * ****listenerCount**(emitter, eventName): number - Inherited from Logger.listenerCount A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`. ``` import { EventEmitter, listenerCount } from 'node:events'; const myEmitter = new EventEmitter(); myEmitter.on('event', () => {}); myEmitter.on('event', () => {}); console.log(listenerCount(myEmitter, 'event')); // Prints: 2 ``` * **@since** v0.9.12 * **@deprecated** Since v3.2.0 - Use `listenerCount` instead. *** #### Parameters * ##### externalemitter: EventEmitter\ The emitter to query * ##### externaleventName: string | symbol The event name #### Returns number ### [**](#on)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L303)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L308)staticexternalinheritedon * ****on**(emitter, eventName, options): AsyncIterator\ * ****on**(emitter, eventName, options): AsyncIterator\ - Inherited from Logger.on ``` import { on, EventEmitter } from 'node:events'; import process from 'node:process'; const ee = new EventEmitter(); // Emit later on process.nextTick(() => { ee.emit('foo', 'bar'); ee.emit('foo', 42); }); for await (const event of on(ee, 'foo')) { // The execution of this inner block is synchronous and it // processes one event at a time (even with await). Do not use // if concurrent execution is required. console.log(event); // prints ['bar'] [42] } // Unreachable here ``` Returns an `AsyncIterator` that iterates `eventName` events. It will throw if the `EventEmitter` emits `'error'`. It removes all listeners when exiting the loop. The `value` returned by each iteration is an array composed of the emitted event arguments. An `AbortSignal` can be used to cancel waiting on events: ``` import { on, EventEmitter } from 'node:events'; import process from 'node:process'; const ac = new AbortController(); (async () => { const ee = new EventEmitter(); // Emit later on process.nextTick(() => { ee.emit('foo', 'bar'); ee.emit('foo', 42); }); for await (const event of on(ee, 'foo', { signal: ac.signal })) { // The execution of this inner block is synchronous and it // processes one event at a time (even with await). Do not use // if concurrent execution is required. console.log(event); // prints ['bar'] [42] } // Unreachable here })(); process.nextTick(() => ac.abort()); ``` Use the `close` option to specify an array of event names that will end the iteration: ``` import { on, EventEmitter } from 'node:events'; import process from 'node:process'; const ee = new EventEmitter(); // Emit later on process.nextTick(() => { ee.emit('foo', 'bar'); ee.emit('foo', 42); ee.emit('close'); }); for await (const event of on(ee, 'foo', { close: ['close'] })) { console.log(event); // prints ['bar'] [42] } // the loop will exit after 'close' is emitted console.log('done'); // prints 'done' ``` * **@since** v13.6.0, v12.16.0 *** #### Parameters * ##### externalemitter: EventEmitter\ * ##### externaleventName: string | symbol * ##### externaloptionaloptions: StaticEventEmitterIteratorOptions #### Returns AsyncIterator\ An `AsyncIterator` that iterates `eventName` events emitted by the `emitter` ### [**](#once)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L217)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L222)staticexternalinheritedonce * ****once**(emitter, eventName, options): Promise\ * ****once**(emitter, eventName, options): Promise\ - Inherited from Logger.once Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given event or that is rejected if the `EventEmitter` emits `'error'` while waiting. The `Promise` will resolve with an array of all the arguments emitted to the given event. This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event semantics and does not listen to the `'error'` event. ``` import { once, EventEmitter } from 'node:events'; import process from 'node:process'; const ee = new EventEmitter(); process.nextTick(() => { ee.emit('myevent', 42); }); const [value] = await once(ee, 'myevent'); console.log(value); const err = new Error('kaboom'); process.nextTick(() => { ee.emit('error', err); }); try { await once(ee, 'myevent'); } catch (err) { console.error('error happened', err); } ``` The special handling of the `'error'` event is only used when `events.once()` is used to wait for another event. If `events.once()` is used to wait for the '`error'` event itself, then it is treated as any other kind of event without special handling: ``` import { EventEmitter, once } from 'node:events'; const ee = new EventEmitter(); once(ee, 'error') .then(([err]) => console.log('ok', err.message)) .catch((err) => console.error('error', err.message)); ee.emit('error', new Error('boom')); // Prints: ok boom ``` An `AbortSignal` can be used to cancel waiting for the event: ``` import { EventEmitter, once } from 'node:events'; const ee = new EventEmitter(); const ac = new AbortController(); async function foo(emitter, event, signal) { try { await once(emitter, event, { signal }); console.log('event emitted!'); } catch (error) { if (error.name === 'AbortError') { console.error('Waiting for the event was canceled!'); } else { console.error('There was an error', error.message); } } } foo(ee, 'foo', ac.signal); ac.abort(); // Abort waiting for the event ee.emit('foo'); // Prints: Waiting for the event was canceled! ``` * **@since** v11.13.0, v10.16.0 *** #### Parameters * ##### externalemitter: EventEmitter\ * ##### externaleventName: string | symbol * ##### externaloptionaloptions: StaticEventEmitterOptions #### Returns Promise\ ### [**](#setMaxListeners)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@types/node/events.d.ts#L402)staticexternalinheritedsetMaxListeners * ****setMaxListeners**(n, ...eventTargets): void - Inherited from Logger.setMaxListeners ``` import { setMaxListeners, EventEmitter } from 'node:events'; const target = new EventTarget(); const emitter = new EventEmitter(); setMaxListeners(5, target, emitter); ``` * **@since** v15.4.0 *** #### Parameters * ##### externaloptionaln: number A non-negative number. The maximum number of listeners per `EventTarget` event. * ##### externalrest...eventTargets: (EventEmitter\ | EventTarget)\[] Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} objects. #### Returns void --- # Source: https://docs.apify.com/sdk/js/reference/interface/MainOptions.md # MainOptions ### Hierarchy * [ExitOptions](https://docs.apify.com/sdk/js/sdk/js/reference/interface/ExitOptions.md) * [InitOptions](https://docs.apify.com/sdk/js/sdk/js/reference/interface/InitOptions.md) * *MainOptions* ## Index[**](#Index) ### Properties * [**exit](#exit) * [**exitCode](#exitCode) * [**statusMessage](#statusMessage) * [**storage](#storage) * [**timeoutSecs](#timeoutSecs) ## Properties[**](#Properties) ### [**](#exit)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1981)optionalinheritedexit **exit? : boolean Inherited from ExitOptions.exit Call `process.exit()`? Defaults to true ### [**](#exitCode)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1979)optionalinheritedexitCode **exitCode? : number Inherited from ExitOptions.exitCode Exit code, defaults to 0 ### [**](#statusMessage)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1972)optionalinheritedstatusMessage **statusMessage? : string Inherited from ExitOptions.statusMessage Exit with given status message ### [**](#storage)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1748)optionalinheritedstorage **storage? : StorageClient Inherited from InitOptions.storage ### [**](#timeoutSecs)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1977)optionalinheritedtimeoutSecs **timeoutSecs? : number = 30 Inherited from ExitOptions.timeoutSecs Amount of time, in seconds, to wait for all event handlers to finish before exiting the process. --- # Source: https://docs.apify.com/sdk/python/reference/class/MemoryStorageClient.md # MemoryStorageClient Memory implementation of the storage client. This storage client provides access to datasets, key-value stores, and request queues that store all data in memory using Python data structures (lists and dictionaries). No data is persisted between process runs, meaning all stored data is lost when the program terminates. The memory implementation provides fast access to data but is limited by available memory and does not support data sharing across different processes. All storage operations happen entirely in memory with no disk operations. The memory storage client is useful for testing and development environments, or short-lived crawler operations where persistence is not required. ### Hierarchy * [StorageClient](https://crawlee.dev/python/api/class/StorageClient) * *MemoryStorageClient* ## Index[**](#Index) ### Methods * [**create\_dataset\_client](https://docs.apify.com/sdk/python/sdk/python/reference/class/MemoryStorageClient.md#create_dataset_client) * [**create\_kvs\_client](https://docs.apify.com/sdk/python/sdk/python/reference/class/MemoryStorageClient.md#create_kvs_client) * [**create\_rq\_client](https://docs.apify.com/sdk/python/sdk/python/reference/class/MemoryStorageClient.md#create_rq_client) * [**get\_rate\_limit\_errors](https://docs.apify.com/sdk/python/sdk/python/reference/class/MemoryStorageClient.md#get_rate_limit_errors) * [**get\_storage\_client\_cache\_key](https://docs.apify.com/sdk/python/sdk/python/reference/class/MemoryStorageClient.md#get_storage_client_cache_key) ## Methods[**](#Methods) ### [**](#create_dataset_client)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_memory/_storage_client.py#L31)create\_dataset\_client * **async **create\_dataset\_client**(\*, id, name, alias, configuration): [DatasetClient](https://crawlee.dev/python/api/class/DatasetClient) - Overrides [StorageClient.create\_dataset\_client](https://crawlee.dev/python/api/class/StorageClient#create_dataset_client) Create a dataset client. *** #### Parameters * ##### optionalkeyword-onlyid: str | None = None * ##### optionalkeyword-onlyname: str | None = None * ##### optionalkeyword-onlyalias: str | None = None * ##### optionalkeyword-onlyconfiguration: [Configuration](https://crawlee.dev/python/api/class/Configuration) | None = None #### Returns [DatasetClient](https://crawlee.dev/python/api/class/DatasetClient) ### [**](#create_kvs_client)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_memory/_storage_client.py#L45)create\_kvs\_client * **async **create\_kvs\_client**(\*, id, name, alias, configuration): [KeyValueStoreClient](https://crawlee.dev/python/api/class/KeyValueStoreClient) - Overrides [StorageClient.create\_kvs\_client](https://crawlee.dev/python/api/class/StorageClient#create_kvs_client) Create a key-value store client. *** #### Parameters * ##### optionalkeyword-onlyid: str | None = None * ##### optionalkeyword-onlyname: str | None = None * ##### optionalkeyword-onlyalias: str | None = None * ##### optionalkeyword-onlyconfiguration: [Configuration](https://crawlee.dev/python/api/class/Configuration) | None = None #### Returns [KeyValueStoreClient](https://crawlee.dev/python/api/class/KeyValueStoreClient) ### [**](#create_rq_client)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_memory/_storage_client.py#L59)create\_rq\_client * **async **create\_rq\_client**(\*, id, name, alias, configuration): [RequestQueueClient](https://crawlee.dev/python/api/class/RequestQueueClient) - Overrides [StorageClient.create\_rq\_client](https://crawlee.dev/python/api/class/StorageClient#create_rq_client) Create a request queue client. *** #### Parameters * ##### optionalkeyword-onlyid: str | None = None * ##### optionalkeyword-onlyname: str | None = None * ##### optionalkeyword-onlyalias: str | None = None * ##### optionalkeyword-onlyconfiguration: [Configuration](https://crawlee.dev/python/api/class/Configuration) | None = None #### Returns [RequestQueueClient](https://crawlee.dev/python/api/class/RequestQueueClient) ### [**](#get_rate_limit_errors)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_base/_storage_client.py#L74)get\_rate\_limit\_errors * ****get\_rate\_limit\_errors**(): dict\[int, int] - Inherited from [StorageClient.get\_rate\_limit\_errors](https://crawlee.dev/python/api/class/StorageClient#get_rate_limit_errors) Return statistics about rate limit errors encountered by the HTTP client in storage client. *** #### Returns dict\[int, int] ### [**](#get_storage_client_cache_key)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_base/_storage_client.py#L33)get\_storage\_client\_cache\_key * ****get\_storage\_client\_cache\_key**(configuration): Hashable - Inherited from [StorageClient.get\_storage\_client\_cache\_key](https://crawlee.dev/python/api/class/StorageClient#get_storage_client_cache_key) Return a cache key that can differentiate between different storages of this and other clients. Can be based on configuration or on the client itself. By default, returns a module and name of the client class. *** #### Parameters * ##### configuration: [Configuration](https://crawlee.dev/python/api/class/Configuration) #### Returns Hashable --- # Source: https://docs.apify.com/sdk/js/reference/interface/MetamorphOptions.md # MetamorphOptions ## Index[**](#Index) ### Properties * [**build](#build) * [**contentType](#contentType) ## Properties[**](#Properties) ### [**](#build)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1959)optionalbuild **build? : string Tag or number of the target Actor build to metamorph into (e.g. `beta` or `1.2.345`). If not provided, the run uses build tag or number from the default Actor run configuration (typically `latest`). ### [**](#contentType)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1953)optionalcontentType **contentType? : string Content type for the `input`. If not specified, `input` is expected to be an object that will be stringified to JSON and content type set to `application/json; charset=utf-8`. If `options.contentType` is specified, then `input` must be a `String` or `Buffer`. --- # Source: https://docs.apify.com/sdk/python/reference/class/MigratingEvent.md # MigratingEvent ## Index[**](#Index) ### Properties * [**data](https://docs.apify.com/sdk/python/sdk/python/reference/class/MigratingEvent.md#data) * [**name](https://docs.apify.com/sdk/python/sdk/python/reference/class/MigratingEvent.md#name) ## Properties[**](#Properties) ### [**](#data)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L62)data **data: EventMigratingData ### [**](#name)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L61)name **name: Literal\[Event.MIGRATING] --- # Source: https://docs.apify.com/api/client/js/reference/interface/MonthlyUsage.md # MonthlyUsage ## Index[**](#Index) ### Properties * [**dailyServiceUsages](#dailyServiceUsages) * [**monthlyServiceUsage](#monthlyServiceUsage) * [**totalUsageCreditsUsdAfterVolumeDiscount](#totalUsageCreditsUsdAfterVolumeDiscount) * [**totalUsageCreditsUsdBeforeVolumeDiscount](#totalUsageCreditsUsdBeforeVolumeDiscount) * [**usageCycle](#usageCycle) ## Properties[**](#Properties) ### [**](#dailyServiceUsages)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L220)dailyServiceUsages **dailyServiceUsages: DailyServiceUsage\[] ### [**](#monthlyServiceUsage)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L219)monthlyServiceUsage **monthlyServiceUsage: {} #### Type declaration ### [**](#totalUsageCreditsUsdAfterVolumeDiscount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L222)totalUsageCreditsUsdAfterVolumeDiscount **totalUsageCreditsUsdAfterVolumeDiscount: number ### [**](#totalUsageCreditsUsdBeforeVolumeDiscount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L221)totalUsageCreditsUsdBeforeVolumeDiscount **totalUsageCreditsUsdBeforeVolumeDiscount: number ### [**](#usageCycle)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L218)usageCycle **usageCycle: [UsageCycle](https://docs.apify.com/api/client/js/api/client/js/reference/interface/UsageCycle.md) --- # Source: https://docs.apify.com/api/client/js/reference/interface/MonthlyUsageCycle.md # MonthlyUsageCycle ## Index[**](#Index) ### Properties * [**endAt](#endAt) * [**startAt](#startAt) ## Properties[**](#Properties) ### [**](#endAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L271)endAt **endAt: Date ### [**](#startAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L270)startAt **startAt: Date --- # Source: https://docs.apify.com/api/client/js/reference/interface/OpenApiDefinition.md # OpenApiDefinition OpenAPI specification for an Actor. Defines the Actor's API interface in OpenAPI 3.0 format, useful for integration with tools like ChatGPT plugins and other API consumers. ## Index[**](#Index) ### Properties * [**components](#components) * [**info](#info) * [**openapi](#openapi) * [**paths](#paths) * [**servers](#servers) ## Properties[**](#Properties) ### [**](#components)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L286)components **components: { schemas: {} } #### Type declaration * ##### schemas: {} ### [**](#info)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L278)info **info: { description? : string; title: string; version? : string; x-build-id: string } #### Type declaration * ##### optionaldescription?: string * ##### title: string * ##### optionalversion?: string * ##### x-build-id: string ### [**](#openapi)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L277)openapi **openapi: string ### [**](#paths)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L285)paths **paths: {} #### Type declaration ### [**](#servers)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/build.ts#L284)servers **servers: { url: string }\[] --- # Source: https://docs.apify.com/sdk/js/reference/interface/OpenStorageOptions.md # OpenStorageOptions ## Index[**](#Index) ### Properties * [**forceCloud](#forceCloud) ## Properties[**](#Properties) ### [**](#forceCloud)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1990)optionalforceCloud **forceCloud? : boolean = false If set to `true` then the cloud storage is used even if the `CRAWLEE_STORAGE_DIR` environment variable is set. This way it is possible to combine local and cloud storage. --- # Source: https://docs.apify.com/api/client/js/reference/interface/PaginatedList.md # PaginatedList \ Paginated list with detailed pagination information. Used primarily for Dataset items and other list operations that support offset-based pagination and field transformations. ### Hierarchy * PaginatedResponse\ * *PaginatedList* ## Index[**](#Index) ### Properties * [**count](#count) * [**desc](#desc) * [**items](#items) * [**limit](#limit) * [**offset](#offset) * [**total](#total) ## Properties[**](#Properties) ### [**](#count)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L283)count **count: number Count of dataset entries returned in this set. ### [**](#desc)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L289)desc **desc: boolean Should the results be in descending order. ### [**](#items)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L270)inheriteditems **items: Data\[] Inherited from PaginatedResponse.items Entries. ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L287)limit **limit: number Maximum number of dataset entries requested. ### [**](#offset)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L285)offset **offset: number Position of the first returned entry in the dataset. ### [**](#total)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L268)inheritedtotal **total: number Inherited from PaginatedResponse.total Total count of entries. --- # Source: https://docs.apify.com/sdk/python/reference/class/PayPerEventActorPricingInfo.md # PayPerEventActorPricingInfo ## Index[**](#Index) ### Properties * [**minimal\_max\_total\_charge\_usd](https://docs.apify.com/sdk/python/sdk/python/reference/class/PayPerEventActorPricingInfo.md#minimal_max_total_charge_usd) * [**pricing\_model](https://docs.apify.com/sdk/python/sdk/python/reference/class/PayPerEventActorPricingInfo.md#pricing_model) * [**pricing\_per\_event](https://docs.apify.com/sdk/python/sdk/python/reference/class/PayPerEventActorPricingInfo.md#pricing_per_event) ## Properties[**](#Properties) ### [**](#minimal_max_total_charge_usd)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/_models.py#L166)minimal\_max\_total\_charge\_usd **minimal\_max\_total\_charge\_usd: Decimal | None ### [**](#pricing_model)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/_models.py#L164)pricing\_model **pricing\_model: Literal\[PAY\_PER\_EVENT] ### [**](#pricing_per_event)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/_models.py#L165)pricing\_per\_event **pricing\_per\_event: [PricingPerEvent](https://docs.apify.com/sdk/python/sdk/python/reference/class/PricingPerEvent.md) --- # Source: https://docs.apify.com/sdk/python/reference/class/PersistStateEvent.md # PersistStateEvent ## Index[**](#Index) ### Properties * [**data](https://docs.apify.com/sdk/python/sdk/python/reference/class/PersistStateEvent.md#data) * [**name](https://docs.apify.com/sdk/python/sdk/python/reference/class/PersistStateEvent.md#name) ## Properties[**](#Properties) ### [**](#data)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L50)data **data: EventPersistStateData ### [**](#name)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L49)name **name: Literal\[Event.PERSIST\_STATE] --- # Source: https://docs.apify.com/sdk/js/reference/class/PlatformEventManager.md # PlatformEventManager Gets an instance of a Node.js' [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter) class that emits various events from the SDK or the Apify platform. The event emitter is initialized by calling the [Actor.main](https://docs.apify.com/sdk/js/sdk/js/reference/class/Actor.md#main) function. **Example usage:** ``` Actor.on('cpuInfo', (data) => { if (data.isCpuOverloaded) console.log('Oh no, the CPU is overloaded!'); }); ``` The following events are emitted: * `cpuInfo`: `{ "isCpuOverloaded": Boolean }` The event is emitted approximately every second and it indicates whether the Actor is using the maximum of available CPU resources. If that's the case, the Actor should not add more workload. For example, this event is used by the AutoscaledPool class. * `migrating`: `void` Emitted when the Actor running on the Apify platform is going to be migrated to another worker server soon. You can use it to persist the state of the Actor and gracefully stop your in-progress tasks, so that they are not interrupted by the migration. For example, this is used by the RequestList class. * `aborting`: `void` When a user aborts an Actor run on the Apify platform, they can choose to abort gracefully to allow the Actor some time before getting killed. This graceful abort emits the `aborting` event which the SDK uses to gracefully stop running crawls and you can use it to do your own cleanup as well. * `persistState`: `{ "isMigrating": Boolean }` Emitted in regular intervals (by default 60 seconds) to notify all components of Apify SDK that it is time to persist their state, in order to avoid repeating all work when the Actor restarts. This event is automatically emitted together with the `migrating` event, in which case the `isMigrating` flag is set to `true`. Otherwise the flag is `false`. Note that the `persistState` event is provided merely for user convenience, you can achieve the same effect using `setInterval()` and listening for the `migrating` event. ### Hierarchy * EventManager * *PlatformEventManager* ## Index[**](#Index) ### Constructors * [**constructor](#constructor) ### Properties * [**config](#config) ### Methods * [**close](#close) * [**emit](#emit) * [**init](#init) * [**isInitialized](#isInitialized) * [**off](#off) * [**on](#on) ## Constructors[**](#Constructors) ### [**](#constructor)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/platform_event_manager.ts#L50)constructor * ****new PlatformEventManager**(config): [PlatformEventManager](https://docs.apify.com/sdk/js/sdk/js/reference/class/PlatformEventManager.md) - Overrides EventManager.constructor #### Parameters * ##### config: [Configuration](https://docs.apify.com/sdk/js/sdk/js/reference/class/Configuration.md) = ... #### Returns [PlatformEventManager](https://docs.apify.com/sdk/js/sdk/js/reference/class/PlatformEventManager.md) ## Properties[**](#Properties) ### [**](#config)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/platform_event_manager.ts#L50)readonlyinheritedconfig **config: [Configuration](https://docs.apify.com/sdk/js/sdk/js/reference/class/Configuration.md) = ... Inherited from EventManager.config ## Methods[**](#Methods) ### [**](#close)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/platform_event_manager.ts#L112)close * ****close**(): Promise\ - Overrides EventManager.close Closes websocket providing events from Actor infrastructure and also stops sending internal events of Apify package such as `persistState`. This is automatically called at the end of `Actor.main()`. *** #### Returns Promise\ ### [**](#emit)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/events/event_manager.d.ts#L36)externalinheritedemit * ****emit**(event, ...args): void - Inherited from EventManager.emit #### Parameters * ##### externalevent: EventTypeName * ##### externalrest...args: unknown\[] #### Returns void ### [**](#init)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/platform_event_manager.ts#L58)init * ****init**(): Promise\ - Overrides EventManager.init Initializes `Actor.events` event emitter by creating a connection to a websocket that provides them. This is an internal function that is automatically called by `Actor.main()`. *** #### Returns Promise\ ### [**](#isInitialized)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/events/event_manager.d.ts#L37)externalinheritedisInitialized * ****isInitialized**(): boolean - Inherited from EventManager.isInitialized #### Returns boolean ### [**](#off)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/events/event_manager.d.ts#L35)externalinheritedoff * ****off**(event, listener): void - Inherited from EventManager.off #### Parameters * ##### externalevent: EventTypeName * ##### externaloptionallistener: (...args) => any #### Returns void ### [**](#on)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/events/event_manager.d.ts#L34)externalinheritedon * ****on**(event, listener): void - Inherited from EventManager.on #### Parameters * ##### externalevent: EventTypeName * ##### externallistener: (...args) => any #### Returns void --- # Source: https://docs.apify.com/api/client/js/reference/enum/PlatformFeature.md # PlatformFeature ## Index[**](#Index) ### Enumeration Members * [**Actors](#Actors) * [**Proxy](#Proxy) * [**ProxyExternalAccess](#ProxyExternalAccess) * [**ProxySERPS](#ProxySERPS) * [**Scheduler](#Scheduler) * [**Storage](#Storage) * [**Webhooks](#Webhooks) ## Enumeration Members[**](<#Enumeration Members>) ### [**](#Actors)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L183)Actors **Actors: ACTORS ### [**](#Proxy)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L188)Proxy **Proxy: PROXY ### [**](#ProxyExternalAccess)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L189)ProxyExternalAccess **ProxyExternalAccess: PROXY\_EXTERNAL\_ACCESS ### [**](#ProxySERPS)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L185)ProxySERPS **ProxySERPS: PROXY\_SERPS ### [**](#Scheduler)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L186)Scheduler **Scheduler: SCHEDULER ### [**](#Storage)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L184)Storage **Storage: STORAGE ### [**](#Webhooks)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L187)Webhooks **Webhooks: WEBHOOKS --- # Source: https://docs.apify.com/sdk/python/reference/class/PricePerDatasetItemActorPricingInfo.md # Source: https://docs.apify.com/api/client/js/reference/interface/PricePerDatasetItemActorPricingInfo.md # PricePerDatasetItemActorPricingInfo Pricing information for pay-per-result Actors. These Actors charge based on the number of items saved to the dataset. ### Hierarchy * CommonActorPricingInfo * *PricePerDatasetItemActorPricingInfo* ## Index[**](#Index) ### Properties * [**apifyMarginPercentage](#apifyMarginPercentage) * [**createdAt](#createdAt) * [**notifiedAboutChangeAt](#notifiedAboutChangeAt) * [**notifiedAboutFutureChangeAt](#notifiedAboutFutureChangeAt) * [**pricePerUnitUsd](#pricePerUnitUsd) * [**pricingModel](#pricingModel) * [**reasonForChange](#reasonForChange) * [**startedAt](#startedAt) * [**unitName](#unitName) ## Properties[**](#Properties) ### [**](#apifyMarginPercentage)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L846)inheritedapifyMarginPercentage **apifyMarginPercentage: number Inherited from CommonActorPricingInfo.apifyMarginPercentage In \[0, 1], fraction of pricePerUnitUsd that goes to Apify ### [**](#createdAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L848)inheritedcreatedAt **createdAt: Date Inherited from CommonActorPricingInfo.createdAt When this pricing info record has been created ### [**](#notifiedAboutChangeAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L852)optionalinheritednotifiedAboutChangeAt **notifiedAboutChangeAt? : Date Inherited from CommonActorPricingInfo.notifiedAboutChangeAt ### [**](#notifiedAboutFutureChangeAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L851)optionalinheritednotifiedAboutFutureChangeAt **notifiedAboutFutureChangeAt? : Date Inherited from CommonActorPricingInfo.notifiedAboutFutureChangeAt ### [**](#pricePerUnitUsd)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L883)pricePerUnitUsd **pricePerUnitUsd: number ### [**](#pricingModel)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L880)pricingModel **pricingModel: PRICE\_PER\_DATASET\_ITEM ### [**](#reasonForChange)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L853)optionalinheritedreasonForChange **reasonForChange? : string Inherited from CommonActorPricingInfo.reasonForChange ### [**](#startedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L850)inheritedstartedAt **startedAt: Date Inherited from CommonActorPricingInfo.startedAt Since when is this pricing info record effective for a given Actor ### [**](#unitName)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L882)optionalunitName **unitName? : string Name of the unit that is being charged --- # Source: https://docs.apify.com/api/client/js/reference/interface/PricePerEventActorPricingInfo.md # PricePerEventActorPricingInfo Pricing information for pay-per-event Actors. These Actors charge based on specific events (e.g., emails sent, API calls made). ### Hierarchy * CommonActorPricingInfo * *PricePerEventActorPricingInfo* ## Index[**](#Index) ### Properties * [**apifyMarginPercentage](#apifyMarginPercentage) * [**createdAt](#createdAt) * [**minimalMaxTotalChargeUsd](#minimalMaxTotalChargeUsd) * [**notifiedAboutChangeAt](#notifiedAboutChangeAt) * [**notifiedAboutFutureChangeAt](#notifiedAboutFutureChangeAt) * [**pricingModel](#pricingModel) * [**pricingPerEvent](#pricingPerEvent) * [**reasonForChange](#reasonForChange) * [**startedAt](#startedAt) ## Properties[**](#Properties) ### [**](#apifyMarginPercentage)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L846)inheritedapifyMarginPercentage **apifyMarginPercentage: number Inherited from CommonActorPricingInfo.apifyMarginPercentage In \[0, 1], fraction of pricePerUnitUsd that goes to Apify ### [**](#createdAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L848)inheritedcreatedAt **createdAt: Date Inherited from CommonActorPricingInfo.createdAt When this pricing info record has been created ### [**](#minimalMaxTotalChargeUsd)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L910)optionalminimalMaxTotalChargeUsd **minimalMaxTotalChargeUsd? : number ### [**](#notifiedAboutChangeAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L852)optionalinheritednotifiedAboutChangeAt **notifiedAboutChangeAt? : Date Inherited from CommonActorPricingInfo.notifiedAboutChangeAt ### [**](#notifiedAboutFutureChangeAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L851)optionalinheritednotifiedAboutFutureChangeAt **notifiedAboutFutureChangeAt? : Date Inherited from CommonActorPricingInfo.notifiedAboutFutureChangeAt ### [**](#pricingModel)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L906)pricingModel **pricingModel: PAY\_PER\_EVENT ### [**](#pricingPerEvent)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L907)pricingPerEvent **pricingPerEvent: { actorChargeEvents: [ActorChargeEvents](https://docs.apify.com/api/client/js/api/client/js/reference.md#ActorChargeEvents) } #### Type declaration * ##### actorChargeEvents: [ActorChargeEvents](https://docs.apify.com/api/client/js/api/client/js/reference.md#ActorChargeEvents) ### [**](#reasonForChange)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L853)optionalinheritedreasonForChange **reasonForChange? : string Inherited from CommonActorPricingInfo.reasonForChange ### [**](#startedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L850)inheritedstartedAt **startedAt: Date Inherited from CommonActorPricingInfo.startedAt Since when is this pricing info record effective for a given Actor --- # Source: https://docs.apify.com/api/client/js/reference/interface/PricingInfo.md # PricingInfo ## Index[**](#Index) ### Properties * [**pricingModel](#pricingModel) ## Properties[**](#Properties) ### [**](#pricingModel)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/store_collection.ts#L78)pricingModel **pricingModel: string --- # Source: https://docs.apify.com/sdk/python/reference/class/PricingInfoItem.md # PricingInfoItem ## Index[**](#Index) ### Properties * [**price](https://docs.apify.com/sdk/python/sdk/python/reference/class/PricingInfoItem.md#price) * [**title](https://docs.apify.com/sdk/python/sdk/python/reference/class/PricingInfoItem.md#title) ## Properties[**](#Properties) ### [**](#price)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/_charging.py#L380)price **price: Decimal ### [**](#title)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/_charging.py#L381)title **title: str --- # Source: https://docs.apify.com/sdk/python/reference/class/PricingPerEvent.md # PricingPerEvent ## Index[**](#Index) ### Properties * [**actor\_charge\_events](https://docs.apify.com/sdk/python/sdk/python/reference/class/PricingPerEvent.md#actor_charge_events) ## Properties[**](#Properties) ### [**](#actor_charge_events)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/_models.py#L160)actor\_charge\_events **actor\_charge\_events: dict\[str, [ActorChargeEvent](https://docs.apify.com/sdk/python/sdk/python/reference/class/ActorChargeEvent.md)] --- # Source: https://docs.apify.com/sdk/python/reference/class/ProcessedRequest.md # ProcessedRequest Represents a processed request. ## Index[**](#Index) ### Properties * [**id](https://docs.apify.com/sdk/python/sdk/python/reference/class/ProcessedRequest.md#id) * [**model\_config](https://docs.apify.com/sdk/python/sdk/python/reference/class/ProcessedRequest.md#model_config) * [**unique\_key](https://docs.apify.com/sdk/python/sdk/python/reference/class/ProcessedRequest.md#unique_key) * [**was\_already\_handled](https://docs.apify.com/sdk/python/sdk/python/reference/class/ProcessedRequest.md#was_already_handled) * [**was\_already\_present](https://docs.apify.com/sdk/python/sdk/python/reference/class/ProcessedRequest.md#was_already_present) ## Properties[**](#Properties) ### [**](#id)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L145)id **id: str | None Internal representation of the request by the storage client. Only some clients use id. ### [**](#model_config)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L143)model\_config **model\_config: Undefined ### [**](#unique_key)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L148)unique\_key **unique\_key: str ### [**](#was_already_handled)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L150)was\_already\_handled **was\_already\_handled: bool ### [**](#was_already_present)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L149)was\_already\_present **was\_already\_present: bool --- # Source: https://docs.apify.com/sdk/python/reference/class/ProlongRequestLockResponse.md # ProlongRequestLockResponse Response to prolong request lock calls. ## Index[**](#Index) ### Properties * [**lock\_expires\_at](https://docs.apify.com/sdk/python/sdk/python/reference/class/ProlongRequestLockResponse.md#lock_expires_at) * [**model\_config](https://docs.apify.com/sdk/python/sdk/python/reference/class/ProlongRequestLockResponse.md#model_config) ## Properties[**](#Properties) ### [**](#lock_expires_at)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L31)lock\_expires\_at **lock\_expires\_at: datetime ### [**](#model_config)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L29)model\_config **model\_config: Undefined --- # Source: https://docs.apify.com/sdk/python/reference/class/ProxyConfiguration.md # Source: https://docs.apify.com/sdk/js/reference/class/ProxyConfiguration.md # ProxyConfiguration Configures connection to a proxy server with the provided options. Proxy servers are used to prevent target websites from blocking your crawlers based on IP address rate limits or blacklists. Setting proxy configuration in your crawlers automatically configures them to use the selected proxies for all connections. You can get information about the currently used proxy by inspecting the [ProxyInfo](https://docs.apify.com/sdk/js/sdk/js/reference/interface/ProxyInfo.md) property in your crawler's page function. There, you can inspect the proxy's URL and other attributes. The proxy servers are managed by [Apify Proxy](https://docs.apify.com/proxy). To be able to use Apify Proxy, you need an Apify account and access to the selected proxies. If you provide no configuration option, the proxies will be managed automatically using a smart algorithm. If you want to use your own proxies, use the [ProxyConfigurationOptions.proxyUrls](https://docs.apify.com/sdk/js/sdk/js/reference/interface/ProxyConfigurationOptions.md#proxyUrls) option. Your list of proxy URLs will be rotated by the configuration if this option is provided. **Example usage:** ``` const proxyConfiguration = await Actor.createProxyConfiguration({ groups: ['GROUP1', 'GROUP2'] // List of Apify Proxy groups countryCode: 'US', }); const crawler = new CheerioCrawler({ // ... proxyConfiguration, requestHandler({ proxyInfo }) { const usedProxyUrl = proxyInfo.url; // Getting the proxy URL } }) ``` ### Hierarchy * ProxyConfiguration * *ProxyConfiguration* ## Index[**](#Index) ### Properties * [**config](#config) * [**isManInTheMiddle](#isManInTheMiddle) ### Methods * [**initialize](#initialize) * [**newProxyInfo](#newProxyInfo) * [**newUrl](#newUrl) ## Properties[**](#Properties) ### [**](#config)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/proxy_configuration.ts#L171)readonlyconfig **config: [Configuration](https://docs.apify.com/sdk/js/sdk/js/reference/class/Configuration.md) = ... ### [**](#isManInTheMiddle)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/proxy_configuration.d.ts#L157)externalinheritedisManInTheMiddle **isManInTheMiddle: boolean Inherited from CoreProxyConfiguration.isManInTheMiddle ## Methods[**](#Methods) ### [**](#initialize)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/proxy_configuration.ts#L234)initialize * ****initialize**(): Promise\ - Loads proxy password if token is provided and checks access to Apify Proxy and provided proxy groups if Apify Proxy configuration is used. Also checks if country has access to Apify Proxy groups if the country code is provided. You should use the createProxyConfiguration function to create a pre-initialized `ProxyConfiguration` instance instead of calling this manually. *** #### Returns Promise\ ### [**](#newProxyInfo)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/proxy_configuration.ts#L260)newProxyInfo * ****newProxyInfo**(sessionId, options): Promise\ - Overrides CoreProxyConfiguration.newProxyInfo This function creates a new [ProxyInfo](https://docs.apify.com/sdk/js/sdk/js/reference/interface/ProxyInfo.md) info object. It is used by CheerioCrawler and PuppeteerCrawler to generate proxy URLs and also to allow the user to inspect the currently used proxy via the requestHandler parameter `proxyInfo`. Use it if you want to work with a rich representation of a proxy URL. If you need the URL string only, use [ProxyConfiguration.newUrl](https://docs.apify.com/sdk/js/sdk/js/reference/class/ProxyConfiguration.md#newUrl). *** #### Parameters * ##### optionalsessionId: string | number Represents the identifier of user Session that can be managed by the SessionPool or you can use the Apify Proxy [Session](https://docs.apify.com/proxy#sessions) identifier. When the provided sessionId is a number, it's converted to a string. Property sessionId of [ProxyInfo](https://docs.apify.com/sdk/js/sdk/js/reference/interface/ProxyInfo.md) is always returned as a type string. All the HTTP requests going through the proxy with the same session identifier will use the same target proxy server (i.e. the same IP address). The identifier must not be longer than 50 characters and include only the following: `0-9`, `a-z`, `A-Z`, `"."`, `"_"` and `"~"`. * ##### optionaloptions: TieredProxyOptions #### Returns Promise\ Represents information about used proxy and its configuration. ### [**](#newUrl)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/proxy_configuration.ts#L294)newUrl * ****newUrl**(sessionId, options): Promise\ - Overrides CoreProxyConfiguration.newUrl Returns a new proxy URL based on provided configuration options and the `sessionId` parameter. *** #### Parameters * ##### optionalsessionId: string | number Represents the identifier of user Session that can be managed by the SessionPool or you can use the Apify Proxy [Session](https://docs.apify.com/proxy#sessions) identifier. When the provided sessionId is a number, it's converted to a string. All the HTTP requests going through the proxy with the same session identifier will use the same target proxy server (i.e. the same IP address). The identifier must not be longer than 50 characters and include only the following: `0-9`, `a-z`, `A-Z`, `"."`, `"_"` and `"~"`. * ##### optionaloptions: TieredProxyOptions #### Returns Promise\ A string with a proxy URL, including authentication credentials and port number. For example, `http://bob:password123@proxy.example.com:8000` --- # Source: https://docs.apify.com/sdk/js/reference/interface/ProxyConfigurationOptions.md # ProxyConfigurationOptions ### Hierarchy * ProxyConfigurationOptions * *ProxyConfigurationOptions* ## Index[**](#Index) ### Properties * [**apifyProxyCountry](#apifyProxyCountry) * [**apifyProxyGroups](#apifyProxyGroups) * [**countryCode](#countryCode) * [**groups](#groups) * [**newUrlFunction](#newUrlFunction) * [**password](#password) * [**proxyUrls](#proxyUrls) * [**tieredProxyConfig](#tieredProxyConfig) * [**tieredProxyUrls](#tieredProxyUrls) ## Properties[**](#Properties) ### [**](#apifyProxyCountry)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/proxy_configuration.ts#L59)optionalapifyProxyCountry **apifyProxyCountry? : string Same option as `countryCode` which can be used to configurate the proxy by UI input schema. You should use the `countryCode` option in your crawler code. ### [**](#apifyProxyGroups)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/proxy_configuration.ts#L53)optionalapifyProxyGroups **apifyProxyGroups? : string\[] Same option as `groups` which can be used to configurate the proxy by UI input schema. You should use the `groups` option in your crawler code. ### [**](#countryCode)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/proxy_configuration.ts#L47)optionalcountryCode **countryCode? : string If set and relevant proxies are available in your Apify account, all proxied requests will use IP addresses that are geolocated to the specified country. For example `GB` for IPs from Great Britain. Note that online services often have their own rules for handling geolocation and thus the country selection is a best attempt at geolocation, rather than a guaranteed hit. This parameter is optional, by default, each proxied request is assigned an IP address from a random country. The country code needs to be a two letter ISO country code. See the [full list of available country codes](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). This parameter is optional, by default, the proxy uses all available proxy servers from all countries. on the Apify cloud, or when using the [Apify CLI](https://github.com/apify/apify-cli). ### [**](#groups)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/proxy_configuration.ts#L34)optionalgroups **groups? : string\[] An array of proxy groups to be used by the [Apify Proxy](https://docs.apify.com/proxy). If not provided, the proxy will select the groups automatically. ### [**](#newUrlFunction)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/proxy_configuration.d.ts#L20)externaloptionalinheritednewUrlFunction **newUrlFunction? : ProxyConfigurationFunction Inherited from CoreProxyConfigurationOptions.newUrlFunction Custom function that allows you to generate the new proxy URL dynamically. It gets the `sessionId` as a parameter and an optional parameter with the `Request` object when applicable. Can return either stringified proxy URL or `null` if the proxy should not be used. Can be asynchronous. This function is used to generate the URL when [ProxyConfiguration.newUrl](https://docs.apify.com/sdk/js/sdk/js/reference/class/ProxyConfiguration.md#newUrl) or [ProxyConfiguration.newProxyInfo](https://docs.apify.com/sdk/js/sdk/js/reference/class/ProxyConfiguration.md#newProxyInfo) is called. ### [**](#password)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/proxy_configuration.ts#L28)optionalpassword **password? : string User's password for the proxy. By default, it is taken from the `APIFY_PROXY_PASSWORD` environment variable, which is automatically set by the system when running the Actors. ### [**](#proxyUrls)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/proxy_configuration.d.ts#L13)externaloptionalinheritedproxyUrls **proxyUrls? : string\[] Inherited from CoreProxyConfigurationOptions.proxyUrls An array of custom proxy URLs to be rotated. Custom proxies are not compatible with Apify Proxy and an attempt to use both configuration options will cause an error to be thrown on initialize. ### [**](#tieredProxyConfig)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/proxy_configuration.ts#L65)optionaltieredProxyConfig **tieredProxyConfig? : Omit<[ProxyConfigurationOptions](https://docs.apify.com/sdk/js/sdk/js/reference/interface/ProxyConfigurationOptions.md), keyof ProxyConfigurationOptions | tieredProxyConfig>\[] Multiple different ProxyConfigurationOptions stratified into tiers. Crawlee crawlers will switch between those tiers based on the blocked request statistics. ### [**](#tieredProxyUrls)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/proxy_configuration.d.ts#L32)externaloptionalinheritedtieredProxyUrls **tieredProxyUrls? : (null | string)\[]\[] Inherited from CoreProxyConfigurationOptions.tieredProxyUrls An array of custom proxy URLs to be rotated stratified in tiers. This is a more advanced version of `proxyUrls` that allows you to define a hierarchy of proxy URLs If everything goes well, all the requests will be sent through the first proxy URL in the list. Whenever the crawler encounters a problem with the current proxy on the given domain, it will switch to the higher tier for this domain. The crawler probes lower-level proxies at intervals to check if it can make the tier downshift. This feature is useful when you have a set of proxies with different performance characteristics (speed, price, antibot performance etc.) and you want to use the best one for each domain. Use `null` as a proxy URL to disable the proxy for the given tier. --- # Source: https://docs.apify.com/api/client/js/reference/interface/ProxyGroup.md # ProxyGroup ## Index[**](#Index) ### Properties * [**availableCount](#availableCount) * [**description](#description) * [**name](#name) ## Properties[**](#Properties) ### [**](#availableCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L156)availableCount **availableCount: number ### [**](#description)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L155)description **description: string ### [**](#name)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L154)name **name: string --- # Source: https://docs.apify.com/sdk/python/reference/class/ProxyInfo.md # Source: https://docs.apify.com/sdk/js/reference/interface/ProxyInfo.md # ProxyInfo The main purpose of the ProxyInfo object is to provide information about the current proxy connection used by the crawler for the request. Outside of crawlers, you can get this object by calling [ProxyConfiguration.newProxyInfo](https://docs.apify.com/sdk/js/sdk/js/reference/class/ProxyConfiguration.md#newProxyInfo). **Example usage:** ``` const proxyConfiguration = await Actor.createProxyConfiguration({ groups: ['GROUP1', 'GROUP2'] // List of Apify Proxy groups countryCode: 'US', }); // Getting proxyInfo object by calling class method directly const proxyInfo = proxyConfiguration.newProxyInfo(); // In crawler const crawler = new CheerioCrawler({ // ... proxyConfiguration, requestHandler({ proxyInfo }) { // Getting used proxy URL const proxyUrl = proxyInfo.url; // Getting ID of used Session const sessionIdentifier = proxyInfo.sessionId; } }) ``` ### Hierarchy * ProxyInfo * *ProxyInfo* ## Index[**](#Index) ### Properties * [**countryCode](#countryCode) * [**groups](#groups) * [**hostname](#hostname) * [**password](#password) * [**port](#port) * [**proxyTier](#proxyTier) * [**sessionId](#sessionId) * [**url](#url) * [**username](#username) ## Properties[**](#Properties) ### [**](#countryCode)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/proxy_configuration.ts#L117)optionalcountryCode **countryCode? : string If set and relevant proxies are available in your Apify account, all proxied requests will use IP addresses that are geolocated to the specified country. For example `GB` for IPs from Great Britain. Note that online services often have their own rules for handling geolocation and thus the country selection is a best attempt at geolocation, rather than a guaranteed hit. This parameter is optional, by default, each proxied request is assigned an IP address from a random country. The country code needs to be a two letter ISO country code. See the [full list of available country codes](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). This parameter is optional, by default, the proxy uses all available proxy servers from all countries. ### [**](#groups)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/proxy_configuration.ts#L105)groups **groups: string\[] An array of proxy groups to be used by the [Apify Proxy](https://docs.apify.com/proxy). If not provided, the proxy will select the groups automatically. ### [**](#hostname)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/proxy_configuration.d.ts#L88)externalinheritedhostname **hostname: string Inherited from CoreProxyInfo.hostname Hostname of your proxy. ### [**](#password)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/proxy_configuration.ts#L124)password **password: string Overrides CoreProxyInfo.password User's password for the proxy. By default, it is taken from the `APIFY_PROXY_PASSWORD` environment variable, which is automatically set by the system when running the Actors on the Apify cloud, or when using the [Apify CLI](https://github.com/apify/apify-cli). ### [**](#port)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/proxy_configuration.d.ts#L92)externalinheritedport **port: string | number Inherited from CoreProxyInfo.port Proxy port. ### [**](#proxyTier)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/proxy_configuration.d.ts#L96)externaloptionalinheritedproxyTier **proxyTier? : number Inherited from CoreProxyInfo.proxyTier Proxy tier for the current proxy, if applicable (only for `tieredProxyUrls`). ### [**](#sessionId)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/proxy_configuration.d.ts#L72)externaloptionalinheritedsessionId **sessionId? : string Inherited from CoreProxyInfo.sessionId The identifier of used Session, if used. ### [**](#url)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/proxy_configuration.d.ts#L76)externalinheritedurl **url: string Inherited from CoreProxyInfo.url The URL of the proxy. ### [**](#username)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/proxy_configuration.d.ts#L80)externaloptionalinheritedusername **username? : string Inherited from CoreProxyInfo.username Username for the proxy. --- # Source: https://docs.apify.com/sdk/js/reference/interface/QueueOperationInfo.md # externalQueueOperationInfo A helper class that is used to report results from various [RequestQueue](https://docs.apify.com/sdk/js/sdk/js/reference/class/RequestQueue.md) functions as well as enqueueLinks. ## Index[**](#Index) ### Properties * [**requestId](#requestId) * [**wasAlreadyHandled](#wasAlreadyHandled) * [**wasAlreadyPresent](#wasAlreadyPresent) ## Properties[**](#Properties) ### [**](#requestId)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/types/storages.d.ts#L12)externalrequestId **requestId: string The ID of the added request ### [**](#wasAlreadyHandled)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/types/storages.d.ts#L10)externalwasAlreadyHandled **wasAlreadyHandled: boolean Indicates if request was already marked as handled. ### [**](#wasAlreadyPresent)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/types/storages.d.ts#L8)externalwasAlreadyPresent **wasAlreadyPresent: boolean Indicates if request was already present in the queue. --- # Source: https://docs.apify.com/sdk/js/reference/interface/RebootOptions.md # RebootOptions --- # Source: https://docs.apify.com/sdk/js/reference/interface/RecordOptions.md # externalRecordOptions ## Index[**](#Index) ### Properties * [**contentType](#contentType) ## Properties[**](#Properties) ### [**](#contentType)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/key_value_store.d.ts#L390)externaloptionalcontentType **contentType? : string Specifies a custom MIME content type of the record. --- # Source: https://docs.apify.com/api/client/python/reference/class/RedirectLogFormatter.md # RedirectLogFormatter Formatter applied to default redirect logger. ## Index[**](#Index) ### Methods * [**format](https://docs.apify.com/api/client/python/api/client/python/reference/class/RedirectLogFormatter.md#format) ## Methods[**](#Methods) ### [**](#format)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_logging.py#L160)format * ****format**(record): str - Format the log by prepending logger name to the original message. *** #### Parameters * ##### record: logging.LogRecord Log record to be formatted. #### Returns str --- # Source: https://docs.apify.com/sdk/python/reference/class/Request.md # Request Represents a request in the Crawlee framework, containing the necessary information for crawling operations. The `Request` class is one of the core components in Crawlee, utilized by various components such as request providers, HTTP clients, crawlers, and more. It encapsulates the essential data for executing web requests, including the URL, HTTP method, headers, payload, and user data. The user data allows custom information to be stored and persisted throughout the request lifecycle, including its retries. Key functionalities include managing the request's identifier (`id`), unique key (`unique_key`) that is used for request deduplication, controlling retries, handling state management, and enabling configuration for session rotation and proxy handling. The recommended way to create a new instance is by using the `Request.from_url` constructor, which automatically generates a unique key and identifier based on the URL and request parameters. ### Usage ``` from crawlee import Request request = Request.from_url('https://crawlee.dev') ``` ### Hierarchy * *Request* * [RequestWithLock](https://crawlee.dev/python/api/class/RequestWithLock) ## Index[**](#Index) ### Methods * [**crawl\_depth](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#crawl_depth) * [**enqueue\_strategy](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#enqueue_strategy) * [**forefront](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#forefront) * [**from\_url](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#from_url) * [**get\_query\_param\_from\_url](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#get_query_param_from_url) * [**last\_proxy\_tier](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#last_proxy_tier) * [**session\_rotation\_count](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#session_rotation_count) * [**state](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#state) ### Properties * [**crawl\_depth](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#crawl_depth) * [**crawlee\_data](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#crawlee_data) * [**enqueue\_strategy](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#enqueue_strategy) * [**forefront](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#forefront) * [**handled\_at](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#handled_at) * [**label](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#label) * [**last\_proxy\_tier](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#last_proxy_tier) * [**loaded\_url](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#loaded_url) * [**max\_retries](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#max_retries) * [**method](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#method) * [**model\_config](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#model_config) * [**no\_retry](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#no_retry) * [**payload](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#payload) * [**retry\_count](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#retry_count) * [**session\_id](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#session_id) * [**session\_rotation\_count](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#session_rotation_count) * [**state](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#state) * [**unique\_key](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#unique_key) * [**url](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#url) * [**was\_already\_handled](https://docs.apify.com/sdk/python/sdk/python/reference/class/Request.md#was_already_handled) ## Methods[**](#Methods) ### [**](#crawl_depth)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L374)crawl\_depth * ****crawl\_depth**(new\_value): None - #### Parameters * ##### new\_value: int #### Returns None ### [**](#enqueue_strategy)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L406)enqueue\_strategy * ****enqueue\_strategy**(new\_enqueue\_strategy): None - #### Parameters * ##### new\_enqueue\_strategy: [EnqueueStrategy](https://crawlee.dev/python/api#EnqueueStrategy) #### Returns None ### [**](#forefront)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L424)forefront * ****forefront**(new\_value): None - #### Parameters * ##### new\_value: bool #### Returns None ### [**](#from_url)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L243)from\_url * ****from\_url**(url, \*, method, headers, payload, label, session\_id, unique\_key, keep\_url\_fragment, use\_extended\_unique\_key, always\_enqueue, enqueue\_strategy, max\_retries, kwargs): Self - Create a new `Request` instance from a URL. This is recommended constructor for creating new `Request` instances. It generates a `Request` object from a given URL with additional options to customize HTTP method, payload, unique key, and other request properties. If no `unique_key` or `id` is provided, they are computed automatically based on the URL, method and payload. It depends on the `keep_url_fragment` and `use_extended_unique_key` flags. *** #### Parameters * ##### url: str The URL of the request. * ##### optionalkeyword-onlymethod: [HttpMethod](https://crawlee.dev/python/api#HttpMethod) = 'GET' The HTTP method of the request. * ##### optionalkeyword-onlyheaders: ([HttpHeaders](https://crawlee.dev/python/api/class/HttpHeaders) | dict\[str, str]) | None = None The HTTP headers of the request. * ##### optionalkeyword-onlypayload: ([HttpPayload](https://crawlee.dev/python/api#HttpPayload) | str) | None = None The data to be sent as the request body. Typically used with 'POST' or 'PUT' requests. * ##### optionalkeyword-onlylabel: str | None = None A custom label to differentiate between request types. This is stored in `user_data`, and it is used for request routing (different requests go to different handlers). * ##### optionalkeyword-onlysession\_id: str | None = None ID of a specific `Session` to which the request will be strictly bound. If the session becomes unavailable when the request is processed, a `RequestCollisionError` will be raised. * ##### optionalkeyword-onlyunique\_key: str | None = None A unique key identifying the request. If not provided, it is automatically computed based on the URL and other parameters. Requests with the same `unique_key` are treated as identical. * ##### optionalkeyword-onlykeep\_url\_fragment: bool = False Determines whether the URL fragment (e.g., `` `section` ``) should be included in the `unique_key` computation. This is only relevant when `unique_key` is not provided. * ##### optionalkeyword-onlyuse\_extended\_unique\_key: bool = False Determines whether to include the HTTP method, ID Session and payload in the `unique_key` computation. This is only relevant when `unique_key` is not provided. * ##### optionalkeyword-onlyalways\_enqueue: bool = False If set to `True`, the request will be enqueued even if it is already present in the queue. Using this is not allowed when a custom `unique_key` is also provided and will result in a `ValueError`. * ##### optionalkeyword-onlyenqueue\_strategy: [EnqueueStrategy](https://crawlee.dev/python/api#EnqueueStrategy) | None = None The strategy that will be used for enqueuing the request. * ##### optionalkeyword-onlymax\_retries: int | None = None Maximum number of retries for this request. Allows to override the global `max_request_retries` option of `BasicCrawler`. * ##### kwargs: Any #### Returns Self ### [**](#get_query_param_from_url)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L344)get\_query\_param\_from\_url * ****get\_query\_param\_from\_url**(param, \*, default): str | None - Get the value of a specific query parameter from the URL. *** #### Parameters * ##### param: str * ##### optionalkeyword-onlydefault: str | None = None #### Returns str | None ### [**](#last_proxy_tier)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L415)last\_proxy\_tier * ****last\_proxy\_tier**(new\_value): None - #### Parameters * ##### new\_value: int #### Returns None ### [**](#session_rotation_count)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L397)session\_rotation\_count * ****session\_rotation\_count**(new\_session\_rotation\_count): None - #### Parameters * ##### new\_session\_rotation\_count: int #### Returns None ### [**](#state)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L383)state * ****state**(new\_state): None - #### Parameters * ##### new\_state: [RequestState](https://crawlee.dev/python/api/class/RequestState) #### Returns None ## Properties[**](#Properties) ### [**](#crawl_depth)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L369)crawl\_depth **crawl\_depth: int The depth of the request in the crawl tree. ### [**](#crawlee_data)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L360)crawlee\_data **crawlee\_data: [CrawleeRequestData](https://crawlee.dev/python/api/class/CrawleeRequestData) Crawlee-specific configuration stored in the `user_data`. ### [**](#enqueue_strategy)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L401)enqueue\_strategy **enqueue\_strategy: [EnqueueStrategy](https://crawlee.dev/python/api#EnqueueStrategy) The strategy that was used for enqueuing the request. ### [**](#forefront)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L419)forefront **forefront: bool Indicate whether the request should be enqueued at the front of the queue. ### [**](#handled_at)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L239)handled\_at **handled\_at: datetime | None Timestamp when the request was handled. ### [**](#label)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L350)label **label: str | None A string used to differentiate between arbitrary request types. ### [**](#last_proxy_tier)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L410)last\_proxy\_tier **last\_proxy\_tier: int | None The last proxy tier used to process the request. ### [**](#loaded_url)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L236)loaded\_url **loaded\_url: str | None URL of the web page that was loaded. This can differ from the original URL in case of redirects. ### [**](#max_retries)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L387)max\_retries **max\_retries: int | None Crawlee-specific limit on the number of retries of the request. ### [**](#method)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L187)method **method: [HttpMethod](https://crawlee.dev/python/api#HttpMethod) HTTP request method. ### [**](#model_config)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L169)model\_config **model\_config: Undefined ### [**](#no_retry)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L233)no\_retry **no\_retry: bool If set to `True`, the request will not be retried in case of failure. ### [**](#payload)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L190)payload **payload: [HttpPayload](https://crawlee.dev/python/api#HttpPayload) | None HTTP request payload. ### [**](#retry_count)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L230)retry\_count **retry\_count: int Number of times the request has been retried. ### [**](#session_id)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L355)session\_id **session\_id: str | None The ID of the bound session, if there is any. ### [**](#session_rotation_count)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L392)session\_rotation\_count **session\_rotation\_count: int | None Crawlee-specific number of finished session rotations for the request. ### [**](#state)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L378)state **state: [RequestState](https://crawlee.dev/python/api/class/RequestState) Crawlee-specific request handling state. ### [**](#unique_key)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L171)unique\_key **unique\_key: str A unique key identifying the request. Two requests with the same `unique_key` are considered as pointing to the same URL. If `unique_key` is not provided, then it is automatically generated by normalizing the URL. For example, the URL of `HTTP://www.EXAMPLE.com/something/` will produce the `unique_key` of `http://www.example.com/something`. Pass an arbitrary non-empty text value to the `unique_key` property to override the default behavior and specify which URLs shall be considered equal. ### [**](#url)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L183)url **url: str The URL of the web page to crawl. Must be a valid HTTP or HTTPS URL, and may include query parameters and fragments. ### [**](#was_already_handled)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/_request.py#L428)was\_already\_handled **was\_already\_handled: bool Indicates whether the request was handled. --- # Source: https://docs.apify.com/sdk/python/reference/class/RequestLoader.md # RequestLoader An abstract class defining the interface for classes that provide access to a read-only stream of requests. Request loaders are used to manage and provide access to a storage of crawling requests. Key responsibilities: * Fetching the next request to be processed. * Marking requests as successfully handled after processing. * Managing state information such as the total and handled request counts. ### Hierarchy * *RequestLoader* * [RequestList](https://crawlee.dev/python/api/class/RequestList) * [RequestManager](https://crawlee.dev/python/api/class/RequestManager) * [SitemapRequestLoader](https://crawlee.dev/python/api/class/SitemapRequestLoader) ## Index[**](#Index) ### Methods * [](https://crawlee.dev/python/api/class/RequestLoader#fetch_next_request) * [](https://crawlee.dev/python/api/class/RequestLoader#get_handled_count) * [](https://crawlee.dev/python/api/class/RequestLoader#get_total_count) * [](https://crawlee.dev/python/api/class/RequestLoader#is_empty) * [](https://crawlee.dev/python/api/class/RequestLoader#is_finished) * [](https://crawlee.dev/python/api/class/RequestLoader#mark_request_as_handled) * [**to\_tandem](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestLoader.md#to_tandem) ## Methods[**](#Methods) ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/request_loaders/_request_loader.py#L45) : ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/request_loaders/_request_loader.py#L29) : ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/request_loaders/_request_loader.py#L33) : ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/request_loaders/_request_loader.py#L37) : ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/request_loaders/_request_loader.py#L41) : ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/request_loaders/_request_loader.py#L53) : ### [**](#to_tandem)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_request_loader.py#L56)to\_tandem * **async **to\_tandem**(request\_manager): [RequestManagerTandem](https://crawlee.dev/python/api/class/RequestManagerTandem) - Combine the loader with a request manager to support adding and reclaiming requests. *** #### Parameters * ##### optionalrequest\_manager: [RequestManager](https://crawlee.dev/python/api/class/RequestManager) | None = None Request manager to combine the loader with. If None is given, the default request queue is used. #### Returns [RequestManagerTandem](https://crawlee.dev/python/api/class/RequestManagerTandem) --- # Source: https://docs.apify.com/sdk/python/reference/class/RequestManager.md # RequestManager Base class that extends `RequestLoader` with the capability to enqueue new requests and reclaim failed ones. ### Hierarchy * [RequestLoader](https://crawlee.dev/python/api/class/RequestLoader) * *RequestManager* * [RequestQueue](https://crawlee.dev/python/api/class/RequestQueue) * [RequestManagerTandem](https://crawlee.dev/python/api/class/RequestManagerTandem) ## Index[**](#Index) ### Methods * [](https://crawlee.dev/python/api/class/RequestManager#add_request) * [](https://crawlee.dev/python/api/class/RequestManager#add_requests) * [**drop](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestManager.md#drop) * [](https://crawlee.dev/python/api/class/RequestManager#fetch_next_request) * [](https://crawlee.dev/python/api/class/RequestManager#get_handled_count) * [](https://crawlee.dev/python/api/class/RequestManager#get_total_count) * [](https://crawlee.dev/python/api/class/RequestManager#is_empty) * [](https://crawlee.dev/python/api/class/RequestManager#is_finished) * [](https://crawlee.dev/python/api/class/RequestManager#mark_request_as_handled) * [](https://crawlee.dev/python/api/class/RequestManager#reclaim_request) * [**to\_tandem](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestManager.md#to_tandem) ## Methods[**](#Methods) ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/request_loaders/_request_manager.py#L26) : ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/request_loaders/_request_manager.py#L43) : ### [**](#drop)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_request_manager.py#L22)drop * **async **drop**(): None - Overrides [Storage.drop](https://crawlee.dev/python/api/class/Storage#drop) Remove persistent state either from the Apify Cloud storage or from the local database. *** #### Returns None ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/request_loaders/_request_loader.py#L45) : ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/request_loaders/_request_loader.py#L29) : ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/request_loaders/_request_loader.py#L33) : ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/request_loaders/_request_loader.py#L37) : ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/request_loaders/_request_loader.py#L41) : ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/request_loaders/_request_loader.py#L53) : ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/request_loaders/_request_manager.py#L70) : ### [**](#to_tandem)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_request_loader.py#L56)to\_tandem * **async **to\_tandem**(request\_manager): [RequestManagerTandem](https://crawlee.dev/python/api/class/RequestManagerTandem) - Inherited from [RequestLoader.to\_tandem](https://crawlee.dev/python/api/class/RequestLoader#to_tandem) Combine the loader with a request manager to support adding and reclaiming requests. *** #### Parameters * ##### optionalrequest\_manager: RequestManager | None = None Request manager to combine the loader with. If None is given, the default request queue is used. #### Returns [RequestManagerTandem](https://crawlee.dev/python/api/class/RequestManagerTandem) --- # Source: https://docs.apify.com/sdk/python/reference/class/RequestManagerTandem.md # RequestManagerTandem Implements a tandem behaviour for a pair of `RequestLoader` and `RequestManager`. In this scenario, the contents of the "loader" get transferred into the "manager", allowing processing the requests from both sources and also enqueueing new requests (not possible with plain `RequestManager`). ### Hierarchy * [RequestManager](https://crawlee.dev/python/api/class/RequestManager) * *RequestManagerTandem* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestManagerTandem.md#__init__) * [**add\_request](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestManagerTandem.md#add_request) * [**add\_requests](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestManagerTandem.md#add_requests) * [**drop](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestManagerTandem.md#drop) * [**fetch\_next\_request](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestManagerTandem.md#fetch_next_request) * [**get\_handled\_count](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestManagerTandem.md#get_handled_count) * [**get\_total\_count](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestManagerTandem.md#get_total_count) * [**is\_empty](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestManagerTandem.md#is_empty) * [**is\_finished](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestManagerTandem.md#is_finished) * [**mark\_request\_as\_handled](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestManagerTandem.md#mark_request_as_handled) * [**reclaim\_request](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestManagerTandem.md#reclaim_request) * [**to\_tandem](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestManagerTandem.md#to_tandem) ## Methods[**](#Methods) ### [**](#__init__)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_request_manager_tandem.py#L31)\_\_init\_\_ * ****\_\_init\_\_**(request\_loader, request\_manager): None - #### Parameters * ##### request\_loader: [RequestLoader](https://crawlee.dev/python/api/class/RequestLoader) * ##### request\_manager: [RequestManager](https://crawlee.dev/python/api/class/RequestManager) #### Returns None ### [**](#add_request)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_request_manager_tandem.py#L52)add\_request * **async **add\_request**(request, \*, forefront): [ProcessedRequest](https://crawlee.dev/python/api/class/ProcessedRequest) - Overrides [RequestManager.add\_request](https://crawlee.dev/python/api/class/RequestManager#add_request) Add a single request to the manager and store it in underlying resource client. *** #### Parameters * ##### request: str | [Request](https://crawlee.dev/python/api/class/Request) The request object (or its string representation) to be added to the manager. * ##### optionalkeyword-onlyforefront: bool = False Determines whether the request should be added to the beginning (if True) or the end (if False) of the manager. #### Returns [ProcessedRequest](https://crawlee.dev/python/api/class/ProcessedRequest) ### [**](#add_requests)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_request_manager_tandem.py#L56)add\_requests * **async **add\_requests**(requests, \*, forefront, batch\_size, wait\_time\_between\_batches, wait\_for\_all\_requests\_to\_be\_added, wait\_for\_all\_requests\_to\_be\_added\_timeout): None - Overrides [RequestManager.add\_requests](https://crawlee.dev/python/api/class/RequestManager#add_requests) Add requests to the manager in batches. *** #### Parameters * ##### requests: Sequence\[str | [Request](https://crawlee.dev/python/api/class/Request)] Requests to enqueue. * ##### optionalkeyword-onlyforefront: bool = False If True, add requests to the beginning of the queue. * ##### optionalkeyword-onlybatch\_size: int = 1000 The number of requests to add in one batch. * ##### optionalkeyword-onlywait\_time\_between\_batches: timedelta = timedelta(seconds=1) Time to wait between adding batches. * ##### optionalkeyword-onlywait\_for\_all\_requests\_to\_be\_added: bool = False If True, wait for all requests to be added before returning. * ##### optionalkeyword-onlywait\_for\_all\_requests\_to\_be\_added\_timeout: timedelta | None = None Timeout for waiting for all requests to be added. #### Returns None ### [**](#drop)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_request_manager_tandem.py#L107)drop * **async **drop**(): None - Overrides [Storage.drop](https://crawlee.dev/python/api/class/Storage#drop) Remove persistent state either from the Apify Cloud storage or from the local database. *** #### Returns None ### [**](#fetch_next_request)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_request_manager_tandem.py#L76)fetch\_next\_request * **async **fetch\_next\_request**(): Request | None - Overrides [RequestManager.fetch\_next\_request](https://crawlee.dev/python/api/class/RequestManager#fetch_next_request) Return the next request to be processed, or `None` if there are no more pending requests. The method should return `None` if and only if `is_finished` would return `True`. In other cases, the method should wait until a request appears. *** #### Returns Request | None ### [**](#get_handled_count)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_request_manager_tandem.py#L36)get\_handled\_count * **async **get\_handled\_count**(): int - Overrides [RequestManager.get\_handled\_count](https://crawlee.dev/python/api/class/RequestManager#get_handled_count) Get the number of requests in the loader that have been handled. *** #### Returns int ### [**](#get_total_count)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_request_manager_tandem.py#L40)get\_total\_count * **async **get\_total\_count**(): int - Overrides [RequestManager.get\_total\_count](https://crawlee.dev/python/api/class/RequestManager#get_total_count) Get an offline approximation of the total number of requests in the loader (i.e. pending + handled). *** #### Returns int ### [**](#is_empty)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_request_manager_tandem.py#L44)is\_empty * **async **is\_empty**(): bool - Overrides [RequestManager.is\_empty](https://crawlee.dev/python/api/class/RequestManager#is_empty) Return True if there are no more requests in the loader (there might still be unfinished requests). *** #### Returns bool ### [**](#is_finished)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_request_manager_tandem.py#L48)is\_finished * **async **is\_finished**(): bool - Overrides [RequestManager.is\_finished](https://crawlee.dev/python/api/class/RequestManager#is_finished) Return True if all requests have been handled. *** #### Returns bool ### [**](#mark_request_as_handled)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_request_manager_tandem.py#L103)mark\_request\_as\_handled * **async **mark\_request\_as\_handled**(request): ProcessedRequest | None - Overrides [RequestManager.mark\_request\_as\_handled](https://crawlee.dev/python/api/class/RequestManager#mark_request_as_handled) Mark a request as handled after a successful processing (or after giving up retrying). *** #### Parameters * ##### request: [Request](https://crawlee.dev/python/api/class/Request) #### Returns ProcessedRequest | None ### [**](#reclaim_request)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_request_manager_tandem.py#L99)reclaim\_request * **async **reclaim\_request**(request, \*, forefront): [ProcessedRequest](https://crawlee.dev/python/api/class/ProcessedRequest) | None - Overrides [RequestManager.reclaim\_request](https://crawlee.dev/python/api/class/RequestManager#reclaim_request) Reclaims a failed request back to the source, so that it can be returned for processing later again. It is possible to modify the request data by supplying an updated request as a parameter. *** #### Parameters * ##### request: [Request](https://crawlee.dev/python/api/class/Request) * ##### optionalkeyword-onlyforefront: bool = False #### Returns [ProcessedRequest](https://crawlee.dev/python/api/class/ProcessedRequest) | None ### [**](#to_tandem)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_request_loader.py#L56)to\_tandem * **async **to\_tandem**(request\_manager): [RequestManagerTandem](https://crawlee.dev/python/api/class/RequestManagerTandem) - Inherited from [RequestLoader.to\_tandem](https://crawlee.dev/python/api/class/RequestLoader#to_tandem) Combine the loader with a request manager to support adding and reclaiming requests. *** #### Parameters * ##### optionalrequest\_manager: RequestManager | None = None Request manager to combine the loader with. If None is given, the default request queue is used. #### Returns [RequestManagerTandem](https://crawlee.dev/python/api/class/RequestManagerTandem) --- # Source: https://docs.apify.com/sdk/python/reference/class/RequestQueue.md # Source: https://docs.apify.com/sdk/js/reference/class/RequestQueue.md # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueue.md # RequestQueue Represents a Request Queue storage on the Apify platform. Request queues store URLs (requests) to be processed by web crawlers. They provide automatic deduplication, request locking for parallel processing, and persistence. ## Index[**](#Index) ### Properties * [**accessedAt](#accessedAt) * [**actId](#actId) * [**actRunId](#actRunId) * [**createdAt](#createdAt) * [**expireAt](#expireAt) * [**generalAccess](#generalAccess) * [**hadMultipleClients](#hadMultipleClients) * [**handledRequestCount](#handledRequestCount) * [**id](#id) * [**modifiedAt](#modifiedAt) * [**name](#name) * [**pendingRequestCount](#pendingRequestCount) * [**stats](#stats) * [**title](#title) * [**totalRequestCount](#totalRequestCount) * [**userId](#userId) * [**username](#username) ## Properties[**](#Properties) ### [**](#accessedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L814)accessedAt **accessedAt: Date ### [**](#actId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L819)optionalactId **actId? : string ### [**](#actRunId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L820)optionalactRunId **actRunId? : string ### [**](#createdAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L812)createdAt **createdAt: Date ### [**](#expireAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L815)optionalexpireAt **expireAt? : string ### [**](#generalAccess)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L823)optionalgeneralAccess **generalAccess? : null | STORAGE\_GENERAL\_ACCESS ### [**](#hadMultipleClients)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L821)hadMultipleClients **hadMultipleClients: boolean ### [**](#handledRequestCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L817)handledRequestCount **handledRequestCount: number ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L807)id **id: string ### [**](#modifiedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L813)modifiedAt **modifiedAt: Date ### [**](#name)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L808)optionalname **name? : string ### [**](#pendingRequestCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L818)pendingRequestCount **pendingRequestCount: number ### [**](#stats)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L822)stats **stats: [RequestQueueStats](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueStats.md) ### [**](#title)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L809)optionaltitle **title? : string ### [**](#totalRequestCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L816)totalRequestCount **totalRequestCount: number ### [**](#userId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L810)userId **userId: string ### [**](#username)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L811)optionalusername **username? : string --- # Source: https://docs.apify.com/api/client/python/reference/class/RequestQueueClient.md # Source: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient.md # RequestQueueClient Client for managing a specific Request queue. Request queues store URLs to be crawled and their metadata. Each request in the queue has a unique ID and can be in various states (pending, handled). This client provides methods to add, get, update, and delete requests, as well as manage the queue itself. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const queueClient = client.requestQueue('my-queue-id'); // Add a request to the queue await queueClient.addRequest({ url: 'https://example.com', uniqueKey: 'example-com' }); // Get the next request from the queue const request = await queueClient.listHead(); // Mark request as handled await queueClient.updateRequest({ id: request.id, handledAt: new Date().toISOString() }); ``` * **@see** ### Hierarchy * ResourceClient * *RequestQueueClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**addRequest](#addRequest) * [**batchAddRequests](#batchAddRequests) * [**batchDeleteRequests](#batchDeleteRequests) * [**delete](#delete) * [**deleteRequest](#deleteRequest) * [**deleteRequestLock](#deleteRequestLock) * [**get](#get) * [**getRequest](#getRequest) * [**listAndLockHead](#listAndLockHead) * [**listHead](#listHead) * [**listRequests](#listRequests) * [**paginateRequests](#paginateRequests) * [**prolongRequestLock](#prolongRequestLock) * [**unlockRequests](#unlockRequests) * [**update](#update) * [**updateRequest](#updateRequest) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceClient.url ## Methods[**](#Methods) ### [**](#addRequest)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L233)addRequest * ****addRequest**(request, options): Promise<[RequestQueueClientAddRequestResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientAddRequestResult.md)> - Adds a single request to the queue. If a request with the same `uniqueKey` already exists, the method will return information about the existing request without adding a duplicate. The `uniqueKey` is used for deduplication - typically it's the URL, but you can use any string to identify the request. * **@see** * **@example** ``` const result = await client.requestQueue('my-queue').addRequest({ url: 'https://example.com', uniqueKey: 'example-page', method: 'GET', userData: { label: 'START', depth: 0 } }); console.log(`Request ID: ${result.requestId}`); console.log(`Already present: ${result.wasAlreadyPresent}`); console.log(`Already handled: ${result.wasAlreadyHandled}`); // Add urgent request to the front of the queue await client.requestQueue('my-queue').addRequest( { url: 'https://priority.com', uniqueKey: 'priority-page' }, { forefront: true } ); ``` *** #### Parameters * ##### request: Omit<[RequestQueueClientRequestSchema](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientRequestSchema.md), id> The request object to add (excluding `id`, which is assigned by the API) * ##### options: [RequestQueueClientAddRequestOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientAddRequestOptions.md) = {} Additional options #### Returns Promise<[RequestQueueClientAddRequestResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientAddRequestResult.md)> Object with `requestId`, `wasAlreadyPresent`, and `wasAlreadyHandled` flags ### [**](#batchAddRequests)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L410)batchAddRequests * ****batchAddRequests**(requests, options): Promise<[RequestQueueClientBatchRequestsOperationResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientBatchRequestsOperationResult.md)> - Adds multiple requests to the queue in a single operation. This is significantly more efficient than calling addRequest multiple times, especially for large batches. The method automatically handles batching (max 25 requests per API call), retries on rate limiting, and parallel processing. Requests are sent in chunks respecting the API payload size limit, and any unprocessed requests due to rate limits are automatically retried with exponential backoff. * **@see** * **@example** ``` // Add a batch of URLs to crawl const requests = [ { url: 'https://example.com', uniqueKey: 'page1', userData: { depth: 1 } }, { url: 'https://example.com/2', uniqueKey: 'page2', userData: { depth: 1 } }, { url: 'https://example.com/3', uniqueKey: 'page3', userData: { depth: 1 } } ]; const result = await client.requestQueue('my-queue').batchAddRequests(requests); console.log(`Successfully added: ${result.processedRequests.length}`); console.log(`Failed: ${result.unprocessedRequests.length}`); // Batch add with custom retry settings const result = await client.requestQueue('my-queue').batchAddRequests( requests, { maxUnprocessedRequestsRetries: 5, maxParallel: 10 } ); ``` *** #### Parameters * ##### requests: Omit<[RequestQueueClientRequestSchema](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientRequestSchema.md), id>\[] Array of request objects to add (excluding `id` fields) * ##### options: [RequestQueueClientBatchAddRequestWithRetriesOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientBatchAddRequestWithRetriesOptions.md) = {} Batch operation configuration #### Returns Promise<[RequestQueueClientBatchRequestsOperationResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientBatchRequestsOperationResult.md)> Object with `processedRequests` (successfully added) and `unprocessedRequests` (failed after all retries) ### [**](#batchDeleteRequests)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L480)batchDeleteRequests * ****batchDeleteRequests**(requests): Promise<[RequestQueueClientBatchRequestsOperationResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientBatchRequestsOperationResult.md)> - Deletes multiple requests from the queue in a single operation. Requests can be identified by either their ID or unique key. * **@see** *** #### Parameters * ##### requests: [RequestQueueClientRequestToDelete](https://docs.apify.com/api/client/js/api/client/js/reference.md#RequestQueueClientRequestToDelete)\[] Array of requests to delete (by id or uniqueKey) #### Returns Promise<[RequestQueueClientBatchRequestsOperationResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientBatchRequestsOperationResult.md)> Result containing processed and unprocessed requests ### [**](#delete)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L103)delete * ****delete**(): Promise\ - Deletes the Request queue. * **@see** *** #### Returns Promise\ ### [**](#deleteRequest)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L576)deleteRequest * ****deleteRequest**(id): Promise\ - Deletes a specific request from the queue. *** #### Parameters * ##### id: string Request ID #### Returns Promise\ ### [**](#deleteRequestLock)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L650)deleteRequestLock * ****deleteRequestLock**(id, options): Promise\ - Releases the lock on a request, allowing other clients to process it. This should be called after successfully processing a request or when you decide not to process it. * **@see** *** #### Parameters * ##### id: string Request ID * ##### options: [RequestQueueClientDeleteRequestLockOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientDeleteRequestLockOptions.md) = {} Options such as whether to move to front #### Returns Promise\ ### [**](#get)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L81)get * ****get**(): Promise\ - Gets the Request queue object from the Apify API. * **@see** *** #### Returns Promise\ The RequestQueue object, or `undefined` if it does not exist ### [**](#getRequest)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L513)getRequest * ****getRequest**(id): Promise\ - Gets a specific request from the queue by its ID. * **@see** *** #### Parameters * ##### id: string Request ID #### Returns Promise\ The request object, or `undefined` if not found ### [**](#listAndLockHead)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L170)listAndLockHead * ****listAndLockHead**(options): Promise<[RequestQueueClientListAndLockHeadResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientListAndLockHeadResult.md)> - Gets and locks the next requests from the queue head for processing. This method retrieves requests from the beginning of the queue and locks them for the specified duration to prevent other clients from processing them simultaneously. This is the primary method used by distributed web crawlers to coordinate work across multiple workers. Locked requests won't be returned to other clients until the lock expires or is explicitly released using deleteRequestLock. * **@see** * **@example** ``` // Get and lock up to 10 requests for 60 seconds const { items, lockSecs } = await client.requestQueue('my-queue').listAndLockHead({ lockSecs: 60, limit: 10 }); // Process each locked request for (const request of items) { console.log(`Processing: ${request.url}`); // ... process request ... // Delete lock after successful processing await client.requestQueue('my-queue').deleteRequestLock(request.id); } ``` *** #### Parameters * ##### options: [RequestQueueClientListAndLockHeadOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientListAndLockHeadOptions.md) Lock configuration #### Returns Promise<[RequestQueueClientListAndLockHeadResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientListAndLockHeadResult.md)> Object containing `items` (locked requests), `queueModifiedAt`, `hadMultipleClients`, and lock information ### [**](#listHead)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L117)listHead * ****listHead**(options): Promise<[RequestQueueClientListHeadResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientListHeadResult.md)> - Lists requests from the beginning of the queue (head). Returns the first N requests from the queue without locking them. This is useful for inspecting what requests are waiting to be processed. * **@see** *** #### Parameters * ##### options: [RequestQueueClientListHeadOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientListHeadOptions.md) = {} Options for listing (e.g., limit) #### Returns Promise<[RequestQueueClientListHeadResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientListHeadResult.md)> List of requests from the queue head ### [**](#listRequests)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L680)listRequests * ****listRequests**(options): Promise<[RequestQueueClientListRequestsResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientListRequestsResult.md)> & AsyncIterable<[RequestQueueClientRequestSchema](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientRequestSchema.md), any, any> - Lists all requests in the queue. Returns a paginated list of all requests, allowing you to iterate through the entire queue contents. * **@see** *** #### Parameters * ##### options: [RequestQueueClientListRequestsOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientListRequestsOptions.md) = {} Pagination options #### Returns Promise<[RequestQueueClientListRequestsResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientListRequestsResult.md)> & AsyncIterable<[RequestQueueClientRequestSchema](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientRequestSchema.md), any, any> List of requests with pagination information ### [**](#paginateRequests)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L771)paginateRequests * ****paginateRequests**(options): [RequestQueueRequestsAsyncIterable](https://docs.apify.com/api/client/js/api/client/js/reference.md#RequestQueueRequestsAsyncIterable)<[RequestQueueClientListRequestsResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientListRequestsResult.md)> - Returns an async iterable for paginating through all requests in the queue. This allows you to efficiently process all requests using a for-await-of loop, automatically handling pagination behind the scenes. * **@see** * **@example** ``` for await (const { items } of client.requestQueue('my-queue').paginateRequests({ limit: 100 })) { items.forEach((request) => console.log(request.url)); } ``` *** #### Parameters * ##### options: [RequestQueueClientPaginateRequestsOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientPaginateRequestsOptions.md) = {} Pagination options #### Returns [RequestQueueRequestsAsyncIterable](https://docs.apify.com/api/client/js/api/client/js/reference.md#RequestQueueRequestsAsyncIterable)<[RequestQueueClientListRequestsResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientListRequestsResult.md)> An async iterable of request pages ### [**](#prolongRequestLock)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L613)prolongRequestLock * ****prolongRequestLock**(id, options): Promise<[RequestQueueClientProlongRequestLockResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientProlongRequestLockResult.md)> - Prolongs the lock on a request to prevent it from being returned to other clients. This is useful when processing a request takes longer than expected and you need to extend the lock duration to prevent other workers from picking it up. The lock expiration time is reset to the current time plus the specified duration. * **@see** * **@example** ``` // Lock request for initial processing const { items } = await client.requestQueue('my-queue').listAndLockHead({ lockSecs: 60, limit: 1 }); const request = items[0]; // Processing takes longer than expected, extend the lock await client.requestQueue('my-queue').prolongRequestLock(request.id, { lockSecs: 120 }); ``` *** #### Parameters * ##### id: string Request ID (obtained from listAndLockHead or getRequest) * ##### options: [RequestQueueClientProlongRequestLockOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientProlongRequestLockOptions.md) Lock extension options #### Returns Promise<[RequestQueueClientProlongRequestLockResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientProlongRequestLockResult.md)> Object with new `lockExpiresAt` timestamp ### [**](#unlockRequests)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L741)unlockRequests * ****unlockRequests**(): Promise<[RequestQueueClientUnlockRequestsResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientUnlockRequestsResult.md)> - Unlocks all requests locked by this client. This is useful for releasing all locks at once, for example when shutting down a crawler gracefully. * **@see** *** #### Returns Promise<[RequestQueueClientUnlockRequestsResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientUnlockRequestsResult.md)> Number of requests that were unlocked ### [**](#update)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L92)update * ****update**(newFields): Promise<[RequestQueue](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueue.md)> - Updates the Request queue with specified fields. * **@see** *** #### Parameters * ##### newFields: [RequestQueueClientUpdateOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientUpdateOptions.md) Fields to update in the Request queue #### Returns Promise<[RequestQueue](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueue.md)> The updated RequestQueue object ### [**](#updateRequest)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L539)updateRequest * ****updateRequest**(request, options): Promise<[RequestQueueClientAddRequestResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientAddRequestResult.md)> - Updates a request in the queue. * **@see** *** #### Parameters * ##### request: [RequestQueueClientRequestSchema](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientRequestSchema.md) The updated request object (must include id) * ##### options: [RequestQueueClientAddRequestOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientAddRequestOptions.md) = {} Update options such as whether to move to front #### Returns Promise<[RequestQueueClientAddRequestResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientAddRequestResult.md)> Information about the updated request --- # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueueClientAddRequestOptions.md # RequestQueueClientAddRequestOptions ## Index[**](#Index) ### Properties * [**forefront](#forefront) ## Properties[**](#Properties) ### [**](#forefront)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L922)optionalforefront **forefront? : boolean --- # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueueClientAddRequestResult.md # RequestQueueClientAddRequestResult Result of adding a request to the queue. ## Index[**](#Index) ### Properties * [**requestId](#requestId) * [**wasAlreadyHandled](#wasAlreadyHandled) * [**wasAlreadyPresent](#wasAlreadyPresent) ## Properties[**](#Properties) ### [**](#requestId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L969)requestId **requestId: string ### [**](#wasAlreadyHandled)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L971)wasAlreadyHandled **wasAlreadyHandled: boolean ### [**](#wasAlreadyPresent)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L970)wasAlreadyPresent **wasAlreadyPresent: boolean --- # Source: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync.md # RequestQueueClientAsync Async sub-client for manipulating a single request queue. ### Hierarchy * [ResourceClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md) * *RequestQueueClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md#__init__) * [**add\_request](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md#add_request) * [**batch\_add\_requests](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md#batch_add_requests) * [**batch\_delete\_requests](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md#batch_delete_requests) * [**delete](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md#delete) * [**delete\_request](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md#delete_request) * [**delete\_request\_lock](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md#delete_request_lock) * [**get](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md#get) * [**get\_request](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md#get_request) * [**list\_and\_lock\_head](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md#list_and_lock_head) * [**list\_head](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md#list_head) * [**list\_requests](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md#list_requests) * [**prolong\_request\_lock](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md#prolong_request_lock) * [**unlock\_requests](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md#unlock_requests) * [**update](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md#update) * [**update\_request](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md#update_request) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/request_queue.py#L431)\_\_init\_\_ * ****\_\_init\_\_**(args, \*, client\_key, kwargs): None - Overrides [ResourceClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### args: Any * ##### optionalkeyword-onlyclient\_key: str | None = None A unique identifier of the client accessing the request queue. * ##### kwargs: Any #### Returns None ### [**](#add_request)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/request_queue.py#L527)add\_request * **async **add\_request**(request, \*, forefront): dict - Add a request to the queue. *** #### Parameters * ##### request: dict The request to add to the queue. * ##### optionalkeyword-onlyforefront: bool | None = None Whether to add the request to the head or the end of the queue. #### Returns dict ### [**](#batch_add_requests)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/request_queue.py#L713)batch\_add\_requests * **async **batch\_add\_requests**(requests, \*, forefront, max\_parallel, max\_unprocessed\_requests\_retries, min\_delay\_between\_unprocessed\_requests\_retries): [BatchAddRequestsResult](https://docs.apify.com/api/client/python/api/client/python/reference/class/BatchAddRequestsResult.md) - Add requests to the request queue in batches. Requests are split into batches based on size and processed in parallel. *** #### Parameters * ##### requests: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[dict] List of requests to be added to the queue. * ##### optionalkeyword-onlyforefront: bool = False Whether to add requests to the front of the queue. * ##### optionalkeyword-onlymax\_parallel: int = 5 Specifies the maximum number of parallel tasks for API calls. This is only applicable to the async client. For the sync client, this value must be set to 1, as parallel execution is not supported. * ##### optionalkeyword-onlymax\_unprocessed\_requests\_retries: int | None = None Deprecated argument. Will be removed in next major release. * ##### optionalkeyword-onlymin\_delay\_between\_unprocessed\_requests\_retries: timedelta | None = None Deprecated argument. Will be removed in next major release. #### Returns [BatchAddRequestsResult](https://docs.apify.com/api/client/python/api/client/python/reference/class/BatchAddRequestsResult.md) ### [**](#batch_delete_requests)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/request_queue.py#L793)batch\_delete\_requests * **async **batch\_delete\_requests**(requests): dict - Delete given requests from the queue. *** #### Parameters * ##### requests: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[dict] List of the requests to delete. #### Returns dict ### [**](#delete)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/request_queue.py#L475)delete * **async **delete**(): None - Delete the request queue. *** #### Returns None ### [**](#delete_request)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/request_queue.py#L602)delete\_request * **async **delete\_request**(request\_id): None - Delete a request from the queue. *** #### Parameters * ##### request\_id: str ID of the request to delete. #### Returns None ### [**](#delete_request_lock)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/request_queue.py#L646)delete\_request\_lock * **async **delete\_request\_lock**(request\_id, \*, forefront): None - Delete the lock on a request. *** #### Parameters * ##### request\_id: str ID of the request to delete the lock. * ##### optionalkeyword-onlyforefront: bool | None = None Whether to put the request in the beginning or the end of the queue after the lock is deleted. #### Returns None ### [**](#get)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/request_queue.py#L446)get * **async **get**(): dict | None - Retrieve the request queue. *** #### Returns dict | None ### [**](#get_request)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/request_queue.py#L551)get\_request * **async **get\_request**(request\_id): dict | None - Retrieve a request from the queue. *** #### Parameters * ##### request\_id: str ID of the request to retrieve. #### Returns dict | None ### [**](#list_and_lock_head)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/request_queue.py#L504)list\_and\_lock\_head * **async **list\_and\_lock\_head**(\*, lock\_secs, limit): dict - Retrieve a given number of unlocked requests from the beginning of the queue and lock them for a given time. *** #### Parameters * ##### keyword-onlylock\_secs: int How long the requests will be locked for, in seconds. * ##### optionalkeyword-onlylimit: int | None = None How many requests to retrieve. #### Returns dict ### [**](#list_head)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/request_queue.py#L482)list\_head * **async **list\_head**(\*, limit): dict - Retrieve a given number of requests from the beginning of the queue. *** #### Parameters * ##### optionalkeyword-onlylimit: int | None = None How many requests to retrieve. #### Returns dict ### [**](#list_requests)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/request_queue.py#L812)list\_requests * **async **list\_requests**(\*, limit, exclusive\_start\_id): dict - List requests in the queue. *** #### Parameters * ##### optionalkeyword-onlylimit: int | None = None How many requests to retrieve. * ##### optionalkeyword-onlyexclusive\_start\_id: str | None = None All requests up to this one (including) are skipped from the result. #### Returns dict ### [**](#prolong_request_lock)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/request_queue.py#L619)prolong\_request\_lock * **async **prolong\_request\_lock**(request\_id, \*, forefront, lock\_secs): dict - Prolong the lock on a request. *** #### Parameters * ##### request\_id: str ID of the request to prolong the lock. * ##### optionalkeyword-onlyforefront: bool | None = None Whether to put the request in the beginning or the end of the queue after lock expires. * ##### keyword-onlylock\_secs: int By how much to prolong the lock, in seconds. #### Returns dict ### [**](#unlock_requests)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/request_queue.py#L837)unlock\_requests * **async **unlock\_requests**(): dict - Unlock all requests in the queue, which were locked by the same clientKey or from the same Actor run. *** #### Returns dict ### [**](#update)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/request_queue.py#L456)update * **async **update**(\*, name, general\_access): dict - Update the request queue with specified fields. *** #### Parameters * ##### optionalkeyword-onlyname: str | None = None The new name for the request queue. * ##### optionalkeyword-onlygeneral\_access: StorageGeneralAccess | None = None Determines how others can access the request queue. #### Returns dict ### [**](#update_request)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/request_queue.py#L576)update\_request * **async **update\_request**(request, \*, forefront): dict - Update a request in the queue. *** #### Parameters * ##### request: dict The updated request. * ##### optionalkeyword-onlyforefront: bool | None = None Whether to put the updated request in the beginning or the end of the queue. #### Returns dict ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueueClientBatchAddRequestWithRetriesOptions.md # RequestQueueClientBatchAddRequestWithRetriesOptions ## Index[**](#Index) ### Properties * [**forefront](#forefront) * [**maxParallel](#maxParallel) * [**maxUnprocessedRequestsRetries](#maxUnprocessedRequestsRetries) * [**minDelayBetweenUnprocessedRequestsRetriesMillis](#minDelayBetweenUnprocessedRequestsRetriesMillis) ## Properties[**](#Properties) ### [**](#forefront)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L939)optionalforefront **forefront? : boolean ### [**](#maxParallel)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L941)optionalmaxParallel **maxParallel? : number ### [**](#maxUnprocessedRequestsRetries)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L940)optionalmaxUnprocessedRequestsRetries **maxUnprocessedRequestsRetries? : number ### [**](#minDelayBetweenUnprocessedRequestsRetriesMillis)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L942)optionalminDelayBetweenUnprocessedRequestsRetriesMillis **minDelayBetweenUnprocessedRequestsRetriesMillis? : number --- # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueueClientBatchRequestsOperationResult.md # RequestQueueClientBatchRequestsOperationResult Result of a batch operation on requests. Contains lists of successfully processed and unprocessed requests. ## Index[**](#Index) ### Properties * [**processedRequests](#processedRequests) * [**unprocessedRequests](#unprocessedRequests) ## Properties[**](#Properties) ### [**](#processedRequests)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L997)processedRequests **processedRequests: ProcessedRequest\[] ### [**](#unprocessedRequests)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L998)unprocessedRequests **unprocessedRequests: UnprocessedRequest\[] --- # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueueClientDeleteRequestLockOptions.md # RequestQueueClientDeleteRequestLockOptions ## Index[**](#Index) ### Properties * [**forefront](#forefront) ## Properties[**](#Properties) ### [**](#forefront)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L931)optionalforefront **forefront? : boolean --- # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueueClientListAndLockHeadOptions.md # RequestQueueClientListAndLockHeadOptions Options for listing and locking requests from the queue head. ## Index[**](#Index) ### Properties * [**limit](#limit) * [**lockSecs](#lockSecs) ## Properties[**](#Properties) ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L895)optionallimit **limit? : number ### [**](#lockSecs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L894)lockSecs **lockSecs: number --- # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueueClientListAndLockHeadResult.md # RequestQueueClientListAndLockHeadResult Result of listing and locking requests from the queue head. Extends [RequestQueueClientListHeadResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientListHeadResult.md) with lock information. ### Hierarchy * [RequestQueueClientListHeadResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientListHeadResult.md) * *RequestQueueClientListAndLockHeadResult* ## Index[**](#Index) ### Properties * [**clientKey](#clientKey) * [**hadMultipleClients](#hadMultipleClients) * [**items](#items) * [**limit](#limit) * [**lockSecs](#lockSecs) * [**queueHasLockedRequests](#queueHasLockedRequests) * [**queueModifiedAt](#queueModifiedAt) ## Properties[**](#Properties) ### [**](#clientKey)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L906)clientKey **clientKey: string ### [**](#hadMultipleClients)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L859)inheritedhadMultipleClients **hadMultipleClients: boolean Inherited from RequestQueueClientListHeadResult.hadMultipleClients ### [**](#items)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L860)inheriteditems **items: [RequestQueueClientListItem](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientListItem.md)\[] Inherited from RequestQueueClientListHeadResult.items ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L857)inheritedlimit **limit: number Inherited from RequestQueueClientListHeadResult.limit ### [**](#lockSecs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L904)lockSecs **lockSecs: number ### [**](#queueHasLockedRequests)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L905)queueHasLockedRequests **queueHasLockedRequests: boolean ### [**](#queueModifiedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L858)inheritedqueueModifiedAt **queueModifiedAt: Date Inherited from RequestQueueClientListHeadResult.queueModifiedAt --- # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueueClientListHeadOptions.md # RequestQueueClientListHeadOptions Options for listing requests from the queue head. ## Index[**](#Index) ### Properties * [**limit](#limit) ## Properties[**](#Properties) ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L850)optionallimit **limit? : number --- # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueueClientListHeadResult.md # RequestQueueClientListHeadResult Result of listing requests from the queue head. ### Hierarchy * *RequestQueueClientListHeadResult* * [RequestQueueClientListAndLockHeadResult](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientListAndLockHeadResult.md) ## Index[**](#Index) ### Properties * [**hadMultipleClients](#hadMultipleClients) * [**items](#items) * [**limit](#limit) * [**queueModifiedAt](#queueModifiedAt) ## Properties[**](#Properties) ### [**](#hadMultipleClients)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L859)hadMultipleClients **hadMultipleClients: boolean ### [**](#items)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L860)items **items: [RequestQueueClientListItem](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientListItem.md)\[] ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L857)limit **limit: number ### [**](#queueModifiedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L858)queueModifiedAt **queueModifiedAt: Date --- # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueueClientListItem.md # RequestQueueClientListItem Simplified request information used in list results. ## Index[**](#Index) ### Properties * [**id](#id) * [**lockExpiresAt](#lockExpiresAt) * [**method](#method) * [**retryCount](#retryCount) * [**uniqueKey](#uniqueKey) * [**url](#url) ## Properties[**](#Properties) ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L913)id **id: string ### [**](#lockExpiresAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L918)optionallockExpiresAt **lockExpiresAt? : Date ### [**](#method)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L917)method **method: [AllowedHttpMethods](https://docs.apify.com/api/client/js/api/client/js/reference.md#AllowedHttpMethods) ### [**](#retryCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L914)retryCount **retryCount: number ### [**](#uniqueKey)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L915)uniqueKey **uniqueKey: string ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L916)url **url: string --- # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueueClientListRequestsOptions.md # RequestQueueClientListRequestsOptions Options for listing all requests in the queue. ## Index[**](#Index) ### Properties * [**exclusiveStartId](#exclusiveStartId) * [**limit](#limit) ## Properties[**](#Properties) ### [**](#exclusiveStartId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L869)optionalexclusiveStartId **exclusiveStartId? : string ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L867)optionallimit **limit? : number --- # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueueClientListRequestsResult.md # RequestQueueClientListRequestsResult Result of listing all requests in the queue. ## Index[**](#Index) ### Properties * [**exclusiveStartId](#exclusiveStartId) * [**items](#items) * [**limit](#limit) ## Properties[**](#Properties) ### [**](#exclusiveStartId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L886)optionalexclusiveStartId **exclusiveStartId? : string ### [**](#items)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L887)items **items: [RequestQueueClientRequestSchema](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueClientRequestSchema.md)\[] ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L885)limit **limit: number --- # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueueClientPaginateRequestsOptions.md # RequestQueueClientPaginateRequestsOptions Options for paginating through requests in the queue. ## Index[**](#Index) ### Properties * [**exclusiveStartId](#exclusiveStartId) * [**limit](#limit) * [**maxPageLimit](#maxPageLimit) ## Properties[**](#Properties) ### [**](#exclusiveStartId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L878)optionalexclusiveStartId **exclusiveStartId? : string ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L876)optionallimit **limit? : number ### [**](#maxPageLimit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L877)optionalmaxPageLimit **maxPageLimit? : number --- # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueueClientProlongRequestLockOptions.md # RequestQueueClientProlongRequestLockOptions ## Index[**](#Index) ### Properties * [**forefront](#forefront) * [**lockSecs](#lockSecs) ## Properties[**](#Properties) ### [**](#forefront)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L926)optionalforefront **forefront? : boolean ### [**](#lockSecs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L927)lockSecs **lockSecs: number --- # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueueClientProlongRequestLockResult.md # RequestQueueClientProlongRequestLockResult ## Index[**](#Index) ### Properties * [**lockExpiresAt](#lockExpiresAt) ## Properties[**](#Properties) ### [**](#lockExpiresAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L935)lockExpiresAt **lockExpiresAt: Date --- # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueueClientRequestSchema.md # RequestQueueClientRequestSchema Complete schema for a request in the queue. Represents a URL to be crawled along with its metadata, retry information, and custom data. ## Index[**](#Index) ### Properties * [**errorMessages](#errorMessages) * [**handledAt](#handledAt) * [**headers](#headers) * [**id](#id) * [**loadedUrl](#loadedUrl) * [**method](#method) * [**noRetry](#noRetry) * [**payload](#payload) * [**retryCount](#retryCount) * [**uniqueKey](#uniqueKey) * [**url](#url) * [**userData](#userData) ## Properties[**](#Properties) ### [**](#errorMessages)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L957)optionalerrorMessages **errorMessages? : string\[] ### [**](#handledAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L960)optionalhandledAt **handledAt? : string ### [**](#headers)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L958)optionalheaders **headers? : Record\ ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L951)id **id: string ### [**](#loadedUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L962)optionalloadedUrl **loadedUrl? : string ### [**](#method)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L954)optionalmethod **method? : [AllowedHttpMethods](https://docs.apify.com/api/client/js/api/client/js/reference.md#AllowedHttpMethods) ### [**](#noRetry)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L961)optionalnoRetry **noRetry? : boolean ### [**](#payload)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L955)optionalpayload **payload? : string ### [**](#retryCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L956)optionalretryCount **retryCount? : number ### [**](#uniqueKey)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L952)uniqueKey **uniqueKey: string ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L953)url **url: string ### [**](#userData)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L959)optionaluserData **userData? : Record\ --- # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueueClientUnlockRequestsResult.md # RequestQueueClientUnlockRequestsResult ## Index[**](#Index) ### Properties * [**unlockedCount](#unlockedCount) ## Properties[**](#Properties) ### [**](#unlockedCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L988)unlockedCount **unlockedCount: number --- # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueueClientUpdateOptions.md # RequestQueueClientUpdateOptions Options for updating a Request Queue. ## Index[**](#Index) ### Properties * [**generalAccess](#generalAccess) * [**name](#name) * [**title](#title) ## Properties[**](#Properties) ### [**](#generalAccess)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L843)optionalgeneralAccess **generalAccess? : null | STORAGE\_GENERAL\_ACCESS ### [**](#name)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L841)optionalname **name? : null | string ### [**](#title)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L842)optionaltitle **title? : string --- # Source: https://docs.apify.com/api/client/python/reference/class/RequestQueueCollectionClient.md # Source: https://docs.apify.com/api/client/js/reference/class/RequestQueueCollectionClient.md # RequestQueueCollectionClient Client for managing the collection of Request queues in your account. Request queues store URLs to be crawled and their metadata. This client provides methods to list, create, or get request queues by name. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const queuesClient = client.requestQueues(); // List all request queues const { items } = await queuesClient.list(); // Get or create a request queue by name const queue = await queuesClient.getOrCreate('my-queue'); ``` * **@see** ### Hierarchy * ResourceCollectionClient * *RequestQueueCollectionClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**getOrCreate](#getOrCreate) * [**list](#list) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceCollectionClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceCollectionClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceCollectionClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceCollectionClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceCollectionClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceCollectionClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceCollectionClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceCollectionClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceCollectionClient.url ## Methods[**](#Methods) ### [**](#getOrCreate)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue_collection.ts#L82)getOrCreate * ****getOrCreate**(name): Promise<[RequestQueue](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueue.md)> - Gets or creates a Request queue with the specified name. * **@see** *** #### Parameters * ##### optionalname: string Name of the Request queue. If not provided, a default queue is used. #### Returns Promise<[RequestQueue](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueue.md)> The Request queue object. ### [**](#list)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue_collection.ts#L59)list * ****list**(options): Promise<[RequestQueueCollectionListResult](https://docs.apify.com/api/client/js/api/client/js/reference.md#RequestQueueCollectionListResult)> & AsyncIterable<[RequestQueue](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueue.md), any, any> - Lists all Request queues. 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 * ##### options: [RequestQueueCollectionListOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueueCollectionListOptions.md) = {} Pagination options. #### Returns Promise<[RequestQueueCollectionListResult](https://docs.apify.com/api/client/js/api/client/js/reference.md#RequestQueueCollectionListResult)> & AsyncIterable<[RequestQueue](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RequestQueue.md), any, any> A paginated iterator of Request queues. --- # Source: https://docs.apify.com/api/client/python/reference/class/RequestQueueCollectionClientAsync.md # RequestQueueCollectionClientAsync Async sub-client for manipulating request queues. ### Hierarchy * [ResourceCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md) * *RequestQueueCollectionClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClientAsync.md#__init__) * [**get\_or\_create](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClientAsync.md#get_or_create) * [**list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClientAsync.md#list) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/request_queue_collection.py#L58)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceCollectionClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#get_or_create)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/request_queue_collection.py#L85)get\_or\_create * **async **get\_or\_create**(\*, name): dict - Retrieve a named request queue, or create a new one when it doesn't exist. *** #### Parameters * ##### optionalkeyword-onlyname: str | None = None The name of the request queue to retrieve or create. #### Returns dict ### [**](#list)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/request_queue_collection.py#L62)list * **async **list**(\*, unnamed, limit, offset, desc): [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] - List the available request queues. *** #### Parameters * ##### optionalkeyword-onlyunnamed: bool | None = None Whether to include unnamed request queues in the list. * ##### optionalkeyword-onlylimit: int | None = None How many request queues to retrieve. * ##### optionalkeyword-onlyoffset: int | None = None What request queue to include as first when retrieving the list. * ##### optionalkeyword-onlydesc: bool | None = None Whether to sort therequest queues in descending order based on their modification date. #### Returns [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueueCollectionListOptions.md # RequestQueueCollectionListOptions ### Hierarchy * PaginationOptions * *RequestQueueCollectionListOptions* ## Index[**](#Index) ### Properties * [**chunkSize](#chunkSize) * [**desc](#desc) * [**limit](#limit) * [**offset](#offset) * [**unnamed](#unnamed) ## Properties[**](#Properties) ### [**](#chunkSize)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L258)optionalinheritedchunkSize **chunkSize? : number Inherited from PaginationOptions.chunkSize Maximum number of items returned in one API response. Relevant in the context of asyncIterator, the iterator will fetch results in chunks of this size from API and yield them one by one. It will stop fetching once the limit is reached or once all items from API have been fetched. Chunk size is usually limited by API. Minimum of those two limits will be used. ### [**](#desc)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue_collection.ts#L91)optionaldesc **desc? : boolean ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L251)optionalinheritedlimit **limit? : number Inherited from PaginationOptions.limit Maximum number of entries requested. ### [**](#offset)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L249)optionalinheritedoffset **offset? : number Inherited from PaginationOptions.offset Position of the first returned entry. ### [**](#unnamed)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue_collection.ts#L90)optionalunnamed **unnamed? : boolean --- # Source: https://docs.apify.com/sdk/python/reference/class/RequestQueueHead.md # RequestQueueHead Model for request queue head. Represents a collection of requests retrieved from the beginning of a queue, including metadata about the queue's state and lock information for the requests. ## Index[**](#Index) ### Properties * [**had\_multiple\_clients](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestQueueHead.md#had_multiple_clients) * [**items](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestQueueHead.md#items) * [**limit](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestQueueHead.md#limit) * [**lock\_time](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestQueueHead.md#lock_time) * [**model\_config](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestQueueHead.md#model_config) * [**queue\_has\_locked\_requests](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestQueueHead.md#queue_has_locked_requests) * [**queue\_modified\_at](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestQueueHead.md#queue_modified_at) ## Properties[**](#Properties) ### [**](#had_multiple_clients)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L47)had\_multiple\_clients **had\_multiple\_clients: bool Indicates whether the queue has been accessed by multiple clients (consumers). ### [**](#items)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L59)items **items: list\[Request] The list of request objects retrieved from the beginning of the queue. ### [**](#limit)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L44)limit **limit: int | None The maximum number of requests that were requested from the queue. ### [**](#lock_time)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L53)lock\_time **lock\_time: timedelta | None The duration for which the returned requests are locked and cannot be processed by other clients. ### [**](#model_config)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L42)model\_config **model\_config: Undefined ### [**](#queue_has_locked_requests)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L56)queue\_has\_locked\_requests **queue\_has\_locked\_requests: bool | None Indicates whether the queue contains any locked requests. ### [**](#queue_modified_at)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_apify/_models.py#L50)queue\_modified\_at **queue\_modified\_at: datetime The timestamp when the queue was last modified. --- # Source: https://docs.apify.com/sdk/python/reference/class/RequestQueueMetadata.md # RequestQueueMetadata Model for a request queue metadata. ### Hierarchy * [StorageMetadata](https://crawlee.dev/python/api/class/StorageMetadata) * *RequestQueueMetadata* ## Index[**](#Index) ### Properties * [**accessed\_at](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestQueueMetadata.md#accessed_at) * [**created\_at](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestQueueMetadata.md#created_at) * [**had\_multiple\_clients](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestQueueMetadata.md#had_multiple_clients) * [**handled\_request\_count](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestQueueMetadata.md#handled_request_count) * [**id](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestQueueMetadata.md#id) * [**model\_config](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestQueueMetadata.md#model_config) * [**modified\_at](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestQueueMetadata.md#modified_at) * [**name](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestQueueMetadata.md#name) * [**pending\_request\_count](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestQueueMetadata.md#pending_request_count) * [**total\_request\_count](https://docs.apify.com/sdk/python/sdk/python/reference/class/RequestQueueMetadata.md#total_request_count) ## Properties[**](#Properties) ### [**](#accessed_at)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L31)accessed\_at **accessed\_at: Annotated\[datetime, Field(alias='accessedAt')] Inherited from [StorageMetadata.accessed\_at](https://crawlee.dev/python/api/class/StorageMetadata#accessed_at) The timestamp when the storage was last accessed. ### [**](#created_at)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L34)created\_at **created\_at: Annotated\[datetime, Field(alias='createdAt')] Inherited from [StorageMetadata.created\_at](https://crawlee.dev/python/api/class/StorageMetadata#created_at) The timestamp when the storage was created. ### [**](#had_multiple_clients)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L64)had\_multiple\_clients **had\_multiple\_clients: bool Indicates whether the queue has been accessed by multiple clients (consumers). ### [**](#handled_request_count)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L67)handled\_request\_count **handled\_request\_count: int The number of requests that have been handled from the queue. ### [**](#id)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L25)id **id: Annotated\[str, Field(alias='id')] Inherited from [StorageMetadata.id](https://crawlee.dev/python/api/class/StorageMetadata#id) The unique identifier of the storage. ### [**](#model_config)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L62)model\_config **model\_config: Undefined Overrides [StorageMetadata.model\_config](https://crawlee.dev/python/api/class/StorageMetadata#model_config) ### [**](#modified_at)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L37)modified\_at **modified\_at: Annotated\[datetime, Field(alias='modifiedAt')] Inherited from [StorageMetadata.modified\_at](https://crawlee.dev/python/api/class/StorageMetadata#modified_at) The timestamp when the storage was last modified. ### [**](#name)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L28)name **name: Annotated\[str | None, Field(alias='name', default=None)] Inherited from [StorageMetadata.name](https://crawlee.dev/python/api/class/StorageMetadata#name) The name of the storage. ### [**](#pending_request_count)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L70)pending\_request\_count **pending\_request\_count: int The number of requests that are still pending in the queue. ### [**](#total_request_count)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L73)total\_request\_count **total\_request\_count: int The total number of requests that have been added to the queue. --- # Source: https://docs.apify.com/sdk/js/reference/interface/RequestQueueOperationOptions.md # externalRequestQueueOperationOptions ## Index[**](#Index) ### Properties * [**forefront](#forefront) ## Properties[**](#Properties) ### [**](#forefront)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/request_provider.d.ts#L256)externaloptionalforefront **forefront? : boolean = false If set to `true`: * while adding the request to the queue: the request will be added to the foremost position in the queue. * while reclaiming the request: the request will be placed to the beginning of the queue, so that it's returned in the next call to [RequestQueue.fetchNextRequest](https://docs.apify.com/sdk/js/sdk/js/reference/class/RequestQueue.md#fetchNextRequest). By default, it's put to the end of the queue. In case the request is already present in the queue, this option has no effect. If more requests are added with this option at once, their order in the following `fetchNextRequest` call is arbitrary. --- # Source: https://docs.apify.com/sdk/js/reference/interface/RequestQueueOptions.md # externalRequestQueueOptions * **@deprecated** Use RequestProviderOptions instead. ### Hierarchy * RequestProviderOptions * *RequestQueueOptions* ## Index[**](#Index) ### Properties * [**client](#client) * [**id](#id) * [**name](#name) * [**proxyConfiguration](#proxyConfiguration) ## Properties[**](#Properties) ### [**](#client)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/request_provider.d.ts#L221)externalinheritedclient **client: StorageClient Inherited from RequestProviderOptions.client ### [**](#id)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/request_provider.d.ts#L219)externalinheritedid **id: string Inherited from RequestProviderOptions.id ### [**](#name)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/request_provider.d.ts#L220)externaloptionalinheritedname **name? : string Inherited from RequestProviderOptions.name ### [**](#proxyConfiguration)[**](https://undefined/apify/apify-sdk-js/blob/master/node_modules/@crawlee/core/storages/request_provider.d.ts#L227)externaloptionalinheritedproxyConfiguration **proxyConfiguration? : ProxyConfiguration Inherited from RequestProviderOptions.proxyConfiguration Used to pass the proxy configuration for the `requestsFromUrl` objects. Takes advantage of the internal address rotation and authentication process. If undefined, the `requestsFromUrl` requests will be made without proxy. --- # Source: https://docs.apify.com/sdk/python/reference/class/RequestQueueStats.md # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueueStats.md # RequestQueueStats Statistics about Request Queue usage and storage. ## Index[**](#Index) ### Properties * [**deleteCount](#deleteCount) * [**headItemReadCount](#headItemReadCount) * [**readCount](#readCount) * [**storageBytes](#storageBytes) * [**writeCount](#writeCount) ## Properties[**](#Properties) ### [**](#deleteCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L832)optionaldeleteCount **deleteCount? : number ### [**](#headItemReadCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L833)optionalheadItemReadCount **headItemReadCount? : number ### [**](#readCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L830)optionalreadCount **readCount? : number ### [**](#storageBytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L834)optionalstorageBytes **storageBytes? : number ### [**](#writeCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L831)optionalwriteCount **writeCount? : number --- # Source: https://docs.apify.com/api/client/js/reference/interface/RequestQueueUserOptions.md # RequestQueueUserOptions User-specific options for RequestQueueClient. ## Index[**](#Index) ### Properties * [**clientKey](#clientKey) * [**timeoutSecs](#timeoutSecs) ## Properties[**](#Properties) ### [**](#clientKey)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L796)optionalclientKey **clientKey? : string ### [**](#timeoutSecs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/request_queue.ts#L797)optionaltimeoutSecs **timeoutSecs? : number --- # Source: https://docs.apify.com/api/client/python/reference/class/ResourceClient.md # ResourceClient Base class for sub-clients manipulating a single resource. ### Hierarchy * [BaseClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClient.md) * *ResourceClient* * [RequestQueueClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClient.md) * [DatasetClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClient.md) * [UserClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/UserClient.md) * [ScheduleClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleClient.md) * [WebhookDispatchClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchClient.md) * [ActorEnvVarClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarClient.md) * [TaskClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskClient.md) * [ActorClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClient.md) * [ActorVersionClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionClient.md) * [WebhookClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookClient.md) * [KeyValueStoreClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClient.md) * [LogClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogClient.md) * [ActorJobBaseClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorJobBaseClient.md) ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClient.md#__init__) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClient.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClient.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClient.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClient.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClient.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L56)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceClient.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClient.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) The ApifyClient instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) The HTTPClient instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L53)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClient.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L54)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClient.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/python/reference/class/ResourceClientAsync.md # ResourceClientAsync Base class for async sub-clients manipulating a single resource. ### Hierarchy * [BaseClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md) * *ResourceClientAsync* * [RequestQueueClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md) * [DatasetClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClientAsync.md) * [UserClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/UserClientAsync.md) * [ScheduleClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleClientAsync.md) * [WebhookDispatchClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchClientAsync.md) * [ActorEnvVarClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarClientAsync.md) * [TaskClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskClientAsync.md) * [ActorClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorClientAsync.md) * [ActorVersionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionClientAsync.md) * [WebhookClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookClientAsync.md) * [KeyValueStoreClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md) * [LogClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogClientAsync.md) * [ActorJobBaseClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorJobBaseClientAsync.md) ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md#__init__) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L97)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/python/reference/class/ResourceCollectionClient.md # ResourceCollectionClient Base class for sub-clients manipulating a resource collection. ### Hierarchy * [BaseClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClient.md) * *ResourceCollectionClient* * [RequestQueueCollectionClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md) * [StoreCollectionClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/StoreCollectionClient.md) * [DatasetCollectionClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetCollectionClient.md) * [KeyValueStoreCollectionClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreCollectionClient.md) * [ScheduleCollectionClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleCollectionClient.md) * [ActorVersionCollectionClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionCollectionClient.md) * [WebhookCollectionClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookCollectionClient.md) * [ActorCollectionClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorCollectionClient.md) * [ActorEnvVarCollectionClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarCollectionClient.md) * [BuildCollectionClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildCollectionClient.md) * [TaskCollectionClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskCollectionClient.md) * [RunCollectionClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunCollectionClient.md) * [WebhookDispatchCollectionClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchCollectionClient.md) ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClient.md#__init__) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClient.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClient.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClient.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClient.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClient.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L56)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceCollectionClient.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClient.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) The ApifyClient instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) The HTTPClient instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L53)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClient.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L54)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClient.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/python/reference/class/ResourceCollectionClientAsync.md # ResourceCollectionClientAsync Base class for async sub-clients manipulating a resource collection. ### Hierarchy * [BaseClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md) * *ResourceCollectionClientAsync* * [RequestQueueCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClientAsync.md) * [StoreCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/StoreCollectionClientAsync.md) * [DatasetCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetCollectionClientAsync.md) * [KeyValueStoreCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreCollectionClientAsync.md) * [ScheduleCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleCollectionClientAsync.md) * [ActorVersionCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorVersionCollectionClientAsync.md) * [WebhookCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookCollectionClientAsync.md) * [ActorCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorCollectionClientAsync.md) * [ActorEnvVarCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorEnvVarCollectionClientAsync.md) * [BuildCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/BuildCollectionClientAsync.md) * [TaskCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskCollectionClientAsync.md) * [RunCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunCollectionClientAsync.md) * [WebhookDispatchCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchCollectionClientAsync.md) ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md#__init__) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L97)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceCollectionClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/js/reference/interface/RunAbortOptions.md # RunAbortOptions Options for aborting a Run. ## Index[**](#Index) ### Properties * [**gracefully](#gracefully) ## Properties[**](#Properties) ### [**](#gracefully)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L492)optionalgracefully **gracefully? : boolean --- # Source: https://docs.apify.com/api/client/js/reference/interface/RunChargeOptions.md # RunChargeOptions Options for charging events in a pay-per-event Actor run. ## Index[**](#Index) ### Properties * [**count](#count) * [**eventName](#eventName) * [**idempotencyKey](#idempotencyKey) ## Properties[**](#Properties) ### [**](#count)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L531)optionalcount **count? : number Defaults to 1 ### [**](#eventName)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L529)eventName **eventName: string Name of the event to charge. Must be defined in the Actor's pricing info else the API will throw. ### [**](#idempotencyKey)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L533)optionalidempotencyKey **idempotencyKey? : string Defaults to runId-eventName-timestamp --- # Source: https://docs.apify.com/api/client/python/reference/class/RunClient.md # Source: https://docs.apify.com/api/client/js/reference/class/RunClient.md # RunClient Client for managing a specific Actor run. Provides methods to get run details, abort, metamorph, resurrect, wait for completion, and access the run's dataset, key-value store, request queue, and logs. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const runClient = client.run('my-run-id'); // Get run details const run = await runClient.get(); // Wait for the run to finish const finishedRun = await runClient.waitForFinish(); // Access the run's dataset const { items } = await runClient.dataset().listItems(); ``` * **@see** ### Hierarchy * ResourceClient * *RunClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**abort](#abort) * [**charge](#charge) * [**dataset](#dataset) * [**delete](#delete) * [**get](#get) * [**getStreamedLog](#getStreamedLog) * [**keyValueStore](#keyValueStore) * [**log](#log) * [**metamorph](#metamorph) * [**reboot](#reboot) * [**requestQueue](#requestQueue) * [**resurrect](#resurrect) * [**update](#update) * [**waitForFinish](#waitForFinish) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceClient.url ## Methods[**](#Methods) ### [**](#abort)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L99)abort * ****abort**(options): Promise<[ActorRun](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRun.md)> - Aborts the Actor run. * **@see** * **@example** ``` // Abort immediately await client.run('run-id').abort(); // Abort gracefully (allows cleanup) await client.run('run-id').abort({ gracefully: true }); ``` *** #### Parameters * ##### options: [RunAbortOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RunAbortOptions.md) = {} Abort options #### Returns Promise<[ActorRun](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRun.md)> The updated ActorRun object with `ABORTING` or `ABORTED` status ### [**](#charge)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L293)charge * ****charge**(options): Promise\>> - Charges the Actor run for a specific event. * **@see** *** #### Parameters * ##### options: [RunChargeOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RunChargeOptions.md) Charge options including event name and count. #### Returns Promise\>> Empty response object. ### [**](#dataset)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L375)dataset * ****dataset**(): [DatasetClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/DatasetClient.md)\> - Returns a client for the default dataset of this Actor run. * **@see** * **@example** ``` // Access run's dataset const { items } = await client.run('run-id').dataset().listItems(); ``` *** #### Returns [DatasetClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/DatasetClient.md)\> A client for accessing the run's default dataset ### [**](#delete)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L121)delete * ****delete**(): Promise\ - Deletes the Actor run. * **@see** *** #### Returns Promise\ ### [**](#get)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L71)get * ****get**(options): Promise\ - Gets the Actor run object from the Apify API. * **@see** * **@example** ``` // Get run status immediately const run = await client.run('run-id').get(); console.log(`Status: ${run.status}`); // Wait up to 60 seconds for run to finish const run = await client.run('run-id').get({ waitForFinish: 60 }); ``` *** #### Parameters * ##### options: [RunGetOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RunGetOptions.md) = {} Get options #### Returns Promise\ The ActorRun object, or `undefined` if it does not exist ### [**](#getStreamedLog)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L447)getStreamedLog * ****getStreamedLog**(options): Promise\ - Get StreamedLog for convenient streaming of the run log and their redirection. *** #### Parameters * ##### options: [GetStreamedLogOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/GetStreamedLogOptions.md) = {} #### Returns Promise\ ### [**](#keyValueStore)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L395)keyValueStore * ****keyValueStore**(): [KeyValueStoreClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/KeyValueStoreClient.md) - Returns a client for the default key-value store of this Actor run. * **@see** * **@example** ``` // Access run's key-value store const output = await client.run('run-id').keyValueStore().getRecord('OUTPUT'); ``` *** #### Returns [KeyValueStoreClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/KeyValueStoreClient.md) A client for accessing the run's default key-value store ### [**](#log)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L436)log * ****log**(): [LogClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/LogClient.md) - Returns a client for accessing the log of this Actor run. * **@see** * **@example** ``` // Get run log const log = await client.run('run-id').log().get(); console.log(log); ``` *** #### Returns [LogClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/LogClient.md) A client for accessing the run's log ### [**](#metamorph)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L150)metamorph * ****metamorph**(targetActorId, input, options): Promise<[ActorRun](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRun.md)> - Transforms the Actor run into a run of another Actor (metamorph). This operation preserves the run ID, storages (dataset, key-value store, request queue), and resource allocation. The run effectively becomes a run of the target Actor with new input. This is useful for chaining Actor executions or implementing complex workflows. * **@see** * **@example** ``` // Transform current run into another Actor const metamorphedRun = await client.run('original-run-id').metamorph( 'target-actor-id', { url: 'https://example.com' } ); console.log(`Run ${metamorphedRun.id} is now running ${metamorphedRun.actId}`); ``` *** #### Parameters * ##### targetActorId: string ID or username/name of the target Actor * ##### input: unknown Input for the target Actor. Can be any JSON-serializable value. * ##### options: [RunMetamorphOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RunMetamorphOptions.md) = {} Metamorph options #### Returns Promise<[ActorRun](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRun.md)> The metamorphed ActorRun object (same ID, but now running the target Actor) ### [**](#reboot)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L205)reboot * ****reboot**(): Promise<[ActorRun](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRun.md)> - Reboots the Actor run. Rebooting restarts the Actor's Docker container while preserving the run ID and storages. This can be useful to recover from certain errors or to force the Actor to restart with a fresh environment. * **@see** * **@example** ``` const run = await client.run('run-id').reboot(); ``` *** #### Returns Promise<[ActorRun](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRun.md)> The updated ActorRun object ### [**](#requestQueue)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L415)requestQueue * ****requestQueue**(): [RequestQueueClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/RequestQueueClient.md) - Returns a client for the default Request queue of this Actor run. * **@see** * **@example** ``` // Access run's Request queue const { items } = await client.run('run-id').requestQueue().listHead(); ``` *** #### Returns [RequestQueueClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/RequestQueueClient.md) A client for accessing the run's default Request queue ### [**](#resurrect)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L261)resurrect * ****resurrect**(options): Promise<[ActorRun](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRun.md)> - Resurrects a finished Actor run, starting it again with the same settings. This creates a new run with the same configuration as the original run. The original run's storages (dataset, key-value store, request queue) are preserved and reused. * **@see** * **@example** ``` // Resurrect a failed run with more memory const newRun = await client.run('failed-run-id').resurrect({ memory: 2048 }); console.log(`New run started: ${newRun.id}`); ``` *** #### Parameters * ##### options: [RunResurrectOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RunResurrectOptions.md) = {} Resurrection options (override original run settings) #### Returns Promise<[ActorRun](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRun.md)> The new (resurrected) ActorRun object ### [**](#update)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L232)update * ****update**(newFields): Promise<[ActorRun](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRun.md)> - Updates the Actor run with specified fields. * **@example** ``` // Set a status message await client.run('run-id').update({ statusMessage: 'Processing items: 50/100' }); ``` *** #### Parameters * ##### newFields: [RunUpdateOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RunUpdateOptions.md) Fields to update #### Returns Promise<[ActorRun](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRun.md)> The updated ActorRun object ### [**](#waitForFinish)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L352)waitForFinish * ****waitForFinish**(options): Promise<[ActorRun](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRun.md)> - Waits for the Actor run to finish and returns the finished Run object. The promise resolves when the run reaches a terminal state (`SUCCEEDED`, `FAILED`, `ABORTED`, or `TIMED-OUT`). If `waitSecs` is provided and the timeout is reached, the promise resolves with the unfinished Run object (status will be `RUNNING` or `READY`). The promise is NOT rejected based on run status. Unlike the `waitForFinish` parameter in get, this method can wait indefinitely by polling the run status. It uses the `waitForFinish` parameter internally (max 60s per call) and continuously polls until the run finishes or the timeout is reached. * **@example** ``` // Wait indefinitely for run to finish const run = await client.run('run-id').waitForFinish(); console.log(`Run finished with status: ${run.status}`); // Wait up to 5 minutes const run = await client.run('run-id').waitForFinish({ waitSecs: 300 }); if (run.status === 'SUCCEEDED') { console.log('Run succeeded!'); } ``` *** #### Parameters * ##### options: [RunWaitForFinishOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RunWaitForFinishOptions.md) = {} Wait options #### Returns Promise<[ActorRun](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRun.md)> The ActorRun object (finished or still running if timeout was reached) --- # Source: https://docs.apify.com/api/client/python/reference/class/RunClientAsync.md # RunClientAsync Async sub-client for manipulating a single Actor run. ### Hierarchy * [ActorJobBaseClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorJobBaseClientAsync.md) * *RunClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md#__init__) * [**abort](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md#abort) * [**charge](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md#charge) * [**dataset](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md#dataset) * [**delete](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md#delete) * [**get](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md#get) * [**get\_status\_message\_watcher](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md#get_status_message_watcher) * [**get\_streamed\_log](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md#get_streamed_log) * [**key\_value\_store](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md#key_value_store) * [**log](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md#log) * [**metamorph](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md#metamorph) * [**reboot](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md#reboot) * [**request\_queue](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md#request_queue) * [**resurrect](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md#resurrect) * [**update](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md#update) * [**wait\_for\_finish](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md#wait_for_finish) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/run.py#L364)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ActorJobBaseClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ActorJobBaseClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#abort)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/run.py#L405)abort * **async **abort**(\*, gracefully): dict - Abort the Actor run which is starting or currently running and return its details. *** #### Parameters * ##### optionalkeyword-onlygracefully: bool | None = None If True, the Actor run will abort gracefully. It will send `aborting` and `persistStates` events into the run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. #### Returns dict ### [**](#charge)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/run.py#L623)charge * **async **charge**(event\_name, count, idempotency\_key): None - Charge for an event of a Pay-Per-Event Actor run. *** #### Parameters * ##### event\_name: str * ##### optionalcount: int | None = None * ##### optionalidempotency\_key: str | None = None #### Returns None ### [**](#dataset)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/run.py#L546)dataset * ****dataset**(): [DatasetClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClientAsync.md) - Get the client for the default dataset of the Actor run. *** #### Returns [DatasetClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/DatasetClientAsync.md) ### [**](#delete)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/run.py#L432)delete * **async **delete**(): None - Delete the run. *** #### Returns None ### [**](#get)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/run.py#L368)get * **async **get**(): dict | None - Return information about the Actor run. *** #### Returns dict | None ### [**](#get_status_message_watcher)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/run.py#L658)get\_status\_message\_watcher * **async **get\_status\_message\_watcher**(to\_logger, check\_period): [StatusMessageWatcherAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/StatusMessageWatcherAsync.md) - Get `StatusMessageWatcher` instance that can be used to redirect status and status messages to logs. `StatusMessageWatcher` can be explicitly started and stopped or used as a context manager. *** #### Parameters * ##### optionalto\_logger: logging.Logger | None = None `Logger` used for logging the status and status messages. If not provided, a new logger is created. * ##### optionalcheck\_period: timedelta = timedelta(seconds=1) The period with which the status message will be polled. #### Returns [StatusMessageWatcherAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/StatusMessageWatcherAsync.md) ### [**](#get_streamed_log)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/run.py#L594)get\_streamed\_log * **async **get\_streamed\_log**(to\_logger, \*, from\_start): [StreamedLogAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/StreamedLogAsync.md) - Get `StreamedLog` instance that can be used to redirect logs. `StreamedLog` can be explicitly started and stopped or used as a context manager. *** #### Parameters * ##### optionalto\_logger: logging.Logger | None = None `Logger` used for logging the redirected messages. If not provided, a new logger is created * ##### optionalkeyword-onlyfrom\_start: bool = True If `True`, all logs from the start of the actor run will be redirected. If `False`, only newly arrived logs will be redirected. This can be useful for redirecting only a small portion of relevant logs for long-running actors in stand-by. #### Returns [StreamedLogAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/StreamedLogAsync.md) ### [**](#key_value_store)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/run.py#L558)key\_value\_store * ****key\_value\_store**(): [KeyValueStoreClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md) - Get the client for the default key-value store of the Actor run. *** #### Returns [KeyValueStoreClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/KeyValueStoreClientAsync.md) ### [**](#log)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/run.py#L582)log * ****log**(): [LogClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogClientAsync.md) - Get the client for the log of the Actor run. *** #### Returns [LogClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/LogClientAsync.md) ### [**](#metamorph)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/run.py#L439)metamorph * **async **metamorph**(\*, target\_actor\_id, target\_actor\_build, run\_input, content\_type): dict - Transform an Actor run into a run of another Actor with a new input. *** #### Parameters * ##### keyword-onlytarget\_actor\_id: str ID of the target Actor that the run should be transformed into. * ##### optionalkeyword-onlytarget\_actor\_build: str | None = None The build of the target Actor. 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 target Actor (typically the latest build). * ##### optionalkeyword-onlyrun\_input: Any = None The input to pass to the new run. * ##### optionalkeyword-onlycontent\_type: str | None = None The content type of the input. #### Returns dict ### [**](#reboot)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/run.py#L532)reboot * **async **reboot**(): dict - Reboot an Actor run. Only runs that are running, i.e. runs with status RUNNING can be rebooted. *** #### Returns dict ### [**](#request_queue)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/run.py#L570)request\_queue * ****request\_queue**(): [RequestQueueClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md) - Get the client for the default request queue of the Actor run. *** #### Returns [RequestQueueClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueClientAsync.md) ### [**](#resurrect)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/run.py#L481)resurrect * **async **resurrect**(\*, build, memory\_mbytes, timeout\_secs, max\_items, max\_total\_charge\_usd, restart\_on\_error): dict - Resurrect a finished Actor run. Only finished runs, i.e. runs with status FINISHED, FAILED, ABORTED and TIMED-OUT can be resurrected. Run status will be updated to RUNNING and its container will be restarted with the same default storages. *** #### Parameters * ##### optionalkeyword-onlybuild: str | None = None Which Actor build the resurrected run should use. It can be either a build tag or build number. By default, the resurrected run uses the same build as before. * ##### optionalkeyword-onlymemory\_mbytes: int | None = None New memory limit for the resurrected run, in megabytes. By default, the resurrected run uses the same memory limit as before. * ##### optionalkeyword-onlytimeout\_secs: int | None = None New timeout for the resurrected run, in seconds. By default, the resurrected run uses the same timeout as before. * ##### optionalkeyword-onlymax\_items: int | None = None Maximum number of items that the resurrected pay-per-result run will return. By default, the resurrected run uses the same limit as before. Limit can be only increased. * ##### optionalkeyword-onlymax\_total\_charge\_usd: Decimal | None = None Maximum cost for the resurrected pay-per-event run in USD. By default, the resurrected run uses the same limit as before. Limit can be only increased. * ##### optionalkeyword-onlyrestart\_on\_error: bool | None = None Determines whether the resurrected run will be restarted if it fails. By default, the resurrected run uses the same setting as before. #### Returns dict ### [**](#update)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/run.py#L378)update * **async **update**(\*, status\_message, is\_status\_message\_terminal, general\_access): dict - Update the run with the specified fields. *** #### Parameters * ##### optionalkeyword-onlystatus\_message: str | None = None The new status message for the run. * ##### optionalkeyword-onlyis\_status\_message\_terminal: bool | None = None Set this flag to True if this is the final status message of the Actor run. * ##### optionalkeyword-onlygeneral\_access: RunGeneralAccess | None = None Determines how others can access the run and its storages. #### Returns dict ### [**](#wait_for_finish)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/run.py#L420)wait\_for\_finish * **async **wait\_for\_finish**(\*, wait\_secs): dict | None - Wait synchronously until the run finishes or the server times out. *** #### Parameters * ##### optionalkeyword-onlywait\_secs: int | None = None How long does the client wait for run to finish. None for indefinite. #### Returns dict | None ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/python/reference/class/RunCollectionClient.md # Source: https://docs.apify.com/api/client/js/reference/class/RunCollectionClient.md # RunCollectionClient Client for managing the collection of Actor runs. Provides methods to list Actor runs across all Actors or for a specific Actor. To access an individual run, use the `run()` method on the main ApifyClient. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); // List all runs const runsClient = client.runs(); const { items } = await runsClient.list(); // List runs for a specific Actor const actorRunsClient = client.actor('my-actor-id').runs(); const { items: actorRuns } = await actorRunsClient.list(); ``` * **@see** ### Hierarchy * ResourceCollectionClient * *RunCollectionClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**list](#list) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceCollectionClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceCollectionClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceCollectionClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceCollectionClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceCollectionClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceCollectionClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceCollectionClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceCollectionClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceCollectionClient.url ## Methods[**](#Methods) ### [**](#list)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run_collection.ts#L62)list * ****list**(options): PaginatedIterator<[ActorRunListItem](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRunListItem.md)> - Lists all Actor runs. 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 * ##### options: [RunCollectionListOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/RunCollectionListOptions.md) = {} Pagination and filtering options. #### Returns PaginatedIterator<[ActorRunListItem](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRunListItem.md)> A paginated iterator of Actor runs. --- # Source: https://docs.apify.com/api/client/python/reference/class/RunCollectionClientAsync.md # RunCollectionClientAsync Async sub-client for listing Actor runs. ### Hierarchy * [ResourceCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md) * *RunCollectionClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunCollectionClientAsync.md#__init__) * [**list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunCollectionClientAsync.md#list) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunCollectionClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunCollectionClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunCollectionClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunCollectionClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunCollectionClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/run_collection.py#L70)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceCollectionClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#list)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/run_collection.py#L74)list * **async **list**(\*, limit, offset, desc, status, started\_before, started\_after): [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] - List all Actor runs. List all Actor runs, either of a single Actor, or all user's Actors, depending on where this client was initialized from. *** #### Parameters * ##### optionalkeyword-onlylimit: int | None = None How many runs to retrieve. * ##### optionalkeyword-onlyoffset: int | None = None What run to include as first when retrieving the list. * ##### optionalkeyword-onlydesc: bool | None = None Whether to sort the runs in descending order based on their start date. * ##### optionalkeyword-onlystatus: (ActorJobStatus | [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[ActorJobStatus]) | None = None Retrieve only runs with the provided statuses. * ##### optionalkeyword-onlystarted\_before: (str | datetime) | None = None Only return runs started before this date (inclusive). * ##### optionalkeyword-onlystarted\_after: (str | datetime) | None = None Only return runs started after this date (inclusive). #### Returns [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/js/reference/interface/RunCollectionListOptions.md # RunCollectionListOptions ### Hierarchy * PaginationOptions * *RunCollectionListOptions* ## Index[**](#Index) ### Properties * [**chunkSize](#chunkSize) * [**desc](#desc) * [**limit](#limit) * [**offset](#offset) * [**startedAfter](#startedAfter) * [**startedBefore](#startedBefore) * [**status](#status) ## Properties[**](#Properties) ### [**](#chunkSize)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L258)optionalinheritedchunkSize **chunkSize? : number Inherited from PaginationOptions.chunkSize Maximum number of items returned in one API response. Relevant in the context of asyncIterator, the iterator will fetch results in chunks of this size from API and yield them one by one. It will stop fetching once the limit is reached or once all items from API have been fetched. Chunk size is usually limited by API. Minimum of those two limits will be used. ### [**](#desc)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run_collection.ts#L83)optionaldesc **desc? : boolean ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L251)optionalinheritedlimit **limit? : number Inherited from PaginationOptions.limit Maximum number of entries requested. ### [**](#offset)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L249)optionalinheritedoffset **offset? : number Inherited from PaginationOptions.offset Position of the first returned entry. ### [**](#startedAfter)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run_collection.ts#L88)optionalstartedAfter **startedAfter? : string | Date ### [**](#startedBefore)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run_collection.ts#L87)optionalstartedBefore **startedBefore? : string | Date ### [**](#status)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run_collection.ts#L84)optionalstatus **status? : READY | RUNNING | SUCCEEDED | FAILED | ABORTING | ABORTED | TIMING-OUT | TIMED-OUT | (READY | RUNNING | SUCCEEDED | FAILED | ABORTING | ABORTED | TIMING-OUT | TIMED-OUT)\[] --- # Source: https://docs.apify.com/api/client/js/reference/interface/RunGetOptions.md # RunGetOptions Options for getting a Run. ## Index[**](#Index) ### Properties * [**waitForFinish](#waitForFinish) ## Properties[**](#Properties) ### [**](#waitForFinish)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L485)optionalwaitForFinish **waitForFinish? : number --- # Source: https://docs.apify.com/api/client/js/reference/interface/RunMetamorphOptions.md # RunMetamorphOptions Options for metamorphing a Run into another Actor. ## Index[**](#Index) ### Properties * [**build](#build) * [**contentType](#contentType) ## Properties[**](#Properties) ### [**](#build)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L500)optionalbuild **build? : string ### [**](#contentType)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L499)optionalcontentType **contentType? : string --- # Source: https://docs.apify.com/api/client/js/reference/interface/RunResurrectOptions.md # RunResurrectOptions Options for resurrecting a finished Run. ## Index[**](#Index) ### Properties * [**build](#build) * [**maxItems](#maxItems) * [**maxTotalChargeUsd](#maxTotalChargeUsd) * [**memory](#memory) * [**restartOnError](#restartOnError) * [**timeout](#timeout) ## Properties[**](#Properties) ### [**](#build)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L516)optionalbuild **build? : string ### [**](#maxItems)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L519)optionalmaxItems **maxItems? : number ### [**](#maxTotalChargeUsd)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L520)optionalmaxTotalChargeUsd **maxTotalChargeUsd? : number ### [**](#memory)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L517)optionalmemory **memory? : number ### [**](#restartOnError)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L521)optionalrestartOnError **restartOnError? : boolean ### [**](#timeout)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L518)optionaltimeout **timeout? : number --- # Source: https://docs.apify.com/api/client/js/reference/interface/RunUpdateOptions.md # RunUpdateOptions Options for updating a Run. ## Index[**](#Index) ### Properties * [**generalAccess](#generalAccess) * [**isStatusMessageTerminal](#isStatusMessageTerminal) * [**statusMessage](#statusMessage) ## Properties[**](#Properties) ### [**](#generalAccess)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L509)optionalgeneralAccess **generalAccess? : null | RUN\_GENERAL\_ACCESS ### [**](#isStatusMessageTerminal)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L508)optionalisStatusMessageTerminal **isStatusMessageTerminal? : boolean ### [**](#statusMessage)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L507)optionalstatusMessage **statusMessage? : string --- # Source: https://docs.apify.com/api/client/js/reference/interface/RunWaitForFinishOptions.md # RunWaitForFinishOptions Options for waiting for a Run to finish. ## Index[**](#Index) ### Properties * [**waitSecs](#waitSecs) ## Properties[**](#Properties) ### [**](#waitSecs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/run.ts#L545)optionalwaitSecs **waitSecs? : number Maximum time to wait for the run to finish, in seconds. If the limit is reached, the returned promise is resolved to a run object that will have status `READY` or `RUNNING`. If `waitSecs` omitted, the function waits indefinitely. --- # Source: https://docs.apify.com/api/client/js/reference/interface/Schedule.md # Schedule Represents a schedule for automated Actor or Task runs. Schedules use cron expressions to define when Actors or Tasks should run automatically. ## Index[**](#Index) ### Properties * [**actions](#actions) * [**createdAt](#createdAt) * [**cronExpression](#cronExpression) * [**description](#description) * [**id](#id) * [**isEnabled](#isEnabled) * [**isExclusive](#isExclusive) * [**lastRunAt](#lastRunAt) * [**modifiedAt](#modifiedAt) * [**name](#name) * [**nextRunAt](#nextRunAt) * [**notifications](#notifications) * [**timezone](#timezone) * [**title](#title) * [**userId](#userId) ## Properties[**](#Properties) ### [**](#actions)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L118)actions **actions: [ScheduleAction](https://docs.apify.com/api/client/js/api/client/js/reference.md#ScheduleAction)\[] ### [**](#createdAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L114)createdAt **createdAt: Date ### [**](#cronExpression)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L109)cronExpression **cronExpression: string ### [**](#description)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L113)optionaldescription **description? : string ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L105)id **id: string ### [**](#isEnabled)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L111)isEnabled **isEnabled: boolean ### [**](#isExclusive)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L112)isExclusive **isExclusive: boolean ### [**](#lastRunAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L117)lastRunAt **lastRunAt: string ### [**](#modifiedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L115)modifiedAt **modifiedAt: Date ### [**](#name)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L107)name **name: string ### [**](#nextRunAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L116)nextRunAt **nextRunAt: string ### [**](#notifications)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L119)notifications **notifications: { email: boolean } #### Type declaration * ##### email: boolean ### [**](#timezone)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L110)timezone **timezone: Africa/Abidjan | Africa/Accra | Africa/Addis\_Ababa | Africa/Algiers | Africa/Asmara | Africa/Asmera | Africa/Bamako | Africa/Bangui | Africa/Banjul | Africa/Bissau | Africa/Blantyre | Africa/Brazzaville | Africa/Bujumbura | Africa/Cairo | Africa/Casablanca | Africa/Ceuta | Africa/Conakry | Africa/Dakar | Africa/Dar\_es\_Salaam | Africa/Djibouti | Africa/Douala | Africa/El\_Aaiun | Africa/Freetown | Africa/Gaborone | Africa/Harare | Africa/Johannesburg | Africa/Juba | Africa/Kampala | Africa/Khartoum | Africa/Kigali | Africa/Kinshasa | Africa/Lagos | Africa/Libreville | Africa/Lome | Africa/Luanda | Africa/Lubumbashi | Africa/Lusaka | Africa/Malabo | Africa/Maputo | Africa/Maseru | Africa/Mbabane | Africa/Mogadishu | Africa/Monrovia | Africa/Nairobi | Africa/Ndjamena | Africa/Niamey | Africa/Nouakchott | Africa/Ouagadougou | Africa/Porto-Novo | Africa/Sao\_Tome | Africa/Timbuktu | Africa/Tripoli | Africa/Tunis | Africa/Windhoek | America/Adak | America/Anchorage | America/Anguilla | America/Antigua | America/Araguaina | America/Argentina/Buenos\_Aires | America/Argentina/Catamarca | America/Argentina/ComodRivadavia | America/Argentina/Cordoba | America/Argentina/Jujuy | America/Argentina/La\_Rioja | America/Argentina/Mendoza | America/Argentina/Rio\_Gallegos | America/Argentina/Salta | America/Argentina/San\_Juan | America/Argentina/San\_Luis | America/Argentina/Tucuman | America/Argentina/Ushuaia | America/Aruba | America/Asuncion | America/Atikokan | America/Atka | America/Bahia | America/Bahia\_Banderas | America/Barbados | America/Belem | America/Belize | America/Blanc-Sablon | America/Boa\_Vista | America/Bogota | America/Boise | America/Buenos\_Aires | America/Cambridge\_Bay | America/Campo\_Grande | America/Cancun | America/Caracas | America/Catamarca | America/Cayenne | America/Cayman | America/Chicago | America/Chihuahua | America/Coral\_Harbour | America/Cordoba | America/Costa\_Rica | America/Creston | America/Cuiaba | America/Curacao | America/Danmarkshavn | America/Dawson | America/Dawson\_Creek | America/Denver | America/Detroit | America/Dominica | America/Edmonton | America/Eirunepe | America/El\_Salvador | America/Ensenada | America/Fort\_Nelson | America/Fort\_Wayne | America/Fortaleza | America/Glace\_Bay | America/Godthab | America/Goose\_Bay | America/Grand\_Turk | America/Grenada | America/Guadeloupe | America/Guatemala | America/Guayaquil | America/Guyana | America/Halifax | America/Havana | America/Hermosillo | America/Indiana/Indianapolis | America/Indiana/Knox | America/Indiana/Marengo | America/Indiana/Petersburg | America/Indiana/Tell\_City | America/Indiana/Vevay | America/Indiana/Vincennes | America/Indiana/Winamac | America/Indianapolis | America/Inuvik | America/Iqaluit | America/Jamaica | America/Jujuy | America/Juneau | America/Kentucky/Louisville | America/Kentucky/Monticello | America/Knox\_IN | America/Kralendijk | America/La\_Paz | America/Lima | America/Los\_Angeles | America/Louisville | America/Lower\_Princes | America/Maceio | America/Managua | America/Manaus | America/Marigot | America/Martinique | America/Matamoros | America/Mazatlan | America/Mendoza | America/Menominee | America/Merida | America/Metlakatla | America/Mexico\_City | America/Miquelon | America/Moncton | America/Monterrey | America/Montevideo | America/Montreal | America/Montserrat | America/Nassau | America/New\_York | America/Nipigon | America/Nome | America/Noronha | America/North\_Dakota/Beulah | America/North\_Dakota/Center | America/North\_Dakota/New\_Salem | America/Nuuk | America/Ojinaga | America/Panama | America/Pangnirtung | America/Paramaribo | America/Phoenix | America/Port-au-Prince | America/Port\_of\_Spain | America/Porto\_Acre | America/Porto\_Velho | America/Puerto\_Rico | America/Punta\_Arenas | America/Rainy\_River | America/Rankin\_Inlet | America/Recife | America/Regina | America/Resolute | America/Rio\_Branco | America/Rosario | America/Santa\_Isabel | America/Santarem | America/Santiago | America/Santo\_Domingo | America/Sao\_Paulo | America/Scoresbysund | America/Shiprock | America/Sitka | America/St\_Barthelemy | America/St\_Johns | America/St\_Kitts | America/St\_Lucia | America/St\_Thomas | America/St\_Vincent | America/Swift\_Current | America/Tegucigalpa | America/Thule | America/Thunder\_Bay | America/Tijuana | America/Toronto | America/Tortola | America/Vancouver | America/Virgin | America/Whitehorse | America/Winnipeg | America/Yakutat | America/Yellowknife | Antarctica/Casey | Antarctica/Davis | Antarctica/DumontDUrville | Antarctica/Macquarie | Antarctica/Mawson | Antarctica/McMurdo | Antarctica/Palmer | Antarctica/Rothera | Antarctica/South\_Pole | Antarctica/Syowa | Antarctica/Troll | Antarctica/Vostok | Arctic/Longyearbyen | Asia/Aden | Asia/Almaty | Asia/Amman | Asia/Anadyr | Asia/Aqtau | Asia/Aqtobe | Asia/Ashgabat | Asia/Ashkhabad | Asia/Atyrau | Asia/Baghdad | Asia/Bahrain | Asia/Baku | Asia/Bangkok | Asia/Barnaul | Asia/Beirut | Asia/Bishkek | Asia/Brunei | Asia/Calcutta | Asia/Chita | Asia/Choibalsan | Asia/Chongqing | Asia/Chungking | Asia/Colombo | Asia/Dacca | Asia/Damascus | Asia/Dhaka | Asia/Dili | Asia/Dubai | Asia/Dushanbe | Asia/Famagusta | Asia/Gaza | Asia/Harbin | Asia/Hebron | Asia/Ho\_Chi\_Minh | Asia/Hong\_Kong | Asia/Hovd | Asia/Irkutsk | Asia/Istanbul | Asia/Jakarta | Asia/Jayapura | Asia/Jerusalem | Asia/Kabul | Asia/Kamchatka | Asia/Karachi | Asia/Kashgar | Asia/Kathmandu | Asia/Katmandu | Asia/Khandyga | Asia/Kolkata | Asia/Krasnoyarsk | Asia/Kuala\_Lumpur | Asia/Kuching | Asia/Kuwait | Asia/Macao | Asia/Macau | Asia/Magadan | Asia/Makassar | Asia/Manila | Asia/Muscat | Asia/Nicosia | Asia/Novokuznetsk | Asia/Novosibirsk | Asia/Omsk | Asia/Oral | Asia/Phnom\_Penh | Asia/Pontianak | Asia/Pyongyang | Asia/Qatar | Asia/Qostanay | Asia/Qyzylorda | Asia/Rangoon | Asia/Riyadh | Asia/Saigon | Asia/Sakhalin | Asia/Samarkand | Asia/Seoul | Asia/Shanghai | Asia/Singapore | Asia/Srednekolymsk | Asia/Taipei | Asia/Tashkent | Asia/Tbilisi | Asia/Tehran | Asia/Tel\_Aviv | Asia/Thimbu | Asia/Thimphu | Asia/Tokyo | Asia/Tomsk | Asia/Ujung\_Pandang | Asia/Ulaanbaatar | Asia/Ulan\_Bator | Asia/Urumqi | Asia/Ust-Nera | Asia/Vientiane | Asia/Vladivostok | Asia/Yakutsk | Asia/Yangon | Asia/Yekaterinburg | Asia/Yerevan | Atlantic/Azores | Atlantic/Bermuda | Atlantic/Canary | Atlantic/Cape\_Verde | Atlantic/Faeroe | Atlantic/Faroe | Atlantic/Jan\_Mayen | Atlantic/Madeira | Atlantic/Reykjavik | Atlantic/South\_Georgia | Atlantic/St\_Helena | Atlantic/Stanley | Australia/ACT | Australia/Adelaide | Australia/Brisbane | Australia/Broken\_Hill | Australia/Canberra | Australia/Currie | Australia/Darwin | Australia/Eucla | Australia/Hobart | Australia/LHI | Australia/Lindeman | Australia/Lord\_Howe | Australia/Melbourne | Australia/NSW | Australia/North | Australia/Perth | Australia/Queensland | Australia/South | Australia/Sydney | Australia/Tasmania | Australia/Victoria | Australia/West | Australia/Yancowinna | Brazil/Acre | Brazil/DeNoronha | Brazil/East | Brazil/West | CET | CST6CDT | Canada/Atlantic | Canada/Central | Canada/Eastern | Canada/Mountain | Canada/Newfoundland | Canada/Pacific | Canada/Saskatchewan | Canada/Yukon | Chile/Continental | Chile/EasterIsland | Cuba | EET | EST | EST5EDT | Egypt | Eire | Etc/GMT | Etc/GMT+0 | Etc/GMT+1 | Etc/GMT+10 | Etc/GMT+11 | Etc/GMT+12 | Etc/GMT+2 | Etc/GMT+3 | Etc/GMT+4 | Etc/GMT+5 | Etc/GMT+6 | Etc/GMT+7 | Etc/GMT+8 | Etc/GMT+9 | Etc/GMT-0 | Etc/GMT-1 | Etc/GMT-10 | Etc/GMT-11 | Etc/GMT-12 | Etc/GMT-13 | Etc/GMT-14 | Etc/GMT-2 | Etc/GMT-3 | Etc/GMT-4 | Etc/GMT-5 | Etc/GMT-6 | Etc/GMT-7 | Etc/GMT-8 | Etc/GMT-9 | Etc/GMT0 | Etc/Greenwich | Etc/UCT | Etc/UTC | Etc/Universal | Etc/Zulu | Europe/Amsterdam | Europe/Andorra | Europe/Astrakhan | Europe/Athens | Europe/Belfast | Europe/Belgrade | Europe/Berlin | Europe/Bratislava | Europe/Brussels | Europe/Bucharest | Europe/Budapest | Europe/Busingen | Europe/Chisinau | Europe/Copenhagen | Europe/Dublin | Europe/Gibraltar | Europe/Guernsey | Europe/Helsinki | Europe/Isle\_of\_Man | Europe/Istanbul | Europe/Jersey | Europe/Kaliningrad | Europe/Kiev | Europe/Kirov | Europe/Lisbon | Europe/Ljubljana | Europe/London | Europe/Luxembourg | Europe/Madrid | Europe/Malta | Europe/Mariehamn | Europe/Minsk | Europe/Monaco | Europe/Moscow | Europe/Nicosia | Europe/Oslo | Europe/Paris | Europe/Podgorica | Europe/Prague | Europe/Riga | Europe/Rome | Europe/Samara | Europe/San\_Marino | Europe/Sarajevo | Europe/Saratov | Europe/Simferopol | Europe/Skopje | Europe/Sofia | Europe/Stockholm | Europe/Tallinn | Europe/Tirane | Europe/Tiraspol | Europe/Ulyanovsk | Europe/Uzhgorod | Europe/Vaduz | Europe/Vatican | Europe/Vienna | Europe/Vilnius | Europe/Volgograd | Europe/Warsaw | Europe/Zagreb | Europe/Zaporozhye | Europe/Zurich | GB | GB-Eire | GMT | GMT+0 | GMT-0 | GMT0 | Greenwich | HST | Hongkong | Iceland | Indian/Antananarivo | Indian/Chagos | Indian/Christmas | Indian/Cocos | Indian/Comoro | Indian/Kerguelen | Indian/Mahe | Indian/Maldives | Indian/Mauritius | Indian/Mayotte | Indian/Reunion | Iran | Israel | Jamaica | Japan | Kwajalein | Libya | MET | MST | MST7MDT | Mexico/BajaNorte | Mexico/BajaSur | Mexico/General | NZ | NZ-CHAT | Navajo | PRC | PST8PDT | Pacific/Apia | Pacific/Auckland | Pacific/Bougainville | Pacific/Chatham | Pacific/Chuuk | Pacific/Easter | Pacific/Efate | Pacific/Enderbury | Pacific/Fakaofo | Pacific/Fiji | Pacific/Funafuti | Pacific/Galapagos | Pacific/Gambier | Pacific/Guadalcanal | Pacific/Guam | Pacific/Honolulu | Pacific/Johnston | Pacific/Kiritimati | Pacific/Kosrae | Pacific/Kwajalein | Pacific/Majuro | Pacific/Marquesas | Pacific/Midway | Pacific/Nauru | Pacific/Niue | Pacific/Norfolk | Pacific/Noumea | Pacific/Pago\_Pago | Pacific/Palau | Pacific/Pitcairn | Pacific/Pohnpei | Pacific/Ponape | Pacific/Port\_Moresby | Pacific/Rarotonga | Pacific/Saipan | Pacific/Samoa | Pacific/Tahiti | Pacific/Tarawa | Pacific/Tongatapu | Pacific/Truk | Pacific/Wake | Pacific/Wallis | Pacific/Yap | Poland | Portugal | ROC | ROK | Singapore | Turkey | UCT | US/Alaska | US/Aleutian | US/Arizona | US/Central | US/East-Indiana | US/Eastern | US/Hawaii | US/Indiana-Starke | US/Michigan | US/Mountain | US/Pacific | US/Samoa | UTC | Universal | W-SU | WET | Zulu ### [**](#title)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L108)optionaltitle **title? : string ### [**](#userId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L106)userId **userId: string --- # Source: https://docs.apify.com/api/client/js/reference/interface/ScheduleActionRunActor.md # ScheduleActionRunActor Scheduled action to run an Actor. ### Hierarchy * BaseScheduleAction\ * *ScheduleActionRunActor* ## Index[**](#Index) ### Properties * [**actorId](#actorId) * [**id](#id) * [**runInput](#runInput) * [**runOptions](#runOptions) * [**type](#type) ## Properties[**](#Properties) ### [**](#actorId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L158)actorId **actorId: string ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L145)inheritedid **id: string Inherited from BaseScheduleAction.id ### [**](#runInput)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L159)optionalrunInput **runInput? : [ScheduledActorRunInput](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ScheduledActorRunInput.md) ### [**](#runOptions)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L160)optionalrunOptions **runOptions? : [ScheduledActorRunOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ScheduledActorRunOptions.md) ### [**](#type)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L146)inheritedtype **type: RunActor Inherited from BaseScheduleAction.type --- # Source: https://docs.apify.com/api/client/js/reference/interface/ScheduleActionRunActorTask.md # ScheduleActionRunActorTask Scheduled action to run an Actor task. ### Hierarchy * BaseScheduleAction\ * *ScheduleActionRunActorTask* ## Index[**](#Index) ### Properties * [**actorTaskId](#actorTaskId) * [**id](#id) * [**input](#input) * [**type](#type) ## Properties[**](#Properties) ### [**](#actorTaskId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L185)actorTaskId **actorTaskId: string ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L145)inheritedid **id: string Inherited from BaseScheduleAction.id ### [**](#input)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L186)optionalinput **input? : string ### [**](#type)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L146)inheritedtype **type: RunActorTask Inherited from BaseScheduleAction.type --- # Source: https://docs.apify.com/api/client/js/reference/enum/ScheduleActions.md # ScheduleActions Types of actions that can be scheduled. ## Index[**](#Index) ### Enumeration Members * [**RunActor](#RunActor) * [**RunActorTask](#RunActorTask) ## Enumeration Members[**](<#Enumeration Members>) ### [**](#RunActor)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L140)RunActor **RunActor: RUN\_ACTOR ### [**](#RunActorTask)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L141)RunActorTask **RunActorTask: RUN\_ACTOR\_TASK --- # Source: https://docs.apify.com/api/client/python/reference/class/ScheduleClient.md # Source: https://docs.apify.com/api/client/js/reference/class/ScheduleClient.md # ScheduleClient Client for managing a specific Schedule. Schedules are used to automatically start Actors or tasks at specified times. This client provides methods to get, update, and delete schedules, as well as retrieve schedule logs. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const scheduleClient = client.schedule('my-schedule-id'); // Get schedule details const schedule = await scheduleClient.get(); // Update schedule await scheduleClient.update({ cronExpression: '0 12 * * *', isEnabled: true }); ``` * **@see** ### Hierarchy * ResourceClient * *ScheduleClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**delete](#delete) * [**get](#get) * [**getLog](#getLog) * [**update](#update) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceClient.url ## Methods[**](#Methods) ### [**](#delete)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L72)delete * ****delete**(): Promise\ - Deletes the schedule. * **@see** *** #### Returns Promise\ ### [**](#get)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L51)get * ****get**(): Promise\ - Retrieves the schedule. * **@see** *** #### Returns Promise\ The schedule object, or `undefined` if it does not exist. ### [**](#getLog)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L82)getLog * ****getLog**(): Promise\ - Retrieves the schedule's log. * **@see** *** #### Returns Promise\ The schedule log as a string, or `undefined` if it does not exist. ### [**](#update)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L62)update * ****update**(newFields): Promise<[Schedule](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Schedule.md)> - Updates the schedule with the specified fields. * **@see** *** #### Parameters * ##### newFields: Partial\ & { actions: DistributiveOptional<[ScheduleAction](https://docs.apify.com/api/client/js/api/client/js/reference.md#ScheduleAction), id>\[] }> Fields to update. #### Returns Promise<[Schedule](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Schedule.md)> The updated schedule object. --- # Source: https://docs.apify.com/api/client/python/reference/class/ScheduleClientAsync.md # ScheduleClientAsync Async sub-client for manipulating a single schedule. ### Hierarchy * [ResourceClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md) * *ScheduleClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleClientAsync.md#__init__) * [**delete](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleClientAsync.md#delete) * [**get](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleClientAsync.md#get) * [**get\_log](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleClientAsync.md#get_log) * [**update](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleClientAsync.md#update) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/schedule.py#L125)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#delete)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/schedule.py#L183)delete * **async **delete**(): None - Delete the schedule. *** #### Returns None ### [**](#get)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/schedule.py#L129)get * **async **get**(): dict | None - Return information about the schedule. *** #### Returns dict | None ### [**](#get_log)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/schedule.py#L190)get\_log * **async **get\_log**(): [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list) | None - Return log for the given schedule. *** #### Returns [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list) | None ### [**](#update)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/schedule.py#L139)update * **async **update**(\*, cron\_expression, is\_enabled, is\_exclusive, name, actions, description, timezone, title): dict - Update the schedule with specified fields. *** #### Parameters * ##### optionalkeyword-onlycron\_expression: str | None = None The cron expression used by this schedule. * ##### optionalkeyword-onlyis\_enabled: bool | None = None True if the schedule should be enabled. * ##### optionalkeyword-onlyis\_exclusive: bool | None = None When set to true, don't start Actor or Actor task if it's still running from the previous schedule. * ##### optionalkeyword-onlyname: str | None = None The name of the schedule to create. * ##### optionalkeyword-onlyactions: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[dict] | None = None Actors or tasks that should be run on this schedule. See the API documentation for exact structure. * ##### optionalkeyword-onlydescription: str | None = None Description of this schedule. * ##### optionalkeyword-onlytimezone: str | None = None Timezone in which your cron expression runs (TZ database name from ). * ##### optionalkeyword-onlytitle: str | None = None A human-friendly equivalent of the name. #### Returns dict ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/python/reference/class/ScheduleCollectionClient.md # Source: https://docs.apify.com/api/client/js/reference/class/ScheduleCollectionClient.md # ScheduleCollectionClient Client for managing the collection of Schedules in your account. Schedules are used to automatically start Actors or tasks at specified times. This client provides methods to list and create schedules. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const schedulesClient = client.schedules(); // List all schedules const { items } = await schedulesClient.list(); // Create a new schedule const newSchedule = await schedulesClient.create({ actorId: 'my-actor-id', cronExpression: '0 9 * * *', isEnabled: true }); ``` * **@see** ### Hierarchy * ResourceCollectionClient * *ScheduleCollectionClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**create](#create) * [**list](#list) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceCollectionClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceCollectionClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceCollectionClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceCollectionClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceCollectionClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceCollectionClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceCollectionClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceCollectionClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceCollectionClient.url ## Methods[**](#Methods) ### [**](#create)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule_collection.ts#L83)create * ****create**(schedule): Promise<[Schedule](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Schedule.md)> - Creates a new schedule. * **@see** *** #### Parameters * ##### optionalschedule: Partial\ & { actions: DistributiveOptional<[ScheduleAction](https://docs.apify.com/api/client/js/api/client/js/reference.md#ScheduleAction), id>\[] }> The schedule data. #### Returns Promise<[Schedule](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Schedule.md)> The created schedule object. ### [**](#list)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule_collection.ts#L63)list * ****list**(options): PaginatedIterator<[Schedule](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Schedule.md)> - Lists all schedules. 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 * ##### options: [ScheduleCollectionListOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ScheduleCollectionListOptions.md) = {} Pagination and sorting options. #### Returns PaginatedIterator<[Schedule](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Schedule.md)> A paginated iterator of schedules. --- # Source: https://docs.apify.com/api/client/python/reference/class/ScheduleCollectionClientAsync.md # ScheduleCollectionClientAsync Async sub-client for manipulating schedules. ### Hierarchy * [ResourceCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md) * *ScheduleCollectionClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleCollectionClientAsync.md#__init__) * [**create](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleCollectionClientAsync.md#create) * [**list](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleCollectionClientAsync.md#list) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleCollectionClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleCollectionClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleCollectionClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleCollectionClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/ScheduleCollectionClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/schedule_collection.py#L92)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceCollectionClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#create)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/schedule_collection.py#L117)create * **async **create**(\*, cron\_expression, is\_enabled, is\_exclusive, name, actions, description, timezone, title): dict - Create a new schedule. *** #### Parameters * ##### keyword-onlycron\_expression: str The cron expression used by this schedule. * ##### keyword-onlyis\_enabled: bool True if the schedule should be enabled. * ##### keyword-onlyis\_exclusive: bool When set to true, don't start Actor or Actor task if it's still running from the previous schedule. * ##### optionalkeyword-onlyname: str | None = None The name of the schedule to create. * ##### optionalkeyword-onlyactions: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[dict] | None = None Actors or tasks that should be run on this schedule. See the API documentation for exact structure. * ##### optionalkeyword-onlydescription: str | None = None Description of this schedule. * ##### optionalkeyword-onlytimezone: str | None = None Timezone in which your cron expression runs (TZ database name from ). * ##### optionalkeyword-onlytitle: str | None = None Title of this schedule. #### Returns dict ### [**](#list)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/schedule_collection.py#L96)list * **async **list**(\*, limit, offset, desc): [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] - List the available schedules. *** #### Parameters * ##### optionalkeyword-onlylimit: int | None = None How many schedules to retrieve. * ##### optionalkeyword-onlyoffset: int | None = None What schedules to include as first when retrieving the list. * ##### optionalkeyword-onlydesc: bool | None = None Whether to sort the schedules in descending order based on their modification date. #### Returns [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/js/reference/interface/ScheduleCollectionListOptions.md # ScheduleCollectionListOptions ### Hierarchy * PaginationOptions * *ScheduleCollectionListOptions* ## Index[**](#Index) ### Properties * [**chunkSize](#chunkSize) * [**desc](#desc) * [**limit](#limit) * [**offset](#offset) ## Properties[**](#Properties) ### [**](#chunkSize)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L258)optionalinheritedchunkSize **chunkSize? : number Inherited from PaginationOptions.chunkSize Maximum number of items returned in one API response. Relevant in the context of asyncIterator, the iterator will fetch results in chunks of this size from API and yield them one by one. It will stop fetching once the limit is reached or once all items from API have been fetched. Chunk size is usually limited by API. Minimum of those two limits will be used. ### [**](#desc)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule_collection.ts#L91)optionaldesc **desc? : boolean ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L251)optionalinheritedlimit **limit? : number Inherited from PaginationOptions.limit Maximum number of entries requested. ### [**](#offset)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L249)optionalinheritedoffset **offset? : number Inherited from PaginationOptions.offset Position of the first returned entry. --- # Source: https://docs.apify.com/api/client/js/reference/interface/ScheduledActorRunInput.md # ScheduledActorRunInput Input configuration for a scheduled Actor run. ## Index[**](#Index) ### Properties * [**body](#body) * [**contentType](#contentType) ## Properties[**](#Properties) ### [**](#body)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L167)body **body: string ### [**](#contentType)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L168)contentType **contentType: string --- # Source: https://docs.apify.com/api/client/js/reference/interface/ScheduledActorRunOptions.md # ScheduledActorRunOptions Run options for a scheduled Actor run. ## Index[**](#Index) ### Properties * [**build](#build) * [**memoryMbytes](#memoryMbytes) * [**restartOnError](#restartOnError) * [**timeoutSecs](#timeoutSecs) ## Properties[**](#Properties) ### [**](#build)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L175)build **build: string ### [**](#memoryMbytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L177)memoryMbytes **memoryMbytes: number ### [**](#restartOnError)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L178)optionalrestartOnError **restartOnError? : boolean ### [**](#timeoutSecs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/schedule.ts#L176)timeoutSecs **timeoutSecs: number --- # Source: https://docs.apify.com/sdk/python/reference/class/SitemapRequestLoader.md # SitemapRequestLoader A request loader that reads URLs from sitemap(s). The loader is designed to handle sitemaps that follow the format described in the Sitemaps protocol (). It supports both XML and plain text sitemap formats. Note that HTML pages containing links are not supported - those should be handled by regular crawlers and the `enqueue_links` functionality. The loader fetches and parses sitemaps in the background, allowing crawling to start before all URLs are loaded. It supports filtering URLs using glob and regex patterns. The loader supports state persistence, allowing it to resume from where it left off after interruption when a `persist_state_key` is provided during initialization. ### Hierarchy * [RequestLoader](https://crawlee.dev/python/api/class/RequestLoader) * *SitemapRequestLoader* ## Index[**](#Index) ### Methods * [**\_\_aenter\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/SitemapRequestLoader.md#__aenter__) * [**\_\_aexit\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/SitemapRequestLoader.md#__aexit__) * [**\_\_init\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/SitemapRequestLoader.md#__init__) * [**abort\_loading](https://docs.apify.com/sdk/python/sdk/python/reference/class/SitemapRequestLoader.md#abort_loading) * [**close](https://docs.apify.com/sdk/python/sdk/python/reference/class/SitemapRequestLoader.md#close) * [**fetch\_next\_request](https://docs.apify.com/sdk/python/sdk/python/reference/class/SitemapRequestLoader.md#fetch_next_request) * [**get\_handled\_count](https://docs.apify.com/sdk/python/sdk/python/reference/class/SitemapRequestLoader.md#get_handled_count) * [**get\_total\_count](https://docs.apify.com/sdk/python/sdk/python/reference/class/SitemapRequestLoader.md#get_total_count) * [**is\_empty](https://docs.apify.com/sdk/python/sdk/python/reference/class/SitemapRequestLoader.md#is_empty) * [**is\_finished](https://docs.apify.com/sdk/python/sdk/python/reference/class/SitemapRequestLoader.md#is_finished) * [**mark\_request\_as\_handled](https://docs.apify.com/sdk/python/sdk/python/reference/class/SitemapRequestLoader.md#mark_request_as_handled) * [**start](https://docs.apify.com/sdk/python/sdk/python/reference/class/SitemapRequestLoader.md#start) * [**to\_tandem](https://docs.apify.com/sdk/python/sdk/python/reference/class/SitemapRequestLoader.md#to_tandem) ## Methods[**](#Methods) ### [**](#__aenter__)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_sitemap_request_loader.py#L366)\_\_aenter\_\_ * **async **\_\_aenter\_\_**(): [SitemapRequestLoader](https://crawlee.dev/python/api/class/SitemapRequestLoader) - Enter the context manager. *** #### Returns [SitemapRequestLoader](https://crawlee.dev/python/api/class/SitemapRequestLoader) ### [**](#__aexit__)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_sitemap_request_loader.py#L371)\_\_aexit\_\_ * **async **\_\_aexit\_\_**(exc\_type, exc\_value, exc\_traceback): None - Exit the context manager. *** #### Parameters * ##### exc\_type: [type](https://crawlee.dev/python/api/class/SitemapSource#type)\[BaseException] | None * ##### exc\_value: BaseException | None * ##### exc\_traceback: TracebackType | None #### Returns None ### [**](#__init__)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_sitemap_request_loader.py#L106)\_\_init\_\_ * ****\_\_init\_\_**(sitemap\_urls, http\_client, \*, proxy\_info, include, exclude, max\_buffer\_size, persist\_state\_key, transform\_request\_function): None - Initialize the sitemap request loader. *** #### Parameters * ##### sitemap\_urls: list\[str] Configuration options for the loader. * ##### http\_client: [HttpClient](https://crawlee.dev/python/api/class/HttpClient) the instance of `HttpClient` to use for fetching sitemaps. * ##### optionalkeyword-onlyproxy\_info: [ProxyInfo](https://crawlee.dev/python/api/class/ProxyInfo) | None = None Optional proxy to use for fetching sitemaps. * ##### optionalkeyword-onlyinclude: list\[re.Pattern\[Any] | [Glob](https://crawlee.dev/python/api/class/Glob)] | None = None List of glob or regex patterns to include URLs. * ##### optionalkeyword-onlyexclude: list\[re.Pattern\[Any] | [Glob](https://crawlee.dev/python/api/class/Glob)] | None = None List of glob or regex patterns to exclude URLs. * ##### optionalkeyword-onlymax\_buffer\_size: int = 200 Maximum number of URLs to buffer in memory. * ##### optionalkeyword-onlypersist\_state\_key: str | None = None A key for persisting the loader's state in the KeyValueStore. When provided, allows resuming from where it left off after interruption. If None, no state persistence occurs. * ##### optionalkeyword-onlytransform\_request\_function: Callable\[\[RequestOptions], [RequestOptions](https://crawlee.dev/python/api/class/RequestOptions) | [RequestTransformAction](https://crawlee.dev/python/api#RequestTransformAction)] | None = None An optional function to transform requests generated by the loader. It receives `RequestOptions` with `url` and should return either modified `RequestOptions` or a `RequestTransformAction`. #### Returns None ### [**](#abort_loading)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_sitemap_request_loader.py#L348)abort\_loading * **async **abort\_loading**(): None - Abort the sitemap loading process. *** #### Returns None ### [**](#close)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_sitemap_request_loader.py#L361)close * **async **close**(): None - Close the request loader. *** #### Returns None ### [**](#fetch_next_request)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_sitemap_request_loader.py#L312)fetch\_next\_request * **async **fetch\_next\_request**(): [Request](https://crawlee.dev/python/api/class/Request) | None - Overrides [RequestLoader.fetch\_next\_request](https://crawlee.dev/python/api/class/RequestLoader#fetch_next_request) Fetch the next request to process. *** #### Returns [Request](https://crawlee.dev/python/api/class/Request) | None ### [**](#get_handled_count)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_sitemap_request_loader.py#L294)get\_handled\_count * **async **get\_handled\_count**(): int - Overrides [RequestLoader.get\_handled\_count](https://crawlee.dev/python/api/class/RequestLoader#get_handled_count) Return the number of URLs that have been handled. *** #### Returns int ### [**](#get_total_count)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_sitemap_request_loader.py#L288)get\_total\_count * **async **get\_total\_count**(): int - Overrides [RequestLoader.get\_total\_count](https://crawlee.dev/python/api/class/RequestLoader#get_total_count) Return the total number of URLs found so far. *** #### Returns int ### [**](#is_empty)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_sitemap_request_loader.py#L300)is\_empty * **async **is\_empty**(): bool - Overrides [RequestLoader.is\_empty](https://crawlee.dev/python/api/class/RequestLoader#is_empty) Check if there are no more URLs to process. *** #### Returns bool ### [**](#is_finished)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_sitemap_request_loader.py#L306)is\_finished * **async **is\_finished**(): bool - Overrides [RequestLoader.is\_finished](https://crawlee.dev/python/api/class/RequestLoader#is_finished) Check if all URLs have been processed. *** #### Returns bool ### [**](#mark_request_as_handled)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_sitemap_request_loader.py#L340)mark\_request\_as\_handled * **async **mark\_request\_as\_handled**(request): [ProcessedRequest](https://crawlee.dev/python/api/class/ProcessedRequest) | None - Overrides [RequestLoader.mark\_request\_as\_handled](https://crawlee.dev/python/api/class/RequestLoader#mark_request_as_handled) Mark a request as successfully handled. *** #### Parameters * ##### request: [Request](https://crawlee.dev/python/api/class/Request) #### Returns [ProcessedRequest](https://crawlee.dev/python/api/class/ProcessedRequest) | None ### [**](#start)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_sitemap_request_loader.py#L355)start * **async **start**(): None - Start the sitemap loading process. *** #### Returns None ### [**](#to_tandem)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/request_loaders/_request_loader.py#L56)to\_tandem * **async **to\_tandem**(request\_manager): [RequestManagerTandem](https://crawlee.dev/python/api/class/RequestManagerTandem) - Inherited from [RequestLoader.to\_tandem](https://crawlee.dev/python/api/class/RequestLoader#to_tandem) Combine the loader with a request manager to support adding and reclaiming requests. *** #### Parameters * ##### optionalrequest\_manager: RequestManager | None = None Request manager to combine the loader with. If None is given, the default request queue is used. #### Returns [RequestManagerTandem](https://crawlee.dev/python/api/class/RequestManagerTandem) --- # Source: https://docs.apify.com/sdk/python/reference/class/SmartApifyStorageClient.md # SmartApifyStorageClient Storage client that automatically selects cloud or local storage client based on the environment. This storage client provides access to datasets, key-value stores, and request queues by intelligently delegating to either the cloud or local storage client based on the execution environment and configuration. When running on the Apify platform (which is detected via environment variables), this client automatically uses the `cloud_storage_client` to store storage data there. When running locally, it uses the `local_storage_client` to store storage data there. You can also force cloud storage usage from your local machine by using the `force_cloud` argument. This storage client is designed to work specifically in `Actor` context and provides a seamless development experience where the same code works both locally and on the Apify platform without any changes. ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/SmartApifyStorageClient.md#__init__) * [**\_\_str\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/SmartApifyStorageClient.md#__str__) * [**create\_dataset\_client](https://docs.apify.com/sdk/python/sdk/python/reference/class/SmartApifyStorageClient.md#create_dataset_client) * [**create\_kvs\_client](https://docs.apify.com/sdk/python/sdk/python/reference/class/SmartApifyStorageClient.md#create_kvs_client) * [**create\_rq\_client](https://docs.apify.com/sdk/python/sdk/python/reference/class/SmartApifyStorageClient.md#create_rq_client) * [**get\_storage\_client\_cache\_key](https://docs.apify.com/sdk/python/sdk/python/reference/class/SmartApifyStorageClient.md#get_storage_client_cache_key) * [**get\_suitable\_storage\_client](https://docs.apify.com/sdk/python/sdk/python/reference/class/SmartApifyStorageClient.md#get_suitable_storage_client) ## Methods[**](#Methods) ### [**](#__init__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_smart_apify/_storage_client.py#L35)\_\_init\_\_ * ****\_\_init\_\_**(\*, cloud\_storage\_client, local\_storage\_client): None - Initialize a new instance. *** #### Parameters * ##### optionalkeyword-onlycloud\_storage\_client: StorageClient | None = None Storage client used when an Actor is running on the Apify platform, or when explicitly enabled via the `force_cloud` argument. Defaults to `ApifyStorageClient`. * ##### optionalkeyword-onlylocal\_storage\_client: StorageClient | None = None Storage client used when an Actor is not running on the Apify platform and when `force_cloud` flag is not set. Defaults to `FileSystemStorageClient`. #### Returns None ### [**](#__str__)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_smart_apify/_storage_client.py#L52)\_\_str\_\_ * ****\_\_str\_\_**(): str - #### Returns str ### [**](#create_dataset_client)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_smart_apify/_storage_client.py#L68)create\_dataset\_client * **async **create\_dataset\_client**(\*, id, name, alias, configuration): DatasetClient - #### Parameters * ##### optionalkeyword-onlyid: str | None = None * ##### optionalkeyword-onlyname: str | None = None * ##### optionalkeyword-onlyalias: str | None = None * ##### optionalkeyword-onlyconfiguration: CrawleeConfiguration | None = None #### Returns DatasetClient ### [**](#create_kvs_client)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_smart_apify/_storage_client.py#L81)create\_kvs\_client * **async **create\_kvs\_client**(\*, id, name, alias, configuration): KeyValueStoreClient - #### Parameters * ##### optionalkeyword-onlyid: str | None = None * ##### optionalkeyword-onlyname: str | None = None * ##### optionalkeyword-onlyalias: str | None = None * ##### optionalkeyword-onlyconfiguration: CrawleeConfiguration | None = None #### Returns KeyValueStoreClient ### [**](#create_rq_client)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_smart_apify/_storage_client.py#L94)create\_rq\_client * **async **create\_rq\_client**(\*, id, name, alias, configuration): RequestQueueClient - #### Parameters * ##### optionalkeyword-onlyid: str | None = None * ##### optionalkeyword-onlyname: str | None = None * ##### optionalkeyword-onlyalias: str | None = None * ##### optionalkeyword-onlyconfiguration: CrawleeConfiguration | None = None #### Returns RequestQueueClient ### [**](#get_storage_client_cache_key)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_smart_apify/_storage_client.py#L59)get\_storage\_client\_cache\_key * ****get\_storage\_client\_cache\_key**(configuration): Hashable - #### Parameters * ##### configuration: CrawleeConfiguration #### Returns Hashable ### [**](#get_suitable_storage_client)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/storage_clients/_smart_apify/_storage_client.py#L106)get\_suitable\_storage\_client * ****get\_suitable\_storage\_client**(\*, force\_cloud): StorageClient - Get a suitable storage client based on the global configuration and the value of the force\_cloud flag. *** #### Parameters * ##### optionalkeyword-onlyforce\_cloud: bool = False If True, return `cloud_storage_client`. #### Returns StorageClient --- # Source: https://docs.apify.com/sdk/python/reference/class/SqlStorageClient.md # SqlStorageClient SQL implementation of the storage client. This storage client provides access to datasets, key-value stores, and request queues that persist data to a SQL database using SQLAlchemy 2+. Each storage type uses two tables: one for metadata and one for records. The client accepts either a database connection string or a pre-configured AsyncEngine. If neither is provided, it creates a default SQLite database 'crawlee.db' in the storage directory. Database schema is automatically created during initialization. SQLite databases receive performance optimizations including WAL mode and increased cache size. ### Hierarchy * [StorageClient](https://crawlee.dev/python/api/class/StorageClient) * *SqlStorageClient* ## Index[**](#Index) ### Methods * [**\_\_aenter\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/SqlStorageClient.md#__aenter__) * [**\_\_aexit\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/SqlStorageClient.md#__aexit__) * [**\_\_init\_\_](https://docs.apify.com/sdk/python/sdk/python/reference/class/SqlStorageClient.md#__init__) * [**close](https://docs.apify.com/sdk/python/sdk/python/reference/class/SqlStorageClient.md#close) * [**create\_dataset\_client](https://docs.apify.com/sdk/python/sdk/python/reference/class/SqlStorageClient.md#create_dataset_client) * [**create\_kvs\_client](https://docs.apify.com/sdk/python/sdk/python/reference/class/SqlStorageClient.md#create_kvs_client) * [**create\_rq\_client](https://docs.apify.com/sdk/python/sdk/python/reference/class/SqlStorageClient.md#create_rq_client) * [**create\_session](https://docs.apify.com/sdk/python/sdk/python/reference/class/SqlStorageClient.md#create_session) * [**get\_accessed\_modified\_update\_interval](https://docs.apify.com/sdk/python/sdk/python/reference/class/SqlStorageClient.md#get_accessed_modified_update_interval) * [**get\_dialect\_name](https://docs.apify.com/sdk/python/sdk/python/reference/class/SqlStorageClient.md#get_dialect_name) * [**get\_rate\_limit\_errors](https://docs.apify.com/sdk/python/sdk/python/reference/class/SqlStorageClient.md#get_rate_limit_errors) * [**get\_storage\_client\_cache\_key](https://docs.apify.com/sdk/python/sdk/python/reference/class/SqlStorageClient.md#get_storage_client_cache_key) * [**initialize](https://docs.apify.com/sdk/python/sdk/python/reference/class/SqlStorageClient.md#initialize) ### Properties * [**engine](https://docs.apify.com/sdk/python/sdk/python/reference/class/SqlStorageClient.md#engine) ## Methods[**](#Methods) ### [**](#__aenter__)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_sql/_storage_client.py#L84)\_\_aenter\_\_ * **async **\_\_aenter\_\_**(): [SqlStorageClient](https://crawlee.dev/python/api/class/SqlStorageClient) - Async context manager entry. *** #### Returns [SqlStorageClient](https://crawlee.dev/python/api/class/SqlStorageClient) ### [**](#__aexit__)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_sql/_storage_client.py#L88)\_\_aexit\_\_ * **async **\_\_aexit\_\_**(exc\_type, exc\_value, exc\_traceback): None - Async context manager exit. *** #### Parameters * ##### exc\_type: [type](https://crawlee.dev/python/api/class/SitemapSource#type)\[BaseException] | None * ##### exc\_value: BaseException | None * ##### exc\_traceback: TracebackType | None #### Returns None ### [**](#__init__)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_sql/_storage_client.py#L49)\_\_init\_\_ * ****\_\_init\_\_**(\*, connection\_string, engine): None - Initialize the SQL storage client. *** #### Parameters * ##### optionalkeyword-onlyconnection\_string: str | None = None Database connection string (e.g., "sqlite+aiosqlite:///crawlee.db"). If not provided, defaults to SQLite database in the storage directory. * ##### optionalkeyword-onlyengine: AsyncEngine | None = None Pre-configured AsyncEngine instance. If provided, connection\_string is ignored. #### Returns None ### [**](#close)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_sql/_storage_client.py#L166)close * **async **close**(): None - Close the database connection pool. *** #### Returns None ### [**](#create_dataset_client)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_sql/_storage_client.py#L183)create\_dataset\_client * **async **create\_dataset\_client**(\*, id, name, alias, configuration): [DatasetClient](https://crawlee.dev/python/api/class/DatasetClient) - Overrides [StorageClient.create\_dataset\_client](https://crawlee.dev/python/api/class/StorageClient#create_dataset_client) Create a dataset client. *** #### Parameters * ##### optionalkeyword-onlyid: str | None = None * ##### optionalkeyword-onlyname: str | None = None * ##### optionalkeyword-onlyalias: str | None = None * ##### optionalkeyword-onlyconfiguration: [Configuration](https://crawlee.dev/python/api/class/Configuration) | None = None #### Returns [DatasetClient](https://crawlee.dev/python/api/class/DatasetClient) ### [**](#create_kvs_client)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_sql/_storage_client.py#L205)create\_kvs\_client * **async **create\_kvs\_client**(\*, id, name, alias, configuration): [KeyValueStoreClient](https://crawlee.dev/python/api/class/KeyValueStoreClient) - Overrides [StorageClient.create\_kvs\_client](https://crawlee.dev/python/api/class/StorageClient#create_kvs_client) Create a key-value store client. *** #### Parameters * ##### optionalkeyword-onlyid: str | None = None * ##### optionalkeyword-onlyname: str | None = None * ##### optionalkeyword-onlyalias: str | None = None * ##### optionalkeyword-onlyconfiguration: [Configuration](https://crawlee.dev/python/api/class/Configuration) | None = None #### Returns [KeyValueStoreClient](https://crawlee.dev/python/api/class/KeyValueStoreClient) ### [**](#create_rq_client)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_sql/_storage_client.py#L227)create\_rq\_client * **async **create\_rq\_client**(\*, id, name, alias, configuration): [RequestQueueClient](https://crawlee.dev/python/api/class/RequestQueueClient) - Overrides [StorageClient.create\_rq\_client](https://crawlee.dev/python/api/class/StorageClient#create_rq_client) Create a request queue client. *** #### Parameters * ##### optionalkeyword-onlyid: str | None = None * ##### optionalkeyword-onlyname: str | None = None * ##### optionalkeyword-onlyalias: str | None = None * ##### optionalkeyword-onlyconfiguration: [Configuration](https://crawlee.dev/python/api/class/Configuration) | None = None #### Returns [RequestQueueClient](https://crawlee.dev/python/api/class/RequestQueueClient) ### [**](#create_session)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_sql/_storage_client.py#L172)create\_session * ****create\_session**(): AsyncSession - Create a new database session. *** #### Returns AsyncSession ### [**](#get_accessed_modified_update_interval)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_sql/_storage_client.py#L108)get\_accessed\_modified\_update\_interval * ****get\_accessed\_modified\_update\_interval**(): timedelta - Get the interval for accessed and modified updates. *** #### Returns timedelta ### [**](#get_dialect_name)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_sql/_storage_client.py#L104)get\_dialect\_name * ****get\_dialect\_name**(): str | None - Get the database dialect name. *** #### Returns str | None ### [**](#get_rate_limit_errors)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_base/_storage_client.py#L74)get\_rate\_limit\_errors * ****get\_rate\_limit\_errors**(): dict\[int, int] - Inherited from [StorageClient.get\_rate\_limit\_errors](https://crawlee.dev/python/api/class/StorageClient#get_rate_limit_errors) Return statistics about rate limit errors encountered by the HTTP client in storage client. *** #### Returns dict\[int, int] ### [**](#get_storage_client_cache_key)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_base/_storage_client.py#L33)get\_storage\_client\_cache\_key * ****get\_storage\_client\_cache\_key**(configuration): Hashable - Inherited from [StorageClient.get\_storage\_client\_cache\_key](https://crawlee.dev/python/api/class/StorageClient#get_storage_client_cache_key) Return a cache key that can differentiate between different storages of this and other clients. Can be based on configuration or on the client itself. By default, returns a module and name of the client class. *** #### Parameters * ##### configuration: [Configuration](https://crawlee.dev/python/api/class/Configuration) #### Returns Hashable ### [**](#initialize)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_sql/_storage_client.py#L112)initialize * **async **initialize**(configuration): None - Initialize the database schema. This method creates all necessary tables if they don't exist. Should be called before using the storage client. *** #### Parameters * ##### configuration: [Configuration](https://crawlee.dev/python/api/class/Configuration) #### Returns None ## Properties[**](#Properties) ### [**](#engine)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_sql/_storage_client.py#L98)engine **engine: AsyncEngine Get the SQLAlchemy AsyncEngine instance. --- # Source: https://docs.apify.com/api/client/python/reference/class/Statistics.md # Statistics Statistics about API client usage and rate limit errors. ## Index[**](#Index) ### Methods * [**add\_rate\_limit\_error](https://docs.apify.com/api/client/python/api/client/python/reference/class/Statistics.md#add_rate_limit_error) ### Properties * [**calls](https://docs.apify.com/api/client/python/api/client/python/reference/class/Statistics.md#calls) * [**rate\_limit\_errors](https://docs.apify.com/api/client/python/api/client/python/reference/class/Statistics.md#rate_limit_errors) * [**requests](https://docs.apify.com/api/client/python/api/client/python/reference/class/Statistics.md#requests) ## Methods[**](#Methods) ### [**](#add_rate_limit_error)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_statistics.py#L18)add\_rate\_limit\_error * ****add\_rate\_limit\_error**(attempt): None - Add rate limit error for specific attempt. *** #### Parameters * ##### attempt: int The attempt number (1-based indexing). #### Returns None ## Properties[**](#Properties) ### [**](#calls)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_statistics.py#L9)calls **calls: int Total number of API method calls made by the client. ### [**](#rate_limit_errors)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_statistics.py#L15)rate\_limit\_errors **rate\_limit\_errors: defaultdict\[int, int] List tracking which retry attempts encountered rate limit (429) errors. ### [**](#requests)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_statistics.py#L12)requests **requests: int Total number of HTTP requests sent, including retries. --- # Source: https://docs.apify.com/api/client/python/reference/class/StatusMessageWatcher.md # StatusMessageWatcher Utility class for logging status messages from another Actor run. Status message is logged at fixed time intervals, and there is no guarantee that all messages will be logged, especially in cases of frequent status message changes. ### Hierarchy * *StatusMessageWatcher* * [StatusMessageWatcherAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/StatusMessageWatcherAsync.md) * [StatusMessageWatcherSync](https://docs.apify.com/api/client/python/api/client/python/reference/class/StatusMessageWatcherSync.md) ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/StatusMessageWatcher.md#__init__) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L394)\_\_init\_\_ * ****\_\_init\_\_**(\*, to\_logger, check\_period): None - Initialize `StatusMessageWatcher`. *** #### Parameters * ##### keyword-onlyto\_logger: logging.Logger The logger to which the status message will be redirected. * ##### optionalkeyword-onlycheck\_period: timedelta = timedelta(seconds=5) The period with which the status message will be polled. #### Returns None --- # Source: https://docs.apify.com/api/client/python/reference/class/StatusMessageWatcherAsync.md # StatusMessageWatcherAsync Async variant of `StatusMessageWatcher` that is logging in task. ### Hierarchy * [StatusMessageWatcher](https://docs.apify.com/api/client/python/api/client/python/reference/class/StatusMessageWatcher.md) * *StatusMessageWatcherAsync* ## Index[**](#Index) ### Methods * [**\_\_aenter\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/StatusMessageWatcherAsync.md#__aenter__) * [**\_\_aexit\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/StatusMessageWatcherAsync.md#__aexit__) * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/StatusMessageWatcherAsync.md#__init__) * [**start](https://docs.apify.com/api/client/python/api/client/python/reference/class/StatusMessageWatcherAsync.md#start) * [**stop](https://docs.apify.com/api/client/python/api/client/python/reference/class/StatusMessageWatcherAsync.md#stop) ## Methods[**](#Methods) ### [**](#__aenter__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L464)\_\_aenter\_\_ * **async **\_\_aenter\_\_**(): Self - Start the logging task within the context. Exiting the context will cancel the logging task. *** #### Returns Self ### [**](#__aexit__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L469)\_\_aexit\_\_ * **async **\_\_aexit\_\_**(exc\_type, exc\_val, exc\_tb): None - Cancel the logging task. *** #### Parameters * ##### exc\_type: type\[BaseException] | None * ##### exc\_val: BaseException | None * ##### exc\_tb: TracebackType | None #### Returns None ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L432)\_\_init\_\_ * ****\_\_init\_\_**(\*, run\_client, to\_logger, check\_period): None - Overrides [StatusMessageWatcher.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/StatusMessageWatcher.md#__init__) Initialize `StatusMessageWatcherAsync`. *** #### Parameters * ##### keyword-onlyrun\_client: [RunClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md) The client for run that will be used to get a status and message. * ##### keyword-onlyto\_logger: logging.Logger The logger to which the status message will be redirected. * ##### optionalkeyword-onlycheck\_period: timedelta = timedelta(seconds=1) The period with which the status message will be polled. #### Returns None ### [**](#start)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L446)start * ****start**(): Task - Start the logging task. The caller has to handle any cleanup by manually calling the `stop` method. *** #### Returns Task ### [**](#stop)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L453)stop * **async **stop**(): None - Stop the logging task. *** #### Returns None --- # Source: https://docs.apify.com/api/client/python/reference/class/StatusMessageWatcherSync.md # StatusMessageWatcherSync Sync variant of `StatusMessageWatcher` that is logging in thread. ### Hierarchy * [StatusMessageWatcher](https://docs.apify.com/api/client/python/api/client/python/reference/class/StatusMessageWatcher.md) * *StatusMessageWatcherSync* ## Index[**](#Index) ### Methods * [**\_\_enter\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/StatusMessageWatcherSync.md#__enter__) * [**\_\_exit\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/StatusMessageWatcherSync.md#__exit__) * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/StatusMessageWatcherSync.md#__init__) * [**start](https://docs.apify.com/api/client/python/api/client/python/reference/class/StatusMessageWatcherSync.md#start) * [**stop](https://docs.apify.com/api/client/python/api/client/python/reference/class/StatusMessageWatcherSync.md#stop) ## Methods[**](#Methods) ### [**](#__enter__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L521)\_\_enter\_\_ * ****\_\_enter\_\_**(): Self - Start the logging task within the context. Exiting the context will cancel the logging task. *** #### Returns Self ### [**](#__exit__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L526)\_\_exit\_\_ * ****\_\_exit\_\_**(exc\_type, exc\_val, exc\_tb): None - Cancel the logging task. *** #### Parameters * ##### exc\_type: type\[BaseException] | None * ##### exc\_val: BaseException | None * ##### exc\_tb: TracebackType | None #### Returns None ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L487)\_\_init\_\_ * ****\_\_init\_\_**(\*, run\_client, to\_logger, check\_period): None - Overrides [StatusMessageWatcher.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/StatusMessageWatcher.md#__init__) Initialize `StatusMessageWatcherSync`. *** #### Parameters * ##### keyword-onlyrun\_client: [RunClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClient.md) The client for run that will be used to get a status and message. * ##### keyword-onlyto\_logger: logging.Logger The logger to which the status message will be redirected. * ##### optionalkeyword-onlycheck\_period: timedelta = timedelta(seconds=1) The period with which the status message will be polled. #### Returns None ### [**](#start)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L502)start * ****start**(): Thread - Start the logging thread. The caller has to handle any cleanup by manually calling the `stop` method. *** #### Returns Thread ### [**](#stop)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L511)stop * ****stop**(): None - Signal the \_logging\_thread thread to stop logging and wait for it to finish. *** #### Returns None --- # Source: https://docs.apify.com/sdk/python/reference/class/Storage.md # Storage Base class for storages. ### Hierarchy * *Storage* * [KeyValueStore](https://crawlee.dev/python/api/class/KeyValueStore) * [Dataset](https://crawlee.dev/python/api/class/Dataset) * [RequestQueue](https://crawlee.dev/python/api/class/RequestQueue) ## Index[**](#Index) ### Methods * [](https://crawlee.dev/python/api/class/Storage#drop) * [](https://crawlee.dev/python/api/class/Storage#get_metadata) * [](https://crawlee.dev/python/api/class/Storage#open) * [](https://crawlee.dev/python/api/class/Storage#purge) ### Properties * [**id](https://docs.apify.com/sdk/python/sdk/python/reference/class/Storage.md#id) * [**name](https://docs.apify.com/sdk/python/sdk/python/reference/class/Storage.md#name) ## Methods[**](#Methods) ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/storages/_base.py#L57) : ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/storages/_base.py#L29) : ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/storages/_base.py#L34) : ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/storages/_base.py#L61) : ## Properties[**](#Properties) ### [**](#id)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storages/_base.py#L20)id **id: str Get the storage ID. ### [**](#name)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storages/_base.py#L25)name **name: str | None Get the storage name. --- # Source: https://docs.apify.com/sdk/python/reference/class/StorageClient.md # StorageClient Base class for storage clients. The `StorageClient` serves as an abstract base class that defines the interface for accessing Crawlee's storage types: datasets, key-value stores, and request queues. It provides methods to open clients for each of these storage types and handles common functionality. Storage clients implementations can be provided for various backends (file system, memory, databases, various cloud providers, etc.) to support different use cases from development to production environments. Each storage client implementation is responsible for ensuring proper initialization, data persistence (where applicable), and consistent access patterns across all storage types it supports. ### Hierarchy * *StorageClient* * [SqlStorageClient](https://crawlee.dev/python/api/class/SqlStorageClient) * [FileSystemStorageClient](https://crawlee.dev/python/api/class/FileSystemStorageClient) * [MemoryStorageClient](https://crawlee.dev/python/api/class/MemoryStorageClient) * [RedisStorageClient](https://crawlee.dev/python/api/class/RedisStorageClient) ## Index[**](#Index) ### Methods * [](https://crawlee.dev/python/api/class/StorageClient#create_dataset_client) * [](https://crawlee.dev/python/api/class/StorageClient#create_kvs_client) * [](https://crawlee.dev/python/api/class/StorageClient#create_rq_client) * [**get\_rate\_limit\_errors](https://docs.apify.com/sdk/python/sdk/python/reference/class/StorageClient.md#get_rate_limit_errors) * [](https://crawlee.dev/python/api/class/StorageClient#get_storage_client_cache_key) ## Methods[**](#Methods) ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/storage_clients/_base/_storage_client.py#L42) : ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/storage_clients/_base/_storage_client.py#L53) : ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/storage_clients/_base/_storage_client.py#L64) : ### [**](#get_rate_limit_errors)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/_base/_storage_client.py#L74)get\_rate\_limit\_errors * ****get\_rate\_limit\_errors**(): dict\[int, int] - Return statistics about rate limit errors encountered by the HTTP client in storage client. *** #### Returns dict\[int, int] ### [**](#undefined)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/crawlee/storage_clients/_base/_storage_client.py#L33) : --- # Source: https://docs.apify.com/sdk/python/reference/class/StorageMetadata.md # StorageMetadata Represents the base model for storage metadata. It contains common fields shared across all specific storage types. ### Hierarchy * *StorageMetadata* * [DatasetMetadata](https://crawlee.dev/python/api/class/DatasetMetadata) * [KeyValueStoreMetadata](https://crawlee.dev/python/api/class/KeyValueStoreMetadata) * [RequestQueueMetadata](https://crawlee.dev/python/api/class/RequestQueueMetadata) ## Index[**](#Index) ### Properties * [**accessed\_at](https://docs.apify.com/sdk/python/sdk/python/reference/class/StorageMetadata.md#accessed_at) * [**created\_at](https://docs.apify.com/sdk/python/sdk/python/reference/class/StorageMetadata.md#created_at) * [**id](https://docs.apify.com/sdk/python/sdk/python/reference/class/StorageMetadata.md#id) * [**model\_config](https://docs.apify.com/sdk/python/sdk/python/reference/class/StorageMetadata.md#model_config) * [**modified\_at](https://docs.apify.com/sdk/python/sdk/python/reference/class/StorageMetadata.md#modified_at) * [**name](https://docs.apify.com/sdk/python/sdk/python/reference/class/StorageMetadata.md#name) ## Properties[**](#Properties) ### [**](#accessed_at)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L31)accessed\_at **accessed\_at: datetime The timestamp when the storage was last accessed. ### [**](#created_at)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L34)created\_at **created\_at: datetime The timestamp when the storage was created. ### [**](#id)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L25)id **id: str The unique identifier of the storage. ### [**](#model_config)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L23)model\_config **model\_config: Undefined ### [**](#modified_at)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L37)modified\_at **modified\_at: datetime The timestamp when the storage was last modified. ### [**](#name)[**](https://github.com/apify/crawlee-python/blob/3e08b24571bbd21f25523e9aa81bc31ba308628d//src/crawlee/storage_clients/models.py#L28)name **name: str | None The name of the storage. --- # Source: https://docs.apify.com/api/client/python/reference/class/StoreCollectionClient.md # Source: https://docs.apify.com/api/client/js/reference/class/StoreCollectionClient.md # StoreCollectionClient Client for browsing Actors in the Apify Store. The Apify Store contains publicly available Actors that can be used by anyone. This client provides methods to search and list Actors from the Store. * **@example** ``` const client = new ApifyClient(); const storeClient = client.store(); // Search for Actors in the Store const { items } = await storeClient.list({ search: 'web scraper' }); // Get details about a specific Store Actor const actor = await storeClient.list({ username: 'apify', actorName: 'web-scraper' }); ``` * **@see** ### Hierarchy * ResourceCollectionClient * *StoreCollectionClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**list](#list) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceCollectionClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceCollectionClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceCollectionClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceCollectionClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceCollectionClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceCollectionClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceCollectionClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceCollectionClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceCollectionClient.url ## Methods[**](#Methods) ### [**](#list)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/store_collection.ts#L59)list * ****list**(options): PaginatedIterator<[ActorStoreList](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorStoreList.md)> - Lists Actors from the Apify Store. 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 * ##### options: [StoreCollectionListOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/StoreCollectionListOptions.md) = {} Search and pagination options. #### Returns PaginatedIterator<[ActorStoreList](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorStoreList.md)> A paginated iterator of store Actors. --- # Source: https://docs.apify.com/api/client/python/reference/class/StoreCollectionClientAsync.md # StoreCollectionClientAsync Async sub-client for Apify store. ### Hierarchy * [ResourceCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md) * *StoreCollectionClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/StoreCollectionClientAsync.md#__init__) * [**list](https://docs.apify.com/api/client/python/api/client/python/reference/class/StoreCollectionClientAsync.md#list) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/StoreCollectionClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/StoreCollectionClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/StoreCollectionClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/StoreCollectionClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/StoreCollectionClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/store_collection.py#L60)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceCollectionClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#list)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/store_collection.py#L64)list * **async **list**(\*, limit, offset, search, sort\_by, category, username, pricing\_model): [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] - List Actors in Apify store. *** #### Parameters * ##### 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-onlysearch: str | None = None String to search by. The search runs on the following fields: title, name, description, username, readme. * ##### optionalkeyword-onlysort\_by: str | None = None Specifies the field by which to sort the results. * ##### optionalkeyword-onlycategory: str | None = None Filter by this category. * ##### optionalkeyword-onlyusername: str | None = None Filter by this username. * ##### optionalkeyword-onlypricing\_model: str | None = None Filter by this pricing model. #### Returns [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/js/reference/interface/StoreCollectionListOptions.md # StoreCollectionListOptions ### Hierarchy * PaginationOptions * *StoreCollectionListOptions* ## Index[**](#Index) ### Properties * [**category](#category) * [**chunkSize](#chunkSize) * [**limit](#limit) * [**offset](#offset) * [**pricingModel](#pricingModel) * [**search](#search) * [**sortBy](#sortBy) * [**username](#username) ## Properties[**](#Properties) ### [**](#category)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/store_collection.ts#L97)optionalcategory **category? : string ### [**](#chunkSize)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L258)optionalinheritedchunkSize **chunkSize? : number Inherited from PaginationOptions.chunkSize Maximum number of items returned in one API response. Relevant in the context of asyncIterator, the iterator will fetch results in chunks of this size from API and yield them one by one. It will stop fetching once the limit is reached or once all items from API have been fetched. Chunk size is usually limited by API. Minimum of those two limits will be used. ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L251)optionalinheritedlimit **limit? : number Inherited from PaginationOptions.limit Maximum number of entries requested. ### [**](#offset)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L249)optionalinheritedoffset **offset? : number Inherited from PaginationOptions.offset Position of the first returned entry. ### [**](#pricingModel)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/store_collection.ts#L99)optionalpricingModel **pricingModel? : string ### [**](#search)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/store_collection.ts#L95)optionalsearch **search? : string ### [**](#sortBy)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/store_collection.ts#L96)optionalsortBy **sortBy? : string ### [**](#username)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/store_collection.ts#L98)optionalusername **username? : string --- # Source: https://docs.apify.com/api/client/python/reference/class/StreamedLog.md # Source: https://docs.apify.com/api/client/js/reference/class/StreamedLog.md # StreamedLog Helper class for redirecting streamed Actor logs to another log. ## Index[**](#Index) ### Constructors * [**constructor](#constructor) ### Methods * [**start](#start) * [**stop](#stop) ## Constructors[**](#Constructors) ### [**](#constructor)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/log.ts#L155)constructor * ****new StreamedLog**(options): [StreamedLog](https://docs.apify.com/api/client/js/api/client/js/reference/class/StreamedLog.md) - #### Parameters * ##### options: [StreamedLogOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/StreamedLogOptions.md) #### Returns [StreamedLog](https://docs.apify.com/api/client/js/api/client/js/reference/class/StreamedLog.md) ## Methods[**](#Methods) ### [**](#start)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/log.ts#L165)publicstart * ****start**(): void - Start log redirection. *** #### Returns void ### [**](#stop)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/log.ts#L176)publicstop * ****stop**(): Promise\ - Stop log redirection. *** #### Returns Promise\ --- # Source: https://docs.apify.com/api/client/python/reference/class/StreamedLogAsync.md # StreamedLogAsync Async variant of `StreamedLog` that is logging in tasks. ### Hierarchy * [StreamedLog](https://docs.apify.com/api/client/python/api/client/python/reference/class/StreamedLog.md) * *StreamedLogAsync* ## Index[**](#Index) ### Methods * [**\_\_aenter\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/StreamedLogAsync.md#__aenter__) * [**\_\_aexit\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/StreamedLogAsync.md#__aexit__) * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/StreamedLogAsync.md#__init__) * [**start](https://docs.apify.com/api/client/python/api/client/python/reference/class/StreamedLogAsync.md#start) * [**stop](https://docs.apify.com/api/client/python/api/client/python/reference/class/StreamedLogAsync.md#stop) ## Methods[**](#Methods) ### [**](#__aenter__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L359)\_\_aenter\_\_ * **async **\_\_aenter\_\_**(): Self - Start the streaming task within the context. Exiting the context will cancel the streaming task. *** #### Returns Self ### [**](#__aexit__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L364)\_\_aexit\_\_ * **async **\_\_aexit\_\_**(exc\_type, exc\_val, exc\_tb): None - Cancel the streaming task. *** #### Parameters * ##### exc\_type: type\[BaseException] | None * ##### exc\_val: BaseException | None * ##### exc\_tb: TracebackType | None #### Returns None ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L336)\_\_init\_\_ * ****\_\_init\_\_**(to\_logger, \*, from\_start): None - Overrides [StreamedLog.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/StreamedLog.md#__init__) Initialize `StreamedLog`. *** #### Parameters * ##### to\_logger: logging.Logger The logger to which the logs will be redirected. * ##### optionalkeyword-onlyfrom\_start: bool = True If `True`, all logs from the start of the actor run will be redirected. If `False`, only newly arrived logs will be redirected. This can be useful for redirecting only a small portion of relevant logs for long-running actors in stand-by. #### Returns None ### [**](#start)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L341)start * ****start**(): Task - Start the streaming task. The caller has to handle any cleanup by manually calling the `stop` method. *** #### Returns Task ### [**](#stop)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L348)stop * **async **stop**(): None - Stop the streaming task. *** #### Returns None --- # Source: https://docs.apify.com/api/client/js/reference/interface/StreamedLogOptions.md # StreamedLogOptions ## Index[**](#Index) ### Properties * [**fromStart](#fromStart) * [**logClient](#logClient) * [**toLog](#toLog) ## Properties[**](#Properties) ### [**](#fromStart)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/log.ts#L269)optionalfromStart **fromStart? : boolean Whether to redirect all logs from Actor run start (even logs from the past). ### [**](#logClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/log.ts#L265)logClient **logClient: [LogClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/LogClient.md) Log client used to communicate with the Apify API. ### [**](#toLog)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/log.ts#L267)toLog **toLog: Log Log to which the Actor run logs will be redirected. --- # Source: https://docs.apify.com/api/client/python/reference/class/StreamedLogSync.md # StreamedLogSync Sync variant of `StreamedLog` that is logging in threads. ### Hierarchy * [StreamedLog](https://docs.apify.com/api/client/python/api/client/python/reference/class/StreamedLog.md) * *StreamedLogSync* ## Index[**](#Index) ### Methods * [**\_\_enter\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/StreamedLogSync.md#__enter__) * [**\_\_exit\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/StreamedLogSync.md#__exit__) * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/StreamedLogSync.md#__init__) * [**start](https://docs.apify.com/api/client/python/api/client/python/reference/class/StreamedLogSync.md#start) * [**stop](https://docs.apify.com/api/client/python/api/client/python/reference/class/StreamedLogSync.md#stop) ## Methods[**](#Methods) ### [**](#__enter__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L308)\_\_enter\_\_ * ****\_\_enter\_\_**(): Self - Start the streaming thread within the context. Exiting the context will finish the streaming thread. *** #### Returns Self ### [**](#__exit__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L313)\_\_exit\_\_ * ****\_\_exit\_\_**(exc\_type, exc\_val, exc\_tb): None - Stop the streaming thread. *** #### Parameters * ##### exc\_type: type\[BaseException] | None * ##### exc\_val: BaseException | None * ##### exc\_tb: TracebackType | None #### Returns None ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L284)\_\_init\_\_ * ****\_\_init\_\_**(to\_logger, \*, from\_start): None - Overrides [StreamedLog.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/StreamedLog.md#__init__) Initialize `StreamedLog`. *** #### Parameters * ##### to\_logger: logging.Logger The logger to which the logs will be redirected. * ##### optionalkeyword-onlyfrom\_start: bool = True If `True`, all logs from the start of the actor run will be redirected. If `False`, only newly arrived logs will be redirected. This can be useful for redirecting only a small portion of relevant logs for long-running actors in stand-by. #### Returns None ### [**](#start)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L290)start * ****start**(): Thread - Start the streaming thread. The caller has to handle any cleanup by manually calling the `stop` method. *** #### Returns Thread ### [**](#stop)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/log.py#L299)stop * ****stop**(): None - Signal the streaming thread to stop logging and wait for it to finish. *** #### Returns None --- # Source: https://docs.apify.com/sdk/python/reference/class/SystemInfoEvent.md # SystemInfoEvent ## Index[**](#Index) ### Properties * [**data](https://docs.apify.com/sdk/python/sdk/python/reference/class/SystemInfoEvent.md#data) * [**name](https://docs.apify.com/sdk/python/sdk/python/reference/class/SystemInfoEvent.md#name) ## Properties[**](#Properties) ### [**](#data)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L56)data **data: [SystemInfoEventData](https://docs.apify.com/sdk/python/sdk/python/reference/class/SystemInfoEventData.md) ### [**](#name)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L55)name **name: Literal\[Event.SYSTEM\_INFO] --- # Source: https://docs.apify.com/sdk/python/reference/class/SystemInfoEventData.md # SystemInfoEventData ## Index[**](#Index) ### Methods * [**to\_crawlee\_format](https://docs.apify.com/sdk/python/sdk/python/reference/class/SystemInfoEventData.md#to_crawlee_format) ### Properties * [**cpu\_avg\_usage](https://docs.apify.com/sdk/python/sdk/python/reference/class/SystemInfoEventData.md#cpu_avg_usage) * [**cpu\_current\_usage](https://docs.apify.com/sdk/python/sdk/python/reference/class/SystemInfoEventData.md#cpu_current_usage) * [**cpu\_max\_usage](https://docs.apify.com/sdk/python/sdk/python/reference/class/SystemInfoEventData.md#cpu_max_usage) * [**created\_at](https://docs.apify.com/sdk/python/sdk/python/reference/class/SystemInfoEventData.md#created_at) * [**is\_cpu\_overloaded](https://docs.apify.com/sdk/python/sdk/python/reference/class/SystemInfoEventData.md#is_cpu_overloaded) * [**mem\_avg\_bytes](https://docs.apify.com/sdk/python/sdk/python/reference/class/SystemInfoEventData.md#mem_avg_bytes) * [**mem\_current\_bytes](https://docs.apify.com/sdk/python/sdk/python/reference/class/SystemInfoEventData.md#mem_current_bytes) * [**mem\_max\_bytes](https://docs.apify.com/sdk/python/sdk/python/reference/class/SystemInfoEventData.md#mem_max_bytes) ## Methods[**](#Methods) ### [**](#to_crawlee_format)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L31)to\_crawlee\_format * ****to\_crawlee\_format**(dedicated\_cpus): EventSystemInfoData - #### Parameters * ##### dedicated\_cpus: float #### Returns EventSystemInfoData ## Properties[**](#Properties) ### [**](#cpu_avg_usage)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L25)cpu\_avg\_usage **cpu\_avg\_usage: float ### [**](#cpu_current_usage)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L27)cpu\_current\_usage **cpu\_current\_usage: float ### [**](#cpu_max_usage)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L26)cpu\_max\_usage **cpu\_max\_usage: float ### [**](#created_at)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L29)created\_at **created\_at: datetime ### [**](#is_cpu_overloaded)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L28)is\_cpu\_overloaded **is\_cpu\_overloaded: bool ### [**](#mem_avg_bytes)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L22)mem\_avg\_bytes **mem\_avg\_bytes: float ### [**](#mem_current_bytes)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L23)mem\_current\_bytes **mem\_current\_bytes: float ### [**](#mem_max_bytes)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L24)mem\_max\_bytes **mem\_max\_bytes: float --- # Source: https://docs.apify.com/api/client/js/reference/interface/Task.md # Task Represents an Actor task. Tasks are saved Actor configurations with input and settings that can be executed repeatedly without having to specify the full input each time. ## Index[**](#Index) ### Properties * [**actId](#actId) * [**actorStandby](#actorStandby) * [**createdAt](#createdAt) * [**description](#description) * [**id](#id) * [**input](#input) * [**modifiedAt](#modifiedAt) * [**name](#name) * [**options](#options) * [**stats](#stats) * [**title](#title) * [**userId](#userId) * [**username](#username) ## Properties[**](#Properties) ### [**](#actId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L285)actId **actId: string ### [**](#actorStandby)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L295)optionalactorStandby **actorStandby? : Partial<[ActorStandby](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorStandby.md)> ### [**](#createdAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L290)createdAt **createdAt: Date ### [**](#description)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L288)optionaldescription **description? : string ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L283)id **id: string ### [**](#input)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L294)optionalinput **input? : [Dictionary](https://docs.apify.com/api/client/js/api/client/js/reference.md#Dictionary) | [Dictionary](https://docs.apify.com/api/client/js/api/client/js/reference.md#Dictionary)\[] ### [**](#modifiedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L291)modifiedAt **modifiedAt: Date ### [**](#name)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L286)name **name: string ### [**](#options)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L293)optionaloptions **options? : [TaskOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/TaskOptions.md) ### [**](#stats)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L292)stats **stats: [TaskStats](https://docs.apify.com/api/client/js/api/client/js/reference/interface/TaskStats.md) ### [**](#title)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L287)optionaltitle **title? : string ### [**](#userId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L284)userId **userId: string ### [**](#username)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L289)optionalusername **username? : string --- # Source: https://docs.apify.com/api/client/js/reference/interface/TaskCallOptions.md # TaskCallOptions Options for calling a Task and waiting for it to finish. ### Hierarchy * Omit<[TaskStartOptions](https://docs.apify.com/api/client/js/api/client/js/reference.md#TaskStartOptions), waitForFinish> * *TaskCallOptions* ## Index[**](#Index) ### Properties * [**build](#build) * [**maxItems](#maxItems) * [**maxTotalChargeUsd](#maxTotalChargeUsd) * [**memory](#memory) * [**restartOnError](#restartOnError) * [**timeout](#timeout) * [**waitSecs](#waitSecs) * [**webhooks](#webhooks) ## Properties[**](#Properties) ### [**](#build)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L594)optionalinheritedbuild **build? : string Inherited from Omit.build Tag or number of the Actor build to run (e.g. `beta` or `1.2.345`). If not provided, the run uses build tag or number from the default Actor run configuration (typically `latest`). ### [**](#maxItems)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L639)optionalinheritedmaxItems **maxItems? : number Inherited from Omit.maxItems Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the Actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. ### [**](#maxTotalChargeUsd)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L647)optionalinheritedmaxTotalChargeUsd **maxTotalChargeUsd? : number Inherited from Omit.maxTotalChargeUsd Specifies the maximum cost of the Actor run. This parameter is used only for pay-per-event Actors. It allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. ### [**](#memory)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L608)optionalinheritedmemory **memory? : number Inherited from Omit.memory Memory in megabytes which will be allocated for the new Actor run. If not provided, the run uses memory of the default Actor run configuration. ### [**](#restartOnError)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L652)optionalinheritedrestartOnError **restartOnError? : boolean Inherited from Omit.restartOnError Determines whether the run will be restarted if it fails. ### [**](#timeout)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L613)optionalinheritedtimeout **timeout? : number Inherited from Omit.timeout Timeout for the Actor run in seconds. Zero value means there is no timeout. If not provided, the run uses timeout of the default Actor run configuration. ### [**](#waitSecs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L341)optionalwaitSecs **waitSecs? : number ### [**](#webhooks)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/actor.ts#L630)optionalinheritedwebhooks **webhooks? : readonly [WebhookUpdateData](https://docs.apify.com/api/client/js/api/client/js/reference.md#WebhookUpdateData)\[] Inherited from Omit.webhooks Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed, see [ad hook webhooks documentation](https://docs.apify.com/webhooks/ad-hoc-webhooks) for detailed description. --- # Source: https://docs.apify.com/api/client/python/reference/class/TaskClient.md # Source: https://docs.apify.com/api/client/js/reference/class/TaskClient.md # TaskClient Client for managing a specific Actor task. Tasks are pre-configured Actor runs with saved input and options. This client provides methods to start, call, update, and delete tasks, as well as manage their runs and webhooks. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const taskClient = client.task('my-task-id'); // Start a task const run = await taskClient.start(); // Call a task and wait for it to finish const finishedRun = await taskClient.call(); ``` * **@see** ### Hierarchy * ResourceClient * *TaskClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**call](#call) * [**delete](#delete) * [**get](#get) * [**getInput](#getInput) * [**lastRun](#lastRun) * [**runs](#runs) * [**start](#start) * [**update](#update) * [**updateInput](#updateInput) * [**webhooks](#webhooks) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceClient.url ## Methods[**](#Methods) ### [**](#call)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L158)call * ****call**(input, options): Promise<[ActorRun](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRun.md)> - Starts a task and waits for it to finish before returning the Run object. It waits indefinitely, unless the `waitSecs` option is provided. * **@see** *** #### Parameters * ##### optionalinput: [Dictionary](https://docs.apify.com/api/client/js/api/client/js/reference.md#Dictionary) Input overrides for the task. If not provided, the task's saved input is used. * ##### options: [TaskCallOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/TaskCallOptions.md) = {} Run and wait options. #### Returns Promise<[ActorRun](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRun.md)> The Actor run object. ### [**](#delete)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L75)delete * ****delete**(): Promise\ - Deletes the Task. * **@see** *** #### Returns Promise\ ### [**](#get)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L53)get * ****get**(): Promise\ - Retrieves the Actor task. * **@see** *** #### Returns Promise\ The task object, or `undefined` if it does not exist. ### [**](#getInput)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L190)getInput * ****getInput**(): Promise\ - Retrieves the Actor task's input object. * **@see** *** #### Returns Promise\ The Task's input, or `undefined` if it does not exist. ### [**](#lastRun)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L233)lastRun * ****lastRun**(options): [RunClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/RunClient.md) - Returns a client for the last run of this task. * **@see** *** #### Parameters * ##### options: [TaskLastRunOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/TaskLastRunOptions.md) = {} Filter options for the last run. #### Returns [RunClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/RunClient.md) A client for the last run. ### [**](#runs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L257)runs * ****runs**(): [RunCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/RunCollectionClient.md) - Returns a client for the Runs of this Task. * **@see** *** #### Returns [RunCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/RunCollectionClient.md) A client for the task's runs. ### [**](#start)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L95)start * ****start**(input, options): Promise<[ActorRun](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRun.md)> - Starts an Actor task and immediately returns the Run object. * **@see** *** #### Parameters * ##### optionalinput: [Dictionary](https://docs.apify.com/api/client/js/api/client/js/reference.md#Dictionary) Input overrides for the task. If not provided, the task's saved input is used. * ##### options: [TaskStartOptions](https://docs.apify.com/api/client/js/api/client/js/reference.md#TaskStartOptions) = {} Run options. #### Returns Promise<[ActorRun](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorRun.md)> The Actor Run object. ### [**](#update)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L64)update * ****update**(newFields): Promise<[Task](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Task.md)> - Updates the task with the specified fields. * **@see** *** #### Parameters * ##### newFields: Partial\> Fields to update. #### Returns Promise<[Task](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Task.md)> The updated task object. ### [**](#updateInput)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L213)updateInput * ****updateInput**(newFields): Promise<[Dictionary](https://docs.apify.com/api/client/js/api/client/js/reference.md#Dictionary) | [Dictionary](https://docs.apify.com/api/client/js/api/client/js/reference.md#Dictionary)\[]> - Updates the Actor task's input object. * **@see** *** #### Parameters * ##### newFields: [Dictionary](https://docs.apify.com/api/client/js/api/client/js/reference.md#Dictionary) | [Dictionary](https://docs.apify.com/api/client/js/api/client/js/reference.md#Dictionary)\[] New input data for the task. #### Returns Promise<[Dictionary](https://docs.apify.com/api/client/js/api/client/js/reference.md#Dictionary) | [Dictionary](https://docs.apify.com/api/client/js/api/client/js/reference.md#Dictionary)\[]> The updated task input. ### [**](#webhooks)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L271)webhooks * ****webhooks**(): [WebhookCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/WebhookCollectionClient.md) - Returns a client for the Webhooks of this Task. * **@see** *** #### Returns [WebhookCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/WebhookCollectionClient.md) A client for the task's webhooks. --- # Source: https://docs.apify.com/api/client/python/reference/class/TaskClientAsync.md # TaskClientAsync Async sub-client for manipulating a single task. ### Hierarchy * [ResourceClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md) * *TaskClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskClientAsync.md#__init__) * [**call](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskClientAsync.md#call) * [**delete](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskClientAsync.md#delete) * [**get](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskClientAsync.md#get) * [**get\_input](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskClientAsync.md#get_input) * [**last\_run](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskClientAsync.md#last_run) * [**runs](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskClientAsync.md#runs) * [**start](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskClientAsync.md#start) * [**update](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskClientAsync.md#update) * [**update\_input](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskClientAsync.md#update_input) * [**webhooks](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskClientAsync.md#webhooks) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/task.py#L337)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#call)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/task.py#L484)call * **async **call**(\*, task\_input, build, max\_items, memory\_mbytes, timeout\_secs, restart\_on\_error, webhooks, wait\_secs): dict | None - Start a task and wait for it to finish before returning the Run object. It waits indefinitely, unless the wait\_secs argument is provided. *** #### Parameters * ##### optionalkeyword-onlytask\_input: dict | None = None Task input dictionary. * ##### optionalkeyword-onlybuild: str | None = 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 task settings (typically latest). * ##### optionalkeyword-onlymax\_items: int | None = None Maximum number of results that will be returned by this run. If the Actor is charged per result, you will not be charged for more results than the given limit. * ##### 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-onlytimeout\_secs: int | None = None Optional timeout for the run, in seconds. By default, the run uses timeout specified in the task settings. * ##### 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-onlywebhooks: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[dict] | None = None Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. Note: if you already have a webhook set up for the Actor or task, you do not have to add it again here. * ##### optionalkeyword-onlywait\_secs: int | None = None The maximum number of seconds the server waits for the task run to finish. If not provided, waits indefinitely. #### Returns dict | None ### [**](#delete)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/task.py#L416)delete * **async **delete**(): None - Delete the task. *** #### Returns None ### [**](#get)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/task.py#L341)get * **async **get**(): dict | None - Retrieve the task. *** #### Returns dict | None ### [**](#get_input)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/task.py#L535)get\_input * **async **get\_input**(): dict | None - Retrieve the default input for this task. *** #### Returns dict | None ### [**](#last_run)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/task.py#L574)last\_run * ****last\_run**(\*, status, origin): [RunClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md) - Retrieve the client for the last run of this task. Last run is retrieved based on the start time of the runs. *** #### Parameters * ##### optionalkeyword-onlystatus: ActorJobStatus | None = None Consider only runs with this status. * ##### optionalkeyword-onlyorigin: MetaOrigin | None = None Consider only runs started with this origin. #### Returns [RunClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunClientAsync.md) ### [**](#runs)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/task.py#L570)runs * ****runs**(): [RunCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunCollectionClientAsync.md) - Retrieve a client for the runs of this task. *** #### Returns [RunCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/RunCollectionClientAsync.md) ### [**](#start)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/task.py#L423)start * **async **start**(\*, task\_input, build, max\_items, memory\_mbytes, timeout\_secs, restart\_on\_error, wait\_for\_finish, webhooks): dict - Start the task and immediately return the Run object. *** #### Parameters * ##### optionalkeyword-onlytask\_input: dict | None = None Task input dictionary. * ##### optionalkeyword-onlybuild: str | None = 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 task settings (typically latest). * ##### optionalkeyword-onlymax\_items: int | None = None Maximum number of results that will be returned by this run. If the Actor is charged per result, you will not be charged for more results than the given limit. * ##### 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-onlytimeout\_secs: int | None = None Optional timeout for the run, in seconds. By default, the run uses timeout specified in the task settings. * ##### 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-onlywait\_for\_finish: int | None = None The maximum number of seconds the server waits for the run to finish. By default, it is 0, the maximum value is 60. * ##### optionalkeyword-onlywebhooks: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[dict] | None = None Optional 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 template for the request payload. #### Returns dict ### [**](#update)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/task.py#L351)update * **async **update**(\*, name, task\_input, build, max\_items, memory\_mbytes, timeout\_secs, restart\_on\_error, title, actor\_standby\_desired\_requests\_per\_actor\_run, actor\_standby\_max\_requests\_per\_actor\_run, actor\_standby\_idle\_timeout\_secs, actor\_standby\_build, actor\_standby\_memory\_mbytes): dict - Update the task with specified fields. *** #### Parameters * ##### optionalkeyword-onlyname: str | None = None Name of the task. * ##### optionalkeyword-onlytask\_input: dict | None = None Task input dictionary. * ##### 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-onlymax\_items: int | None = None Maximum number of results that will be returned by this run. If the Actor is charged per result, you will not be charged for more results than the given limit. * ##### 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-onlytimeout\_secs: int | None = None Optional timeout for the run, in seconds. By default, the run uses timeout specified in the task settings. * ##### 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-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\_secs: int | 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 dict ### [**](#update_input)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/task.py#L554)update\_input * **async **update\_input**(\*, task\_input): dict - Update the default input for this task. *** #### Parameters * ##### keyword-onlytask\_input: dict #### Returns dict ### [**](#webhooks)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/task.py#L597)webhooks * ****webhooks**(): [WebhookCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookCollectionClientAsync.md) - Retrieve a client for webhooks associated with this task. *** #### Returns [WebhookCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookCollectionClientAsync.md) ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/python/reference/class/TaskCollectionClient.md # Source: https://docs.apify.com/api/client/js/reference/class/TaskCollectionClient.md # TaskCollectionClient Client for managing the collection of Actor tasks in your account. Tasks are pre-configured Actor runs with saved input and options. This client provides methods to list and create tasks. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const tasksClient = client.tasks(); // List all tasks const { items } = await tasksClient.list(); // Create a new task const newTask = await tasksClient.create({ actId: 'my-actor-id', name: 'my-task', input: { url: 'https://example.com' } }); ``` * **@see** ### Hierarchy * ResourceCollectionClient * *TaskCollectionClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**create](#create) * [**list](#list) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceCollectionClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceCollectionClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceCollectionClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceCollectionClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceCollectionClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceCollectionClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceCollectionClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceCollectionClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceCollectionClient.url ## Methods[**](#Methods) ### [**](#create)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task_collection.ts#L83)create * ****create**(task): Promise<[Task](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Task.md)> - Creates a new task. * **@see** *** #### Parameters * ##### task: [TaskCreateData](https://docs.apify.com/api/client/js/api/client/js/reference/interface/TaskCreateData.md) The task data. #### Returns Promise<[Task](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Task.md)> The created task object. ### [**](#list)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task_collection.ts#L63)list * ****list**(options): PaginatedIterator<[TaskList](https://docs.apify.com/api/client/js/api/client/js/reference.md#TaskList)> - Lists all Tasks. 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 * ##### options: [TaskCollectionListOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/TaskCollectionListOptions.md) = {} Pagination and sorting options. #### Returns PaginatedIterator<[TaskList](https://docs.apify.com/api/client/js/api/client/js/reference.md#TaskList)> A paginated iterator of tasks. --- # Source: https://docs.apify.com/api/client/python/reference/class/TaskCollectionClientAsync.md # TaskCollectionClientAsync Async sub-client for manipulating tasks. ### Hierarchy * [ResourceCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md) * *TaskCollectionClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskCollectionClientAsync.md#__init__) * [**create](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskCollectionClientAsync.md#create) * [**list](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskCollectionClientAsync.md#list) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskCollectionClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskCollectionClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskCollectionClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskCollectionClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/TaskCollectionClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/task_collection.py#L113)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceCollectionClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#create)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/task_collection.py#L138)create * **async **create**(\*, actor\_id, name, build, timeout\_secs, 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\_secs, actor\_standby\_build, actor\_standby\_memory\_mbytes): dict - Create a new 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\_secs: int | None = None Optional timeout for the run, in seconds. 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\_secs: int | 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 dict ### [**](#list)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/task_collection.py#L117)list * **async **list**(\*, limit, offset, desc): [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] - List the available tasks. *** #### 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 [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/js/reference/interface/TaskCollectionListOptions.md # TaskCollectionListOptions ### Hierarchy * PaginationOptions * *TaskCollectionListOptions* ## Index[**](#Index) ### Properties * [**chunkSize](#chunkSize) * [**desc](#desc) * [**limit](#limit) * [**offset](#offset) ## Properties[**](#Properties) ### [**](#chunkSize)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L258)optionalinheritedchunkSize **chunkSize? : number Inherited from PaginationOptions.chunkSize Maximum number of items returned in one API response. Relevant in the context of asyncIterator, the iterator will fetch results in chunks of this size from API and yield them one by one. It will stop fetching once the limit is reached or once all items from API have been fetched. Chunk size is usually limited by API. Minimum of those two limits will be used. ### [**](#desc)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task_collection.ts#L91)optionaldesc **desc? : boolean ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L251)optionalinheritedlimit **limit? : number Inherited from PaginationOptions.limit Maximum number of entries requested. ### [**](#offset)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L249)optionalinheritedoffset **offset? : number Inherited from PaginationOptions.offset Position of the first returned entry. --- # Source: https://docs.apify.com/api/client/js/reference/interface/TaskCreateData.md # TaskCreateData Fields that can be updated when modifying a Task. ### Hierarchy * [TaskUpdateData](https://docs.apify.com/api/client/js/api/client/js/reference.md#TaskUpdateData) * *TaskCreateData* ## Index[**](#Index) ### Properties * [**actId](#actId) * [**actorStandby](#actorStandby) * [**description](#description) * [**input](#input) * [**name](#name) * [**options](#options) * [**title](#title) ## Properties[**](#Properties) ### [**](#actId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task_collection.ts#L97)actId **actId: string ### [**](#actorStandby)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L295)optionalinheritedactorStandby **actorStandby? : Partial<[ActorStandby](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ActorStandby.md)> Inherited from TaskUpdateData.actorStandby ### [**](#description)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L288)optionalinheriteddescription **description? : string Inherited from TaskUpdateData.description ### [**](#input)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L294)optionalinheritedinput **input? : [Dictionary](https://docs.apify.com/api/client/js/api/client/js/reference.md#Dictionary) | [Dictionary](https://docs.apify.com/api/client/js/api/client/js/reference.md#Dictionary)\[] Inherited from TaskUpdateData.input ### [**](#name)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L286)optionalinheritedname **name? : string Inherited from TaskUpdateData.name ### [**](#options)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L293)optionalinheritedoptions **options? : [TaskOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/TaskOptions.md) Inherited from TaskUpdateData.options ### [**](#title)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L287)optionalinheritedtitle **title? : string Inherited from TaskUpdateData.title --- # Source: https://docs.apify.com/api/client/js/reference/interface/TaskLastRunOptions.md # TaskLastRunOptions Options for filtering the last run of a Task. ## Index[**](#Index) ### Properties * [**status](#status) ## Properties[**](#Properties) ### [**](#status)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L326)optionalstatus **status? : READY | RUNNING | SUCCEEDED | FAILED | TIMING\_OUT | TIMED\_OUT | ABORTING | ABORTED --- # Source: https://docs.apify.com/api/client/js/reference/interface/TaskOptions.md # TaskOptions Configuration options for an Actor task. ## Index[**](#Index) ### Properties * [**build](#build) * [**memoryMbytes](#memoryMbytes) * [**restartOnError](#restartOnError) * [**timeoutSecs](#timeoutSecs) ## Properties[**](#Properties) ### [**](#build)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L309)optionalbuild **build? : string ### [**](#memoryMbytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L311)optionalmemoryMbytes **memoryMbytes? : number ### [**](#restartOnError)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L312)optionalrestartOnError **restartOnError? : boolean ### [**](#timeoutSecs)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L310)optionaltimeoutSecs **timeoutSecs? : number --- # Source: https://docs.apify.com/api/client/js/reference/interface/TaskStats.md # TaskStats Statistics about Actor task usage. ## Index[**](#Index) ### Properties * [**totalRuns](#totalRuns) ## Properties[**](#Properties) ### [**](#totalRuns)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/task.ts#L302)totalRuns **totalRuns: number --- # Source: https://docs.apify.com/sdk/python/reference/class/UnknownEvent.md # UnknownEvent ## Index[**](#Index) ### Properties * [**data](https://docs.apify.com/sdk/python/sdk/python/reference/class/UnknownEvent.md#data) * [**name](https://docs.apify.com/sdk/python/sdk/python/reference/class/UnknownEvent.md#name) ## Properties[**](#Properties) ### [**](#data)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L99)data **data: dict\[str, Any] ### [**](#name)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/events/_types.py#L98)name **name: str --- # Source: https://docs.apify.com/api/client/js/reference/interface/UsageCycle.md # UsageCycle ## Index[**](#Index) ### Properties * [**endAt](#endAt) * [**startAt](#startAt) ## Properties[**](#Properties) ### [**](#endAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L227)endAt **endAt: Date ### [**](#startAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L226)startAt **startAt: Date --- # Source: https://docs.apify.com/api/client/js/reference/interface/User.md # User ## Index[**](#Index) ### Properties * [**createdAt](#createdAt) * [**effectivePlatformFeatures](#effectivePlatformFeatures) * [**email](#email) * [**id](#id) * [**isPaying](#isPaying) * [**plan](#plan) * [**profile](#profile) * [**proxy](#proxy) * [**username](#username) ## Properties[**](#Properties) ### [**](#createdAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L144)optionalcreatedAt **createdAt? : Date ### [**](#effectivePlatformFeatures)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L143)optionaleffectivePlatformFeatures **effectivePlatformFeatures? : EffectivePlatformFeatures ### [**](#email)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L140)optionalemail **email? : string ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L139)optionalid **id? : string ### [**](#isPaying)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L145)optionalisPaying **isPaying? : boolean ### [**](#plan)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L142)optionalplan **plan? : [UserPlan](https://docs.apify.com/api/client/js/api/client/js/reference/interface/UserPlan.md) ### [**](#profile)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L130)profile **profile: { bio? : string; githubUsername? : string; name? : string; pictureUrl? : string; twitterUsername? : string; websiteUrl? : string } #### Type declaration * ##### optionalbio?: string * ##### optionalgithubUsername?: string * ##### optionalname?: string * ##### optionalpictureUrl?: string * ##### optionaltwitterUsername?: string * ##### optionalwebsiteUrl?: string ### [**](#proxy)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L141)optionalproxy **proxy? : [UserProxy](https://docs.apify.com/api/client/js/api/client/js/reference/interface/UserProxy.md) ### [**](#username)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L129)username **username: string --- # Source: https://docs.apify.com/api/client/python/reference/class/UserClient.md # Source: https://docs.apify.com/api/client/js/reference/class/UserClient.md # UserClient Client for managing user account information. Provides methods to retrieve user details, monthly usage statistics, and account limits. When using an API token, you can access your own user information or public information about other users. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const userClient = client.user('my-user-id'); // Get user information const user = await userClient.get(); // Get monthly usage const usage = await userClient.monthlyUsage(); // Get account limits const limits = await userClient.limits(); ``` * **@see** ### Hierarchy * ResourceClient * *UserClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**get](#get) * [**limits](#limits) * [**monthlyUsage](#monthlyUsage) * [**updateLimits](#updateLimits) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceClient.url ## Methods[**](#Methods) ### [**](#get)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L51)get * ****get**(): Promise<[User](https://docs.apify.com/api/client/js/api/client/js/reference/interface/User.md)> - Retrieves the user data. Depending on whether ApifyClient was created with a token, the method will either return public or private user data. * **@see** *** #### Returns Promise<[User](https://docs.apify.com/api/client/js/api/client/js/reference/interface/User.md)> The user object. ### [**](#limits)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L89)limits * ****limits**(): Promise\ - Retrieves the user's account and usage limits. * **@see** *** #### Returns Promise\ The account and usage limits object, or `undefined` if it does not exist. ### [**](#monthlyUsage)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L61)monthlyUsage * ****monthlyUsage**(): Promise\ - Retrieves the user's monthly usage data. * **@see** *** #### Returns Promise\ The monthly usage object, or `undefined` if it does not exist. ### [**](#updateLimits)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L111)updateLimits * ****updateLimits**(options): Promise\ - Updates the user's account and usage limits. * **@see** *** #### Parameters * ##### options: [LimitsUpdateOptions](https://docs.apify.com/api/client/js/api/client/js/reference.md#LimitsUpdateOptions) The new limits to set. #### Returns Promise\ --- # Source: https://docs.apify.com/api/client/python/reference/class/UserClientAsync.md # UserClientAsync Async sub-client for querying user data. ### Hierarchy * [ResourceClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md) * *UserClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/UserClientAsync.md#__init__) * [**get](https://docs.apify.com/api/client/python/api/client/python/reference/class/UserClientAsync.md#get) * [**limits](https://docs.apify.com/api/client/python/api/client/python/reference/class/UserClientAsync.md#limits) * [**monthly\_usage](https://docs.apify.com/api/client/python/api/client/python/reference/class/UserClientAsync.md#monthly_usage) * [**update\_limits](https://docs.apify.com/api/client/python/api/client/python/reference/class/UserClientAsync.md#update_limits) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/UserClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/UserClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/UserClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/UserClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/UserClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/user.py#L109)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#get)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/user.py#L116)get * **async **get**(): dict | None - Return information about user account. You receive all or only public info based on your token permissions. *** #### Returns dict | None ### [**](#limits)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/user.py#L153)limits * **async **limits**(): dict | None - Return a complete summary of the user account's limits. It is the same information which is available on the account's Limits page. The returned data includes the current usage cycle, a summary of the account's limits, and the current usage. *** #### Returns dict | None ### [**](#monthly_usage)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/user.py#L128)monthly\_usage * **async **monthly\_usage**(): dict | None - Return monthly usage of the user account. This includes a complete usage summary for the current usage cycle, an overall sum, as well as a daily breakdown of usage. It is the same information which is available on the account's Billing page. The information includes use of storage, data transfer, and request queue usage. *** #### Returns dict | None ### [**](#update_limits)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/user.py#L177)update\_limits * **async **update\_limits**(\*, max\_monthly\_usage\_usd, data\_retention\_days): None - Update the account's limits manageable on your account's Limits page. *** #### Parameters * ##### optionalkeyword-onlymax\_monthly\_usage\_usd: int | None = None * ##### optionalkeyword-onlydata\_retention\_days: int | None = None #### Returns None ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/js/reference/interface/UserPlan.md # UserPlan ## Index[**](#Index) ### Properties * [**availableAddOns](#availableAddOns) * [**availableProxyGroups](#availableProxyGroups) * [**dataRetentionDays](#dataRetentionDays) * [**description](#description) * [**enabledPlatformFeatures](#enabledPlatformFeatures) * [**id](#id) * [**isEnabled](#isEnabled) * [**maxActorCount](#maxActorCount) * [**maxActorMemoryGbytes](#maxActorMemoryGbytes) * [**maxActorTaskCount](#maxActorTaskCount) * [**maxMonthlyActorComputeUnits](#maxMonthlyActorComputeUnits) * [**maxMonthlyExternalDataTransferGbytes](#maxMonthlyExternalDataTransferGbytes) * [**maxMonthlyProxySerps](#maxMonthlyProxySerps) * [**maxMonthlyResidentialProxyGbytes](#maxMonthlyResidentialProxyGbytes) * [**maxMonthlyUsageUsd](#maxMonthlyUsageUsd) * [**monthlyBasePriceUsd](#monthlyBasePriceUsd) * [**monthlyUsageCreditsUsd](#monthlyUsageCreditsUsd) * [**supportLevel](#supportLevel) * [**teamAccountSeatCount](#teamAccountSeatCount) * [**usageDiscountPercent](#usageDiscountPercent) ## Properties[**](#Properties) ### [**](#availableAddOns)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L179)availableAddOns **availableAddOns: unknown\[] ### [**](#availableProxyGroups)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L176)availableProxyGroups **availableProxyGroups: Record\ ### [**](#dataRetentionDays)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L175)dataRetentionDays **dataRetentionDays: number ### [**](#description)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L161)description **description: string ### [**](#enabledPlatformFeatures)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L166)enabledPlatformFeatures **enabledPlatformFeatures: [PlatformFeature](https://docs.apify.com/api/client/js/api/client/js/reference/enum/PlatformFeature.md)\[] ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L160)id **id: string ### [**](#isEnabled)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L162)isEnabled **isEnabled: boolean ### [**](#maxActorCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L173)maxActorCount **maxActorCount: number ### [**](#maxActorMemoryGbytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L168)maxActorMemoryGbytes **maxActorMemoryGbytes: number ### [**](#maxActorTaskCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L174)maxActorTaskCount **maxActorTaskCount: number ### [**](#maxMonthlyActorComputeUnits)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L169)maxMonthlyActorComputeUnits **maxMonthlyActorComputeUnits: number ### [**](#maxMonthlyExternalDataTransferGbytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L172)maxMonthlyExternalDataTransferGbytes **maxMonthlyExternalDataTransferGbytes: number ### [**](#maxMonthlyProxySerps)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L171)maxMonthlyProxySerps **maxMonthlyProxySerps: number ### [**](#maxMonthlyResidentialProxyGbytes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L170)maxMonthlyResidentialProxyGbytes **maxMonthlyResidentialProxyGbytes: number ### [**](#maxMonthlyUsageUsd)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L167)maxMonthlyUsageUsd **maxMonthlyUsageUsd: number ### [**](#monthlyBasePriceUsd)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L163)monthlyBasePriceUsd **monthlyBasePriceUsd: number ### [**](#monthlyUsageCreditsUsd)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L164)monthlyUsageCreditsUsd **monthlyUsageCreditsUsd: number ### [**](#supportLevel)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L178)supportLevel **supportLevel: string ### [**](#teamAccountSeatCount)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L177)teamAccountSeatCount **teamAccountSeatCount: number ### [**](#usageDiscountPercent)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L165)usageDiscountPercent **usageDiscountPercent: number --- # Source: https://docs.apify.com/api/client/js/reference/interface/UserProxy.md # UserProxy ## Index[**](#Index) ### Properties * [**groups](#groups) * [**password](#password) ## Properties[**](#Properties) ### [**](#groups)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L150)groups **groups: [ProxyGroup](https://docs.apify.com/api/client/js/api/client/js/reference/interface/ProxyGroup.md)\[] ### [**](#password)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/user.ts#L149)password **password: string --- # Source: https://docs.apify.com/sdk/python/reference/class/Webhook.md # Source: https://docs.apify.com/api/client/js/reference/interface/Webhook.md # Webhook Represents a webhook for receiving notifications about Actor events. Webhooks send HTTP POST requests to specified URLs when certain events occur (e.g., Actor run succeeds, fails, or times out). ## Index[**](#Index) ### Properties * [**condition](#condition) * [**createdAt](#createdAt) * [**description](#description) * [**doNotRetry](#doNotRetry) * [**eventTypes](#eventTypes) * [**headersTemplate](#headersTemplate) * [**id](#id) * [**ignoreSslErrors](#ignoreSslErrors) * [**isAdHoc](#isAdHoc) * [**isApifyIntegration](#isApifyIntegration) * [**lastDispatch](#lastDispatch) * [**modifiedAt](#modifiedAt) * [**payloadTemplate](#payloadTemplate) * [**requestUrl](#requestUrl) * [**shouldInterpolateStrings](#shouldInterpolateStrings) * [**stats](#stats) * [**userId](#userId) ## Properties[**](#Properties) ### [**](#condition)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L135)condition **condition: [WebhookCondition](https://docs.apify.com/api/client/js/api/client/js/reference.md#WebhookCondition) ### [**](#createdAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L131)createdAt **createdAt: Date ### [**](#description)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L145)optionaldescription **description? : string ### [**](#doNotRetry)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L137)doNotRetry **doNotRetry: boolean ### [**](#eventTypes)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L134)eventTypes **eventTypes: [WebhookEventType](https://docs.apify.com/api/client/js/api/client/js/reference.md#WebhookEventType)\[] ### [**](#headersTemplate)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L144)optionalheadersTemplate **headersTemplate? : string ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L129)id **id: string ### [**](#ignoreSslErrors)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L136)ignoreSslErrors **ignoreSslErrors: boolean ### [**](#isAdHoc)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L133)isAdHoc **isAdHoc: boolean ### [**](#isApifyIntegration)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L143)optionalisApifyIntegration **isApifyIntegration? : boolean ### [**](#lastDispatch)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L140)lastDispatch **lastDispatch: string ### [**](#modifiedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L132)modifiedAt **modifiedAt: Date ### [**](#payloadTemplate)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L139)payloadTemplate **payloadTemplate: string ### [**](#requestUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L138)requestUrl **requestUrl: string ### [**](#shouldInterpolateStrings)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L142)shouldInterpolateStrings **shouldInterpolateStrings: boolean ### [**](#stats)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L141)stats **stats: [WebhookStats](https://docs.apify.com/api/client/js/api/client/js/reference/interface/WebhookStats.md) ### [**](#userId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L130)userId **userId: string --- # Source: https://docs.apify.com/api/client/js/reference/interface/WebhookAnyRunOfActorCondition.md # WebhookAnyRunOfActorCondition ## Index[**](#Index) ### Properties * [**actorId](#actorId) ## Properties[**](#Properties) ### [**](#actorId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L194)actorId **actorId: string --- # Source: https://docs.apify.com/api/client/js/reference/interface/WebhookAnyRunOfActorTaskCondition.md # WebhookAnyRunOfActorTaskCondition ## Index[**](#Index) ### Properties * [**actorTaskId](#actorTaskId) ## Properties[**](#Properties) ### [**](#actorTaskId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L198)actorTaskId **actorTaskId: string --- # Source: https://docs.apify.com/api/client/js/reference/interface/WebhookCertainRunCondition.md # WebhookCertainRunCondition ## Index[**](#Index) ### Properties * [**actorRunId](#actorRunId) ## Properties[**](#Properties) ### [**](#actorRunId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L202)actorRunId **actorRunId: string --- # Source: https://docs.apify.com/api/client/python/reference/class/WebhookClient.md # Source: https://docs.apify.com/api/client/js/reference/class/WebhookClient.md # WebhookClient Client for managing a specific webhook. Webhooks allow you to receive notifications when specific events occur in your Actors or tasks. This client provides methods to get, update, delete, and test webhooks, as well as retrieve webhook dispatches. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const webhookClient = client.webhook('my-webhook-id'); // Get webhook details const webhook = await webhookClient.get(); // Update webhook await webhookClient.update({ isEnabled: true, eventTypes: ['ACTOR.RUN.SUCCEEDED'], requestUrl: 'https://example.com/webhook' }); // Test webhook await webhookClient.test(); ``` * **@see** ### Hierarchy * ResourceClient * *WebhookClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**delete](#delete) * [**dispatches](#dispatches) * [**get](#get) * [**test](#test) * [**update](#update) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceClient.url ## Methods[**](#Methods) ### [**](#delete)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L80)delete * ****delete**(): Promise\ - Deletes the webhook. * **@see** *** #### Returns Promise\ ### [**](#dispatches)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L113)dispatches * ****dispatches**(): [WebhookDispatchCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/WebhookDispatchCollectionClient.md) - Returns a client for the dispatches of this webhook. * **@see** *** #### Returns [WebhookDispatchCollectionClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/WebhookDispatchCollectionClient.md) A client for the webhook's dispatches. ### [**](#get)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L58)get * ****get**(): Promise\ - Retrieves the webhook. * **@see** *** #### Returns Promise\ The webhook object, or `undefined` if it does not exist. ### [**](#test)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L90)test * ****test**(): Promise\ - Tests the webhook by dispatching a test event. * **@see** *** #### Returns Promise\ The webhook dispatch object, or `undefined` if the test fails. ### [**](#update)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L69)update * ****update**(newFields): Promise<[Webhook](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Webhook.md)> - Updates the webhook with the specified fields. * **@see** *** #### Parameters * ##### newFields: [WebhookUpdateData](https://docs.apify.com/api/client/js/api/client/js/reference.md#WebhookUpdateData) Fields to update. #### Returns Promise<[Webhook](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Webhook.md)> The updated webhook object. --- # Source: https://docs.apify.com/api/client/python/reference/class/WebhookClientAsync.md # WebhookClientAsync Async sub-client for manipulating a single webhook. ### Hierarchy * [ResourceClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md) * *WebhookClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookClientAsync.md#__init__) * [**delete](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookClientAsync.md#delete) * [**dispatches](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookClientAsync.md#dispatches) * [**get](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookClientAsync.md#get) * [**test](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookClientAsync.md#test) * [**update](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookClientAsync.md#update) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/webhook.py#L175)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#delete)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/webhook.py#L238)delete * **async **delete**(): None - Delete the webhook. *** #### Returns None ### [**](#dispatches)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/webhook.py#L269)dispatches * ****dispatches**(): [WebhookDispatchCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchCollectionClientAsync.md) - Get dispatches of the webhook. *** #### Returns [WebhookDispatchCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchCollectionClientAsync.md) ### [**](#get)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/webhook.py#L179)get * **async **get**(): dict | None - Retrieve the webhook. *** #### Returns dict | None ### [**](#test)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/webhook.py#L245)test * **async **test**(): dict | None - Test a webhook. Creates a webhook dispatch with a dummy payload. *** #### Returns dict | None ### [**](#update)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/webhook.py#L189)update * **async **update**(\*, event\_types, request\_url, payload\_template, headers\_template, actor\_id, actor\_task\_id, actor\_run\_id, ignore\_ssl\_errors, do\_not\_retry, is\_ad\_hoc): dict - Update the webhook. *** #### Parameters * ##### optionalkeyword-onlyevent\_types: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[WebhookEventType] | None = None List of event types that should trigger the webhook. At least one is required. * ##### optionalkeyword-onlyrequest\_url: str | None = None URL that will be invoked once the webhook is triggered. * ##### optionalkeyword-onlypayload\_template: str | None = None Specification of the payload that will be sent to request\_url. * ##### optionalkeyword-onlyheaders\_template: str | None = None Headers that will be sent to the request\_url. * ##### optionalkeyword-onlyactor\_id: str | None = None Id of the Actor whose runs should trigger the webhook. * ##### optionalkeyword-onlyactor\_task\_id: str | None = None Id of the Actor task whose runs should trigger the webhook. * ##### optionalkeyword-onlyactor\_run\_id: str | None = None Id of the Actor run which should trigger the webhook. * ##### optionalkeyword-onlyignore\_ssl\_errors: bool | None = None Whether the webhook should ignore SSL errors returned by request\_url. * ##### optionalkeyword-onlydo\_not\_retry: bool | None = None Whether the webhook should retry sending the payload to request\_url upon failure. * ##### optionalkeyword-onlyis\_ad\_hoc: bool | None = None Set to True if you want the webhook to be triggered only the first time the condition is fulfilled. Only applicable when actor\_run\_id is filled. #### Returns dict ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/python/reference/class/WebhookCollectionClient.md # Source: https://docs.apify.com/api/client/js/reference/class/WebhookCollectionClient.md # WebhookCollectionClient Client for managing the collection of Webhooks. Webhooks allow you to receive notifications when specific events occur in your Actors or tasks. This client provides methods to list and create webhooks for specific Actors or tasks. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); // List webhooks for an Actor const actorWebhooksClient = client.actor('my-actor-id').webhooks(); const { items } = await actorWebhooksClient.list(); // Create a webhook const newWebhook = await actorWebhooksClient.create({ eventTypes: ['ACTOR.RUN.SUCCEEDED'], requestUrl: 'https://example.com/webhook' }); ``` * **@see** ### Hierarchy * ResourceCollectionClient * *WebhookCollectionClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**create](#create) * [**list](#list) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceCollectionClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceCollectionClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceCollectionClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceCollectionClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceCollectionClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceCollectionClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceCollectionClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceCollectionClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceCollectionClient.url ## Methods[**](#Methods) ### [**](#create)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_collection.ts#L85)create * ****create**(webhook): Promise<[Webhook](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Webhook.md)> - Creates a new webhook. * **@see** *** #### Parameters * ##### optionalwebhook: [WebhookUpdateData](https://docs.apify.com/api/client/js/api/client/js/reference.md#WebhookUpdateData) The webhook data. #### Returns Promise<[Webhook](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Webhook.md)> The created webhook object. ### [**](#list)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_collection.ts#L63)list * ****list**(options): PaginatedIterator\> - Lists all Webhooks. 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 * ##### options: [WebhookCollectionListOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/WebhookCollectionListOptions.md) = {} Pagination and sorting options. #### Returns PaginatedIterator\> A paginated iterator of webhooks. --- # Source: https://docs.apify.com/api/client/python/reference/class/WebhookCollectionClientAsync.md # WebhookCollectionClientAsync Async sub-client for manipulating webhooks. ### Hierarchy * [ResourceCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md) * *WebhookCollectionClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookCollectionClientAsync.md#__init__) * [**create](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookCollectionClientAsync.md#create) * [**list](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookCollectionClientAsync.md#list) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookCollectionClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookCollectionClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookCollectionClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookCollectionClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookCollectionClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/webhook_collection.py#L102)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceCollectionClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#create)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/webhook_collection.py#L127)create * **async **create**(\*, event\_types, request\_url, payload\_template, headers\_template, actor\_id, actor\_task\_id, actor\_run\_id, ignore\_ssl\_errors, do\_not\_retry, idempotency\_key, is\_ad\_hoc): dict - Create a new webhook. You have to specify exactly one out of actor\_id, actor\_task\_id or actor\_run\_id. *** #### Parameters * ##### keyword-onlyevent\_types: [list](https://docs.apify.com/api/client/python/api/client/python/reference/class/RequestQueueCollectionClient.md#list)\[WebhookEventType] List of event types that should trigger the webhook. At least one is required. * ##### keyword-onlyrequest\_url: str URL that will be invoked once the webhook is triggered. * ##### optionalkeyword-onlypayload\_template: str | None = None Specification of the payload that will be sent to request\_url. * ##### optionalkeyword-onlyheaders\_template: str | None = None Headers that will be sent to the request\_url. * ##### optionalkeyword-onlyactor\_id: str | None = None Id of the Actor whose runs should trigger the webhook. * ##### optionalkeyword-onlyactor\_task\_id: str | None = None Id of the Actor task whose runs should trigger the webhook. * ##### optionalkeyword-onlyactor\_run\_id: str | None = None Id of the Actor run which should trigger the webhook. * ##### optionalkeyword-onlyignore\_ssl\_errors: bool | None = None Whether the webhook should ignore SSL errors returned by request\_url. * ##### optionalkeyword-onlydo\_not\_retry: bool | None = None Whether the webhook should retry sending the payload to request\_url upon failure. * ##### optionalkeyword-onlyidempotency\_key: str | None = None A unique identifier of a webhook. You can use it to ensure that you won't create the same webhook multiple times. * ##### optionalkeyword-onlyis\_ad\_hoc: bool | None = None Set to True if you want the webhook to be triggered only the first time the condition is fulfilled. Only applicable when actor\_run\_id is filled. #### Returns dict ### [**](#list)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/webhook_collection.py#L106)list * **async **list**(\*, limit, offset, desc): [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] - List the available webhooks. *** #### Parameters * ##### optionalkeyword-onlylimit: int | None = None How many webhooks to retrieve. * ##### optionalkeyword-onlyoffset: int | None = None What webhook to include as first when retrieving the list. * ##### optionalkeyword-onlydesc: bool | None = None Whether to sort the webhooks in descending order based on their date of creation. #### Returns [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/js/reference/interface/WebhookCollectionListOptions.md # WebhookCollectionListOptions ### Hierarchy * PaginationOptions * *WebhookCollectionListOptions* ## Index[**](#Index) ### Properties * [**chunkSize](#chunkSize) * [**desc](#desc) * [**limit](#limit) * [**offset](#offset) ## Properties[**](#Properties) ### [**](#chunkSize)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L258)optionalinheritedchunkSize **chunkSize? : number Inherited from PaginationOptions.chunkSize Maximum number of items returned in one API response. Relevant in the context of asyncIterator, the iterator will fetch results in chunks of this size from API and yield them one by one. It will stop fetching once the limit is reached or once all items from API have been fetched. Chunk size is usually limited by API. Minimum of those two limits will be used. ### [**](#desc)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_collection.ts#L93)optionaldesc **desc? : boolean ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L251)optionalinheritedlimit **limit? : number Inherited from PaginationOptions.limit Maximum number of entries requested. ### [**](#offset)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L249)optionalinheritedoffset **offset? : number Inherited from PaginationOptions.offset Position of the first returned entry. --- # Source: https://docs.apify.com/api/client/js/reference/interface/WebhookDispatch.md # WebhookDispatch ## Index[**](#Index) ### Properties * [**calls](#calls) * [**createdAt](#createdAt) * [**eventData](#eventData) * [**eventType](#eventType) * [**id](#id) * [**status](#status) * [**userId](#userId) * [**webhook](#webhook) * [**webhookId](#webhookId) ## Properties[**](#Properties) ### [**](#calls)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L52)calls **calls: [WebhookDispatchCall](https://docs.apify.com/api/client/js/api/client/js/reference/interface/WebhookDispatchCall.md)\[] ### [**](#createdAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L49)createdAt **createdAt: Date ### [**](#eventData)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L54)eventData **eventData: null | [WebhookDispatchEventData](https://docs.apify.com/api/client/js/api/client/js/reference/interface/WebhookDispatchEventData.md) ### [**](#eventType)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L51)eventType **eventType: [WebhookEventType](https://docs.apify.com/api/client/js/api/client/js/reference.md#WebhookEventType) ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L46)id **id: string ### [**](#status)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L50)status **status: [WebhookDispatchStatus](https://docs.apify.com/api/client/js/api/client/js/reference/enum/WebhookDispatchStatus.md) ### [**](#userId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L47)userId **userId: string ### [**](#webhook)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L53)webhook **webhook: Pick<[Webhook](https://docs.apify.com/api/client/js/api/client/js/reference/interface/Webhook.md), isAdHoc | requestUrl> ### [**](#webhookId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L48)webhookId **webhookId: string --- # Source: https://docs.apify.com/api/client/js/reference/interface/WebhookDispatchCall.md # WebhookDispatchCall ## Index[**](#Index) ### Properties * [**errorMessage](#errorMessage) * [**finishedAt](#finishedAt) * [**responseBody](#responseBody) * [**responseStatus](#responseStatus) * [**startedAt](#startedAt) ## Properties[**](#Properties) ### [**](#errorMessage)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L66)errorMessage **errorMessage: null | string ### [**](#finishedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L65)finishedAt **finishedAt: Date ### [**](#responseBody)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L68)responseBody **responseBody: null | string ### [**](#responseStatus)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L67)responseStatus **responseStatus: null | number ### [**](#startedAt)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L64)startedAt **startedAt: Date --- # Source: https://docs.apify.com/api/client/python/reference/class/WebhookDispatchClient.md # Source: https://docs.apify.com/api/client/js/reference/class/WebhookDispatchClient.md # WebhookDispatchClient Client for managing a specific webhook dispatch. Webhook dispatches represent individual notifications sent by webhooks. This client provides methods to retrieve details about a specific dispatch. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const webhookClient = client.webhook('my-webhook-id'); // Get a specific dispatch const dispatchClient = webhookClient.dispatches().get('dispatch-id'); const dispatch = await dispatchClient.get(); ``` * **@see** ### Hierarchy * ResourceClient * *WebhookDispatchClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**get](#get) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceClient.url ## Methods[**](#Methods) ### [**](#get)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L40)get * ****get**(): Promise\ - Retrieves the webhook dispatch. * **@see** *** #### Returns Promise\ The webhook dispatch object, or `undefined` if it does not exist. --- # Source: https://docs.apify.com/api/client/python/reference/class/WebhookDispatchClientAsync.md # WebhookDispatchClientAsync Async sub-client for querying information about a webhook dispatch. ### Hierarchy * [ResourceClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md) * *WebhookDispatchClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchClientAsync.md#__init__) * [**get](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchClientAsync.md#get) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/webhook_dispatch.py#L29)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#get)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/webhook_dispatch.py#L33)get * **async **get**(): dict | None - Retrieve the webhook dispatch. *** #### Returns dict | None ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/python/reference/class/WebhookDispatchCollectionClient.md # Source: https://docs.apify.com/api/client/js/reference/class/WebhookDispatchCollectionClient.md # WebhookDispatchCollectionClient Client for managing the collection of webhook dispatches. Webhook dispatches represent individual notifications sent by a webhook. This client provides methods to list all dispatches for a specific webhook. * **@example** ``` const client = new ApifyClient({ token: 'my-token' }); const webhookClient = client.webhook('my-webhook-id'); // List all dispatches for this webhook const dispatchesClient = webhookClient.dispatches(); const { items } = await dispatchesClient.list(); ``` * **@see** ### Hierarchy * ResourceCollectionClient * *WebhookDispatchCollectionClient* ## Index[**](#Index) ### Properties * [**apifyClient](#apifyClient) * [**baseUrl](#baseUrl) * [**httpClient](#httpClient) * [**id](#id) * [**params](#params) * [**publicBaseUrl](#publicBaseUrl) * [**resourcePath](#resourcePath) * [**safeId](#safeId) * [**url](#url) ### Methods * [**list](#list) ## Properties[**](#Properties) ### [**](#apifyClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L36)inheritedapifyClient **apifyClient: [ApifyClient](https://docs.apify.com/api/client/js/api/client/js/reference/class/ApifyClient.md) Inherited from ResourceCollectionClient.apifyClient ### [**](#baseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L28)inheritedbaseUrl **baseUrl: string Inherited from ResourceCollectionClient.baseUrl ### [**](#httpClient)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L38)inheritedhttpClient **httpClient: HttpClient Inherited from ResourceCollectionClient.httpClient ### [**](#id)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L24)optionalinheritedid **id? : string Inherited from ResourceCollectionClient.id ### [**](#params)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L40)optionalinheritedparams **params? : Record\ Inherited from ResourceCollectionClient.params ### [**](#publicBaseUrl)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L30)inheritedpublicBaseUrl **publicBaseUrl: string Inherited from ResourceCollectionClient.publicBaseUrl ### [**](#resourcePath)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L32)inheritedresourcePath **resourcePath: string Inherited from ResourceCollectionClient.resourcePath ### [**](#safeId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L26)optionalinheritedsafeId **safeId? : string Inherited from ResourceCollectionClient.safeId ### [**](#url)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/base/api_client.ts#L34)inheritedurl **url: string Inherited from ResourceCollectionClient.url ## Methods[**](#Methods) ### [**](#list)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch_collection.ts#L57)list * ****list**(options): PaginatedIterator<[WebhookDispatch](https://docs.apify.com/api/client/js/api/client/js/reference/interface/WebhookDispatch.md)> - Lists all webhook dispatches. 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 * ##### options: [WebhookDispatchCollectionListOptions](https://docs.apify.com/api/client/js/api/client/js/reference/interface/WebhookDispatchCollectionListOptions.md) = {} Pagination and sorting options. #### Returns PaginatedIterator<[WebhookDispatch](https://docs.apify.com/api/client/js/api/client/js/reference/interface/WebhookDispatch.md)> A paginated iterator of webhook dispatches. --- # Source: https://docs.apify.com/api/client/python/reference/class/WebhookDispatchCollectionClientAsync.md # WebhookDispatchCollectionClientAsync Async sub-client for listing webhook dispatches. ### Hierarchy * [ResourceCollectionClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md) * *WebhookDispatchCollectionClientAsync* ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchCollectionClientAsync.md#__init__) * [**list](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchCollectionClientAsync.md#list) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchCollectionClientAsync.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchCollectionClientAsync.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchCollectionClientAsync.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchCollectionClientAsync.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/WebhookDispatchCollectionClientAsync.md#url) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/webhook_dispatch_collection.py#L43)\_\_init\_\_ * ****\_\_init\_\_**(\*, base\_url, root\_client, http\_client, resource\_id, resource\_path, params): None - Overrides [ResourceCollectionClientAsync.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/ResourceCollectionClientAsync.md#__init__) Initialize a new instance. *** #### Parameters * ##### keyword-onlybase\_url: str Base URL of the API server. * ##### keyword-onlyroot\_client: [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) The ApifyClientAsync instance under which this resource client exists. * ##### keyword-onlyhttp\_client: [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) The HTTPClientAsync instance to be used in this client. * ##### optionalkeyword-onlyresource\_id: str | None = None ID of the manipulated resource, in case of a single-resource client. * ##### keyword-onlyresource\_path: str Path to the resource's endpoint on the API server. * ##### optionalkeyword-onlyparams: dict | None = None Parameters to include in all requests from this client. #### Returns None ### [**](#list)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/resource_clients/webhook_dispatch_collection.py#L47)list * **async **list**(\*, limit, offset, desc): [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] - List all webhook dispatches of a user. *** #### Parameters * ##### optionalkeyword-onlylimit: int | None = None How many webhook dispatches to retrieve. * ##### optionalkeyword-onlyoffset: int | None = None What webhook dispatch to include as first when retrieving the list. * ##### optionalkeyword-onlydesc: bool | None = None Whether to sort the webhook dispatches in descending order based on the date of their creation. #### Returns [ListPage](https://docs.apify.com/api/client/python/api/client/python/reference/class/ListPage.md)\[dict] ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L94)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) Inherited from [BaseClientAsync.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#http_client) Overrides [\_BaseBaseClient.http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict Inherited from [\_BaseBaseClient.params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None Inherited from [\_BaseBaseClient.resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L95)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) Inherited from [BaseClientAsync.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md#root_client) Overrides [\_BaseBaseClient.root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str Inherited from [\_BaseBaseClient.url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) --- # Source: https://docs.apify.com/api/client/js/reference/interface/WebhookDispatchCollectionListOptions.md # WebhookDispatchCollectionListOptions ### Hierarchy * PaginationOptions * *WebhookDispatchCollectionListOptions* ## Index[**](#Index) ### Properties * [**chunkSize](#chunkSize) * [**desc](#desc) * [**limit](#limit) * [**offset](#offset) ## Properties[**](#Properties) ### [**](#chunkSize)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L258)optionalinheritedchunkSize **chunkSize? : number Inherited from PaginationOptions.chunkSize Maximum number of items returned in one API response. Relevant in the context of asyncIterator, the iterator will fetch results in chunks of this size from API and yield them one by one. It will stop fetching once the limit is reached or once all items from API have been fetched. Chunk size is usually limited by API. Minimum of those two limits will be used. ### [**](#desc)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch_collection.ts#L72)optionaldesc **desc? : boolean ### [**](#limit)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L251)optionalinheritedlimit **limit? : number Inherited from PaginationOptions.limit Maximum number of entries requested. ### [**](#offset)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/utils.ts#L249)optionalinheritedoffset **offset? : number Inherited from PaginationOptions.offset Position of the first returned entry. --- # Source: https://docs.apify.com/api/client/js/reference/interface/WebhookDispatchEventData.md # WebhookDispatchEventData ## Index[**](#Index) ### Properties * [**actorBuildId](#actorBuildId) * [**actorId](#actorId) * [**actorRunId](#actorRunId) * [**actorTaskId](#actorTaskId) ## Properties[**](#Properties) ### [**](#actorBuildId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L75)optionalactorBuildId **actorBuildId? : string ### [**](#actorId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L73)optionalactorId **actorId? : string ### [**](#actorRunId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L72)optionalactorRunId **actorRunId? : string ### [**](#actorTaskId)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L74)optionalactorTaskId **actorTaskId? : string --- # Source: https://docs.apify.com/api/client/js/reference/enum/WebhookDispatchStatus.md # WebhookDispatchStatus ## Index[**](#Index) ### Enumeration Members * [**Active](#Active) * [**Failed](#Failed) * [**Succeeded](#Succeeded) ## Enumeration Members[**](<#Enumeration Members>) ### [**](#Active)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L58)Active **Active: ACTIVE ### [**](#Failed)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L60)Failed **Failed: FAILED ### [**](#Succeeded)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook_dispatch.ts#L59)Succeeded **Succeeded: SUCCEEDED --- # Source: https://docs.apify.com/api/client/js/reference/interface/WebhookIdempotencyKey.md # WebhookIdempotencyKey ## Index[**](#Index) ### Properties * [**idempotencyKey](#idempotencyKey) ## Properties[**](#Properties) ### [**](#idempotencyKey)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L149)optionalidempotencyKey **idempotencyKey? : string --- # Source: https://docs.apify.com/sdk/js/reference/interface/WebhookOptions.md # WebhookOptions ## Index[**](#Index) ### Properties * [**eventTypes](#eventTypes) * [**idempotencyKey](#idempotencyKey) * [**payloadTemplate](#payloadTemplate) * [**requestUrl](#requestUrl) ## Properties[**](#Properties) ### [**](#eventTypes)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1920)eventTypes **eventTypes: readonly WebhookEventType\[] Array of event types, which you can set for Actor run, see the [Actor run events](https://docs.apify.com/webhooks/events#actor-run) in the Apify doc. ### [**](#idempotencyKey)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1943)optionalidempotencyKey **idempotencyKey? : string Idempotency key enables you to ensure that a webhook will not be added multiple times in case of an Actor restart or other situation that would cause the `addWebhook()` function to be called again. We suggest using the Actor run ID as the idempotency key. You can get the run ID by calling [Actor.getEnv](https://docs.apify.com/sdk/js/sdk/js/reference/class/Actor.md#getEnv) function. ### [**](#payloadTemplate)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1935)optionalpayloadTemplate **payloadTemplate? : string Payload template is a JSON-like string that describes the structure of the webhook POST request payload. It uses JSON syntax, extended with a double curly braces syntax for injecting variables `{{variable}}`. Those variables are resolved at the time of the webhook's dispatch, and a list of available variables with their descriptions is available in the [Apify webhook documentation](https://docs.apify.com/webhooks). If `payloadTemplate` is omitted, the default payload template is used ([view docs](https://docs.apify.com/webhooks/actions#payload-template)). ### [**](#requestUrl)[**](https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L1925)requestUrl **requestUrl: string URL which will be requested using HTTP POST request, when Actor run will reach the set event type. --- # Source: https://docs.apify.com/api/client/js/reference/interface/WebhookStats.md # WebhookStats Statistics about webhook usage. ## Index[**](#Index) ### Properties * [**totalDispatches](#totalDispatches) ## Properties[**](#Properties) ### [**](#totalDispatches)[**](https://github.com/apify/apify-client-js/blob/a8a29bacd7df19373e3300fc059110221bc37e09/src/resource_clients/webhook.ts#L177)totalDispatches **totalDispatches: number --- # Source: https://docs.apify.com/api/client/python/reference/class/WithLogDetailsClient.md # WithLogDetailsClient ## Index[**](#Index) ### Methods * [**\_\_new\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/WithLogDetailsClient.md#__new__) ## Methods[**](#Methods) ### [**](#__new__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_logging.py#L46)\_\_new\_\_ * ****\_\_new\_\_**(name, bases, attrs): [WithLogDetailsClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/WithLogDetailsClient.md) - #### Parameters * ##### name: str * ##### bases: tuple * ##### attrs: dict #### Returns [WithLogDetailsClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/WithLogDetailsClient.md) --- # Source: https://docs.apify.com/api/client/python/reference/class/_BaseApifyClient.md # \_BaseApifyClient ### Hierarchy * *\_BaseApifyClient* * [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) * [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseApifyClient.md#__init__) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseApifyClient.md#http_client) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L62)\_\_init\_\_ * ****\_\_init\_\_**(token, \*, api\_url, api\_public\_url, max\_retries, min\_delay\_between\_retries\_millis, timeout\_secs): None - Initialize a new instance. *** #### Parameters * ##### optionaltoken: str | None = None The Apify API token. * ##### optionalkeyword-onlyapi\_url: str | None = None The URL of the Apify API server to which to connect. Defaults to . It can be an internal URL that is not globally accessible, in such case `api_public_url` should be set as well. * ##### optionalkeyword-onlyapi\_public\_url: str | None = None The globally accessible URL of the Apify API server. It should be set only if the `api_url` is an internal URL that is not globally accessible. * ##### optionalkeyword-onlymax\_retries: int | None = 8 How many times to retry a failed request at most. * ##### optionalkeyword-onlymin\_delay\_between\_retries\_millis: int | None = 500 How long will the client wait between retrying requests (increases exponentially from this value). * ##### optionalkeyword-onlytimeout\_secs: int | None = DEFAULT\_TIMEOUT The socket timeout of the HTTP requests sent to the Apify API. #### Returns None ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/client.py#L60)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) --- # Source: https://docs.apify.com/api/client/python/reference/class/_BaseBaseClient.md # \_BaseBaseClient ### Hierarchy * *\_BaseBaseClient* * [BaseClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClient.md) * [BaseClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/BaseClientAsync.md) ## Index[**](#Index) ### Properties * [**http\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#http_client) * [**params](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#params) * [**resource\_id](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#resource_id) * [**root\_client](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#root_client) * [**url](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseBaseClient.md#url) ## Properties[**](#Properties) ### [**](#http_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L18)http\_client **http\_client: [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) | [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) ### [**](#params)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L17)params **params: dict ### [**](#resource_id)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L15)resource\_id **resource\_id: str | None ### [**](#root_client)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L19)root\_client **root\_client: [ApifyClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClient.md) | [ApifyClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md) ### [**](#url)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/clients/base/base_client.py#L16)url **url: str --- # Source: https://docs.apify.com/api/client/python/reference/class/_BaseHTTPClient.md # \_BaseHTTPClient ### Hierarchy * *\_BaseHTTPClient* * [HTTPClient](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClient.md) * [HTTPClientAsync](https://docs.apify.com/api/client/python/api/client/python/reference/class/HTTPClientAsync.md) ## Index[**](#Index) ### Methods * [**\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseHTTPClient.md#__init__) ## Methods[**](#Methods) ### [**](#__init__)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_http_client.py#L33)\_\_init\_\_ * ****\_\_init\_\_**(\*, token, max\_retries, min\_delay\_between\_retries\_millis, timeout\_secs, stats): None - Inherited from [\_BaseHTTPClient.\_\_init\_\_](https://docs.apify.com/api/client/python/api/client/python/reference/class/_BaseHTTPClient.md#__init__) #### Parameters * ##### optionalkeyword-onlytoken: str | None = None * ##### optionalkeyword-onlymax\_retries: int = 8 * ##### optionalkeyword-onlymin\_delay\_between\_retries\_millis: int = 500 * ##### optionalkeyword-onlytimeout\_secs: int = 360 * ##### optionalkeyword-onlystats: [Statistics](https://docs.apify.com/api/client/python/api/client/python/reference/class/Statistics.md) | None = None #### Returns None --- # Source: https://docs.apify.com/api/client/python/reference/class/_ContextInjectingFilter.md # \_ContextInjectingFilter ## Index[**](#Index) ### Methods * [**filter](https://docs.apify.com/api/client/python/api/client/python/reference/class/_ContextInjectingFilter.md#filter) ## Methods[**](#Methods) ### [**](#filter)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_logging.py#L94)filter * ****filter**(record): bool - #### Parameters * ##### record: logging.LogRecord #### Returns bool --- # Source: https://docs.apify.com/api/client/python/reference/class/_DebugLogFormatter.md # \_DebugLogFormatter ## Index[**](#Index) ### Methods * [**format](https://docs.apify.com/api/client/python/api/client/python/reference/class/_DebugLogFormatter.md#format) ### Properties * [**empty\_record](https://docs.apify.com/api/client/python/api/client/python/reference/class/_DebugLogFormatter.md#empty_record) ## Methods[**](#Methods) ### [**](#format)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_logging.py#L120)format * ****format**(record): str - #### Parameters * ##### record: logging.LogRecord #### Returns str ## Properties[**](#Properties) ### [**](#empty_record)[**](https://undefined/apify/apify-client-python/blob/25ff4e51e07fe25d1d338b042eacba1ec0c63e84//src/apify_client/_logging.py#L109)empty\_record **empty\_record: Undefined --- # Source: https://docs.apify.com/sdk/python/reference/class/_FetchedPricingInfoDict.md # \_FetchedPricingInfoDict ## Index[**](#Index) ### Properties * [**charged\_event\_counts](https://docs.apify.com/sdk/python/sdk/python/reference/class/_FetchedPricingInfoDict.md#charged_event_counts) * [**max\_total\_charge\_usd](https://docs.apify.com/sdk/python/sdk/python/reference/class/_FetchedPricingInfoDict.md#max_total_charge_usd) * [**pricing\_info](https://docs.apify.com/sdk/python/sdk/python/reference/class/_FetchedPricingInfoDict.md#pricing_info) ## Properties[**](#Properties) ### [**](#charged_event_counts)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/_charging.py#L392)charged\_event\_counts **charged\_event\_counts: dict\[str, int] ### [**](#max_total_charge_usd)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/_charging.py#L393)max\_total\_charge\_usd **max\_total\_charge\_usd: Decimal ### [**](#pricing_info)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/_charging.py#L385)pricing\_info **pricing\_info: ((([FreeActorPricingInfo](https://docs.apify.com/sdk/python/sdk/python/reference/class/FreeActorPricingInfo.md) | [FlatPricePerMonthActorPricingInfo](https://docs.apify.com/sdk/python/sdk/python/reference/class/FlatPricePerMonthActorPricingInfo.md)) | [PricePerDatasetItemActorPricingInfo](https://docs.apify.com/sdk/python/sdk/python/reference/class/PricePerDatasetItemActorPricingInfo.md)) | [PayPerEventActorPricingInfo](https://docs.apify.com/sdk/python/sdk/python/reference/class/PayPerEventActorPricingInfo.md)) | None --- # Source: https://docs.apify.com/sdk/python/reference/class/_RequestDetails.md # \_RequestDetails ### Hierarchy * *\_RequestDetails* * [\_RequestsFromUrlInput](https://docs.apify.com/sdk/python/sdk/python/reference/class/_RequestsFromUrlInput.md) * [\_SimpleUrlInput](https://docs.apify.com/sdk/python/sdk/python/reference/class/_SimpleUrlInput.md) ## Index[**](#Index) ### Properties * [**headers](https://docs.apify.com/sdk/python/sdk/python/reference/class/_RequestDetails.md#headers) * [**method](https://docs.apify.com/sdk/python/sdk/python/reference/class/_RequestDetails.md#method) * [**payload](https://docs.apify.com/sdk/python/sdk/python/reference/class/_RequestDetails.md#payload) * [**user\_data](https://docs.apify.com/sdk/python/sdk/python/reference/class/_RequestDetails.md#user_data) ## Properties[**](#Properties) ### [**](#headers)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/request_loaders/_apify_request_list.py#L25)headers **headers: dict\[str, str] ### [**](#method)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/request_loaders/_apify_request_list.py#L23)method **method: HttpMethod ### [**](#payload)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/request_loaders/_apify_request_list.py#L24)payload **payload: str ### [**](#user_data)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/request_loaders/_apify_request_list.py#L26)user\_data **user\_data: dict\[str, str] --- # Source: https://docs.apify.com/sdk/python/reference/class/_RequestsFromUrlInput.md # \_RequestsFromUrlInput ### Hierarchy * [\_RequestDetails](https://docs.apify.com/sdk/python/sdk/python/reference/class/_RequestDetails.md) * *\_RequestsFromUrlInput* ## Index[**](#Index) ### Properties * [**headers](https://docs.apify.com/sdk/python/sdk/python/reference/class/_RequestsFromUrlInput.md#headers) * [**method](https://docs.apify.com/sdk/python/sdk/python/reference/class/_RequestsFromUrlInput.md#method) * [**payload](https://docs.apify.com/sdk/python/sdk/python/reference/class/_RequestsFromUrlInput.md#payload) * [**requests\_from\_url](https://docs.apify.com/sdk/python/sdk/python/reference/class/_RequestsFromUrlInput.md#requests_from_url) * [**user\_data](https://docs.apify.com/sdk/python/sdk/python/reference/class/_RequestsFromUrlInput.md#user_data) ## Properties[**](#Properties) ### [**](#headers)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/request_loaders/_apify_request_list.py#L25)headers **headers: dict\[str, str] Inherited from [\_RequestDetails.headers](https://docs.apify.com/sdk/python/sdk/python/reference/class/_RequestDetails.md#headers) ### [**](#method)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/request_loaders/_apify_request_list.py#L23)method **method: HttpMethod Inherited from [\_RequestDetails.method](https://docs.apify.com/sdk/python/sdk/python/reference/class/_RequestDetails.md#method) ### [**](#payload)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/request_loaders/_apify_request_list.py#L24)payload **payload: str Inherited from [\_RequestDetails.payload](https://docs.apify.com/sdk/python/sdk/python/reference/class/_RequestDetails.md#payload) ### [**](#requests_from_url)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/request_loaders/_apify_request_list.py#L30)requests\_from\_url **requests\_from\_url: str ### [**](#user_data)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/request_loaders/_apify_request_list.py#L26)user\_data **user\_data: dict\[str, str] Inherited from [\_RequestDetails.user\_data](https://docs.apify.com/sdk/python/sdk/python/reference/class/_RequestDetails.md#user_data) --- # Source: https://docs.apify.com/sdk/python/reference/class/_SimpleUrlInput.md # \_SimpleUrlInput ### Hierarchy * [\_RequestDetails](https://docs.apify.com/sdk/python/sdk/python/reference/class/_RequestDetails.md) * *\_SimpleUrlInput* ## Index[**](#Index) ### Properties * [**headers](https://docs.apify.com/sdk/python/sdk/python/reference/class/_SimpleUrlInput.md#headers) * [**method](https://docs.apify.com/sdk/python/sdk/python/reference/class/_SimpleUrlInput.md#method) * [**payload](https://docs.apify.com/sdk/python/sdk/python/reference/class/_SimpleUrlInput.md#payload) * [**url](https://docs.apify.com/sdk/python/sdk/python/reference/class/_SimpleUrlInput.md#url) * [**user\_data](https://docs.apify.com/sdk/python/sdk/python/reference/class/_SimpleUrlInput.md#user_data) ## Properties[**](#Properties) ### [**](#headers)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/request_loaders/_apify_request_list.py#L25)headers **headers: dict\[str, str] Inherited from [\_RequestDetails.headers](https://docs.apify.com/sdk/python/sdk/python/reference/class/_RequestDetails.md#headers) ### [**](#method)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/request_loaders/_apify_request_list.py#L23)method **method: HttpMethod Inherited from [\_RequestDetails.method](https://docs.apify.com/sdk/python/sdk/python/reference/class/_RequestDetails.md#method) ### [**](#payload)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/request_loaders/_apify_request_list.py#L24)payload **payload: str Inherited from [\_RequestDetails.payload](https://docs.apify.com/sdk/python/sdk/python/reference/class/_RequestDetails.md#payload) ### [**](#url)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/request_loaders/_apify_request_list.py#L34)url **url: str ### [**](#user_data)[**](https://github.com/apify/apify-sdk-python/blob/a01870a180ed391b8b6cad8d1894f12bcc879136//src/apify/request_loaders/_apify_request_list.py#L26)user\_data **user\_data: dict\[str, str] Inherited from [\_RequestDetails.user\_data](https://docs.apify.com/sdk/python/sdk/python/reference/class/_RequestDetails.md#user_data) --- # Source: https://docs.apify.com/academy.md # Apify Academy Learn everything about web scraping and automation with our free courses that will turn you into an expert scraper developer. ## Beginner courses https://docs.apify.com/academy/scraping-basics-javascript.md #### [Web scraping basics with JS](https://docs.apify.com/academy/scraping-basics-javascript.md) [Learn how to use JavaScript to extract information from websites in this practical course, starting from the absolute basics.](https://docs.apify.com/academy/scraping-basics-javascript.md) https://docs.apify.com/academy/scraping-basics-python.md #### [Web scraping basics with Python](https://docs.apify.com/academy/scraping-basics-python.md) [Learn how to use Python to extract information from websites in this practical course, starting from the absolute basics.](https://docs.apify.com/academy/scraping-basics-python.md) https://docs.apify.com/academy/apify-platform.md #### [Apify platform](https://docs.apify.com/academy/apify-platform.md) [The Apify platform is the best place to run your scrapers and automations in the cloud. Learn what an actor is, how to turn your program into an actor, and how to deploy it.](https://docs.apify.com/academy/apify-platform.md) ## Advanced web scraping courses https://docs.apify.com/academy/api-scraping.md #### [API scraping](https://docs.apify.com/academy/api-scraping.md) [Learn all about how the professionals scrape various types of APIs with various configurations, parameters, and requirements.](https://docs.apify.com/academy/api-scraping.md) https://docs.apify.com/academy/anti-scraping.md #### [Anti-scraping protections](https://docs.apify.com/academy/anti-scraping.md) [Understand the various anti-scraping measures different sites use to prevent bots from accessing them, and how to appear more human to fix these issues.](https://docs.apify.com/academy/anti-scraping.md) https://docs.apify.com/academy/expert-scraping-with-apify.md #### [Expert scraping with Apify](https://docs.apify.com/academy/expert-scraping-with-apify.md) [After learning the basics of actors, learn to develop pro-level scrapers on the Apify platform with this advanced course.](https://docs.apify.com/academy/expert-scraping-with-apify.md) --- # Source: https://docs.apify.com/sdk/js/docs/examples/accept-user-input.md # Accept user input Copy for LLM This example accepts and logs user input: ``` import { Actor } from 'apify'; await Actor.init(); const input = await Actor.getInput(); console.log(input); await Actor.exit(); ``` To provide the actor with input, create a `INPUT.json` file inside the "default" key-value store: ``` {PROJECT_FOLDER}/storage/key_value_stores/default/INPUT.json ``` Anything in this file will be available to the actor when it runs. To learn about other ways to provide an actor with input, refer to the [Apify Platform Documentation](https://apify.com/docs/actor#run). --- # Source: https://docs.apify.com/legal/acceptable-use-policy.md # Apify Acceptable Use Policy Apify Technologies s.r.o., with its registered seat at Vodičkova 704/36, Nové Město, 110 00 Prague 1, Czech Republic, Company ID No.: 04788290, registered in the Commercial Register kept by the Municipal Court of Prague, File No.: C 253224 (hereinafter referred to as “**we**” or “**Apify**”), is committed to making sure that the Platform and the Website are being used only for legitimate and legal purposes. By agreeing to our General Terms and Conditions or simply by using the Platform or the Website, you also agree to be bound by this Acceptable Use Policy. ## 1. General Provisions **1.1.** Apify takes firm action against any illegal or non-compliant use of the Platform and the Website and will assist law enforcement in investigating any illegal activities. Any use of the Platform or the Website for illegal, fraudulent, or otherwise unacceptable activities is strictly prohibited. **1.2.** You agree to use the Platform and the Website only for legal and legitimate purposes and to avoid the Prohibited Activities under Article 2.1. **1.3.** Any capitalized terms that are not defined in this Acceptable Use Policy shall have the meaning ascribed to them in the General Terms and Conditions. ## 2. Prohibited Activities **2.1.** Prohibited activities include, but are not limited to: 1. denial-of-service (DDoS) attacks or any other actions that cause undue burden on any servers or infrastructure; 2. unsolicited mass messaging; 3. any fraudulent or deceptive behavior (such as phishing, malware, impersonation, spoofing, ad fraud, click fraud, etc.); 4. any artificial interaction (such as upvotes, shares, etc.); 5. creating fake accounts or deceptive content (such as disinformation, clickbait, misleading ad, scam emails, etc.); 6. any manipulation of Search Engine Optimization (i.e., fake clicks in search engine results); 7. engaging in surveys in exchange for any financial or in-kind benefit; 8. resale of any Platform features without obtaining Apify’s prior written approval; 9. engaging in activities that contravene applicable laws, regulations, or the rights of any third party; 10. any activity that may harm the reputation, goodwill or interests of Apify; 11. any additional activity that Apify deems immoral or undesirable on its Platform or Website (together as the “**Prohibited Activities**”). ## 3. Our Rights **3.1.** In case Apify identifies any of the Prohibited Activities on the Platform or the Website, it is authorized to block, delete, or otherwise restrict any such non-compliant User or Actor from the Platform or Website without notice. Apify may limit the use of the Platform or the Website in its sole discretion to prevent any direct or indirect damage to Apify or any third party. **3.2.** Apify shall not be liable towards you or any third party for exercising its rights according to this Acceptable Use Policy. ## 4. Reporting **4.1.** We encourage users to report any misuse or suspicious activity on our Platform through our contact email [support@apify.com](mailto:hello@apify.com). --- # Source: https://docs.apify.com/sdk/python/docs/concepts/access-apify-api.md # Accessing Apify API Copy for LLM The Apify SDK contains many useful features for making Actor development easier. However, it does not cover all the features the Apify API offers. For working with the Apify API directly, you can use the provided instance of the [Apify API Client](https://docs.apify.com/api/client/python) library. ## Actor client[](#actor-client) To access the provided instance of [`ApifyClientAsync`](https://docs.apify.com/api/client/python/reference/class/ApifyClientAsync), you can use the [`Actor.apify_client`](https://docs.apify.com/sdk/python/sdk/python/reference/class/Actor.md#apify_client) property. For example, to get the details of your user, you can use this snippet: [Run on](https://console.apify.com/actors/HH9rhkFXiZbheuq1V?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCBhc3luY2lvXFxuXFxuZnJvbSBhcGlmeSBpbXBvcnQgQWN0b3JcXG5cXG5cXG5hc3luYyBkZWYgbWFpbigpIC0-IE5vbmU6XFxuICAgIGFzeW5jIHdpdGggQWN0b3I6XFxuICAgICAgICAjIENyZWF0ZSBhIG5ldyB1c2VyIGNsaWVudC5cXG4gICAgICAgIHVzZXJfY2xpZW50ID0gQWN0b3IuYXBpZnlfY2xpZW50LnVzZXIoJ21lJylcXG5cXG4gICAgICAgICMgR2V0IGluZm9ybWF0aW9uIGFib3V0IHRoZSBjdXJyZW50IHVzZXIuXFxuICAgICAgICBtZSA9IGF3YWl0IHVzZXJfY2xpZW50LmdldCgpXFxuICAgICAgICBBY3Rvci5sb2cuaW5mbyhmJ1VzZXI6IHttZX0nKVxcblxcblxcbmlmIF9fbmFtZV9fID09ICdfX21haW5fXyc6XFxuICAgIGFzeW5jaW8ucnVuKG1haW4oKSlcXG5cIn0iLCJvcHRpb25zIjp7ImJ1aWxkIjoibGF0ZXN0IiwiY29udGVudFR5cGUiOiJhcHBsaWNhdGlvbi9qc29uOyBjaGFyc2V0PXV0Zi04IiwibWVtb3J5IjoxMDI0LCJ0aW1lb3V0IjoxODB9fQ.WmlLJkd9Tk8mAypqYz0clI_cBhejAvT52vw3toIUWqw\&asrc=run_on_apify) ``` import asyncio from apify import Actor async def main() -> None: async with Actor: # Create a new user client. user_client = Actor.apify_client.user('me') # Get information about the current user. me = await user_client.get() Actor.log.info(f'User: {me}') if __name__ == '__main__': asyncio.run(main()) ``` ## Actor new client[](#actor-new-client) If you want to create a completely new instance of the client, for example, to get a client for a different user or change the configuration of the client,you can use the [`Actor.new_client`](https://docs.apify.com/sdk/python/sdk/python/reference/class/Actor.md#new_client) method: [Run on](https://console.apify.com/actors/HH9rhkFXiZbheuq1V?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCBhc3luY2lvXFxuXFxuZnJvbSBhcGlmeSBpbXBvcnQgQWN0b3JcXG5cXG5UT0tFTiA9ICdBTk9USEVSX1VTRVJTX1RPS0VOJ1xcblxcblxcbmFzeW5jIGRlZiBtYWluKCkgLT4gTm9uZTpcXG4gICAgYXN5bmMgd2l0aCBBY3RvcjpcXG4gICAgICAgICMgQ3JlYXRlIGEgbmV3IHVzZXIgY2xpZW50IHdpdGggYSBjdXN0b20gdG9rZW4uXFxuICAgICAgICBhcGlmeV9jbGllbnQgPSBBY3Rvci5uZXdfY2xpZW50KHRva2VuPVRPS0VOLCBtYXhfcmV0cmllcz0yKVxcbiAgICAgICAgdXNlcl9jbGllbnQgPSBhcGlmeV9jbGllbnQudXNlcignbWUnKVxcblxcbiAgICAgICAgIyBHZXQgaW5mb3JtYXRpb24gYWJvdXQgdGhlIGFub3RoZXIgdXNlci5cXG4gICAgICAgIHRoZW0gPSBhd2FpdCB1c2VyX2NsaWVudC5nZXQoKVxcbiAgICAgICAgQWN0b3IubG9nLmluZm8oZidBbm90aGVyIHVzZXI6IHt0aGVtfScpXFxuXFxuXFxuaWYgX19uYW1lX18gPT0gJ19fbWFpbl9fJzpcXG4gICAgYXN5bmNpby5ydW4obWFpbigpKVxcblwifSIsIm9wdGlvbnMiOnsiYnVpbGQiOiJsYXRlc3QiLCJjb250ZW50VHlwZSI6ImFwcGxpY2F0aW9uL2pzb247IGNoYXJzZXQ9dXRmLTgiLCJtZW1vcnkiOjEwMjQsInRpbWVvdXQiOjE4MH19.C875ON4a9WzTQz9QDEO3yS1N9RRCqxaRUIPmNGbsxIw\&asrc=run_on_apify) ``` import asyncio from apify import Actor TOKEN = 'ANOTHER_USERS_TOKEN' async def main() -> None: async with Actor: # Create a new user client with a custom token. apify_client = Actor.new_client(token=TOKEN, max_retries=2) user_client = apify_client.user('me') # Get information about the another user. them = await user_client.get() Actor.log.info(f'Another user: {them}') if __name__ == '__main__': asyncio.run(main()) ``` --- # Source: https://docs.apify.com/platform/collaboration/access-rights.md # Access rights **Manage permissions for your private resources such as Actors, Actor runs, and storages. Allow other users to read, run, modify, or build new versions.** *** You can easily and securely share your own resources - Actors, tasks, key-value stores, datasets, and request queues - with other users by using a [granular](https://www.google.com/search?q=define+granular+permissions) permissions system. This enables you, for example, to let your colleague run an [Actor](https://docs.apify.com/platform/actors.md) or view a [dataset](https://docs.apify.com/platform/storage/dataset.md) but not modify it. You can also grant permission to update an Actor and build a new version. [Storages](https://docs.apify.com/platform/storage.md) (key-value stores, request queues, and datasets) are sharable in the same way as a **read** permission or a combination of both **read** and **write** permissions. To share an Actor, task, key-value store, request queue, or dataset, click on the **Actions** button in the top-right corner and select **Share**. You can add a collaborator by using their **user ID**, **email**, or **username**. Once you have added the collaborator, you can configure their permissions. ![Access rights configuration](/assets/images/access-rights-76dfb5c1630309ea547eeb6fbde3b509.png) --- # Source: https://docs.apify.com/api/v2/act-build-abort-post.md # Abort build ``` POST https://api.apify.com/v2/acts/:actorId/builds/:buildId/abort ``` deprecated This endpoint has been deprecated and may be replaced or removed in future versions of the API. **\[DEPRECATED]** API endpoints related to build of the Actor were moved under new namespace . Aborts an Actor build and returns an object that contains all the details about the build. Only builds that are starting or running are aborted. For builds with status `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-build-default-get.md # Get default build ``` GET https://api.apify.com/v2/acts/:actorId/builds/default ``` Get the default build for an Actor. Use the optional `waitForFinish` parameter to synchronously wait for the build to finish. This avoids the need for periodic polling when waiting for the build to complete. This endpoint does not require an authentication token. Instead, calls are authenticated using the Actor's unique ID. However, if you access the endpoint without a token, certain attributes (e.g., `usageUsd` and `usageTotalUsd`) will be hidden. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-build-get.md # Get build ``` GET https://api.apify.com/v2/acts/:actorId/builds/:buildId ``` deprecated API endpoints related to build of the Actor were moved under new namespace . Gets an object that contains all the details about a specific build of an Actor. By passing the optional `waitForFinish` parameter the API endpoint will synchronously wait for the build to finish. This is useful to avoid periodic polling when waiting for an Actor build to finish. This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the build. However, if you access the endpoint without the token, certain attributes, such as `usageUsd` and `usageTotalUsd`, will be hidden. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-builds-get.md # Get list of builds ``` GET https://api.apify.com/v2/acts/:actorId/builds ``` Gets the list of builds of a specific Actor. The response is a JSON with the list of objects, where each object contains basic information about a single build. The endpoint supports pagination using the `limit` and `offset` parameters and it will not return more than 1000 records. By default, the records are sorted by the `startedAt` field in ascending order, therefore you can use pagination to incrementally fetch all builds while new ones are still being started. To sort the records in descending order, use the `desc=1` parameter. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-builds-post.md # Build Actor ``` POST https://api.apify.com/v2/acts/:actorId/builds ``` Builds an Actor. The response is the build object as returned by the endpoint. ## Request ## Responses * 201 * 400 **Response Headers** * **Location** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-delete.md # Delete Actor ``` DELETE https://api.apify.com/v2/acts/:actorId ``` Deletes an Actor. ## Request ## Responses * 204 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-get.md # Get Actor ``` GET https://api.apify.com/v2/acts/:actorId ``` Gets an object that contains all the details about a specific Actor. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-openapi-json-get.md # Get OpenAPI definition ``` GET https://api.apify.com/v2/acts/:actorId/builds/:buildId/openapi.json ``` Get the OpenAPI definition for Actor builds. Two similar endpoints are available: * [First endpoint](https://docs.apify.com/api/v2/act-openapi-json-get.md): Requires both `actorId` and `buildId`. Use `default` as the `buildId` to get the OpenAPI schema for the default Actor build. * [Second endpoint](https://docs.apify.com/api/v2/actor-build-openapi-json-get.md): Requires only `buildId`. Get the OpenAPI definition for a specific Actor build. To fetch the default Actor build, simply pass `default` as the `buildId`. Authentication is based on the build's unique ID. No authentication token is required. note You can also use the [/api/v2/actor-build-openapi-json-get](https://docs.apify.com/api/v2/actor-build-openapi-json-get.md) endpoint to get the OpenAPI definition for a build. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-put.md # Update Actor ``` PUT https://api.apify.com/v2/acts/:actorId ``` Updates settings of an Actor using values specified by an Actor object passed as JSON in the POST payload. If the object does not define a specific property, its value will not be updated. The response is the full Actor object as returned by the endpoint. The request needs to specify the `Content-Type: application/json` HTTP header! When providing your API authentication token, we recommend using the request's `Authorization` header, rather than the URL. (). If you want to make your Actor [public](https://docs.apify.com/platform/actors/publishing) using `isPublic: true`, you will need to provide the Actor's `title` and the `categories` under which that Actor will be classified in Apify Store. For this, it's best to use the [constants from our apify-shared-js package](https://github.com/apify/apify-shared-js/blob/2d43ebc41ece9ad31cd6525bd523fb86939bf860/packages/consts/src/consts.ts#L452-L471). ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-run-abort-post.md # Abort run ``` POST https://api.apify.com/v2/acts/:actorId/runs/:runId/abort ``` deprecated This endpoint has been deprecated and may be replaced or removed in future versions of the API. **\[DEPRECATED]** API endpoints related to run of the Actor were moved under new namespace . Aborts an Actor run and returns an object that contains all the details about the run. Only runs that are starting or running are aborted. For runs with status `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-run-get.md # Get run ``` GET https://api.apify.com/v2/acts/:actorId/runs/:runId ``` deprecated This endpoint has been deprecated and may be replaced or removed in future versions of the API. **\[DEPRECATED]** API endpoints related to run of the Actor were moved under new namespace . Gets an object that contains all the details about a specific run of an Actor. By passing the optional `waitForFinish` parameter the API endpoint will synchronously wait for the run to finish. This is useful to avoid periodic polling when waiting for Actor run to complete. This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the run. However, if you access the endpoint without the token, certain attributes, such as `usageUsd` and `usageTotalUsd`, will be hidden. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-run-metamorph-post.md # Metamorph run ``` POST https://api.apify.com/v2/acts/:actorId/runs/:runId/metamorph ``` deprecated This endpoint has been deprecated and may be replaced or removed in future versions of the API. **\[DEPRECATED]** API endpoints related to run of the Actor were moved under new namespace .Transforms an Actor run into a run of another Actor with a new input. This is useful if you want to use another Actor to finish the work of your current Actor run, without the need to create a completely new run and waiting for its finish. For the users of your Actors, the metamorph operation is transparent, they will just see your Actor got the work done. There is a limit on how many times you can metamorph a single run. You can check the limit in [the Actor runtime limits](https://docs.apify.com/platform/limits#actor-limits). Internally, the system stops the Docker container corresponding to the Actor run and starts a new container using a different Docker image. All the default storages are preserved and the new input is stored under the `INPUT-METAMORPH-1` key in the same default key-value store. For more information, see the [Actor docs](https://docs.apify.com/platform/actors/development/programming-interface/metamorph). ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-run-resurrect-post.md # Resurrect run ``` POST https://api.apify.com/v2/acts/:actorId/runs/:runId/resurrect ``` **\[DEPRECATED]** API endpoints related to run of the Actor were moved under new namespace .Resurrects a finished Actor run and returns an object that contains all the details about the resurrected run. Only finished runs, i.e. runs with status `FINISHED`, `FAILED`, `ABORTED` and `TIMED-OUT` can be resurrected. Run status will be updated to RUNNING and its container will be restarted with the same storages (the same behaviour as when the run gets migrated to the new server). For more information, see the [Actor docs](https://docs.apify.com/platform/actors/running/runs-and-builds#resurrection-of-finished-run). ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-run-sync-get-dataset-items-get.md # Run Actor synchronously without input and get dataset items ``` GET https://api.apify.com/v2/acts/:actorId/run-sync-get-dataset-items ``` Runs a specific Actor and returns its dataset items. The run must finish in 300 seconds otherwise the API endpoint returns a timeout error. The Actor is not passed any input. It allows to send all possible options in parameters from API endpoint. Beware that it might be impossible to maintain an idle HTTP connection for a long period of time, due to client timeout or network conditions. Make sure your HTTP client is configured to have a long enough connection timeout. If the connection breaks, you will not receive any information about the run and its status. To run the Actor asynchronously, use the API endpoint instead. ## Request ## Responses * 201 * 400 * 408 **Response Headers** * **X-Apify-Pagination-Offset** **X-Apify-Pagination-Limit** **X-Apify-Pagination-Count** **X-Apify-Pagination-Total** **Response Headers** **Response Headers** --- # Source: https://docs.apify.com/api/v2/act-run-sync-get-dataset-items-post.md # Run Actor synchronously with input and get dataset items ``` POST https://api.apify.com/v2/acts/:actorId/run-sync-get-dataset-items ``` Runs a specific Actor and returns its dataset items. The POST payload including its `Content-Type` header is passed as `INPUT` to the Actor (usually `application/json`). The HTTP response contains the Actors dataset items, while the format of items depends on specifying dataset items' `format` parameter. You can send all the same options in parameters as the API endpoint. The Actor is started with the default options; you can override them using URL query parameters. If the Actor run exceeds 300 seconds, the HTTP response will return the 408 status code (Request Timeout). Beware that it might be impossible to maintain an idle HTTP connection for a long period of time, due to client timeout or network conditions. Make sure your HTTP client is configured to have a long enough connection timeout. If the connection breaks, you will not receive any information about the run and its status. To run the Actor asynchronously, use the API endpoint instead. ## Request ## Responses * 201 * 400 * 408 **Response Headers** * **X-Apify-Pagination-Offset** **X-Apify-Pagination-Limit** **X-Apify-Pagination-Count** **X-Apify-Pagination-Total** **Response Headers** **Response Headers** --- # Source: https://docs.apify.com/api/v2/act-run-sync-get.md # Without input ``` GET https://api.apify.com/v2/acts/:actorId/run-sync ``` Runs a specific Actor and returns its output. The run must finish in 300 seconds otherwise the API endpoint returns a timeout error. The Actor is not passed any input. Beware that it might be impossible to maintain an idle HTTP connection for a long period of time, due to client timeout or network conditions. Make sure your HTTP client is configured to have a long enough connection timeout. If the connection breaks, you will not receive any information about the run and its status. To run the Actor asynchronously, use the API endpoint instead. ## Request ## Responses * 201 * 400 * 408 **Response Headers** **Response Headers** **Response Headers** --- # Source: https://docs.apify.com/api/v2/act-run-sync-post.md # Run Actor synchronously with input and return output ``` POST https://api.apify.com/v2/acts/:actorId/run-sync ``` Runs a specific Actor and returns its output. The POST payload including its `Content-Type` header is passed as `INPUT` to the Actor (usually `application/json`). The HTTP response contains Actors `OUTPUT` record from its default key-value store. The Actor is started with the default options; you can override them using various URL query parameters. If the Actor run exceeds 300 seconds, the HTTP response will have status 408 (Request Timeout). Beware that it might be impossible to maintain an idle HTTP connection for a long period of time, due to client timeout or network conditions. Make sure your HTTP client is configured to have a long enough connection timeout. If the connection breaks, you will not receive any information about the run and its status. To run the Actor asynchronously, use the API endpoint instead. ## Request ## Responses * 201 * 400 * 408 **Response Headers** **Response Headers** **Response Headers** --- # Source: https://docs.apify.com/api/v2/act-runs-get.md # Get list of runs ``` GET https://api.apify.com/v2/acts/:actorId/runs ``` Gets the list of runs of a specific Actor. The response is a list of objects, where each object contains basic information about a single Actor run. The endpoint supports pagination using the `limit` and `offset` parameters and it will not return more than 1000 array elements. By default, the records are sorted by the `startedAt` field in ascending order, therefore you can use pagination to incrementally fetch all records while new ones are still being created. To sort the records in descending order, use `desc=1` parameter. You can also filter runs by status ([available statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-runs-last-get.md # Get last run ``` GET https://api.apify.com/v2/acts/:actorId/runs/last ``` This is not a single endpoint, but an entire group of endpoints that lets you to retrieve and manage the last run of given Actor or any of its default storages. All the endpoints require an authentication token. The endpoints accept the same HTTP methods and query parameters as the respective storage endpoints. The base path represents the last Actor run object is: `/v2/acts/{actorId}/runs/last{?token,status}` Using the `status` query parameter you can ensure to only get a run with a certain status (e.g. `status=SUCCEEDED`). The output of this endpoint and other query parameters are the same as in the endpoint. In order to access the default storages of the last Actor run, i.e. log, key-value store, dataset and request queue, use the following endpoints: * `/v2/acts/{actorId}/runs/last/log{?token,status}` * `/v2/acts/{actorId}/runs/last/key-value-store{?token,status}` * `/v2/acts/{actorId}/runs/last/dataset{?token,status}` * `/v2/acts/{actorId}/runs/last/request-queue{?token,status}` These API endpoints have the same usage as the equivalent storage endpoints. For example, `/v2/acts/{actorId}/runs/last/key-value-store` has the same HTTP method and parameters as the endpoint. Additionally, each of the above API endpoints supports all sub-endpoints of the original one: #### Key-value store * `/v2/acts/{actorId}/runs/last/key-value-store/keys{?token,status}` * `/v2/acts/{actorId}/runs/last/key-value-store/records/{recordKey}{?token,status}` #### Dataset * `/v2/acts/{actorId}/runs/last/dataset/items{?token,status}` #### Request queue * `/v2/acts/{actorId}/runs/last/request-queue/requests{?token,status}` * `/v2/acts/{actorId}/runs/last/request-queue/requests/{requestId}{?token,status}` * `/v2/acts/{actorId}/runs/last/request-queue/head{?token,status}` For example, to download data from a dataset of the last succeeded Actor run in XML format, send HTTP GET request to the following URL: ``` https://api.apify.com/v2/acts/{actorId}/runs/last/dataset/items?token={yourApiToken}&format=xml&status=SUCCEEDED ``` In order to save new items to the dataset, send HTTP POST request with JSON payload to the same URL. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-runs-post.md # Run Actor ``` POST https://api.apify.com/v2/acts/:actorId/runs ``` Runs an Actor and immediately returns without waiting for the run to finish. The POST payload including its `Content-Type` header is passed as `INPUT` to the Actor (usually `application/json`). The Actor is started with the default options; you can override them using various URL query parameters. The response is the Run object as returned by the API endpoint. If you want to wait for the run to finish and receive the actual output of the Actor as the response, please use one of the API endpoints instead. To fetch the Actor run results that are typically stored in the default dataset, you'll need to pass the ID received in the `defaultDatasetId` field received in the response JSON to the API endpoint. ## Request ## Responses * 201 * 400 **Response Headers** * **Location** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-version-delete.md # Delete version ``` DELETE https://api.apify.com/v2/acts/:actorId/versions/:versionNumber ``` Deletes a specific version of Actor's source code. ## Request ## Responses * 204 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-version-env-var-delete.md # Delete environment variable ``` DELETE https://api.apify.com/v2/acts/:actorId/versions/:versionNumber/env-vars/:envVarName ``` Deletes a specific environment variable. ## Request ## Responses * 204 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-version-env-var-get.md # Get environment variable ``` GET https://api.apify.com/v2/acts/:actorId/versions/:versionNumber/env-vars/:envVarName ``` Gets a that contains all the details about a specific environment variable of an Actor. If `isSecret` is set to `true`, then `value` will never be returned. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-version-env-var-put.md # Update environment variable ``` PUT https://api.apify.com/v2/acts/:actorId/versions/:versionNumber/env-vars/:envVarName ``` Updates Actor environment variable using values specified by a passed as JSON in the POST payload. If the object does not define a specific property, its value will not be updated. The request needs to specify the `Content-Type: application/json` HTTP header! When providing your API authentication token, we recommend using the request's `Authorization` header, rather than the URL. (). The response is the as returned by the endpoint. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-version-env-vars-get.md # Get list of environment variables ``` GET https://api.apify.com/v2/acts/:actorId/versions/:versionNumber/env-vars ``` Gets the list of environment variables for a specific version of an Actor. The response is a JSON object with the list of , where each contains basic information about a single environment variable. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-version-env-vars-post.md # Create environment variable ``` POST https://api.apify.com/v2/acts/:actorId/versions/:versionNumber/env-vars ``` Creates an environment variable of an Actor using values specified in a passed as JSON in the POST payload. The request must specify `name` and `value` parameters (as strings) in the JSON payload and a `Content-Type: application/json` HTTP header. ``` { "name": "ENV_VAR_NAME", "value": "my-env-var" } ``` The response is the as returned by the endpoint. ## Request ## Responses * 201 * 400 **Response Headers** * **Location** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-version-get.md # Get version ``` GET https://api.apify.com/v2/acts/:actorId/versions/:versionNumber ``` Gets a that contains all the details about a specific version of an Actor. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-version-put.md # Update version ``` PUT https://api.apify.com/v2/acts/:actorId/versions/:versionNumber ``` Updates Actor version using values specified by a passed as JSON in the POST payload. If the object does not define a specific property, its value will not be updated. The request needs to specify the `Content-Type: application/json` HTTP header! When providing your API authentication token, we recommend using the request's `Authorization` header, rather than the URL. (). The response is the as returned by the endpoint. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-versions-get.md # Get list of versions ``` GET https://api.apify.com/v2/acts/:actorId/versions ``` Gets the list of versions of a specific Actor. The response is a JSON object with the list of , where each contains basic information about a single version. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-versions-post.md # Create version ``` POST https://api.apify.com/v2/acts/:actorId/versions ``` Creates a version of an Actor using values specified in a passed as JSON in the POST payload. The request must specify `versionNumber` and `sourceType` parameters (as strings) in the JSON payload and a `Content-Type: application/json` HTTP header. Each `sourceType` requires its own additional properties to be passed to the JSON payload object. These are outlined in the table below and in more detail in the [Apify documentation](https://docs.apify.com/platform/actors/development/deployment/source-types). For example, if an Actor's source code is stored in a [GitHub repository](https://docs.apify.com/platform/actors/development/deployment/source-types#git-repository), you will set the `sourceType` to `GIT_REPO` and pass the repository's URL in the `gitRepoUrl` property. ``` { "versionNumber": "0.1", "sourceType": "GIT_REPO", "gitRepoUrl": "https://github.com/my-github-account/actor-repo" } ``` The response is the as returned by the endpoint. ## Request ## Responses * 201 * 400 **Response Headers** * **Location** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/act-webhooks-get.md # Get list of webhooks ``` GET https://api.apify.com/v2/acts/:actorId/webhooks ``` Gets the list of webhooks of a specific Actor. The response is a JSON with the list of objects, where each object contains basic information about a single webhook. The endpoint supports pagination using the `limit` and `offset` parameters and it will not return more than 1000 records. By default, the records are sorted by the `createdAt` field in ascending order, to sort the records in descending order, use the `desc=1` parameter. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/platform/integrations/webhooks/actions.md # Webhook actions **Send notifications when specific events occur in your Actor/task run or build. Dynamically add data to the notification payload.** *** ## Send HTTP request To send notification, you can use the HTTP request action, which sends an HTTP POST request to a specified URL with a JSON payload. The payload is defined using a payload template, which is a JSON-like syntax that allows you to include variables enclosed in double curly braces `{{variable}}`. This enables the dynamic injection of data into the payload when the webhook is triggered. Webhook delivery Webhooks are sent from servers that use static IP addresses. If your webhook destination is secured by a firewall, you can add the following IP addresses to your allow list to ensure Apify webhooks are delivered successfully. IP list * `3.215.64.207` * `13.216.80.7` * `13.216.180.86` * `34.224.107.31` * `34.236.208.85` * `44.198.219.104` * `44.207.71.44` * `44.207.141.205` * `52.4.20.206` * `52.203.255.236` ### Response management The response to the POST request must have an HTTP status code in the `2XX` range. If the response has a different status code, it is considered an error, and the request will be retried periodically with an exponential back-off: * First retry: after approximately *1 minute* * Second retry: after *2 minutes* * Third retry: after *4 minutes* * ... * Eleventh retry: after approximately *32 hours* If the request fails after *11 retries*, the system stops retrying. ### Security considerations For security reasons, include a secret token in the webhook URL to ensure that only Apify can invoke it. You can use the **Test** button in the user interface to test your endpoint. Headers template You can also use [Headers template](https://docs.apify.com/platform/integrations/webhooks/actions.md#headers-template) for this purpose. Note that webhook HTTP requests have a timeout of *30 seconds*. If your endpoint performs a time-consuming operation, respond to the request immediately to prevent timeouts before Apify receives the response. To ensure reliable completion of the time-consuming operation, consider using a message queue internally to retry the operation on internal failure. In rare cases, the webhook might be invoked more than once. Design your code to be idempotent to handle duplicate calls. Apify requests: auto-added tokens If the URL of your request points toward Apify, you don't need to add a token, since it will be added automatically. ## Payload template The payload template is a JSON-like string that allows you to define a custom payload structure and inject dynamic data known only at the time of the webhook's invocation. Apart from the variables, the string must be a valid JSON. Variables must be enclosed in double curly braces and can only use the pre-defined variables listed in the section. Using any other variable will result in a validation error. The syntax of a variable is: `{{oneOfAvailableVariables}}`. Variables support accessing nested properties using dot notation: `{{variable.property}}`. ### Default payload template ``` { "userId": {{userId}}, "createdAt": {{createdAt}}, "eventType": {{eventType}}, "eventData": {{eventData}}, "resource": {{resource}} } ``` ### Default payload example ``` { "userId": "abf6vtB2nvQZ4nJzo", "createdAt": "2019-01-09T15:59:56.408Z", "eventType": "ACTOR.RUN.SUCCEEDED", "eventData": { "actorId": "fW4MyDhgwtMLrB987", "actorRunId": "uPBN9qaKd2iLs5naZ" }, "resource": { "id": "uPBN9qaKd2iLs5naZ", "actId": "fW4MyDhgwtMLrB987", "userId": "abf6vtB2nvQZ4nJzo", "startedAt": "2019-01-09T15:59:40.750Z", "finishedAt": "2019-01-09T15:59:56.408Z", "status": "SUCCEEDED", // ... } } ``` #### String interpolation The payload template is *not* a valid JSON by default, but the resulting payload is. To use templates that provide the same functionality and are valid JSON at the same time, you can use string interpolation. With string interpolation, the default payload template looks like this: ``` { "userId": "{{userId}}", "createdAt": "{{createdAt}}", "eventType": "{{eventType}}", "eventData": "{{eventData}}", "resource": "{{resource}}" } ``` If the string being interpolated contains only the variable, the actual variable value is used in the payload. For example `"{{eventData}}"` results in an object. If the string contains more than just the variable, the string value of the variable will appear in the payload: ``` { "text": "My user id is {{userId}}" } { "text": "My user id is abf6vtB2nvQZ4nJzo" } ``` To enable string interpolation, use **Interpolate variables in string fields** switch within the Apify Console. In JS API Client it's called `shouldInterpolateStrings`. This field is always `true` when integrating Actors or tasks. ### Payload template example This example shows how to use payload template variables to send a custom object that displays the status of a run, its ID and a custom property: ``` { "runId": {{resource.id}}, "runStatus": {{resource.status}}, "myProp": "hello world" } ``` Note that the `eventData` and `resource` properties contain redundant data for backward compatibility. You can use either `eventData` or `resource` in your templates, depending on your use case. ## Headers template The headers template is a JSON-like text where you can add additional information to the default HTTP header of the webhook request. You can pass the variables in the same way as in , including the use of string interpolation and the available variables. The resulting interpolated text need to be a valid JSON object, and values can be strings only. Note that the following HTTP headers are always set by the system and your changes will always be rewritten: | Variable | Value | | ----------------------------- | ------------------------- | | `Host` | Request URL | | `Content-Type` | `application/json` | | `X-Apify-Webhook` | Apify internal value | | `X-Apify-Webhook-Dispatch-Id` | Apify webhook dispatch ID | | `X-Apify-Request-Origin` | Apify origin | ## Description The description is an optional string that you can add to the webhook. It serves for your information and is not sent with the HTTP request when the webhook is dispatched. ## Available variables | Variable | Type | Description | | ----------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `userId` | string | ID of the Apify user who owns the webhook. | | `createdAt` | string | ISO string date of the webhook's trigger event. | | `eventType` | string | Type of the trigger event, see [Events](https://docs.apify.com/platform/integrations/webhooks/events.md). | | `eventData` | Object | Data associated with the trigger event, see [Events](https://docs.apify.com/platform/integrations/webhooks/events.md). | | `resource` | Object | The resource that caused the trigger event. | | `globals` | Object | Data available in global context. Contains `dateISO` (date of webhook's trigger event in ISO 8601 format) and `dateUnix` (date of trigger event in Unix time in seconds) | ### Resource The `resource` variable represents the triggering system resource. For example, when using the `ACTOR.RUN.SUCCEEDED` event, the resource is the Actor run. The variable will be replaced by the `Object` that you would receive as a response from the relevant API at the moment when the webhook is triggered. For the Actor run resource, it would be the response of the [Get Actor run](https://docs.apify.com/api/v2/actor-run-get.md) API endpoint. In addition to Actor runs, webhooks also support various events related to Actor builds. In such cases, the resource object will look like the response of the [Get Actor build](https://docs.apify.com/api/v2/actor-build-get.md) API endpoint. --- # Source: https://docs.apify.com/api/v2/actor-build-abort-post.md # Abort build ``` POST https://api.apify.com/v2/actor-builds/:buildId/abort ``` Aborts an Actor build and returns an object that contains all the details about the build. Only builds that are starting or running are aborted. For builds with status `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-build-delete.md # Delete build ``` DELETE https://api.apify.com/v2/actor-builds/:buildId ``` Delete the build. The build that is the current default build for the Actor cannot be deleted. Only users with build permissions for the Actor can delete builds. ## Request ## Responses * 204 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-build-get.md # Get build ``` GET https://api.apify.com/v2/actor-builds/:buildId ``` Gets an object that contains all the details about a specific build of an Actor. By passing the optional `waitForFinish` parameter the API endpoint will synchronously wait for the build to finish. This is useful to avoid periodic polling when waiting for an Actor build to finish. This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the build. However, if you access the endpoint without the token, certain attributes, such as `usageUsd` and `usageTotalUsd`, will be hidden. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-build-log-get.md # Get log ``` GET https://api.apify.com/v2/actor-builds/:buildId/log ``` Check out for full reference. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-build-openapi-json-get.md # Get OpenAPI definition ``` GET https://api.apify.com/v2/actor-builds/:buildId/openapi.json ``` Get the OpenAPI definition for Actor builds. Two similar endpoints are available: * [First endpoint](https://docs.apify.com/api/v2/act-openapi-json-get.md): Requires both `actorId` and `buildId`. Use `default` as the `buildId` to get the OpenAPI schema for the default Actor build. * [Second endpoint](https://docs.apify.com/api/v2/actor-build-openapi-json-get.md): Requires only `buildId`. Get the OpenAPI definition for a specific Actor build. Authentication is based on the build's unique ID. No authentication token is required. note You can also use the [/api/v2/act-openapi-json-get](https://docs.apify.com/api/v2/act-openapi-json-get.md) endpoint to get the OpenAPI definition for a build. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-builds-get.md # Get user builds list ``` GET https://api.apify.com/v2/actor-builds ``` Gets a list of all builds for a user. The response is a JSON array of objects, where each object contains basic information about a single build. The endpoint supports pagination using the `limit` and `offset` parameters and it will not return more than 1000 records. By default, the records are sorted by the `startedAt` field in ascending order. Therefore, you can use pagination to incrementally fetch all builds while new ones are still being started. To sort the records in descending order, use the `desc=1` parameter. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-builds.md # Actor builds - Introduction The API endpoints described in this section enable you to manage, and delete Apify Actor builds. Note that if any returned build object contains usage in dollars, your effective unit pricing at the time of query has been used for computation of this dollar equivalent, and hence it should be used only for informative purposes. You can learn more about platform usage in the [documentation](https://docs.apify.com/platform/actors/running/usage-and-resources#usage). ## [Get user builds list](https://docs.apify.com/api/v2/actor-builds-get.md) [/actor-builds](https://docs.apify.com/api/v2/actor-builds-get.md) ## [Get build](https://docs.apify.com/api/v2/actor-build-get.md) [/actor-builds/{buildId}](https://docs.apify.com/api/v2/actor-build-get.md) ## [Delete build](https://docs.apify.com/api/v2/actor-build-delete.md) [/actor-builds/{buildId}](https://docs.apify.com/api/v2/actor-build-delete.md) ## [Abort build](https://docs.apify.com/api/v2/actor-build-abort-post.md) [/actor-builds/{buildId}/abort](https://docs.apify.com/api/v2/actor-build-abort-post.md) ## [Get log](https://docs.apify.com/api/v2/actor-build-log-get.md) [/actor-builds/{buildId}/log](https://docs.apify.com/api/v2/actor-build-log-get.md) ## [Get OpenAPI definition](https://docs.apify.com/api/v2/actor-build-openapi-json-get.md) [/actor-builds/{buildId}/openapi.json](https://docs.apify.com/api/v2/actor-build-openapi-json-get.md) --- # Source: https://docs.apify.com/academy/actor-marketing-playbook/product-optimization/actor-bundles.md # Actor bundles **Learn what an Actor bundle is, explore existing examples, and discover how to promote them.** *** ## What is an Actor bundle? If an Actor is an example of web automation software, what is an Actor bundle? An Actor bundle is basically a chain of multiple Actors unified by a common use case. Bundles can include both scrapers and automation tools, and they are usually designed to achieve an overarching goal related to scraping or automation. The concept of an Actor bundle originated from frequent customer requests for comprehensive tools. For example, someone would ask for a Twitter scraper that also performs additional tasks, or for a way to find all profiles of the same public figure across multiple social media platforms without needing to use each platform separately. For example, consider a bundle that scrapes company reviews from multiple platforms, such as Glassdoor, LinkedIn, and Indeed. Typically, you would need to use several different scrapers and then consolidate the results. But this bundle would do it all in one run, once provided with the name of the company. Or consider a bundle that scrapes all posts and comments of a given profile, and then produces a sentiment score for each scraped comment. The main advantage of an Actor bundle is its ease of use. The user inputs a keyword or a URL, and the Actor triggers all the necessary Actors sequentially to achieve the desired result. The user is not expected to use each Actor separately and then process and filter the results themselves. ### Examples of bundles 🔍 [Social Media Finder](https://apify.com/tri_angle/social-media-finder) searches for profiles on 13 social media sites provided just the (nick)name. 🍝 [Restaurant Review Aggregator](https://apify.com/tri_angle/restaurant-review-aggregator) gets restaurant reviews from Google Maps, DoorDash, Uber Eats, Yelp, Tripadvisor, and Facebook in one place. 🤔 [Social Media Sentiment Analysis Tool](https://apify.com/tri_angle/social-media-sentiment-analysis-tool) not only collects comments from Facebook, Instagram, and TikTok but also performs sentiment analysis on them. It unites post scrapers, comments scrapers and a text analysis tool. 🦾 [Website Content Crawler + Pinecone bundle](https://apify.com/tri_angle/wcc-pinecone-integration) scrapes a website and stores the data in a Pinecone database to build and improve your own AI chatbot assistant. 🤖 [Pinecone GPT chatbot](https://apify.com/tri_angle/pinecone-gpt-chatbot) combines OpenAI's GPT models with Pinecone's vector database, which simplifies creating a GPT chatbot. As you can see, they vary in complexity and range. *** ## Caveats ### Pricing model Since bundles are still relatively experimental, profitability is not guaranteed and will depend heavily on the complexity of the bundle. However, if you have a solid idea for a bundle, don’t hesitate to reach out. Prepare your case, write to our support team, and we’ll help determine if it’s worth it. ### Specifics of bundle promotion First of all, when playing with the idea of creating a bundle, always check the keyword potential. Sometimes, there are true keyword gems just waiting to be discovered, with high search volume and little competition. However, bundles may face the challenge of being "top-of-the-funnel" solutions. People might not search for them directly because they don't have a specific keyword in mind. For instance, someone is more likely to search for an Instagram comment scraper than imagine a bundle that scrapes comments from 10 different platforms, including Instagram. Additionally, Google tends to favor tools with rather focused descriptions. If your tool offers multiple functions, it can send mixed signals that may conflict with each other rather than accumulate. Sometimes, even though a bundle can be a very innovative tool product-wise, it can be hard to market from an SEO perspective and match the search intent. In such cases, you may need to try different marketing and promotion strategies. Once you’ve exhausted every angle of SEO research, be prepared to explore non-organic marketing channels like Product Hunt, email campaigns, community engagement, Reddit, other social media, your existing customer base, word-of-mouth promotion, etc. Remember, bundles originated as customized solutions for specific use cases - they were not primarily designed to be easily found. This is also an opportunity to tell a story rather than just presenting a tool. Consider writing a blog post about how you created this tool, recording a video, or hosting a live webinar. If you go this route, it’s important to emphasize how the tool was created and what a technical feat it represents. That said, don’t abandon SEO entirely. You can still capture some SEO value by referencing the bundle in the READMEs of the individual Actors that comprise it. For example, if a bundle collects reviews from multiple platforms, potential users are likely to search for review scrapers for each specific platform—Google Maps reviews scraper, Tripadvisor reviews scraper, Booking reviews scraper, etc. These keywords may not lead directly to your review scraping bundle, but they can guide users to the individual scrapers, where you can then present the bundle as a more comprehensive solution. *** ## Resources Learn more about Actor Bundles: [https://blog.apify.com/apify-power-actors/](https://blog.apify.com/apify-power-actors/) --- # Source: https://docs.apify.com/sdk/python/docs/concepts/actor-configuration.md # Actor configuration Copy for LLM The [`Actor`](https://docs.apify.com/sdk/python/sdk/python/reference/class/Actor.md) class gets configured using the [`Configuration`](https://docs.apify.com/sdk/python/sdk/python/reference/class/Configuration.md) class, which initializes itself based on the provided environment variables. If you're using the Apify SDK in your Actors on the Apify platform, or Actors running locally through the Apify CLI, you don't need to configure the `Actor` class manually,unless you have some specific requirements, everything will get configured automatically. If you need some special configuration, you can adjust it either through the `Configuration` class directly,or by setting environment variables when running the Actor locally. To see the full list of configuration options, check the `Configuration` class or the list of environment variables that the Actor understands. ## Configuring from code[](#configuring-from-code) This will cause the Actor to persist its state every 10 seconds: [Run on](https://console.apify.com/actors/HH9rhkFXiZbheuq1V?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCBhc3luY2lvXFxuZnJvbSBkYXRldGltZSBpbXBvcnQgdGltZWRlbHRhXFxuXFxuZnJvbSBhcGlmeSBpbXBvcnQgQWN0b3IsIENvbmZpZ3VyYXRpb24sIEV2ZW50XFxuXFxuXFxuYXN5bmMgZGVmIG1haW4oKSAtPiBOb25lOlxcbiAgICBjb25maWd1cmF0aW9uID0gQ29uZmlndXJhdGlvbihcXG4gICAgICAgIHBlcnNpc3Rfc3RhdGVfaW50ZXJ2YWw9dGltZWRlbHRhKHNlY29uZHM9MTApXFxuICAgICAgICAjIFNldCBvdGhlciBjb25maWd1cmF0aW9uIG9wdGlvbnMgaGVyZSBhcyBuZWVkZWQuXFxuICAgIClcXG5cXG4gICAgYXN5bmMgd2l0aCBBY3Rvcihjb25maWd1cmF0aW9uPWNvbmZpZ3VyYXRpb24pOlxcbiAgICAgICAgIyBEZWZpbmUgYSBoYW5kbGVyIHRoYXQgd2lsbCBiZSBjYWxsZWQgZm9yIGV2ZXJ5IHBlcnNpc3Qgc3RhdGUgZXZlbnQuXFxuICAgICAgICBhc3luYyBkZWYgc2F2ZV9zdGF0ZSgpIC0-IE5vbmU6XFxuICAgICAgICAgICAgYXdhaXQgQWN0b3Iuc2V0X3ZhbHVlKCdTVEFURScsICdIZWxsbywgd29ybGQhJylcXG5cXG4gICAgICAgICMgVGhlIHNhdmVfc3RhdGUgaGFuZGxlciB3aWxsIGJlIGNhbGxlZCBldmVyeSAxMCBzZWNvbmRzIG5vdy5cXG4gICAgICAgIEFjdG9yLm9uKEV2ZW50LlBFUlNJU1RfU1RBVEUsIHNhdmVfc3RhdGUpXFxuXFxuXFxuaWYgX19uYW1lX18gPT0gJ19fbWFpbl9fJzpcXG4gICAgYXN5bmNpby5ydW4obWFpbigpKVxcblwifSIsIm9wdGlvbnMiOnsiYnVpbGQiOiJsYXRlc3QiLCJjb250ZW50VHlwZSI6ImFwcGxpY2F0aW9uL2pzb247IGNoYXJzZXQ9dXRmLTgiLCJtZW1vcnkiOjEwMjQsInRpbWVvdXQiOjE4MH19.jrbhGRjqB5tlMvKvW2uCKjDF8hWmIkTe9A28UQseo78\&asrc=run_on_apify) ``` import asyncio from datetime import timedelta from apify import Actor, Configuration, Event async def main() -> None: configuration = Configuration( persist_state_interval=timedelta(seconds=10) # Set other configuration options here as needed. ) async with Actor(configuration=configuration): # Define a handler that will be called for every persist state event. async def save_state() -> None: await Actor.set_value('STATE', 'Hello, world!') # The save_state handler will be called every 10 seconds now. Actor.on(Event.PERSIST_STATE, save_state) if __name__ == '__main__': asyncio.run(main()) ``` ## Configuring via environment variables[](#configuring-via-environment-variables) All the configuration options can be set via environment variables. The environment variables are prefixed with `APIFY_`, and the configuration options are in uppercase, with underscores as separators. See the [`Configuration`](https://docs.apify.com/sdk/python/sdk/python/reference/class/Configuration.md) API reference for the full list of configuration options. This Actor run will not persist its local storages to the filesystem: ``` APIFY_PERSIST_STORAGE=0 apify run ``` --- # Source: https://docs.apify.com/platform/actors/development/actor-definition.md # Actor definition **Learn how to turn your arbitrary code into an Actor simply by adding an Actor definition directory.** *** A single isolated Actor consists of source code and various settings. You can think of an Actor as a cloud app or service that runs on the Apify platform. The run of an Actor is not limited to the lifetime of a single HTTP transaction. It can run for as long as necessary, even forever. Basically, Actors are programs packaged as [Docker images](https://hub.docker.com/), which accept a well-defined JSON input, perform an action, and optionally produce an output. Actors have the following elements: * The main **[actor.json](https://docs.apify.com/platform/actors/development/actor-definition/actor-json.md)** file contains **metadata** such as the Actor name, description, author, version, and links pointing to the other definition files below. * **[Dockerfile](https://docs.apify.com/platform/actors/development/actor-definition/dockerfile.md)** which specifies where is the Actor's source code, how to build it, and run it. * **Documentation** in the form of a **README.md** file. * **[Input](https://docs.apify.com/platform/actors/development/actor-definition/input-schema.md)** and **[dataset schemas](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema.md)** that describe what input the Actor requires and what results it produces. * Access to an out-of-box **[storage](https://docs.apify.com/platform/storage.md)** system for Actor data, results, and files. The documentation and the input/dataset schemas make it possible for people to easily understand what the Actor does, enter the required inputs both in the user interface or API, and integrate the Actor's results with their other workflows. Actors can easily call and interact with each other, enabling building more complex systems on top of simple ones. The Apify platform provides an open [API](https://docs.apify.com/api/v2.md), cron-style [scheduler](https://docs.apify.com/platform/schedules.md), [webhooks](https://docs.apify.com/platform/integrations/webhooks.md), and [integrations](https://docs.apify.com/platform/integrations.md) to services such as Zapier or Make, which make it easy for users to integrate Actors with their existing workflows. Anyone is welcome to [publish Actors](https://docs.apify.com/platform/actors/publishing.md) in [Apify Store](https://apify.com/store), and you can even [monetize your Actors](https://docs.apify.com/platform/actors/publishing/monetize.md). Actors can be developed and run locally and then easily deployed to the Apify platform using the [Apify CLI](https://docs.apify.com/cli) or a [GitHub integration](https://docs.apify.com/platform/integrations/github.md). For more details, see the [Deployment](https://docs.apify.com/platform/actors/development/deployment.md) section. > **To get a better idea of what Apify Actors are, visit [Apify Store](https://apify.com/store), and try out some of them!** --- # Source: https://docs.apify.com/academy/actor-marketing-playbook/actor-basics/actor-description.md # Actor description & SEO description Learn about Actor description and meta description. Where to set them and best practices for both content and length. *** ## What is an Actor description? First impressions are important, especially when it comes to tools. Actor descriptions are the first connection potential users have with your Actor. You can set two kinds of descriptions: *regular description* (in Apify Store) and *SEO description* (on Google search), along with their respective names: regular name and SEO name. tip You can change descriptions and names as many times as you want. ## Regular description vs. SEO description | | Actor description & name | SEO description & name | | ------------------ | ------------------------ | ---------------------- | | Name length | 40-50 characters | 40-50 characters | | Description length | 300 characters | 145-155 characters | | Visibility | Visible on Store | Visible on Google | ### Description & Actor name Actor description is what users see on the Actor's web page in Apify Store, along with the Actor's name and URL. When creating an Actor description, a “warm” visitor experience is prioritized (more on that later). ![actor name \& description](/assets/images/actor-description-name-bea8b2060a01d4c5d190cb2445a9a6c6.png) Actor description is also present in Apify Console and across Apify Store. ![actor description in store](/assets/images/actor-description-store-bda4a42f8f8a0ca572e2fca5ce79d4b1.png) ### SEO description & SEO name Actor SEO description is a tool description visible on Google. It is shorter and SEO-optimized (keywords matter here). When creating the SEO description, a “cold” visitor experience is prioritized. ![seo description](/assets/images/seo_description-12e904f852b518923f228bd2ef68a534.png) Usually the way the potential user interacts with both these descriptions goes like this: SEO first, regular description second. Is there any benefit in them being different? ### Is there any benefit in the description and meta description being different? Different descriptions give you a chance to target different stages of user acquisition. And make sure the acquisition takes place. *SEO description (and SEO name)* is targeting a “cold” potential user who knows nothing about your tool yet and just came across it on Google search. They’re searching to solve a problem or use case. The goal of the meta description is to convince that visitor to click on your tool's page among other similar search results on Google. While it's shorter, SEO description is also the space to search-engine-optimize your language to the max to attract the most matching search intent. *Description (and name)* is targeting a “warm” potential user who is already curious about your tool. They have clicked on the tool's page and have a few seconds to understand how complex the tool is and what it can do for them. Here you can forget SEO optimization and speak directly to the user. The regular description also has a longer character limit, which means you can expand on your Actor’s features. Learn more about search intent here: [SEO](https://docs.apify.com/academy/actor-marketing-playbook/promote-your-actor/seo.md) ## Where can Actor descriptions be set? Both descriptions can be found and edited on the very right **Publication tab → Display information.** It has to be done separately for each Actor. note Setting the SEO description and SEO name is optional. If not set, the description will just be duplicated. ![changing seo name](/assets/images/changing__SEO_name-b739468d580f0dfd5aa0c82cb477f581.png) ![changing actor name and seo name](/assets/images/changing_Actor_name_and_SEO_name-fd56498d2164f1715ff6495538f5690d.png) Actor description specifically can also be quick-edited in this pop-up on the Actor's page in Apify Console. Open the **Actor's page**, then click on **…** in the top right corner, and choose ✎ **Edit name or description**. Then set the URL in the **Unique name** ✎ field and click **Save**. ![changing actor description](/assets/images/change_Actor_description-703d7e6db0ba521eed798cd719c25a2a.png) ## Tips and recommendations on how to write descriptions When writing a description, less is more. You only have a few seconds to capture attention and communicate what your Actor can do. To make the most of that time, follow these guidelines used by Apify (these apply to both types of descriptions): ### Use variations and experiment 🔄 * *SEO name vs. regular name*: * name: Airbnb Scraper * SEO name: Airbnb Data Scraper * *Keywords on the web page*:
Include variations, e.g. Airbnb API, Airbnb data, Airbnb data scraper, Airbnb rentals, Airbnb listings * No-code scraping tool to extract Airbnb data: host info, prices, dates, location, and reviews. * Scrape Airbnb listings without official Airbnb API! * *Scraping/automation process variations*:
Use terms, e.g. crawl, crawler, scraping tool, finder, scraper, data extraction tool, extract data, get data * Scrape XYZ data, scraped data, data scraper, data crawler. ### Choose how to start your sentences 📝 * *Noun-first (descriptive)*: * Data extraction tool to extract Airbnb data: host info, prices, dates, location, and reviews. * *Imperative-first (motivating)*: * Try a free web scraping tool to extract Airbnb data: host info, prices, dates, location, and reviews. ### Keep it short and SEO-focused ✂️ * *Be concise and direct*: clearly state what your Actor does. Avoid unnecessary fluff and boilerplate text. * ✅ Scrapes job listings from Indeed and gathers... * ❌ \*This Actor scrapes job listings from Indeed in order to gather... * *Optimize for search engines*: include popular keywords related to your Actor’s functionality that users might search for. * ✅ This Indeed scraper helps you collect job data efficiently. Use the tool to gather... * ❌ This tool will search through job listings on Indeed and offers you... ### List the data your Actor works with 📝 * Data extraction tool to extract Airbnb data: host info, prices, dates, location, and reviews. * Get hashtags, usernames, mentions, URLs, comments, images, likes, locations without the official Instagram API. ### Use keywords or the language of the target website 🗣️ * Extract data from hundreds of Airbnb home rentals in seconds. * Extract data from chosen tik-toks. Just add a TikTok URL and get TikTok video and profile data: URLs, numbers of shares, followers, hashtags, hearts, video, and music metadata. * Scrape Booking with this hotels scraper and get data about accommodation on Booking.com. ### Highlight your strong suits 🌟 * Ease of use, no coding, user-friendly: * Easy scraping tool to extract Airbnb data. * Fast and scalable: * Scrape whole cities or extract data from hundreds of Airbnb rentals in seconds. * Free (only if the trial run can cover $5 free credits): * Try a free scraping tool to extract Airbnb data: host info, prices, dates, location, and reviews. * Extract host information, locations, availability, stars, reviews, images, and host/guest details for free. * Available platform features (various formats, API, integrations, scheduling): * Export scraped data in formats like HTML, JSON, and Excel. * Additional tips: * Avoid ending lists with etc. * Consider adding relevant emojis for visual appeal. ### Break it down 🔠 Descriptions typically fit into 2-3 sentences. Don't try to jam everything into one. Examples: 1. Scrape whole cities or extract data from hundreds of Airbnb rentals in seconds. 2. Extract host information, addresses, locations, prices, availability, stars, reviews, images, and host/guest details. 3. Export scraped data, run the scraper via API, schedule and monitor runs, or integrate with other tools. ## FAQ #### Can the Actor's meta description and description be the same? Yes, they can, as long as they have the same (shorter) length (under 150 characters). But they can also be different - there's no harm in that. #### How different can description and meta description be? They can be vastly different and target different angles of your Actor. You can experiment by setting up different SEO descriptions for a period of time and seeing if the click-through rate rises. #### I set a custom SEO description but Google doesn't show it Sometimes Google picks up a part of the README as the SEO description. It's heavily dependent on the search query. Sometimes what you see on Google might look differently compared to how you set the SEO description. It's all a part of how Google customizes search results. --- # Source: https://docs.apify.com/sdk/python/docs/concepts/actor-events.md # Actor events & state persistence Copy for LLM During its runtime, the Actor receives Actor events sent by the Apify platform or generated by the Apify SDK itself. ## Event types[](#event-types) | Event | Data | Description | | --------------- | ------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `SYSTEM_INFO` | ``` { "created_at": datetime, "cpu_current_usage": float, "mem_current_bytes": int, "is_cpu_overloaded": bool } ``` | This event is emitted regularly and it indicates the current resource usage of the Actor.The `is_cpu_overloaded` argument indicates whether the current CPU usage is higher than `Config.max_used_cpu_ratio` | | `MIGRATING` | `None` | Emitted when the Actor running on the Apify platform is going to be [migrated](https://docs.apify.com/platform/actors/development/state-persistence#what-is-a-migration) to another worker server soon.You can use it to persist the state of the Actor so that once it is executed again on the new server, it doesn't have to start over from the beginning. Once you have persisted the state of your Actor, you can call [`Actor.reboot`](https://docs.apify.com/sdk/python/../../reference/class/Actor#reboot) to reboot the Actor and trigger the migration immediately, to speed up the process. | | `ABORTING` | `None` | When a user aborts an Actor run on the Apify platform, they can choose to abort gracefully to allow the Actor some time before getting killed. This graceful abort emits the `ABORTING` event which you can use to finish all running tasks and do cleanup. | | `PERSIST_STATE` | ``` { "is_migrating": bool } ``` | Emitted in regular intervals (by default 60 seconds) to notify the Actor that it should persist its state, in order to avoid repeating all work when the Actor restarts.This event is also emitted automatically when the `MIGRATING` event happens, in which case the `is_migrating` flag is set to `True`.Note that the `PERSIST_STATE` event is provided merely for user convenience, you can achieve the same effect by persisting the state regularly in an interval and listening for the migrating event. | ## Adding handlers to events[](#adding-handlers-to-events) To add handlers to these events, you use the [`Actor.on`](https://docs.apify.com/sdk/python/sdk/python/reference/class/Actor.md#on) method, and to remove them, you use the [`Actor.off`](https://docs.apify.com/sdk/python/sdk/python/reference/class/Actor.md#off) method. [Run on](https://console.apify.com/actors/HH9rhkFXiZbheuq1V?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCBhc3luY2lvXFxuZnJvbSB0eXBpbmcgaW1wb3J0IEFueVxcblxcbmZyb20gYXBpZnkgaW1wb3J0IEFjdG9yLCBFdmVudFxcblxcblxcbmFzeW5jIGRlZiBtYWluKCkgLT4gTm9uZTpcXG4gICAgYXN5bmMgd2l0aCBBY3RvcjpcXG4gICAgICAgIHRvdGFsX2l0ZW1zID0gMTAwMFxcblxcbiAgICAgICAgIyBMb2FkIHRoZSBzdGF0ZSBpZiBpdCdzIHNhdmVkIGZyb20gc29tZSBwcmV2aW91cyBleGVjdXRpb25cXG4gICAgICAgIHByb2Nlc3NlZF9pdGVtcyA9IDBcXG4gICAgICAgIGFjdG9yX3N0YXRlID0gYXdhaXQgQWN0b3IuZ2V0X3ZhbHVlKCdTVEFURScpXFxuICAgICAgICBpZiBhY3Rvcl9zdGF0ZSBpcyBub3QgTm9uZTpcXG4gICAgICAgICAgICBwcm9jZXNzZWRfaXRlbXMgPSBhY3Rvcl9zdGF0ZVxcblxcbiAgICAgICAgIyBTYXZlIHRoZSBzdGF0ZSB3aGVuIHRoZSBgUEVSU0lTVF9TVEFURWAgZXZlbnQgaGFwcGVuc1xcbiAgICAgICAgYXN5bmMgZGVmIHNhdmVfc3RhdGUoZXZlbnRfZGF0YTogQW55KSAtPiBOb25lOlxcbiAgICAgICAgICAgIG5vbmxvY2FsIHByb2Nlc3NlZF9pdGVtc1xcbiAgICAgICAgICAgIEFjdG9yLmxvZy5pbmZvKCdTYXZpbmcgQWN0b3Igc3RhdGUnLCBleHRyYT1ldmVudF9kYXRhKVxcbiAgICAgICAgICAgIGF3YWl0IEFjdG9yLnNldF92YWx1ZSgnU1RBVEUnLCBwcm9jZXNzZWRfaXRlbXMpXFxuXFxuICAgICAgICBBY3Rvci5vbihFdmVudC5QRVJTSVNUX1NUQVRFLCBzYXZlX3N0YXRlKVxcblxcbiAgICAgICAgIyBEbyBzb21lIGZha2Ugd29ya1xcbiAgICAgICAgZm9yIGkgaW4gcmFuZ2UocHJvY2Vzc2VkX2l0ZW1zLCB0b3RhbF9pdGVtcyk6XFxuICAgICAgICAgICAgQWN0b3IubG9nLmluZm8oZidQcm9jZXNzaW5nIGl0ZW0ge2l9Li4uJylcXG4gICAgICAgICAgICBwcm9jZXNzZWRfaXRlbXMgPSBpXFxuICAgICAgICAgICAgYXdhaXQgYXN5bmNpby5zbGVlcCgwLjEpXFxuXFxuICAgICAgICAjIFN1cHBvc2Ugd2UgY2FuIHN0b3Agc2F2aW5nIHRoZSBzdGF0ZSBub3dcXG4gICAgICAgIEFjdG9yLm9mZihFdmVudC5QRVJTSVNUX1NUQVRFLCBzYXZlX3N0YXRlKVxcblxcbiAgICAgICAgIyBEbyBzb21lIG1vcmUgZmFrZSB3b3JrLCB0aGlzIHRpbWUgc29tZXRoaW5nIHRoYXQgY2FuJ3QgYmUgcmVzdGFydGVkLFxcbiAgICAgICAgIyBzbyBubyBwb2ludCBwZXJzaXN0aW5nIHRoZSBzdGF0ZVxcbiAgICAgICAgZm9yIGogaW4gcmFuZ2UoMTApOlxcbiAgICAgICAgICAgIEFjdG9yLmxvZy5pbmZvKGYnUHJvY2Vzc2luZyBpdGVtIHtqfSBvZiBhbm90aGVyIGtpbmQuLi4nKVxcbiAgICAgICAgICAgIGF3YWl0IGFzeW5jaW8uc2xlZXAoMSlcXG5cXG5cXG5pZiBfX25hbWVfXyA9PSAnX19tYWluX18nOlxcbiAgICBhc3luY2lvLnJ1bihtYWluKCkpXFxuXCJ9Iiwib3B0aW9ucyI6eyJidWlsZCI6ImxhdGVzdCIsImNvbnRlbnRUeXBlIjoiYXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOCIsIm1lbW9yeSI6MTAyNCwidGltZW91dCI6MTgwfX0.MtXEA1LZvr-mLxWodlPvIvq4ZZKoHen0AbDsC3S7Ayo\&asrc=run_on_apify) ``` import asyncio from typing import Any from apify import Actor, Event async def main() -> None: async with Actor: total_items = 1000 # Load the state if it's saved from some previous execution processed_items = 0 actor_state = await Actor.get_value('STATE') if actor_state is not None: processed_items = actor_state # Save the state when the `PERSIST_STATE` event happens async def save_state(event_data: Any) -> None: nonlocal processed_items Actor.log.info('Saving Actor state', extra=event_data) await Actor.set_value('STATE', processed_items) Actor.on(Event.PERSIST_STATE, save_state) # Do some fake work for i in range(processed_items, total_items): Actor.log.info(f'Processing item {i}...') processed_items = i await asyncio.sleep(0.1) # Suppose we can stop saving the state now Actor.off(Event.PERSIST_STATE, save_state) # Do some more fake work, this time something that can't be restarted, # so no point persisting the state for j in range(10): Actor.log.info(f'Processing item {j} of another kind...') await asyncio.sleep(1) if __name__ == '__main__': asyncio.run(main()) ``` --- # Source: https://docs.apify.com/sdk/python/docs/concepts/actor-input.md # Actor input Copy for LLM The Actor gets its [input](https://docs.apify.com/platform/actors/running/input) from the input record in its default [key-value store](https://docs.apify.com/platform/storage/key-value-store). To access it, instead of reading the record manually, you can use the [`Actor.get_input`](https://docs.apify.com/sdk/python/sdk/python/reference/class/Actor.md#get_input) convenience method. It will get the input record key from the Actor configuration, read the record from the default key-value store,and decrypt any [secret input fields](https://docs.apify.com/platform/actors/development/secret-input). For example, if an Actor received a JSON input with two fields, `{ "firstNumber": 1, "secondNumber": 2 }`, this is how you might process it: [Run on](https://console.apify.com/actors/HH9rhkFXiZbheuq1V?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCBhc3luY2lvXFxuXFxuZnJvbSBhcGlmeSBpbXBvcnQgQWN0b3JcXG5cXG5cXG5hc3luYyBkZWYgbWFpbigpIC0-IE5vbmU6XFxuICAgIGFzeW5jIHdpdGggQWN0b3I6XFxuICAgICAgICBhY3Rvcl9pbnB1dCA9IGF3YWl0IEFjdG9yLmdldF9pbnB1dCgpIG9yIHt9XFxuICAgICAgICBmaXJzdF9udW1iZXIgPSBhY3Rvcl9pbnB1dC5nZXQoJ2ZpcnN0TnVtYmVyJywgMClcXG4gICAgICAgIHNlY29uZF9udW1iZXIgPSBhY3Rvcl9pbnB1dC5nZXQoJ3NlY29uZE51bWJlcicsIDApXFxuICAgICAgICBBY3Rvci5sb2cuaW5mbygnU3VtOiAlcycsIGZpcnN0X251bWJlciArIHNlY29uZF9udW1iZXIpXFxuXFxuXFxuaWYgX19uYW1lX18gPT0gJ19fbWFpbl9fJzpcXG4gICAgYXN5bmNpby5ydW4obWFpbigpKVxcblwifSIsIm9wdGlvbnMiOnsiYnVpbGQiOiJsYXRlc3QiLCJjb250ZW50VHlwZSI6ImFwcGxpY2F0aW9uL2pzb247IGNoYXJzZXQ9dXRmLTgiLCJtZW1vcnkiOjEwMjQsInRpbWVvdXQiOjE4MH19.CF_KyX6EAMxLr_mlIpVnOD9pKv7wI53qxf1HWTha69g\&asrc=run_on_apify) ``` import asyncio from apify import Actor async def main() -> None: async with Actor: actor_input = await Actor.get_input() or {} first_number = actor_input.get('firstNumber', 0) second_number = actor_input.get('secondNumber', 0) Actor.log.info('Sum: %s', first_number + second_number) if __name__ == '__main__': asyncio.run(main()) ``` --- # Source: https://docs.apify.com/platform/actors/development/actor-definition/actor-json.md # actor.json **Learn how to write the main Actor configuration in the `.actor/actor.json` file.** *** Your main Actor configuration is in the `.actor/actor.json` file at the root of your Actor's directory. This file links your local development project to an Actor on the Apify platform. It should include details like the Actor's name, version, build tag, and environment variables. Make sure to commit this file to your Git repository. For example, the `.actor/actor.json` file can look like this: * Full actor.json * Minimal actor.json ``` { "actorSpecification": 1, // always 1 "name": "name-of-my-scraper", "version": "0.0", "buildTag": "latest", "defaultMemoryMbytes": "get(input, 'startUrls.length', 1) * 1024", "minMemoryMbytes": 256, "maxMemoryMbytes": 4096, "environmentVariables": { "MYSQL_USER": "my_username", "MYSQL_PASSWORD": "@mySecretPassword" }, "usesStandbyMode": false, "dockerfile": "./Dockerfile", "readme": "./ACTOR.md", "input": "./input_schema.json", "storages": { "dataset": "./dataset_schema.json" }, "webServerSchema": "./web_server_openapi.json" } ``` ``` { "actorSpecification": 1, // always 1 "name": "name-of-my-scraper", "version": "0.0" } ``` ## Reference Deployment metadata Actor `name`, `version`, `buildTag`, and `environmentVariables` are currently only used when you deploy your Actor using the [Apify CLI](https://docs.apify.com/cli) and not when deployed, for example, via GitHub integration. There, it serves for informative purposes only. | Property | Type | Description | | ---------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `actorSpecification` | Required | The version of the Actor specification. This property must be set to `1`, which is the only version available. | | `name` | Required | The name of the Actor. | | `version` | Required | The version of the Actor, specified in the format `[Number].[Number]`, e.g., `0.1`, `0.3`, `1.0`, `1.3`, etc. | | `buildTag` | Optional | The tag name to be applied to a successful build of the Actor. If not specified, defaults to `latest`. Refer to the [builds](https://docs.apify.com/platform/actors/development/builds-and-runs/builds.md) for more information. | | `environmentVariables` | Optional | A map of environment variables to be used during local development. These variables will also be applied to the Actor when deployed on the Apify platform. For more details, see the [environment variables](https://docs.apify.com/cli/docs/vars) section of Apify CLI documentation. | | `dockerfile` | Optional | The path to the Dockerfile to be used for building the Actor on the platform. If not specified, the system will search for Dockerfiles in the `.actor/Dockerfile` and `Dockerfile` paths, in that order. Refer to the [Dockerfile](https://docs.apify.com/platform/actors/development/actor-definition/dockerfile.md) section for more information. | | `dockerContextDir` | Optional | The path to the directory to be used as the Docker context when building the Actor. The path is relative to the location of the `actor.json` file. This property is useful for monorepos containing multiple Actors. Refer to the [Actor monorepos](https://docs.apify.com/platform/actors/development/deployment/source-types.md#actor-monorepos) section for more details. | | `readme` | Optional | The path to the README file to be used on the platform. If not specified, the system will look for README files in the `.actor/README.md` and `README.md` paths, in that order of preference. Check out [Apify Marketing Playbook to learn how to write a quality README files](https://apify.notion.site/How-to-create-an-Actor-README-759a1614daa54bee834ee39fe4d98bc2) guidance. | | `input` | Optional | You can embed your [input schema](https://docs.apify.com/platform/actors/development/actor-definition/input-schema.md) object directly in `actor.json` under the `input` field. You can also provide a path to a custom input schema. If not provided, the input schema at `.actor/INPUT_SCHEMA.json` or `INPUT_SCHEMA.json` is used, in this order of preference. | | `changelog` | Optional | The path to the CHANGELOG file displayed in the Information tab of the Actor in Apify Console next to Readme. If not provided, the CHANGELOG at `.actor/CHANGELOG.md` or `CHANGELOG.md` is used, in this order of preference. Your Actor doesn't need to have a CHANGELOG but it is a good practice to keep it updated for published Actors. | | `storages.dataset` | Optional | You can define the schema of the items in your dataset under the `storages.dataset` field. This can be either an embedded object or a path to a JSON schema file. [Read more](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema.md) about Actor dataset schemas. | | `defaultMemoryMbytes` | Optional | Specifies the default amount of memory in megabytes to be used when the Actor is started. Can be an integer or a [dynamic memory expression string](https://docs.apify.com/platform/actors/development/actor-definition/dynamic-actor-memory.md). | | `minMemoryMbytes` | Optional | Specifies the minimum amount of memory in megabytes required by the Actor to run. Requires an *integer* value. If both `minMemoryMbytes` and `maxMemoryMbytes` are set, then `minMemoryMbytes` must be equal or lower than `maxMemoryMbytes`. Refer to the [Usage and resources](https://docs.apify.com/platform/actors/running/usage-and-resources#memory) for more details about memory allocation. | | `maxMemoryMbytes` | Optional | Specifies the maximum amount of memory in megabytes required by the Actor to run. It can be used to control the costs of run, especially when developing pay per result Actors. Requires an *integer* value. Refer to the [Usage and resources](https://docs.apify.com/platform/actors/running/usage-and-resources#memory) for more details about memory allocation. | | `usesStandbyMode` | Optional | Boolean specifying whether the Actor will have [Standby mode](https://docs.apify.com/platform/actors/development/programming-interface/standby.md) enabled. | | `webServerSchema` | Optional | Defines an OpenAPI v3 schema for the web server running in the Actor. This can be either an embedded object or a path to a JSON schema file. Use this when your Actor starts its own HTTP server and you want to describe its interface. | --- # Source: https://docs.apify.com/sdk/python/docs/concepts/actor-lifecycle.md # Actor lifecycle Copy for LLM This guide explains how an **Apify Actor** starts, runs, and shuts down, describing the complete Actor lifecycle. For information about the core concepts such as Actors, the Apify Console, storages, and events, check out the [Apify platform documentation](https://docs.apify.com/platform). ## Actor initialization[](#actor-initialization) During initialization, the SDK prepares all the components required to integrate with the Apify platform. It loads configuration from environment variables, initializes access to platform storages such as the [key-value store, dataset, and request queue](https://docs.apify.com/platform/storage), sets up event handling for [platform events](https://docs.apify.com/platform/integrations/webhooks/events), and configures logging. The recommended approach in Python is to use the global [`Actor`](https://docs.apify.com/sdk/python/sdk/python/reference/class/Actor.md) class as an asynchronous context manager. This approach automatically manages setup and teardown and keeps your code concise. When entering the context, the SDK loads configuration and initializes clients lazily—for example, a dataset is opened only when it is first accessed. If the Actor runs on the Apify platform, it also begins listening for platform events. When the Actor exits, either normally or due to an exception, the SDK performs a graceful shutdown. It persists the final Actor state, stops event handling, and sets the terminal exit code together with the [status message](https://docs.apify.com/platform/actors/development/programming-interface/status-messages). * Actor class with context manager * Actor class with manual init/exit [Run on](https://console.apify.com/actors/HH9rhkFXiZbheuq1V?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCBhc3luY2lvXFxuXFxuZnJvbSBhcGlmeSBpbXBvcnQgQWN0b3JcXG5cXG5cXG5hc3luYyBkZWYgbWFpbigpIC0-IE5vbmU6XFxuICAgIGFzeW5jIHdpdGggQWN0b3I6XFxuICAgICAgICAjIEdldCBpbnB1dFxcbiAgICAgICAgYWN0b3JfaW5wdXQgPSBhd2FpdCBBY3Rvci5nZXRfaW5wdXQoKVxcbiAgICAgICAgQWN0b3IubG9nLmluZm8oJ0FjdG9yIGlucHV0OiAlcycsIGFjdG9yX2lucHV0KVxcblxcbiAgICAgICAgIyBZb3VyIEFjdG9yIGxvZ2ljIGhlcmVcXG4gICAgICAgIGRhdGEgPSB7J21lc3NhZ2UnOiAnSGVsbG8gZnJvbSBBY3RvciEnLCAnaW5wdXQnOiBhY3Rvcl9pbnB1dH1cXG4gICAgICAgIGF3YWl0IEFjdG9yLnB1c2hfZGF0YShkYXRhKVxcblxcbiAgICAgICAgIyBTZXQgc3RhdHVzIG1lc3NhZ2VcXG4gICAgICAgIGF3YWl0IEFjdG9yLnNldF9zdGF0dXNfbWVzc2FnZSgnQWN0b3IgY29tcGxldGVkIHN1Y2Nlc3NmdWxseScpXFxuXFxuXFxuaWYgX19uYW1lX18gPT0gJ19fbWFpbl9fJzpcXG4gICAgYXN5bmNpby5ydW4obWFpbigpKVxcblwifSIsIm9wdGlvbnMiOnsiYnVpbGQiOiJsYXRlc3QiLCJjb250ZW50VHlwZSI6ImFwcGxpY2F0aW9uL2pzb247IGNoYXJzZXQ9dXRmLTgiLCJtZW1vcnkiOjEwMjQsInRpbWVvdXQiOjE4MH19.dfnZ3EM-6xRFUTvMWT1esehu2-lA2PZJmoLBc7BBtgQ\&asrc=run_on_apify) ``` import asyncio from apify import Actor async def main() -> None: async with Actor: # Get input actor_input = await Actor.get_input() Actor.log.info('Actor input: %s', actor_input) # Your Actor logic here data = {'message': 'Hello from Actor!', 'input': actor_input} await Actor.push_data(data) # Set status message await Actor.set_status_message('Actor completed successfully') if __name__ == '__main__': asyncio.run(main()) ``` [Run on](https://console.apify.com/actors/HH9rhkFXiZbheuq1V?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCBhc3luY2lvXFxuXFxuZnJvbSBhcGlmeSBpbXBvcnQgQWN0b3JcXG5cXG5cXG5hc3luYyBkZWYgbWFpbigpIC0-IE5vbmU6XFxuICAgIGF3YWl0IEFjdG9yLmluaXQoKVxcblxcbiAgICB0cnk6XFxuICAgICAgICAjIEdldCBpbnB1dFxcbiAgICAgICAgYWN0b3JfaW5wdXQgPSBhd2FpdCBBY3Rvci5nZXRfaW5wdXQoKVxcbiAgICAgICAgQWN0b3IubG9nLmluZm8oJ0FjdG9yIGlucHV0OiAlcycsIGFjdG9yX2lucHV0KVxcblxcbiAgICAgICAgIyBZb3VyIEFjdG9yIGxvZ2ljIGhlcmVcXG4gICAgICAgIGRhdGEgPSB7J21lc3NhZ2UnOiAnSGVsbG8gZnJvbSBBY3RvciEnLCAnaW5wdXQnOiBhY3Rvcl9pbnB1dH1cXG4gICAgICAgIGF3YWl0IEFjdG9yLnB1c2hfZGF0YShkYXRhKVxcblxcbiAgICAgICAgIyBTZXQgc3RhdHVzIG1lc3NhZ2VcXG4gICAgICAgIGF3YWl0IEFjdG9yLnNldF9zdGF0dXNfbWVzc2FnZSgnQWN0b3IgY29tcGxldGVkIHN1Y2Nlc3NmdWxseScpXFxuXFxuICAgIGZpbmFsbHk6XFxuICAgICAgICBhd2FpdCBBY3Rvci5leGl0KClcXG5cXG5cXG5pZiBfX25hbWVfXyA9PSAnX19tYWluX18nOlxcbiAgICBhc3luY2lvLnJ1bihtYWluKCkpXFxuXCJ9Iiwib3B0aW9ucyI6eyJidWlsZCI6ImxhdGVzdCIsImNvbnRlbnRUeXBlIjoiYXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOCIsIm1lbW9yeSI6MTAyNCwidGltZW91dCI6MTgwfX0.fJ1NUD4sv032YWP2SK67VLTacs5vHpqMgqr5Gr3-c3o\&asrc=run_on_apify) ``` import asyncio from apify import Actor async def main() -> None: await Actor.init() try: # Get input actor_input = await Actor.get_input() Actor.log.info('Actor input: %s', actor_input) # Your Actor logic here data = {'message': 'Hello from Actor!', 'input': actor_input} await Actor.push_data(data) # Set status message await Actor.set_status_message('Actor completed successfully') finally: await Actor.exit() if __name__ == '__main__': asyncio.run(main()) ``` You can also create an [`Actor`](https://docs.apify.com/sdk/python/sdk/python/reference/class/Actor.md) instance directly. This does not change its capabilities but allows you to specify optional parameters during initialization, such as disabling automatic `sys.exit()` calls or customizing timeouts. The choice between using a context manager or manual initialization depends on how much control you require over the Actor's startup and shutdown sequence. * Actor instance with context manager * Actor instance with manual init/exit [Run on](https://console.apify.com/actors/HH9rhkFXiZbheuq1V?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCBhc3luY2lvXFxuZnJvbSBkYXRldGltZSBpbXBvcnQgdGltZWRlbHRhXFxuXFxuZnJvbSBhcGlmeSBpbXBvcnQgQWN0b3JcXG5cXG5cXG5hc3luYyBkZWYgbWFpbigpIC0-IE5vbmU6XFxuICAgIGFjdG9yID0gQWN0b3IoXFxuICAgICAgICBldmVudF9saXN0ZW5lcnNfdGltZW91dD10aW1lZGVsdGEoc2Vjb25kcz0zMCksXFxuICAgICAgICBjbGVhbnVwX3RpbWVvdXQ9dGltZWRlbHRhKHNlY29uZHM9MzApLFxcbiAgICApXFxuXFxuICAgIGFzeW5jIHdpdGggYWN0b3I6XFxuICAgICAgICAjIEdldCBpbnB1dFxcbiAgICAgICAgYWN0b3JfaW5wdXQgPSBhd2FpdCBhY3Rvci5nZXRfaW5wdXQoKVxcbiAgICAgICAgYWN0b3IubG9nLmluZm8oJ0FjdG9yIGlucHV0OiAlcycsIGFjdG9yX2lucHV0KVxcblxcbiAgICAgICAgIyBZb3VyIEFjdG9yIGxvZ2ljIGhlcmVcXG4gICAgICAgIGRhdGEgPSB7J21lc3NhZ2UnOiAnSGVsbG8gZnJvbSBBY3RvciBpbnN0YW5jZSEnLCAnaW5wdXQnOiBhY3Rvcl9pbnB1dH1cXG4gICAgICAgIGF3YWl0IGFjdG9yLnB1c2hfZGF0YShkYXRhKVxcblxcbiAgICAgICAgIyBTZXQgc3RhdHVzIG1lc3NhZ2VcXG4gICAgICAgIGF3YWl0IGFjdG9yLnNldF9zdGF0dXNfbWVzc2FnZSgnQWN0b3IgY29tcGxldGVkIHN1Y2Nlc3NmdWxseScpXFxuXFxuXFxuaWYgX19uYW1lX18gPT0gJ19fbWFpbl9fJzpcXG4gICAgYXN5bmNpby5ydW4obWFpbigpKVxcblwifSIsIm9wdGlvbnMiOnsiYnVpbGQiOiJsYXRlc3QiLCJjb250ZW50VHlwZSI6ImFwcGxpY2F0aW9uL2pzb247IGNoYXJzZXQ9dXRmLTgiLCJtZW1vcnkiOjEwMjQsInRpbWVvdXQiOjE4MH19.cA8xIbeHNMk88004brHmb9qQGAwxdwuD-BrHZzRAU1A\&asrc=run_on_apify) ``` import asyncio from datetime import timedelta from apify import Actor async def main() -> None: actor = Actor( event_listeners_timeout=timedelta(seconds=30), cleanup_timeout=timedelta(seconds=30), ) async with actor: # Get input actor_input = await actor.get_input() actor.log.info('Actor input: %s', actor_input) # Your Actor logic here data = {'message': 'Hello from Actor instance!', 'input': actor_input} await actor.push_data(data) # Set status message await actor.set_status_message('Actor completed successfully') if __name__ == '__main__': asyncio.run(main()) ``` [Run on](https://console.apify.com/actors/HH9rhkFXiZbheuq1V?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCBhc3luY2lvXFxuZnJvbSBkYXRldGltZSBpbXBvcnQgdGltZWRlbHRhXFxuXFxuZnJvbSBhcGlmeSBpbXBvcnQgQWN0b3JcXG5cXG5cXG5hc3luYyBkZWYgbWFpbigpIC0-IE5vbmU6XFxuICAgIGFjdG9yID0gQWN0b3IoXFxuICAgICAgICBldmVudF9saXN0ZW5lcnNfdGltZW91dD10aW1lZGVsdGEoc2Vjb25kcz0zMCksXFxuICAgICAgICBjbGVhbnVwX3RpbWVvdXQ9dGltZWRlbHRhKHNlY29uZHM9MzApLFxcbiAgICApXFxuXFxuICAgIGF3YWl0IGFjdG9yLmluaXQoKVxcblxcbiAgICB0cnk6XFxuICAgICAgICAjIEdldCBpbnB1dFxcbiAgICAgICAgYWN0b3JfaW5wdXQgPSBhd2FpdCBhY3Rvci5nZXRfaW5wdXQoKVxcbiAgICAgICAgYWN0b3IubG9nLmluZm8oJ0FjdG9yIGlucHV0OiAlcycsIGFjdG9yX2lucHV0KVxcblxcbiAgICAgICAgIyBZb3VyIEFjdG9yIGxvZ2ljIGhlcmVcXG4gICAgICAgIGRhdGEgPSB7J21lc3NhZ2UnOiAnSGVsbG8gZnJvbSBBY3RvciEnLCAnaW5wdXQnOiBhY3Rvcl9pbnB1dH1cXG4gICAgICAgIGF3YWl0IGFjdG9yLnB1c2hfZGF0YShkYXRhKVxcblxcbiAgICAgICAgIyBTZXQgc3RhdHVzIG1lc3NhZ2VcXG4gICAgICAgIGF3YWl0IGFjdG9yLnNldF9zdGF0dXNfbWVzc2FnZSgnQWN0b3IgY29tcGxldGVkIHN1Y2Nlc3NmdWxseScpXFxuXFxuICAgIGZpbmFsbHk6XFxuICAgICAgICBhd2FpdCBhY3Rvci5leGl0KClcXG5cXG5cXG5pZiBfX25hbWVfXyA9PSAnX19tYWluX18nOlxcbiAgICBhc3luY2lvLnJ1bihtYWluKCkpXFxuXCJ9Iiwib3B0aW9ucyI6eyJidWlsZCI6ImxhdGVzdCIsImNvbnRlbnRUeXBlIjoiYXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOCIsIm1lbW9yeSI6MTAyNCwidGltZW91dCI6MTgwfX0.DleIoDi4ZIZlj9zzVKVeoxceUOz4n7wr4QNv0DJlb7E\&asrc=run_on_apify) ``` import asyncio from datetime import timedelta from apify import Actor async def main() -> None: actor = Actor( event_listeners_timeout=timedelta(seconds=30), cleanup_timeout=timedelta(seconds=30), ) await actor.init() try: # Get input actor_input = await actor.get_input() actor.log.info('Actor input: %s', actor_input) # Your Actor logic here data = {'message': 'Hello from Actor!', 'input': actor_input} await actor.push_data(data) # Set status message await actor.set_status_message('Actor completed successfully') finally: await actor.exit() if __name__ == '__main__': asyncio.run(main()) ``` ## Error handling[](#error-handling) Good error handling lets your Actor fail fast on critical errors, retry transient issues safely, and keep data consistent. Normally you rely on the `async with Actor:` block—if it finishes, the run succeeds (exit code 0); if an unhandled exception occurs, the run fails (exit code 1). The SDK provides helper methods for explicit control: * [`Actor.exit`](https://docs.apify.com/sdk/python/sdk/python/reference/class/Actor.md#exit) - terminates the run successfully (default exit code 0). * [`Actor.fail`](https://docs.apify.com/sdk/python/sdk/python/reference/class/Actor.md#fail) - marks the run as failed (default exit code 1). Any non-zero exit code is treated as a `FAILED` run. You rarely need to call these methods directly unless you want to perform a controlled shutdown or customize the exit behavior. Catch exceptions only when necessary - for example, to retry network timeouts or map specific errors to exit codes. Keep retry loops bounded with backoff and re-raise once exhausted. Make your processing idempotent so that restarts don't corrupt results. Both [`Actor.exit`](https://docs.apify.com/sdk/python/sdk/python/reference/class/Actor.md#exit) and [`Actor.fail`](https://docs.apify.com/sdk/python/sdk/python/reference/class/Actor.md#fail) perform the same cleanup, so complete any long-running persistence before calling them. Below is a minimal context-manager example where an unhandled exception automatically fails the run, followed by a manual pattern giving you more control. [Run on](https://console.apify.com/actors/HH9rhkFXiZbheuq1V?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCBhc3luY2lvXFxuXFxuZnJvbSBhcGlmeSBpbXBvcnQgQWN0b3JcXG5cXG5cXG5hc3luYyBkZWYgbWFpbigpIC0-IE5vbmU6XFxuICAgIGFzeW5jIHdpdGggQWN0b3I6XFxuICAgICAgICAjIEFueSB1bmhhbmRsZWQgZXhjZXB0aW9uIHRyaWdnZXJzIEFjdG9yLmZhaWwoKSBhdXRvbWF0aWNhbGx5XFxuICAgICAgICByYWlzZSBSdW50aW1lRXJyb3IoJ0Jvb20nKVxcblxcblxcbmlmIF9fbmFtZV9fID09ICdfX21haW5fXyc6XFxuICAgIGFzeW5jaW8ucnVuKG1haW4oKSlcXG5cIn0iLCJvcHRpb25zIjp7ImJ1aWxkIjoibGF0ZXN0IiwiY29udGVudFR5cGUiOiJhcHBsaWNhdGlvbi9qc29uOyBjaGFyc2V0PXV0Zi04IiwibWVtb3J5IjoxMDI0LCJ0aW1lb3V0IjoxODB9fQ.tsWHKk9HL-cEP63gyZO5gCvcfsjYgA4J7JPEYEnKwyg\&asrc=run_on_apify) ``` import asyncio from apify import Actor async def main() -> None: async with Actor: # Any unhandled exception triggers Actor.fail() automatically raise RuntimeError('Boom') if __name__ == '__main__': asyncio.run(main()) ``` If you need explicit control over exit codes or status messages, you can manage the Actor manually using [`Actor.init`](https://docs.apify.com/sdk/python/sdk/python/reference/class/Actor.md#init), [`Actor.exit`](https://docs.apify.com/sdk/python/sdk/python/reference/class/Actor.md#exit), and [`Actor.fail`](https://docs.apify.com/sdk/python/sdk/python/reference/class/Actor.md#fail). [Run on](https://console.apify.com/actors/HH9rhkFXiZbheuq1V?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCBhc3luY2lvXFxuaW1wb3J0IHJhbmRvbVxcblxcbmZyb20gYXBpZnkgaW1wb3J0IEFjdG9yXFxuXFxuXFxuYXN5bmMgZGVmIGRvX3dvcmsoKSAtPiBOb25lOlxcbiAgICAjIFNpbXVsYXRlIHJhbmRvbSBvdXRjb21lczogc3VjY2VzcyBvciBvbmUgb2YgdHdvIGV4Y2VwdGlvbiB0eXBlcy5cXG4gICAgb3V0Y29tZSA9IHJhbmRvbS5yYW5kb20oKVxcblxcbiAgICBpZiBvdXRjb21lIDwgMC4zMzpcXG4gICAgICAgIHJhaXNlIFZhbHVlRXJyb3IoJ0ludmFsaWQgaW5wdXQgZGF0YSBlbmNvdW50ZXJlZCcpXFxuICAgIGlmIG91dGNvbWUgPCAwLjY2OlxcbiAgICAgICAgcmFpc2UgUnVudGltZUVycm9yKCdVbmV4cGVjdGVkIHJ1bnRpbWUgZmFpbHVyZScpXFxuXFxuICAgICMgU2ltdWxhdGUgc3VjY2Vzc2Z1bCB3b3JrXFxuICAgIEFjdG9yLmxvZy5pbmZvKCdXb3JrIGNvbXBsZXRlZCBzdWNjZXNzZnVsbHknKVxcblxcblxcbmFzeW5jIGRlZiBtYWluKCkgLT4gTm9uZTpcXG4gICAgYXdhaXQgQWN0b3IuaW5pdCgpXFxuICAgIHRyeTpcXG4gICAgICAgIGF3YWl0IGRvX3dvcmsoKVxcbiAgICBleGNlcHQgVmFsdWVFcnJvciBhcyBleGM6ICAjIFNwZWNpZmljIGVycm9yIG1hcHBpbmcgZXhhbXBsZVxcbiAgICAgICAgYXdhaXQgQWN0b3IuZmFpbChleGl0X2NvZGU9MTAsIGV4Y2VwdGlvbj1leGMpXFxuICAgIGV4Y2VwdCBFeGNlcHRpb24gYXMgZXhjOiAgIyBDYXRjaC1hbGwgZm9yIHVuZXhwZWN0ZWQgZXJyb3JzXFxuICAgICAgICBhd2FpdCBBY3Rvci5mYWlsKGV4aXRfY29kZT05MSwgZXhjZXB0aW9uPWV4YylcXG4gICAgZWxzZTpcXG4gICAgICAgIGF3YWl0IEFjdG9yLmV4aXQoc3RhdHVzX21lc3NhZ2U9J0FjdG9yIGNvbXBsZXRlZCBzdWNjZXNzZnVsbHknKVxcblxcblxcbmlmIF9fbmFtZV9fID09ICdfX21haW5fXyc6XFxuICAgIGFzeW5jaW8ucnVuKG1haW4oKSlcXG5cIn0iLCJvcHRpb25zIjp7ImJ1aWxkIjoibGF0ZXN0IiwiY29udGVudFR5cGUiOiJhcHBsaWNhdGlvbi9qc29uOyBjaGFyc2V0PXV0Zi04IiwibWVtb3J5IjoxMDI0LCJ0aW1lb3V0IjoxODB9fQ.v-eAp4iKOiRP5t_jeg4MaXzUONdmxs_7xM5uZAErtj8\&asrc=run_on_apify) ``` import asyncio import random from apify import Actor async def do_work() -> None: # Simulate random outcomes: success or one of two exception types. outcome = random.random() if outcome < 0.33: raise ValueError('Invalid input data encountered') if outcome < 0.66: raise RuntimeError('Unexpected runtime failure') # Simulate successful work Actor.log.info('Work completed successfully') async def main() -> None: await Actor.init() try: await do_work() except ValueError as exc: # Specific error mapping example await Actor.fail(exit_code=10, exception=exc) except Exception as exc: # Catch-all for unexpected errors await Actor.fail(exit_code=91, exception=exc) else: await Actor.exit(status_message='Actor completed successfully') if __name__ == '__main__': asyncio.run(main()) ``` ## Reboot[](#reboot) Rebooting (available on the Apify platform only) instructs the platform worker to restart your Actor from the beginning of its execution. Use this mechanism only for transient conditions that are likely to resolve after a fresh start — for example, rotating a blocked proxy pool or recovering from a stuck browser environment. Before triggering a reboot, persist any essential state externally (e.g., to the key-value store or dataset), as all in-memory data is lost after reboot. The example below tracks a reboot counter in the default key-value store and allows at most three restarts before exiting normally. [Run on](https://console.apify.com/actors/HH9rhkFXiZbheuq1V?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCBhc3luY2lvXFxuXFxuZnJvbSBhcGlmeSBpbXBvcnQgQWN0b3JcXG5cXG5cXG5hc3luYyBkZWYgbWFpbigpIC0-IE5vbmU6XFxuICAgIGFzeW5jIHdpdGggQWN0b3I6XFxuICAgICAgICAjIFVzZSB0aGUgS1ZTIHRvIHBlcnNpc3QgYSBzaW1wbGUgcmVib290IGNvdW50ZXIgYWNyb3NzIHJlc3RhcnRzLlxcbiAgICAgICAga3ZzID0gYXdhaXQgQWN0b3Iub3Blbl9rZXlfdmFsdWVfc3RvcmUoKVxcbiAgICAgICAgcmVib290X2NvdW50ZXIgPSBhd2FpdCBrdnMuZ2V0X3ZhbHVlKCdyZWJvb3RfY291bnRlcicsIDApXFxuXFxuICAgICAgICAjIExpbWl0IHRoZSBudW1iZXIgb2YgcmVib290cyB0byBhdm9pZCBpbmZpbml0ZSBsb29wcy5cXG4gICAgICAgIGlmIHJlYm9vdF9jb3VudGVyIDwgMzpcXG4gICAgICAgICAgICBhd2FpdCBrdnMuc2V0X3ZhbHVlKCdyZWJvb3RfY291bnRlcicsIHJlYm9vdF9jb3VudGVyICsgMSlcXG4gICAgICAgICAgICBBY3Rvci5sb2cuaW5mbyhmJ1JlYm9vdCBhdHRlbXB0IHtyZWJvb3RfY291bnRlciArIDF9LzMnKVxcbiAgICAgICAgICAgICMgVHJpZ2dlciBhIHBsYXRmb3JtIHJlYm9vdDsgYWZ0ZXIgcmVzdGFydCB0aGUgY29kZSBydW5zIGZyb20gdGhlIGJlZ2lubmluZy5cXG4gICAgICAgICAgICBhd2FpdCBBY3Rvci5yZWJvb3QoKVxcblxcbiAgICAgICAgQWN0b3IubG9nLmluZm8oJ1JlYm9vdCBsaW1pdCByZWFjaGVkLCBmaW5pc2hpbmcgcnVuJylcXG5cXG5cXG5pZiBfX25hbWVfXyA9PSAnX19tYWluX18nOlxcbiAgICBhc3luY2lvLnJ1bihtYWluKCkpXFxuXCJ9Iiwib3B0aW9ucyI6eyJidWlsZCI6ImxhdGVzdCIsImNvbnRlbnRUeXBlIjoiYXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOCIsIm1lbW9yeSI6MTAyNCwidGltZW91dCI6MTgwfX0.zkUzAz4PtCnAuT1nWbo-0HRIvzObMn-69-lX2N96_G0\&asrc=run_on_apify) ``` import asyncio from apify import Actor async def main() -> None: async with Actor: # Use the KVS to persist a simple reboot counter across restarts. kvs = await Actor.open_key_value_store() reboot_counter = await kvs.get_value('reboot_counter', 0) # Limit the number of reboots to avoid infinite loops. if reboot_counter < 3: await kvs.set_value('reboot_counter', reboot_counter + 1) Actor.log.info(f'Reboot attempt {reboot_counter + 1}/3') # Trigger a platform reboot; after restart the code runs from the beginning. await Actor.reboot() Actor.log.info('Reboot limit reached, finishing run') if __name__ == '__main__': asyncio.run(main()) ``` ## Status message[](#status-message) [Status messages](https://docs.apify.com/platform/actors/development/programming-interface/status-messages) are lightweight, human-readable progress indicators displayed with the Actor run on the Apify platform (separate from logs). Use them to communicate high-level phases or milestones, such as "Fetching list", "Processed 120/500 pages", or "Uploading results". Update the status only when the user's understanding of progress changes - avoid frequent updates for every processed item. Detailed information should go to logs or storages (dataset, key-value store) instead. The SDK optimizes updates by sending an API request only when the message text changes, so repeating the same message incurs no additional cost. [Run on](https://console.apify.com/actors/HH9rhkFXiZbheuq1V?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCBhc3luY2lvXFxuXFxuZnJvbSBhcGlmeSBpbXBvcnQgQWN0b3JcXG5cXG5cXG5hc3luYyBkZWYgbWFpbigpIC0-IE5vbmU6XFxuICAgIGFzeW5jIHdpdGggQWN0b3I6XFxuICAgICAgICBhd2FpdCBBY3Rvci5zZXRfc3RhdHVzX21lc3NhZ2UoJ0hlcmUgd2UgZ28hJylcXG4gICAgICAgICMgRG8gc29tZSB3b3JrLi4uXFxuICAgICAgICBhd2FpdCBhc3luY2lvLnNsZWVwKDMpXFxuICAgICAgICBhd2FpdCBBY3Rvci5zZXRfc3RhdHVzX21lc3NhZ2UoJ1NvIGZhciBzbyBnb29kLi4uJylcXG4gICAgICAgIGF3YWl0IGFzeW5jaW8uc2xlZXAoMylcXG4gICAgICAgICMgRG8gc29tZSBtb3JlIHdvcmsuLi5cXG4gICAgICAgIGF3YWl0IEFjdG9yLnNldF9zdGF0dXNfbWVzc2FnZSgnU3RlYWR5IGFzIHNoZSBnb2VzLi4uJylcXG4gICAgICAgIGF3YWl0IGFzeW5jaW8uc2xlZXAoMylcXG4gICAgICAgICMgRG8gZXZlbiBtb3JlIHdvcmsuLi5cXG4gICAgICAgIGF3YWl0IEFjdG9yLnNldF9zdGF0dXNfbWVzc2FnZSgnQWxtb3N0IHRoZXJlLi4uJylcXG4gICAgICAgIGF3YWl0IGFzeW5jaW8uc2xlZXAoMylcXG4gICAgICAgICMgRmluaXNoIHRoZSBqb2JcXG4gICAgICAgIGF3YWl0IEFjdG9yLnNldF9zdGF0dXNfbWVzc2FnZSgnUGhldyEgVGhhdCB3YXMgbm90IHRoYXQgaGFyZCEnKVxcblxcblxcbmlmIF9fbmFtZV9fID09ICdfX21haW5fXyc6XFxuICAgIGFzeW5jaW8ucnVuKG1haW4oKSlcXG5cIn0iLCJvcHRpb25zIjp7ImJ1aWxkIjoibGF0ZXN0IiwiY29udGVudFR5cGUiOiJhcHBsaWNhdGlvbi9qc29uOyBjaGFyc2V0PXV0Zi04IiwibWVtb3J5IjoxMDI0LCJ0aW1lb3V0IjoxODB9fQ.iN59lPqRVtg82YPXPHxgaCtSPbwp_m94VdcyUb8nT5Q\&asrc=run_on_apify) ``` import asyncio from apify import Actor async def main() -> None: async with Actor: await Actor.set_status_message('Here we go!') # Do some work... await asyncio.sleep(3) await Actor.set_status_message('So far so good...') await asyncio.sleep(3) # Do some more work... await Actor.set_status_message('Steady as she goes...') await asyncio.sleep(3) # Do even more work... await Actor.set_status_message('Almost there...') await asyncio.sleep(3) # Finish the job await Actor.set_status_message('Phew! That was not that hard!') if __name__ == '__main__': asyncio.run(main()) ``` ## Conclusion[](#conclusion) This page has presented the full Actor lifecycle: initialization, execution, error handling, rebooting, shutdown and status messages. You've seen how the SDK supports both context-based and manual control patterns. For deeper dives, explore the [reference docs](https://docs.apify.com/sdk/python/sdk/python/reference.md), [guides](https://docs.apify.com/sdk/python/sdk/python/docs/guides/beautifulsoup-httpx.md), and [platform documentation](https://docs.apify.com/platform). --- # Source: https://docs.apify.com/api/v2/actor-run-abort-post.md # Abort run ``` POST https://api.apify.com/v2/actor-runs/:runId/abort ``` Aborts an Actor run and returns an object that contains all the details about the run. Only runs that are starting or running are aborted. For runs with status `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-run-delete.md # Delete run ``` DELETE https://api.apify.com/v2/actor-runs/:runId ``` Delete the run. Only finished runs can be deleted. Only the person or organization that initiated the run can delete it. ## Request ## Responses * 204 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-run-get.md # Get run ``` GET https://api.apify.com/v2/actor-runs/:runId ``` This is not a single endpoint, but an entire group of endpoints that lets you retrieve the run or any of its default storages. The endpoints accept the same HTTP methods and query parameters as the respective storage endpoints. The base path that represents the Actor run object is: `/v2/actor-runs/{runId}{?token}` In order to access the default storages of the Actor run, i.e. log, key-value store, dataset and request queue, use the following endpoints: * `/v2/actor-runs/{runId}/log{?token}` * `/v2/actor-runs/{runId}/key-value-store{?token}` * `/v2/actor-runs/{runId}/dataset{?token}` * `/v2/actor-runs/{runId}/request-queue{?token}` These API endpoints have the same usage as the equivalent storage endpoints. For example, `/v2/actor-runs/{runId}/key-value-store` has the same HTTP method and parameters as the endpoint. Additionally, each of the above API endpoints supports all sub-endpoints of the original one: #### Log * `/v2/actor-runs/{runId}/log` #### Key-value store * `/v2/actor-runs/{runId}/key-value-store/keys{?token}` * `/v2/actor-runs/{runId}/key-value-store/records/{recordKey}{?token}` #### Dataset * `/v2/actor-runs/{runId}/dataset/items{?token}` #### Request queue * `/v2/actor-runs/{runId}/request-queue/requests{?token}` * `/v2/actor-runs/{runId}/request-queue/requests/{requestId}{?token}` * `/v2/actor-runs/{runId}/request-queue/head{?token}` For example, to download data from a dataset of the Actor run in XML format, send HTTP GET request to the following URL: ``` https://api.apify.com/v2/actor-runs/{runId}/dataset/items?format=xml ``` In order to save new items to the dataset, send HTTP POST request with JSON payload to the same URL. Gets an object that contains all the details about a specific run of an Actor. By passing the optional `waitForFinish` parameter the API endpoint will synchronously wait for the run to finish. This is useful to avoid periodic polling when waiting for Actor run to complete. This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the run. However, if you access the endpoint without the token, certain attributes, such as `usageUsd` and `usageTotalUsd`, will be hidden. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-run-metamorph-post.md # Metamorph run ``` POST https://api.apify.com/v2/actor-runs/:runId/metamorph ``` Transforms an Actor run into a run of another Actor with a new input. This is useful if you want to use another Actor to finish the work of your current Actor run, without the need to create a completely new run and waiting for its finish. For the users of your Actors, the metamorph operation is transparent, they will just see your Actor got the work done. Internally, the system stops the Docker container corresponding to the Actor run and starts a new container using a different Docker image. All the default storages are preserved and the new input is stored under the `INPUT-METAMORPH-1` key in the same default key-value store. For more information, see the [Actor docs](https://docs.apify.com/platform/actors/development/programming-interface/metamorph). ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-run-put.md # Update run ``` PUT https://api.apify.com/v2/actor-runs/:runId ``` This endpoint can be used to update both the run's status message and to configure its general resource access level. **Status message:** You can set a single status message on your run that will be displayed in the Apify Console UI. During an Actor run, you will typically do this in order to inform users of your Actor about the Actor's progress. The request body must contain `runId` and `statusMessage` properties. The `isStatusMessageTerminal` property is optional and it indicates if the status message is the very last one. In the absence of a status message, the platform will try to substitute sensible defaults. **General resource access:** You can also update the run's general resource access setting, which determines who can view the run and its related data. Allowed values: * `FOLLOW_USER_SETTING` - The run inherits the general access setting from the account level. * `ANYONE_WITH_ID_CAN_READ` - The run can be viewed anonymously by anyone who has its ID. * `RESTRICTED` - Only users with explicit access to the resource can access the run. When a run is accessible anonymously, all of the run's default storages and logs also become accessible anonymously. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-run-reboot-post.md # Reboot run ``` POST https://api.apify.com/v2/actor-runs/:runId/reboot ``` Reboots an Actor run and returns an object that contains all the details about the rebooted run. Only runs that are running, i.e. runs with status `RUNNING` can be rebooted. The run's container will be restarted, so any data not persisted in the key-value store, dataset, or request queue will be lost. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-runs-get.md # Get user runs list ``` GET https://api.apify.com/v2/actor-runs ``` Gets a list of all runs for a user. The response is a list of objects, where each object contains basic information about a single Actor run. The endpoint supports pagination using the `limit` and `offset` parameters and it will not return more than 1000 array elements. By default, the records are sorted by the `startedAt` field in ascending order. Therefore, you can use pagination to incrementally fetch all records while new ones are still being created. To sort the records in descending order, use `desc=1` parameter. You can also filter runs by `startedAt`` and `status\`\` fields ([available statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-runs.md # Actor runs - Introduction The API endpoints described in this section enable you to manage, and delete Apify Actor runs. If any returned run object contains usage in dollars, your effective unit pricing at the time of query has been used for computation of this dollar equivalent, and hence it should be used only for informative purposes. You can learn more about platform usage in the [documentation](https://docs.apify.com/platform/actors/running/usage-and-resources#usage). ## [Get user runs list](https://docs.apify.com/api/v2/actor-runs-get.md) [/actor-runs](https://docs.apify.com/api/v2/actor-runs-get.md) ## [Get run](https://docs.apify.com/api/v2/actor-run-get.md) [/actor-runs/{runId}](https://docs.apify.com/api/v2/actor-run-get.md) ## [Update run](https://docs.apify.com/api/v2/actor-run-put.md) [/actor-runs/{runId}](https://docs.apify.com/api/v2/actor-run-put.md) ## [Delete run](https://docs.apify.com/api/v2/actor-run-delete.md) [/actor-runs/{runId}](https://docs.apify.com/api/v2/actor-run-delete.md) ## [Abort run](https://docs.apify.com/api/v2/actor-run-abort-post.md) [/actor-runs/{runId}/abort](https://docs.apify.com/api/v2/actor-run-abort-post.md) ## [Metamorph run](https://docs.apify.com/api/v2/actor-run-metamorph-post.md) [/actor-runs/{runId}/metamorph](https://docs.apify.com/api/v2/actor-run-metamorph-post.md) ## [Reboot run](https://docs.apify.com/api/v2/actor-run-reboot-post.md) [/actor-runs/{runId}/reboot](https://docs.apify.com/api/v2/actor-run-reboot-post.md) ## [Resurrect run](https://docs.apify.com/api/v2/post-resurrect-run.md) [/actor-runs/{runId}/resurrect](https://docs.apify.com/api/v2/post-resurrect-run.md) ## [Charge events in run](https://docs.apify.com/api/v2/post-charge-run.md) [/actor-runs/{runId}/charge](https://docs.apify.com/api/v2/post-charge-run.md) --- # Source: https://docs.apify.com/sdk/python/docs/overview/actor-structure.md # Actor structure Copy for LLM All Python Actor templates follow the same structure. The `.actor/` directory contains the [Actor configuration](https://docs.apify.com/platform/actors/development/actor-config), such as the Actor's definition and input schema, and the Dockerfile necessary to run the Actor on the Apify platform. The Actor's runtime dependencies are specified in the `requirements.txt` file, which follows the [standard requirements file format](https://pip.pypa.io/en/stable/reference/requirements-file-format/). The Actor's source code is in the `src/` folder. This folder contains two important files: `main.py`, which contains the main function of the Actor, and `__main__.py`, which is the entrypoint of the Actor package, setting up the Actor [logger](https://docs.apify.com/sdk/python/sdk/python/docs/concepts/logging.md) and executing the Actor's main function via [`asyncio.run`](https://docs.python.org/3/library/asyncio-runner.html#asyncio.run). * \_\_main.py\_\_ * main.py ``` import asyncio from .main import main if __name__ == '__main__': asyncio.run(main()) ``` ``` from apify import Actor async def main() -> None: async with Actor: actor_input = await Actor.get_input() Actor.log.info('Actor input: %s', actor_input) await Actor.set_value('OUTPUT', 'Hello, world!') ``` If you want to modify the Actor structure, you need to make sure that your Actor is executable as a module, via `python -m src`, as that is the command started by `apify run` in the Apify CLI. We recommend keeping the entrypoint for the Actor in the `src/__main__.py` file. --- # Source: https://docs.apify.com/api/v2/actor-task-delete.md # Delete task ``` DELETE https://api.apify.com/v2/actor-tasks/:actorTaskId ``` Delete the task specified through the `actorTaskId` parameter. ## Request ## Responses * 204 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-task-get.md # Get task ``` GET https://api.apify.com/v2/actor-tasks/:actorTaskId ``` Get an object that contains all the details about a task. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-task-input-get.md # Get task input ``` GET https://api.apify.com/v2/actor-tasks/:actorTaskId/input ``` Returns the input of a given task. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-task-input-put.md # Update task input ``` PUT https://api.apify.com/v2/actor-tasks/:actorTaskId/input ``` Updates the input of a task using values specified by an object passed as JSON in the PUT payload. If the object does not define a specific property, its value is not updated. The response is the full task input as returned by the endpoint. The request needs to specify the `Content-Type: application/json` HTTP header! When providing your API authentication token, we recommend using the request's `Authorization` header, rather than the URL. (). ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-task-put.md # Update task ``` PUT https://api.apify.com/v2/actor-tasks/:actorTaskId ``` Update settings of a task using values specified by an object passed as JSON in the POST payload. If the object does not define a specific property, its value is not updated. The response is the full task object as returned by the endpoint. The request needs to specify the `Content-Type: application/json` HTTP header! When providing your API authentication token, we recommend using the request's `Authorization` header, rather than the URL. (). ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-task-run-sync-get-dataset-items-get.md # Run task synchronously and get dataset items ``` GET https://api.apify.com/v2/actor-tasks/:actorTaskId/run-sync-get-dataset-items ``` Run a specific task and return its dataset items. The run must finish in 300 seconds otherwise the HTTP request fails with a timeout error (this won't abort the run itself). You can send all the same options in parameters as the API endpoint. Beware that it might be impossible to maintain an idle HTTP connection for an extended period, due to client timeout or network conditions. Make sure your HTTP client is configured to have a long enough connection timeout. If the connection breaks, you will not receive any information about the run and its status. To run the Task asynchronously, use the endpoint instead. ## Request ## Responses * 201 * 400 * 408 **Response Headers** * **X-Apify-Pagination-Offset** **X-Apify-Pagination-Limit** **X-Apify-Pagination-Count** **X-Apify-Pagination-Total** **Response Headers** Request Timeout: the HTTP request exceeded the 300 second limit **Response Headers** --- # Source: https://docs.apify.com/api/v2/actor-task-run-sync-get-dataset-items-post.md # Run task synchronously and get dataset items ``` POST https://api.apify.com/v2/actor-tasks/:actorTaskId/run-sync-get-dataset-items ``` Runs an Actor task and synchronously returns its dataset items. The run must finish in 300 seconds otherwise the HTTP request fails with a timeout error (this won't abort the run itself). Optionally, you can override the Actor input configuration by passing a JSON object as the POST payload and setting the `Content-Type: application/json` HTTP header. Note that if the object in the POST payload does not define a particular input property, the Actor run uses the default value defined by the task (or the Actor's input schema if not defined by the task). You can send all the same options in parameters as the API endpoint. Beware that it might be impossible to maintain an idle HTTP connection for an extended period, due to client timeout or network conditions. Make sure your HTTP client is configured to have a long enough connection timeout. If the connection breaks, you will not receive any information about the run and its status. Input fields from Actor task configuration can be overloaded with values passed as the POST payload. Just make sure to specify the `Content-Type` header as `application/json` and that the input is an object. To run the task asynchronously, use the API endpoint instead. ## Request ## Responses * 201 * 400 **Response Headers** * **X-Apify-Pagination-Offset** **X-Apify-Pagination-Limit** **X-Apify-Pagination-Count** **X-Apify-Pagination-Total** **Response Headers** --- # Source: https://docs.apify.com/api/v2/actor-task-run-sync-get.md # Run task synchronously ``` GET https://api.apify.com/v2/actor-tasks/:actorTaskId/run-sync ``` Run a specific task and return its output. The run must finish in 300 seconds otherwise the HTTP request fails with a timeout error (this won't abort the run itself). Beware that it might be impossible to maintain an idle HTTP connection for an extended period, due to client timeout or network conditions. Make sure your HTTP client is configured to have a long enough connection timeout. If the connection breaks, you will not receive any information about the run and its status. To run the Task asynchronously, use the endpoint instead. ## Request ## Responses * 201 * 400 * 408 **Response Headers** **Response Headers** Request Timeout: the HTTP request exceeded the 300 second limit **Response Headers** --- # Source: https://docs.apify.com/api/v2/actor-task-run-sync-post.md # Run task synchronously ``` POST https://api.apify.com/v2/actor-tasks/:actorTaskId/run-sync ``` Runs an Actor task and synchronously returns its output. The run must finish in 300 seconds otherwise the HTTP request fails with a timeout error (this won't abort the run itself). Optionally, you can override the Actor input configuration by passing a JSON object as the POST payload and setting the `Content-Type: application/json` HTTP header. Note that if the object in the POST payload does not define a particular input property, the Actor run uses the default value defined by the task (or Actor's input schema if not defined by the task). Beware that it might be impossible to maintain an idle HTTP connection for an extended period, due to client timeout or network conditions. Make sure your HTTP client is configured to have a long enough connection timeout. If the connection breaks, you will not receive any information about the run and its status. Input fields from Actor task configuration can be overloaded with values passed as the POST payload. Just make sure to specify `Content-Type` header to be `application/json` and input to be an object. To run the task asynchronously, use the API endpoint instead. ## Request ## Responses * 201 * 400 **Response Headers** **Response Headers** --- # Source: https://docs.apify.com/api/v2/actor-task-runs-get.md # Get list of task runs ``` GET https://api.apify.com/v2/actor-tasks/:actorTaskId/runs ``` Get a list of runs of a specific task. The response is a list of objects, where each object contains essential information about a single task run. The endpoint supports pagination using the `limit` and `offset` parameters, and it does not return more than a 1000 array elements. By default, the records are sorted by the `startedAt` field in ascending order; therefore you can use pagination to incrementally fetch all records while new ones are still being created. To sort the records in descending order, use the `desc=1` parameter. You can also filter runs by status ([available statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-task-runs-last-get.md # Get last run ``` GET https://api.apify.com/v2/actor-tasks/:actorTaskId/runs/last ``` This is not a single endpoint, but an entire group of endpoints that lets you to retrieve and manage the last run of given actor task or any of its default storages. All the endpoints require an authentication token. The endpoints accept the same HTTP methods and query parameters as the respective storage endpoints. The base path represents the last actor task run object is: `/v2/actor-tasks/{actorTaskId}/runs/last{?token,status}` Using the `status` query parameter you can ensure to only get a run with a certain status (e.g. `status=SUCCEEDED`). The output of this endpoint and other query parameters are the same as in the [Run object](https://docs.apify.com/api/v2/actor-run-get.md) endpoint. In order to access the default storages of the last actor task run, i.e. log, key-value store, dataset and request queue, use the following endpoints: * `/v2/actor-tasks/{actorTaskId}/runs/last/log{?token,status}` * `/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store{?token,status}` * `/v2/actor-tasks/{actorTaskId}/runs/last/dataset{?token,status}` * `/v2/actor-tasks/{actorTaskId}/runs/last/request-queue{?token,status}` These API endpoints have the same usage as the equivalent storage endpoints. For example, `/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store` has the same HTTP method and parameters as the [Key-value store object](https://docs.apify.com/api/v2/storage-key-value-stores.md) endpoint. Additionally, each of the above API endpoints supports all sub-endpoints of the original one: ##### Storage endpoints * [Dataset - introduction](https://docs.apify.com/api/v2/storage-datasets.md) * [Key-value store - introduction](https://docs.apify.com/api/v2/storage-key-value-stores.md) * [Request queue - introduction](https://docs.apify.com/api/v2/storage-request-queues.md) For example, to download data from a dataset of the last succeeded actor task run in XML format, send HTTP GET request to the following URL: ``` https://api.apify.com/v2/actor-tasks/{actorTaskId}/runs/last/dataset/items?token={yourApiToken}&format=xml&status=SUCCEEDED ``` In order to save new items to the dataset, send HTTP POST request with JSON payload to the same URL. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-task-runs-post.md # Run task ``` POST https://api.apify.com/v2/actor-tasks/:actorTaskId/runs ``` Runs an Actor task and immediately returns without waiting for the run to finish. Optionally, you can override the Actor input configuration by passing a JSON object as the POST payload and setting the `Content-Type: application/json` HTTP header. Note that if the object in the POST payload does not define a particular input property, the Actor run uses the default value defined by the task (or Actor's input schema if not defined by the task). The response is the Actor Run object as returned by the endpoint. If you want to wait for the run to finish and receive the actual output of the Actor run as the response, use one of the API endpoints instead. To fetch the Actor run results that are typically stored in the default dataset, you'll need to pass the ID received in the `defaultDatasetId` field received in the response JSON to the API endpoint. ## Request ## Responses * 201 * 400 **Response Headers** * **Location** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-task-webhooks-get.md # Get list of webhooks ``` GET https://api.apify.com/v2/actor-tasks/:actorTaskId/webhooks ``` Gets the list of webhooks of a specific Actor task. The response is a JSON with the list of objects, where each object contains basic information about a single webhook. The endpoint supports pagination using the `limit` and `offset` parameters and it will not return more than 1000 records. By default, the records are sorted by the `createdAt` field in ascending order, to sort the records in descending order, use the `desc=1` parameter. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-tasks-get.md # Get list of tasks ``` GET https://api.apify.com/v2/actor-tasks ``` Gets the complete list of tasks that a user has created or used. The response is a list of objects in which each object contains essential information about a single task. The endpoint supports pagination using the `limit` and `offset` parameters, and it does not return more than a 1000 records. By default, the records are sorted by the `createdAt` field in ascending order; therefore you can use pagination to incrementally fetch all tasks while new ones are still being created. To sort the records in descending order, use the `desc=1` parameter. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-tasks-post.md # Create task ``` POST https://api.apify.com/v2/actor-tasks ``` Create a new task with settings specified by the object passed as JSON in the POST payload. The response is the full task object as returned by the endpoint. The request needs to specify the `Content-Type: application/json` HTTP header! When providing your API authentication token, we recommend using the request's `Authorization` header, rather than the URL. (). ## Request ## Responses * 201 * 400 **Response Headers** * **Location** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/actor-tasks.md # Actor tasks - Introduction The API endpoints described in this section enable you to create, manage, delete, and run Apify Actor tasks. For more information, see the [Actor tasts documentation](https://docs.apify.com/platform/actors/running/tasks). note For all the API endpoints that accept the `actorTaskId` parameter to specify a task, you can pass either the task ID (e.g. `HG7ML7M8z78YcAPEB`) or a tilde-separated username of the task's owner and the task's name (e.g. `janedoe~my-task`). Some of the API endpoints return run objects. If any such run object contains usage in dollars, your effective unit pricing at the time of query has been used for computation of this dollar equivalent, and hence it should be used only for informative purposes. You can learn more about platform usage in the [documentation](https://docs.apify.com/platform/actors/running/usage-and-resources#usage). ## [Get list of tasks](https://docs.apify.com/api/v2/actor-tasks-get.md) [/actor-tasks](https://docs.apify.com/api/v2/actor-tasks-get.md) ## [Create task](https://docs.apify.com/api/v2/actor-tasks-post.md) [/actor-tasks](https://docs.apify.com/api/v2/actor-tasks-post.md) ## [Get task](https://docs.apify.com/api/v2/actor-task-get.md) [/actor-tasks/{actorTaskId}](https://docs.apify.com/api/v2/actor-task-get.md) ## [Update task](https://docs.apify.com/api/v2/actor-task-put.md) [/actor-tasks/{actorTaskId}](https://docs.apify.com/api/v2/actor-task-put.md) ## [Delete task](https://docs.apify.com/api/v2/actor-task-delete.md) [/actor-tasks/{actorTaskId}](https://docs.apify.com/api/v2/actor-task-delete.md) ## [Get task input](https://docs.apify.com/api/v2/actor-task-input-get.md) [/actor-tasks/{actorTaskId}/input](https://docs.apify.com/api/v2/actor-task-input-get.md) ## [Update task input](https://docs.apify.com/api/v2/actor-task-input-put.md) [/actor-tasks/{actorTaskId}/input](https://docs.apify.com/api/v2/actor-task-input-put.md) ## [Get list of webhooks](https://docs.apify.com/api/v2/actor-task-webhooks-get.md) [/actor-tasks/{actorTaskId}/webhooks](https://docs.apify.com/api/v2/actor-task-webhooks-get.md) ## [Get list of task runs](https://docs.apify.com/api/v2/actor-task-runs-get.md) [/actor-tasks/{actorTaskId}/runs](https://docs.apify.com/api/v2/actor-task-runs-get.md) ## [Run task](https://docs.apify.com/api/v2/actor-task-runs-post.md) [/actor-tasks/{actorTaskId}/runs](https://docs.apify.com/api/v2/actor-task-runs-post.md) ## [Run task synchronously](https://docs.apify.com/api/v2/actor-task-run-sync-get.md) [/actor-tasks/{actorTaskId}/run-sync](https://docs.apify.com/api/v2/actor-task-run-sync-get.md) ## [Run task synchronously](https://docs.apify.com/api/v2/actor-task-run-sync-post.md) [/actor-tasks/{actorTaskId}/run-sync](https://docs.apify.com/api/v2/actor-task-run-sync-post.md) ## [Run task synchronously and get dataset items](https://docs.apify.com/api/v2/actor-task-run-sync-get-dataset-items-get.md) [/actor-tasks/{actorTaskId}/run-sync-get-dataset-items](https://docs.apify.com/api/v2/actor-task-run-sync-get-dataset-items-get.md) ## [Run task synchronously and get dataset items](https://docs.apify.com/api/v2/actor-task-run-sync-get-dataset-items-post.md) [/actor-tasks/{actorTaskId}/run-sync-get-dataset-items](https://docs.apify.com/api/v2/actor-task-run-sync-get-dataset-items-post.md) ## [Get last run](https://docs.apify.com/api/v2/actor-task-runs-last-get.md) [/actor-tasks/{actorTaskId}/runs/last](https://docs.apify.com/api/v2/actor-task-runs-last-get.md) --- # Source: https://docs.apify.com/legal/actor-terms-and-conditions.md # Actor Terms and Conditions Effective date: January 12, 2026 *** These Actor Terms and Conditions ("**Actor Terms**") outline the specific provisions governing the use of Actors in connection with the Platform and related Services. They are hereby incorporated into the [Apify General Terms and Conditions](https://docs.apify.com/legal/general-terms-and-conditions.md) ("**General Terms**"). By accessing or using any Actors on the Platform, you acknowledge that you have read, understood, and agree to be bound by these Actor Terms, in addition to the General Terms. In the event of any conflict or inconsistency between these Actor Terms and the General Terms regarding the use of Actors, these Actor Terms shall prevail. ## 1. Definitions Any capitalized terms not otherwise defined in these Actor Terms shall have the meaning set forth in the General Terms. 1.1. "**Apify Maintained Actor**" refers to a public Actor developed and/or maintained, and directly supported by Apify and labeled as "Maintained by Apify" in Apify Store. 1.2. "**Community Actor**" refers to a public Actor (other than an Apify Maintained Actor) developed by any User and made available by such User in Apify Store. 1.3. "**Actor Developer**" refers to a User who creates an Actor through the Platform. 1.4. "**Actor Input**" is any data, input, or parameters provided by you when using an Actor. 1.5. "**Actor Output**" is any intermediate or final data generated during an Actor’s execution, or any data stored by an Actor to Apify or third-party data storage. ## 2. Your Rights and Obligations 2.1. Your use of Actors consumes your prepaid usage and resources, as billed to you according to Apify's pricing as outlined in the Agreement. 2.2. You may use Actors solely for legitimate purposes consistent with their intended functionality and in accordance with these Actor Terms, General Terms (including Apify Acceptable Use Policy), and the respective terms published by the Actor Developer(s) and all applicable laws and regulations. ## 3. Actor Intellectual Property Rights 3.1. Actor Developer reserves all rights, title, and interest, including all Intellectual Property rights in and to their Actor(s). 3.2. You retain all intellectual property rights in your Actor Inputs and Actor Outputs. However, you grant Actor Developer a non-exclusive, worldwide, royalty-free license to process your Actor Inputs and Actor Outputs as necessary to provide the Actor’s functionality to you. ## 4. Actor Privacy 4.1. Subject to your permissions levels setting in your Account, you authorize us to share your Account information and Customer Data relating to the specific Actor with the Actor Developer. You acknowledge that Actor Developers shall not be considered our Subprocessors as defined in the [Apify Data Processing Addendum](https://docs.apify.com/legal/data-processing-addendum.md). 4.2. For Community Actors, you should also review any privacy policies or data handling practices provided by the respective Actor Developer, as they may have direct access to or control over the Actor Inputs and Actor Outputs processed by their Actors. 4.3. Unless the parties agree otherwise, all Actors are intended for the processing of non-confidential, non-proprietary information. Any Actor Outputs retrieved by you and processed through the Platform are considered Customer Data. ## 5. Disclaimer of Warranties 5.1. All Actors are provided “AS IS” and “AS AVAILABLE”. Your use of any Actor is at your sole risk. Apify expressly disclaims all warranties of any kind, whether express or implied, including, but not limited to, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement. Apify makes no warranty that (i) any Actor will meet your requirements; (ii) any Actor’s operation will be uninterrupted, timely, secure, or error-free; (iii) Actor Outputs will be accurate or reliable; or (iv) the quality of any Actor will meet your expectations. ## 6. Liability Limitation 6.1. IN NO EVENT SHALL APIFY BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR EXEMPLARY DAMAGES, INCLUDING BUT NOT LIMITED TO, DAMAGES FOR LOSS OF PROFITS, GOODWILL, USE, DATA, OR OTHER INTANGIBLE LOSSES (EVEN IF APIFY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES), RESULTING FROM: (i) THE USE OR THE INABILITY TO USE ANY ACTOR; (ii) THE COST OF PROCUREMENT OF SUBSTITUTE GOODS AND SERVICES RESULTING FROM ANY GOODS, DATA, INFORMATION, OR SERVICES PURCHASED OR OBTAINED OR MESSAGES RECEIVED OR TRANSACTIONS ENTERED INTO THROUGH OR FROM ANY ACTOR; (iii) UNAUTHORIZED ACCESS TO OR ALTERATION OF YOUR TRANSMISSIONS OR ACTOR INPUTS AND ACTOR OUTPUTS. THIS LIMITATION OF LIABILITY IS FURTHER SUBJECT TO THE LIMITATIONS OUTLINED IN THE GENERAL TERMS. ## 7. Indemnification 7.1. You agree to indemnify and hold Apify, its affiliates, officers, agents, employees, and partners harmless from any claim or demand, including reasonable attorneys' fees, made by any third party due to or arising out of your use of any Actor, your connection of the Actor to the Service, your violation of these Actor Terms, or your violation of any third-party’s rights. ## 8. Apify Maintained Actors 8.1. **License Grant**. We hereby grant you a worldwide, non-exclusive, non-assignable, non-transferable, and revocable license for the duration of the Agreement to use the Apify Maintained Actor(s) in the scope and manner compliant with the Agreement and our technical documentation. Under the license, you may not (i) modify, alter, process, reverse-engineer, or otherwise interfere with the Apify Maintained Actors, any of its parts, including in particular any source codes; (ii) reproduce, share, or distribute the Apify Maintained Actor(s) except for open source software subject to any opensource license approved by the Open Source Initiative ("**OSS**") components; (iii) create derivative or analogous works, copies of the Apify Maintained Actors, or any part thereof; (iv) sublicense, transfer, or assign any rights or obligations under the license, in whole or in part, to third parties. 8.2. **Limited Warranty**. We warrant that Apify Maintained Actors will perform substantially in accordance with their official description. Your sole and exclusive remedy for any breach of this warranty is that we will use commercially reasonable efforts to correct the non-conforming Apify Maintained Actor. 8.3. **Updates**. We may release updates, new versions, or discontinue Apify Maintained Actors at our sole discretion. We will endeavor to provide reasonable notice for any significant changes or deprecations. Use of AI Features. Some Apify Maintained Actors may provide AI features that utilize third-party AI companies’ technology ("**Third-Party AI Provider**"). You acknowledge that other users may submit information or materials to Apify Maintained Actors that generate results that are identical or similar to your Actor Outputs ("**Third-Party Results**"). You acknowledge that you have no right, title, or interest in or to any Third-Party Results. You permit Third Party AI Provider to use the Actor Input to deliver the Actor Output and comply with applicable laws. We contractually restrict Third Party AI Providers from using Actor Inputs for training or otherwise improving Third Party AI Providers’ services. ## 9. Community Actors 9.1. Community Actors are developed by Users and are made available on Apify Store without any verification or guarantees from Apify. Specifically, we do not guarantee security, accuracy, or legal compliance of the Community Actors. 9.2. Apify does not review, vet, endorse, or monitor the Community Actors for quality, security, or compliance. Actor Developers are solely responsible for their Community Actors. They have no obligation to maintain, update, or provide support for their Community Actors, unless explicitly stated by the Actor Developer themselves. 9.3. You are solely responsible for conducting your own due diligence on the Community Actor’s code (if available), reputation, and functionality before use. We do not assume any risks associated with using Community Actors, including, but not limited to, risks of data loss, privacy breaches, security vulnerabilities, inaccurate results, operational failures, and non-compliance with applicable laws. 9.4. You acknowledge that the Actor Developer will have access to and control over any Actor Inputs you provide. Apify has no control over or responsibility for how Actor Developers of Community Actors handle or secure Actor Inputs or Actor Outputs. 9.5. While Apify does not monitor Community Actors, you may report malicious or severely problematic Community Actors to Apify. Apify reserves the right to review such reports and may, at its sole discretion, remove the reported Community Actor or disable access to it without notice or explicit justification. ## 10. General Apify reserves the right to update these Actor Terms periodically. The most current version, dated accordingly, will be posted at [https://docs.apify.com/legal/actor-terms-and-conditions](https://docs.apify.com/legal/actor-terms-and-conditions). Changes become effective upon posting unless a later effective date is specified. For material revisions, Apify may notify you via the Platform or email. Your continued use of the Actors after such updates constitutes your acceptance of the revised Actor Terms. --- # Source: https://docs.apify.com/academy/build-and-publish/actor-ideas/actor-validation.md # Validate your Actor idea Before investing time into building an Actor, validate that people actually need it. This guide shows you how to assess market demand using free tools and research techniques. [YouTube video player](https://www.youtube.com/embed/00PA7a548W0) ## Assess your motivation Ask yourself: *Do you want to build this?* You'll work on this Actor for a long time. The best Actors come from developers who genuinely care about the problem they're solving. You don't need to be obsessed, but you should feel excited. That enthusiasm carries you through challenges and shows in your work. ## Estimate demand with SEO data Check if people are searching for solutions like yours. If your idea aligns with popular search queries, you have a built-in user base. ### Keyword demand Search for terms related to your Actor's function. If you're building a Reddit sentiment analysis scraper, check volume for phrases like *Reddit data extractor* or *analyze Reddit comments tool*. Use free tools: * [Google Keyword Planner](https://business.google.com/en-all/ad-tools/keyword-planner/) * [Whatsmyserp](https://chromewebstore.google.com/detail/whatsmyserp/chbmoagfhnkggnhbjpoonnmhnpjdjdod) Chrome extension * [Keywords Everywhere](https://keywordseverywhere.com/) (paid) High search volume or multiple related terms indicate solid demand. Low or zero searches mean a very niche market, which isn't bad, but you'll rely more on direct marketing. ### Google autocomplete and related searches Type your core keywords into Google and note the suggestions. Typing *scrape Amazon* might show *scrape Amazon reviews* or *Amazon price tracker*, confirming what people actually want. ### SEO difficulty and content gaps Examine current search results. Few quality results for a query like *download data from \[obscure site]* indicates a content gap your Actor can fill. Many results or ads for *Instagram scraper* means the market is proven but competitive. You'll need to differentiate. Check keyword difficulty and domain authority. If difficulty is 70+ and top pages have 80+ domain authority with thousands of backlinks—and Apify already has an official Actor with 100,000+ users—you can't compete directly. Find an adjacent angle or specialization. ## Analyze Google Trends Google Trends shows if interest in your idea is rising or falling. Declining trends are red flags. If searches dropped 90% over 12+ months (like *Clubhouse scraper* since 2021), that market has moved on. Growth velocity matters more than current volume. A keyword growing from 10 to 100 monthly searches over 12 months shows exploding demand. Jump in early, before competition heats up. Watch for spikes. Sudden jumps from media coverage or viral moments usually don't mean sustainable demand. ## Research community discussions Beyond SEO data, go where your potential users are. Browse Reddit, Hacker News, Stack Overflow, X (Twitter), Discord, and Facebook groups. What problems are people discussing? What tools do they wish existed? Document your findings. Note quotes and recurring themes like *Multiple marketers on Reddit want easy competitor pricing tracking—no existing solution mentioned*. These insights complement your SEO data and help you speak your users' language. Zero discussion across multiple platforms over 4+ weeks means either no one cares about the problem or they've already solved it. ### Reddit Search relevant subreddits (r/webscraping, r/datascience, r/SEO, r/marketing, or industry-specific ones) for questions like *How can I extract \[data] from \[site]?* or *I wish there was a tool to do X*. Multiple people independently asking for the same solution is strong validation. Use the `site:` parameter in Google to search for relevant threads: ``` site:reddit.com extracting data from LinkedIn ``` You can also use tools like [F5Bot](https://f5bot.com/) or [GummySearch](https://gummysearch.com/). ### Q\&A forums and Stack Overflow Look for questions about doing the task manually. If thinking about a LinkedIn scraper, check Stack Overflow for questions like *How can I scrape LinkedIn profiles?* Frequent questions or upvotes indicate many people trying to solve it without a good tool—an opportunity for your Actor. Use the `site:` parameter: ``` site:stackoverflow.com extracting data from LinkedIn ``` ### X and social media Search keywords on X, LinkedIn, or other social media for professionals asking for recommendations like *Does anyone know a tool to monitor news about \[topic]?* Run quick polls or ask your followers if they'd use a tool that does XYZ. A few positive responses validate your idea. Silence means rethink your value proposition. Engaging this way is early marketing. Use the `site:` parameter: ``` site:x.com extracting data from LinkedIn ``` ### Hacker News and niche forums Platforms like [Hacker News](https://news.ycombinator.com/) often have discussions on tech pain points and new tool launches. Search for keywords like *scrape Airbnb data* to see if people have shown interest or if someone launched a similar tool and what the reaction was. Use the `site:` parameter: ``` site:news.ycombinator.com extracting data from LinkedIn ``` Look for spending signals Current spending patterns are the strongest signal. When users mention "currently paying $X/month for \[existing tool] but..." or "upgraded from free to paid plan because..." or specific competitor pricing, they are proven buyers. You can also engage in communities. Answer related questions, share knowledge, build reputation. Mention your Actor idea casually where relevant: "I'm building a tool to solve exactly this, would you use it?" Track responses. Positive responses with questions about pricing or features mean genuine interest. ## Analyze GitHub repositories Star counts signal market demand. [Scrapy](https://github.com/scrapy/scrapy) has 58,000+, [Crawlee](https://github.com/apify/crawlee) has 20,000+, web scraping is validated. Use the [Star History tool](https://www.star-history.com/) to check if stars are rising (growing momentum) or flat. Issue analysis reveals pain points your Actor could solve. High issue counts with active responses indicate healthy, used projects. Open issues with themes like *JavaScript rendering problems* or *CAPTCHA bypass needed* show gaps you can fill. Issues with 10+ upvotes mean multiple users face the same problem. Fork and commit activity shows developers actively work with the technology. High fork-to-star ratios mean people are building extensions (evidence of real usage). Recent commits (within 30 days) indicate active maintenance and a healthy project. No commits for 6+ months suggests declining interest. ## Review Product Hunt launches Study successful automation tool launches from the past 12-24 months on Product Hunt. Filter by *Browser Automation* and *Automation tools*, then sort by upvotes. Note which taglines, value propositions, and features resonated. Products with 500+ upvotes validated something—figure out what worked. ## Research Apify Store Apify Store shows transparent competitive intelligence most marketplaces hide. Every Actor displays monthly users, ratings, pricing, and last updates, a data goldmine for what works and what doesn't. Search your use case or segment thoroughly. List relevant Actors with their metrics: monthly users, ratings, pricing, last update, and creator. Create a feature comparison matrix. Analyze top performers' READMEs, documentation quality, and issues. Review competitor issues tabs closely. High-quality READMEs with examples and clear value propositions perform better in Store search. Issues reveal unresolved pain points from actual users. If competitors have 20+ open issues with repeated themes, that's your differentiation roadmap. ### Assess market saturation * 10-30 Actors: healthy competition (market validated, you need differentiation) * 50+ Actors: saturated (need obvious gaps) * 1-5 Actors: blue ocean or unproven demand (validate carefully) If the market has 50+ Actors with strong leaders (Apify-maintained with 50,000+ users) and you can't articulate clear differentiation, pivot. If you spot feature gaps or underserved niches, continue. ## Scan the broader market Do a general Google search for tools or services that solve your problem. Your competition might not be another Actor—it could be a SaaS tool or API. If your idea is *monitor website uptime and screenshot changes*, established services probably exist. Note direct competitors: How do they price it? What audience do they target? Are users satisfied or complaining? This validates that people pay for the service and reveals gaps you can fill. Understanding the competition helps you refine your unique value—whether that's lower cost, better features, or targeting an underserved niche. No existing solutions? Ask why. You might have found an untapped need, or it's a red flag (too difficult to implement, or the target website aggressively blocks scraping). Use your judgment. ## Get feedback from potential users Reach out to people who match your target user profile. Building a real estate data Actor? Contact real estate analysts or agents (LinkedIn works well) and ask if a tool that does X would help them. Keep it informal—describe the problem you're solving and ask if they'd use or pay for it. Direct feedback helps you: * Validate your assumptions * Understand pricing expectations * Identify must-have features * Refine your value proposition Track responses carefully. Enthusiasm with specific questions about features or pricing indicates genuine interest. Generic "sounds interesting" responses mean keep validating. --- # Source: https://docs.apify.com/academy/actorization.md # Wrap open-source as an Actor Apify is a cloud platform with a [marketplace](https://apify.com/store) of 6,000+ web scraping and automation tools called *Actors*. These tools are used for extracting data from social media, search engines, maps, e-commerce sites, travel portals, and general websites. Most Actors are developed by a global creator community, and some are developed by Apify. We have 18k monthly active users/developers on the platform (growing 138% YoY). Last month, we paid out $170k to creators (growing 118% YoY), and in total, over the program's history, we paid out almost $2M to them. ## What are Actors Under the hood, Actors are programs packaged as Docker images, that accept a well-defined JSON input, perform an action, and optionally produce a well-defined JSON output. This makes it easy to auto-generate user interfaces for Actors and integrate them with one another or with external systems. For example, we have user-friendly integrations with Zapier, Make, LangChain, MCP, OpenAPI, and SDKs for TypeScript/Python, CLI, etc. etc. Actors are a new way to build reusable serverless micro-apps that are easy to develop, share, integrate, and build upon—and, importantly, monetize. While Actors are our invention, we’re in the process of making them an open standard. Learn more at [https://whitepaper.actor](https://whitepaper.actor/). While most Actors on our marketplace are web scrapers or crawlers, there are ever more Actors for other use cases including data processing, web automation, API backend, or [AI agents](https://apify.com/store/categories/agents). In fact, any piece of software that accepts input, performs a job, and can run in Docker, can be *Actorized* simply by adding an `.actor` directory to it with a couple of JSON files. ## Why Actorize By publishing your service or project at [Apify Store](https://apify.com/store) your project will benefit from: 1. *Expanded reach*: Your tool instantly becomes available to Apify's user community and connects with popular automation platforms like [Make](https://www.make.com), [n8n](https://n8n.io/), and [Zapier](https://zapier.com/). 2. *Multiple monetization paths*: Choose from flexible pricing models (monthly subscriptions, pay-per-result, or pay-per-event). 3. *AI integration*: Your Actor can serve as a tool for AI agents through Apify's MCP (Model Context Protocol) server, creating new use cases and opportunities while you earn 80% of all revenues. Open-Source Benefits For open-source developers, Actorization adds value without extra costs: * Host your code in the cloud for easy user trials (no local installs needed). * Avoid managing cloud infrastructure—users cover the costs. * Earn income through [Apify’s Open Source Fair Share program](https://apify.com/partners/open-source-fair-share) via GitHub Sponsors or direct payouts. * Publish and monetize 10x faster than building a micro-SaaS, with Apify handling infra, billing, and access to 700,000+ monthly visitors and 70,000 signups. For example, IBM’s [Docling project](https://github.com/docling-project/docling) merged our pull request that actorized their open-source GitHub repo (24k stars) and added the Apify Actor badge to the README: ![Docling Apify badge](/assets/images/docling-apify-badge-3b6ad8beefffa23d0ffcc9bc92d593bb.png) ### Example Actorized projects You can Actorize various projects ranging from open-source libraries, throughout existing SaaS services, up to MCP server: | Name | Type | Source | Actor | | --------------- | ---------------------- | ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- | | Parsera | SaaS service | [https://parsera.org/](https://parsera.org/) | [https://apify.com/parsera-labs/parsera](https://apify.com/parsera-labs/parsera) | | Monolith | Open source library | [https://github.com/Y2Z/monolith](https://github.com/Y2Z/monolith) | [https://apify.com/snshn/monolith](https://apify.com/snshn/monolith) | | Crawl4AI | Open source library | [https://github.com/unclecode/crawl4ai](https://github.com/unclecode/crawl4ai) | [https://apify.com/janbuchar/crawl4ai](https://apify.com/janbuchar/crawl4ai) | | Docling | Open source library | [https://github.com/docling-project/docling](https://github.com/docling-project/docling) | [https://apify.com/vancura/docling/source-code](https://apify.com/vancura/docling/source-code) | | Playwright MCP | Open source MCP server | [https://github.com/microsoft/playwright-mcp](https://github.com/microsoft/playwright-mcp) | [https://apify.com/jiri.spilka/playwright-mcp-server](https://apify.com/jiri.spilka/playwright-mcp-server) | | Browserbase MCP | SaaS MCP server | [https://www.browserbase.com/](https://www.browserbase.com/) | [https://apify.com/agentify/browserbase-mcp-server/api/mcp](https://apify.com/agentify/browserbase-mcp-server/api/mcp) | ### What projects are suitable for Actorization Use these criteria to decide if your project is a good candidate for Actorization: 1. *Is it self-contained?* Does the project work non-interactively, with a well-defined, preferably structured input and output format? Positive examples include various data processing utilities, web scrapers and other automation scripts. Negative examples are GUI applications or applications that run indefinitely. If you want to run HTTP APIs on Apify, you can do so using [Actor Standby](https://docs.apify.com/platform/actors/development/programming-interface/standby.md). 2. *Can the state be stored in Apify storages?* If the application has state that can be stored in a small number of files it can utilize [key-value store](https://docs.apify.com/platform/storage/key-value-store.md), or if it processes records that can be stored in Apify’s [request queue](https://docs.apify.com/platform/storage/request-queue.md). If the output consists of one or many similar JSON objects, it can utilize [dataset](https://docs.apify.com/platform/storage/dataset.md). 3. *Can it be containerized?* The project needs to be able to run in a Docker container. Apify currently does not support GPU workloads. External services (e.g., databases) need to be managed by developer. 4. *Can it use Apify tooling?* Javascript/Typescript applications and Python applications can be Actorized with the help of the [Apify SDK](https://docs.apify.com/sdk.md), which makes easy for your code to interacts with the Apify platform. Applications that can be run using just the CLI can also be Actorized using the Apify CLI by writing a simple shell script that retrieves user input using [Apify CLI](https://docs.apify.com/cli), then runs your application and sends the results back to Apify (also using the CLI). If your application is implemented differently, you can still call the [Apify API](https://docs.apify.com/api/v2.md) directly - it’s just HTTP and pretty much every language has support for that but the implementation is less straightforward. ## Actorization guide This guide outlines the steps to convert your application into an Apify [Actor](https://docs.apify.com/platform/actors.md). Follow the documentation links for detailed information - this guide provides an overview rather than exhaustive instructions. ### 1. Add Actor metadata - the `.actor` folder The Apify platform requires your Actor repository to have a `.actor` folder at the root level, which contains the metadata needed to build and run the Actor. For existing projects, you can add the `.actor` folder using the [apify init CLI command](https://docs.apify.com/cli/docs/reference#apify-init-actorname). In case you're starting a new project, we strongly advise to start with a [template](https://apify.com/templates) using the [apify create CLI command](https://docs.apify.com/cli/docs/reference#apify-create-actorname) based on your usecase * [TypeScript template](https://apify.com/templates/ts-empty) * [Python template](https://apify.com/templates/python-empty) * [CLI template](https://apify.com/templates/cli-start) * [MCP server template](https://apify.com/templates/python-mcp-server) * … and many others, check out for comprehensive list [https://apify.com/templates](https://apify.com/templates) Quick Start for beginners For a step-by-step introduction to creating your first Actor (including tech stack choices and development paths), see [Quick Start](https://docs.apify.com/platform/actors/development/quick-start.md). The newly created `.actor` folder contains an `actor.json` file - a manifest of the Actor. See [documentation](https://docs.apify.com/platform/actors/development/actor-definition/actor-json.md) for more details You must also make sure your Actor has a Dockerfile and that it installs everything needed to successfully run your application. Check out [Dockerfile documentation](https://docs.apify.com/platform/actors/development/actor-definition/dockerfile.md) by Apify. If you don't want to use these, you are free to use any image as the base of your Actor. When launching the Actor, the Apify platform will simply run your Docker image. This means that a) you need to configure the `ENTRYPOINT` and `CMD` directives so that it launches your application and b) you can test your image locally using Docker. These steps are the bare minimum you need to run your code on Apify. The rest of the guide will help you flesh it out better. ### 2. Define input and output Most Actors accept an input and produce an output. As part of Actorization, you need to define the input and output structure of your application. For detailed information, read the docs for [input schema](https://docs.apify.com/platform/actors/development/actor-definition/input-schema.md), [dataset schema](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema.md), and general [storage](https://docs.apify.com/platform/storage.md). #### Design guidelines 1. If your application has some arguments or options, those should be part of the input defined by input schema. 2. If there is a configuration file or if your application is configured with environment variables, those should also be part of the input. Ideally, nested structures should be “unpacked”, i.e., try not to accept deeply nested structures in your input. Start with less input options and expand later. 3. If the output is a single file, you’ll probably want your Actor to output a single dataset item that contains a public URL to the output file stored in the Apify key-value store 4. If the output has a table-like structure or a series of JSON-serializable objects, you should output each row or object as a separate dataset item 5. If the output is a single key-value record, your Actor should return a single dataset item ### 3. Handle state persistence (optional) If your application performs a number of well-defined subtasks, the [request queue](https://docs.apify.com/platform/storage/request-queue.md) lets you pause and resume execution on job restart. This is important for long-running jobs that might be migrated between servers at some point. In addition, this allows the Apify platform to display the progress to your users in the UI. A lightweight alternative to the request queue is simply storing the state of your application as a JSON object in the key-value store and checking for that when your Actor is starting. Fully-fledged Actors will often combine these two approaches for maximum reliability. More on this topic you find in the [state persistence](https://docs.apify.com/platform/actors/development/builds-and-runs/state-persistence.md) article. ### 4. Write Actorization code Perhaps the most important part of the Actorization process is writing the code that will be executed when the Apify platform launches your Actor. Unless you’re writing an application targeted directly on the Apify platform, this will have the form of a script that calls your code and integrates it with the Apify Storages Apify provides SDKs for [Javascript](https://docs.apify.com/sdk/js) and [Python](https://docs.apify.com/sdk/python) plus a [Apify CLI](https://docs.apify.com/cli) allowing an easy interaction with Apify platform from command line. Check out [programming interface](https://docs.apify.com/platform/actors/development/programming-interface.md) documentation article for details on interacting with the Apify platform in your Actor's code. ### 5. Deploy the Actor Deployment to Apify platform can be done easily via `apify push` command of [Apify CLI](https://docs.apify.com/cli) and for details see [deployment](https://docs.apify.com/platform/actors/development/deployment.md) documentation. ### 6. Publish and monetize For details on publishing the Actor in [Apify Store](https://apify.com/store) see the [Publishing and monetization](https://docs.apify.com/platform/actors/publishing.md). You can also follow our guide on [How to create an Actor README](https://docs.apify.com/academy/actor-marketing-playbook/actor-basics/how-to-create-an-actor-readme.md) and [Marketing checklist](https://docs.apify.com/academy/actor-marketing-playbook/promote-your-actor/checklist.md). --- # Source: https://docs.apify.com/api/v2/actors-actor-builds.md # Actor builds - Introduction The API endpoints in this section allow you to manage your Apify Actors builds. ## [Get list of builds](https://docs.apify.com/api/v2/act-builds-get.md) [/acts/{actorId}/builds](https://docs.apify.com/api/v2/act-builds-get.md) ## [Build Actor](https://docs.apify.com/api/v2/act-builds-post.md) [/acts/{actorId}/builds](https://docs.apify.com/api/v2/act-builds-post.md) ## [Get default build](https://docs.apify.com/api/v2/act-build-default-get.md) [/acts/{actorId}/builds/default](https://docs.apify.com/api/v2/act-build-default-get.md) ## [Get OpenAPI definition](https://docs.apify.com/api/v2/act-openapi-json-get.md) [/acts/{actorId}/builds/{buildId}/openapi.json](https://docs.apify.com/api/v2/act-openapi-json-get.md) ## [Get build](https://docs.apify.com/api/v2/act-build-get.md) [/acts/{actorId}/builds/{buildId}](https://docs.apify.com/api/v2/act-build-get.md) ## [Abort build](https://docs.apify.com/api/v2/act-build-abort-post.md) [/acts/{actorId}/builds/{buildId}/abort](https://docs.apify.com/api/v2/act-build-abort-post.md) --- # Source: https://docs.apify.com/api/v2/actors-actor-runs.md # Actor runs - Introduction The API endpoints in this section allow you to manage your Apify Actors runs. Some API endpoints return run objects. If a run object includes usage costs in dollars, note that these values are calculated based on your effective unit pricing at the time of the query. As a result, the dollar amounts should be treated as informational only and not as exact figures. For more information about platform usage and resource calculations, see the [Usage and Resources documentation](https://docs.apify.com/platform/actors/running/usage-and-resources#usage). ## [Get list of runs](https://docs.apify.com/api/v2/act-runs-get.md) [/acts/{actorId}/runs](https://docs.apify.com/api/v2/act-runs-get.md) ## [Run Actor](https://docs.apify.com/api/v2/act-runs-post.md) [/acts/{actorId}/runs](https://docs.apify.com/api/v2/act-runs-post.md) ## [Run Actor synchronously with input and return output](https://docs.apify.com/api/v2/act-run-sync-post.md) [/acts/{actorId}/run-sync](https://docs.apify.com/api/v2/act-run-sync-post.md) ## [Without input](https://docs.apify.com/api/v2/act-run-sync-get.md) [/acts/{actorId}/run-sync](https://docs.apify.com/api/v2/act-run-sync-get.md) ## [Run Actor synchronously with input and get dataset items](https://docs.apify.com/api/v2/act-run-sync-get-dataset-items-post.md) [/acts/{actorId}/run-sync-get-dataset-items](https://docs.apify.com/api/v2/act-run-sync-get-dataset-items-post.md) ## [Run Actor synchronously without input and get dataset items](https://docs.apify.com/api/v2/act-run-sync-get-dataset-items-get.md) [/acts/{actorId}/run-sync-get-dataset-items](https://docs.apify.com/api/v2/act-run-sync-get-dataset-items-get.md) ## [Resurrect run](https://docs.apify.com/api/v2/act-run-resurrect-post.md) [/acts/{actorId}/runs/{runId}/resurrect](https://docs.apify.com/api/v2/act-run-resurrect-post.md) ## [Get last run](https://docs.apify.com/api/v2/act-runs-last-get.md) [/acts/{actorId}/runs/last](https://docs.apify.com/api/v2/act-runs-last-get.md) ## [Get run](https://docs.apify.com/api/v2/act-run-get.md) [/acts/{actorId}/runs/{runId}](https://docs.apify.com/api/v2/act-run-get.md) ## [Abort run](https://docs.apify.com/api/v2/act-run-abort-post.md) [/acts/{actorId}/runs/{runId}/abort](https://docs.apify.com/api/v2/act-run-abort-post.md) ## [Metamorph run](https://docs.apify.com/api/v2/act-run-metamorph-post.md) [/acts/{actorId}/runs/{runId}/metamorph](https://docs.apify.com/api/v2/act-run-metamorph-post.md) --- # Source: https://docs.apify.com/api/v2/actors-actor-versions.md # Actor versions - Introduction The API endpoints in this section allow you to manage your Apify Actors versions. * The version object contains the source code of a specific version of an Actor. * The `sourceType` property indicates where the source code is hosted, and based on its value the Version object has the following additional property: | **Value** | **Description** | | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `"SOURCE_FILES"` | Source code is comprised of multiple files specified in the `sourceFiles` array. Each item of the array is an object with the following fields:
- `name`: File path and name
- `format`: Format of the content, can be either `"TEXT"` or `"BASE64"`
- `content`: File content

Source files can be shown and edited in the Apify Console's Web IDE. | | `"GIT_REPO"` | Source code is cloned from a Git repository, whose URL is specified in the `gitRepoUrl` field. | | `"TARBALL"` | Source code is downloaded using a tarball or Zip file from a URL specified in the `tarballUrl` field. | | `"GITHUB_GIST"` | Source code is taken from a GitHub Gist, whose URL is specified in the `gitHubGistUrl` field. | For more information about source code and Actor versions, check out [Source code](https://docs.apify.com/platform/actors/development/actor-definition/source-code) in Actors documentation. ## [Get list of versions](https://docs.apify.com/api/v2/act-versions-get.md) [/acts/{actorId}/versions](https://docs.apify.com/api/v2/act-versions-get.md) ## [Create version](https://docs.apify.com/api/v2/act-versions-post.md) [/acts/{actorId}/versions](https://docs.apify.com/api/v2/act-versions-post.md) ## [Get version](https://docs.apify.com/api/v2/act-version-get.md) [/acts/{actorId}/versions/{versionNumber}](https://docs.apify.com/api/v2/act-version-get.md) ## [Update version](https://docs.apify.com/api/v2/act-version-put.md) [/acts/{actorId}/versions/{versionNumber}](https://docs.apify.com/api/v2/act-version-put.md) ## [Delete version](https://docs.apify.com/api/v2/act-version-delete.md) [/acts/{actorId}/versions/{versionNumber}](https://docs.apify.com/api/v2/act-version-delete.md) ## [Get list of environment variables](https://docs.apify.com/api/v2/act-version-env-vars-get.md) [/acts/{actorId}/versions/{versionNumber}/env-vars](https://docs.apify.com/api/v2/act-version-env-vars-get.md) ## [Create environment variable](https://docs.apify.com/api/v2/act-version-env-vars-post.md) [/acts/{actorId}/versions/{versionNumber}/env-vars](https://docs.apify.com/api/v2/act-version-env-vars-post.md) ## [Get environment variable](https://docs.apify.com/api/v2/act-version-env-var-get.md) [/acts/{actorId}/versions/{versionNumber}/env-vars/{envVarName}](https://docs.apify.com/api/v2/act-version-env-var-get.md) ## [Update environment variable](https://docs.apify.com/api/v2/act-version-env-var-put.md) [/acts/{actorId}/versions/{versionNumber}/env-vars/{envVarName}](https://docs.apify.com/api/v2/act-version-env-var-put.md) ## [Delete environment variable](https://docs.apify.com/api/v2/act-version-env-var-delete.md) [/acts/{actorId}/versions/{versionNumber}/env-vars/{envVarName}](https://docs.apify.com/api/v2/act-version-env-var-delete.md) --- # Source: https://docs.apify.com/academy/actor-marketing-playbook/actor-basics/actors-and-emojis.md # Actors and emojis Using emojis in Actors is a science on its own. Learn how emojis enhance the user experience in Actors by grabbing attention, simplifying navigation, and making information clearer. ## On the use of emojis in Actors We started using emojis in Actors for several reasons. First, tech today often uses emojis to make things look more user-friendly. Second, people don’t read as much as we’d like. You only have a few seconds to grab their attention, and text alone can feel overwhelming. Third, we don’t have many opportunities or space to explain things about Actors, and we want to avoid users needing to open extra tabs or pages. Clarity should come instantly, so we turned to emojis. When evaluating a new tool, those first 5 seconds are critical. That’s why we use emojis extensively with our Actors. They’re part of the Actor SEO title and description to help the tool stand out in Google search results, although Google doesn't always display them. In READMEs, they serve as shortcuts to different sections and help users quickly understand the type of data they’ll get. In complex input schemas, we rely on emojis to guide users and help them navigate the tool more efficiently. ## Emoji science Believe it or not, there’s a science to emoji usage. When we use emojis in Actors and related content, we tap into the brain's iconic and working memory. Iconic memory holds information for less than a second - this is unconscious processing, where attributes like color, size, and location are instantly recognized. This part is where emojis guide the person's attention in the sea of text. They signify that something important is here. Emojis help with that immediate first impression and create a sense of clarity. After that, the brain shifts to working memory, where it combines information into visual chunks. Since we can only hold about 3-4 chunks at once, emojis help reinforce key points, thus reducing cognitive load. Consistent emoji use across the Actor ecosystem ensures users can quickly connect information without getting overwhelmed. As an example of this whole process, first, the user notices the emojis used in the field titles (pre-attentive processing). They learn to associate the emojis with those titles (attentive processing). Later, when they encounter the same emojis in a README section, they’ll make the connection, making it easier to navigate without drowning in a sea of text. ## Caveats to emojis 1. Don't overuse them, and don’t rely on emojis for critical information. Emojis should support the text, not replace key explanations or instructions. They're a crutch for concise copywriting, not a universal solution. 2. Use them consistently. Choose one and stick with it across all content: descriptions, parts of input schema, mentions in README, blog posts, etc. 3. Some emojis have multiple meanings, so choose the safest one. It could be general internet knowledge or cultural differences, so make sure the ones you choose won’t confuse or offend users in other markets. 4. Some emojis don’t render well on Windows or older devices. Try to choose ones that display correctly on Mac, Windows, and mobile platforms. Besides, emoji-heavy content can be harder for screen readers and accessibility tools to interpret. Make sure the information is still clear without the emojis. 5. It's okay not to use them. --- # Source: https://docs.apify.com/platform/actors/running/actors-in-store.md # Actors in Store **[Apify Store](https://apify.com/store) is home to thousands of public Actors available to the Apify community. It's the easiest way for you to start with Apify.** *** Publishing and monetizing Actors Anyone is welcome to [publish Actors](https://docs.apify.com/platform/actors/publishing.md) in the store, and you can even [monetize your Actors](https://docs.apify.com/platform/actors/publishing/monetize.md). For more information about how to monetize your Actor, best practices, SEO, and promotion tips and tricks, head over to the [Marketing checklist](https://docs.apify.com/academy/actor-marketing-playbook/promote-your-actor/checklist.md) section of the Apify Developers Academy. ## Pricing models All Actors in [Apify Store](https://apify.com/store) fall into one of the four pricing models: 1. - to continue using the Actor after the trial period, you must rent the Actor from the developer and pay a flat monthly fee in addition to the costs associated with the platform usage that the Actor generates. 2. - you do not pay for platform usage the Actor generates and instead just pay for the results it produces. 3. - you can run the Actor and you do not pay for platform usage the Actor generates. Instead you pay for the specific events the Actor creator defines, such as for generating a single result or starting the Actor. 4. - you can run the Actor and you pay for the platform usage the Actor generates. ### Rental Actors Rental Actors are Actors for which you have to pay a recurring fee to the developer after your trial period ends. This empowers the developer to dedicate more time and effort to their Actors, thus ensuring they are of the *highest quality* and receive *ongoing maintenance*. ![Rental Actor example](/assets/images/rental-actor-example-3ad82ec435c67977703b598636eaa2c5.png) Most rental Actors have a *free trial* period. The length of the trial is displayed on each Actor's page. ![Rental Actors in Apify Store](/assets/images/rental-actor-trial-example-0ce81cb643d211da7b80975d191a1169.png) After a trial period, a flat monthly *Actor rental* fee is automatically subtracted from your prepaid platform usage in advance for the following month. Most of this fee goes directly to the developer and is paid on top of the platform usage generated by the Actor. You can read more about our motivation for releasing rental Actors in [this blog post](https://blog.apify.com/make-regular-passive-income-developing-web-automation-actors-b0392278d085/) from Apify's CEO Jan Čurn. #### Rental Actors - Frequently Asked Questions ##### Can I run rental Actors via API or the Apify client? Yes, when you are renting an Actor, you can run it using either our [API](https://docs.apify.com/api/v2.md), [JavaScript](https://docs.apify.com/api/client/js) or [Python](https://docs.apify.com/api/client/python) clients as you would do with private or free public Actors. ##### Do I pay platform costs for running rental Actors? Yes, you will pay normal [platform usage costs](https://apify.com/pricing) on top of the monthly Actor rental fee. The platform costs work exactly the same way as for free public Actors or your private Actors. You should find estimates of the cost of usage in each individual rental Actor's README ([see an example](https://apify.com/compass/crawler-google-places#how-much-will-it-cost)). ##### Do I need an Apify paid plan to use rental Actors? You don't need a paid plan to start a rental Actor's free trial. Just activate the trial, and you are good to go. After that, you will need to subscribe to one of [Apify's paid plans](https://apify.com/pricing) in order to keep renting the Actor and continue using it. ##### When will I be charged for the Actor rental? You always prepay the Actor rental for the following month. The first payment happens when the trial expires, and then recurs monthly. When you open the Actor in the Apify Console, you will see when the next rental payment is due, and you will also receive a notification when it happens. *Example*: You activate a 7-day trial of an Actor at *noon of April 1, 2021*. If you don't turn off auto-renewal, you will be charged at *noon on April 8, 2021*, then *May 8, 2021*. ##### How am I charged for Actor rental? The rental fee for an Actor is automatically subtracted from your prepaid platform usage, similarly to, e.g. [compute units](https://docs.apify.com/platform/actors/running/usage-and-resources.md). If you don't have enough usage prepaid, you will need to cover any overage in the next invoice. ##### Will I be automatically charged at the end of the free trial? If you have an [Apify paid plan](https://apify.com/pricing), the monthly rental fee will be automatically subtracted from your plan's prepaid usage at the end of your free trial, and you will be able to run the Actor for another month. If you are not subscribed to any of [Apify's paid plans](https://apify.com/pricing), you will need to subscribe to one in order to continue using the Actor after the trial has ended. ##### Can I cancel my Actor rental? *You can cancel the Actor rental* during your trial or any time after that so you don't get charged when your current Actor rental period expires. You can always turn it back on later if you want. ##### Where can I see how much I have paid for Actor rental? Since Actor rental fees are paid from prepaid platform usage, these fees conceptually belong under platform usage. You can find the breakdown of how much you have been charged for rental Actors in the **Actors** tab, which you will find within the **Current period** tab in the [Billing](https://console.apify.com/billing) section. ![Rental Actors billing in Apify Console](/assets/images/billing-paid-actors-333edff195608ead302706f5401c94ca.png) ### Pay per result When you run an Actor that is *paid per result*, you pay for the successful results that an Actor returns when you run it, and you are not charged for the underlying platform usage. Estimation simplified This makes it transparent and easy to estimate upfront costs. If you have any feedback or would like to ask something, please join our [Discord](https://discord.gg/qkMS6pU4cF) community and let us know! #### Pay per result Actors - Frequently Asked Questions ##### How do I know an Actor is paid per result? When you try the Actor on the platform, you will see that the Actor is paid per result next to the Actor name. ![Actor paid per result in Console](/assets/images/console_pay_per_result_tag-b80c8c3f7b3d6cd738bb4adb6fc190c7.png) ##### Do I need to pay a monthly rental fee to run the Actor? No, the Actor is free to run. You only pay for the results. ##### What happens when I interact with the dataset after the run finishes? Under the **pay per result** model, all platform costs generated *during the run of an Actor* are not charged towards your account; you pay for the results instead. After the run finishes, any interactions with the default dataset storing the results, such as reading the results or writing additional data, will incur the standard platform usage costs. But do not worry, in the vast majority of cases, you only want to read the result from the dataset and that costs near to nothing. ##### Do I pay for the storage of results on the Apify platform? You will still be charged for the timed storage of the data in the same fashion as with any other Actor. You can always decide to delete the dataset to reduce your costs after you export the data from the platform. By default, any unnamed dataset will be automatically removed after your data retention period, so usually, this is nothing to worry about. ##### Can I set a cap on how many results an Actor should return? You can set a limit on how many items an Actor should return and the amount you will be charged in Options on the Actor detail page in the section below the Actor input. ![Max items for pay-per-result](/assets/images/max-items-for-pay-per-result-eb410b914957a2078cb787a13f16b186.png) ##### Can I publish an Actor that is paid per result? Yes, you can publish an Actor that is paid per result. ##### Where do I see how much I was charged for the pay per result Actors? You can see the overview of how much you have been charged for Actors paid by result on your invoices and in the [Usage tab](https://console.apify.com/billing) of the Billing section in Console. It will be shown there as a separate service. ![Statistics in the billing section](/assets/images/pay_per_result_billing_usage_section-b0a70147a64e4e06243be8ece25ca296.png) On the top of that, you can see how much you have been charged for a specific run in the detail of that run and also in the overview table showing all runs. ![Run cost shown on the run detail](/assets/images/pay_per_result_run_detail-fe4dadc512669d16bfb74a63c9112fb2.png) ![Run cost shown on the overview of all runs](/assets/images/pay_per_result_run_list-6b7b0f9ed43b1774242dbb01d021ffde.png) If you wish to see how much you have been charged for a particular Actor, you will find this information at the bottom of the [Usage tab](https://console.apify.com/billing). ![Actor pay-per-result cost](/assets/images/pay_per_result_actor_items-7f76640cf886d8d683517418a042a32e.png) ### Pay per event Pay per event Actor pricing model is very similar to the pay per result model. You still do not pay the underlying platform usage. Instead of results, you pay for specific events defined by the creator of the Actor. These events will vary between Actors, and will always be described, together with their pricing, on each Actor. Example events might be producing a single result, doing a unit piece of work (e.g. uploading a file) or starting an Actor. #### Pay per event Actors - Frequently Asked Questions #### How do I know Actor is paid per events? You will see that the Actor is paid per events next to the Actor name. ![Example pay per event Actor](/assets/images/pay_per_event_example_actor-548327b71a5877bd4e7324e517ade11c.png) #### Do I need to pay a monthly rental fee to run the Actor? No, you only pay for the events. #### What happens when I interact with the dataset after the run finishes? You would still pay for all interactions after the Actor run finishes, same as for pay per result Actors. #### Do I pay for the storage of results on the Apify platform? You would still pay for the long term storage of results, same as for pay per result Actors. #### Some Actors declare that I still need to pay for usage, how come? When an Actor operates in [Standby mode](https://docs.apify.com/platform/actors/running/standby), you control how the background runs scale and how efficiently they are utilized. In this case, you are responsible for paying the platform usage costs of these runs in addition to the event charges. Some selected Standby Actors may have this usage component waived, so always check the pricing page of the specific Actor to determine whether you will be charged for usage or only for events. #### Where do I see how much I was charged for the pay per result Actors? Similarly to pay per result Actors, you can see how much you have been charged on your invoices, and on the [Usage tab](https://console.apify.com/billing) of the Billing section in the Console. ![Pay per event Actor - historical usage tab](/assets/images/pay_per_event_historical_usage_tab-66fd1c0812dc70b5529a003f0003cd29.png) You can also see the cost of each run on the run detail itself. ![Pay per event Actor - run detail](/assets/images/pay_per_event_price_on_run_detail-9bc0644998cb9c66b60f1b5f5be18d75.png) #### Can I put a cap on a cost of a single Actor run? Yes, when starting an Actor run, you can define the maximum limit on the cost of that run. When the Actor reaches the defined limit, it should terminate gracefully. Even if it didn't, for any reason, and kept producing results, we make always sure you are never charged more that your defined limit. ![Pay per event Actor - max charge per run](/assets/images/pay_per_event_price_on_run_detail-9bc0644998cb9c66b60f1b5f5be18d75.png) #### How do I raise a dispute if the charges for an Actor seem off? Please, in such a case, do not hesitate to contact the Actor author or our support team. If you suspect a bug in the Actor, you can also always create an issue on the Actor detail in the Apify Console. ### Pay per usage When you use a pay per usage Actor, you are only charged for the platform usage that the runs of this Actor generate. [Platform usage](https://docs.apify.com/platform/actors/running/usage-and-resources.md) includes components such as compute units, operations on [storages](https://docs.apify.com/platform/storage.md), and usage of [residential proxies](https://docs.apify.com/platform/proxy/residential-proxy.md) or [SERPs](https://docs.apify.com/platform/proxy/google-serp-proxy.md). ![Pay for usage Actor example](/assets/images/pay-per-usage-actor-example-bb2556d588b1b57227d30bc7362f1e2e.png) Estimating Actor usage cost With this model, it's very easy to see how many platform resources each Actor run consumed, but it is quite difficult to estimate their usage beforehand. The best way to find the costs of free Actors upfront is to try out the Actor on a limited scope (for example, on a small number of pages) and evaluate the consumption. You can easily do that using our [free plan](https://apify.com/pricing). *For more information on platform usage cost see the [usage and resources](https://docs.apify.com/platform/actors/running/usage-and-resources.md) page.* ## Reporting issues with Actors Each Actor has an **Issues** tab in Apify Console. There, you can open an issue (ticket) and chat with the Actor's author, platform admins, and other users of this Actor. Please feel free to use the tab to ask any questions, request new features, or give feedback. Alternatively, you can always write to [community@apify.com](mailto:community@apify.com). ![Paid Actors\' issues tab](/assets/images/paid-actors-issues-tab-934e13f39d178b1c8b368944afa089e2.png) ## Apify Store discounts Each Apify subscription plan includes a discount tier (*BRONZE*, *SILVER*, *GOLD*) that provides access to increasingly lower prices on selected Actors. Discount participation Discount offers are optional and determined by Actor owners. Not all Actors participate in the discount program. Additional discounts are available for Enterprise customers. To check an Actor's pricing and available discounts, visit the Pricing section on the Actor's detail page in Apify Store. ![Apify Store discounts](/assets/images/apify_store_discounts_web-b62495f120b256aa2bb504623c61d4fb.png) In the Apify Console, you can find information about pricing and available discounts in the Actor's header section. ![Apify Store discounts](/assets/images/apify_store_discounts_console-6c53137e2ff29b82b236cdca97af0f6a.png) ![Apify Store discounts full table](/assets/images/apify_store_discounts_full_table-0cc75054fa93d3c85dfcacea2e5df250.png) --- # Source: https://docs.apify.com/api/v2/actors-webhook-collection.md # Webhook collection - Introduction The API endpoint in this section allows you to get a list of webhooks of a specific Actor. ## [Get list of webhooks](https://docs.apify.com/api/v2/act-webhooks-get.md) [/acts/{actorId}/webhooks](https://docs.apify.com/api/v2/act-webhooks-get.md) --- # Source: https://docs.apify.com/academy/expert-scraping-with-apify/actors-webhooks.md # Webhooks & advanced Actor overview **Learn more advanced details about Actors, how they work, and the default configurations they can take. Also, learn how to integrate your Actor with webhooks.** Updates coming This lesson is subject to change because it currently relies on code from our archived **Web scraping basics for JavaScript devs** course. For now you can still access the archived course, but we plan to completely retire it in a few months. This lesson will be updated to remove the dependency. *** Thus far, you've run Actors on the platform and written an Actor of your own, which you published to the platform yourself using the Apify CLI; therefore, it's fair to say that you are becoming more familiar and comfortable with the concept of **Actors**. Within this lesson, we'll take a more in-depth look at Actors and what they can do. ## Advanced Actor overview In this course, we'll be working out of the Amazon scraper project from the **Web scraping basics for JavaScript devs** course. If you haven't already built that project, you can do it in [three short lessons](https://docs.apify.com/academy/scraping-basics-javascript/legacy/challenge.md). We've made a few small modifications to the project with the Apify SDK, but 99% of the code is still the same. Take another look at the files within your Amazon scraper project. You'll notice that there is a **Dockerfile**. Every single Actor has a Dockerfile (the Actor's **Image**) which tells Docker how to spin up a container on the Apify platform which can successfully run the Actor's code. "Apify Actors" is a serverless platform that runs multiple Docker containers. For a deeper understanding of Actor Dockerfiles, refer to the [Apify Actor Dockerfile docs](https://docs.apify.com/sdk/js/docs/guides/docker-images#example-dockerfile). ## Webhooks Webhooks are a powerful tool that can be used for just about anything. You can set up actions to be taken when an Actor reaches a certain state (started, failed, succeeded, etc). These actions usually take the form of an API call (generally a POST request). ## Learning 🧠 Prior to moving forward, please read over these resources: * Read about [running Actors, handling Actor inputs, memory and CPU](https://docs.apify.com/platform/actors/running.md). * Learn about [Actor webhooks](https://docs.apify.com/platform/integrations/webhooks.md), which we will implement in the next lesson. * Learn [how to run Actors](https://docs.apify.com/academy/api/run-actor-and-retrieve-data-via-api.md) using Apify's REST API. ## Knowledge check 📝 1. How do you allocate more CPU for an Actor's run? 2. Within itself, can you get the exact time that an Actor was started? 3. What are the types of default storages connected to an Actor's run? 4. Can you change the allocated memory of an Actor while it's running? 5. How can you run an Actor with Puppeteer on the Apify platform with headless mode set to `false`? ## Our task In this task, we'll be building on top of what we already created in the [Web scraping basics for JavaScript devs](https://docs.apify.com/academy/scraping-basics-javascript/legacy/challenge.md) course's final challenge, so keep those files safe! Once our Amazon Actor has completed its run, we will, rather than sending an email to ourselves, call an Actor through a webhook. The Actor called will be a new Actor that we will create together, which will take the dataset ID as input, then subsequently filter through all of the results and return only the cheapest one for each product. All of the results of the Actor will be pushed to its default dataset. [Solution](https://docs.apify.com/academy/expert-scraping-with-apify/solutions/integrating-webhooks.md) ## Next up This course's [next lesson](https://docs.apify.com/academy/expert-scraping-with-apify/managing-source-code.md) is brief, but discusses a very important topic: managing your code and storing it in a safe place. --- # Source: https://docs.apify.com/platform/integrations/actors.md # Source: https://docs.apify.com/platform/actors.md # Source: https://docs.apify.com/academy/getting-started/actors.md # Source: https://docs.apify.com/api/v2/actors.md # Actors - Introduction The API endpoints in this section allow you to manage Apify Actors. For more details about Actors, refer to the [Actor documentation](https://docs.apify.com/platform/actors). For API endpoints that require the `actorId` parameter to identify an Actor, you can provide either: * The Actor ID (e.g., `HG7ML7M8z78YcAPEB`), or * A tilde-separated combination of the Actor owner's username and the Actor name (e.g., `janedoe~my-actor`). ## [Get list of Actors](https://docs.apify.com/api/v2/acts-get.md) [/acts](https://docs.apify.com/api/v2/acts-get.md) ## [Create Actor](https://docs.apify.com/api/v2/acts-post.md) [/acts](https://docs.apify.com/api/v2/acts-post.md) ## [Get Actor](https://docs.apify.com/api/v2/act-get.md) [/acts/{actorId}](https://docs.apify.com/api/v2/act-get.md) ## [Update Actor](https://docs.apify.com/api/v2/act-put.md) [/acts/{actorId}](https://docs.apify.com/api/v2/act-put.md) ## [Delete Actor](https://docs.apify.com/api/v2/act-delete.md) [/acts/{actorId}](https://docs.apify.com/api/v2/act-delete.md) --- # Source: https://docs.apify.com/api/v2/acts-get.md # Get list of Actors ``` GET https://api.apify.com/v2/acts ``` Gets the list of all Actors that the user created or used. The response is a list of objects, where each object contains a basic information about a single Actor. To only get Actors created by the user, add the `my=1` query parameter. The endpoint supports pagination using the `limit` and `offset` parameters and it will not return more than 1000 records. By default, the records are sorted by the `createdAt` field in ascending order, therefore you can use pagination to incrementally fetch all Actors while new ones are still being created. To sort the records in descending order, use the `desc=1` parameter. You can also sort by your last run by using the `sortBy=stats.lastRunStartedAt` query parameter. In this case, descending order means the most recently run Actor appears first. ## Request ## Responses * 200 * 400 **Response Headers** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/api/v2/acts-post.md # Create Actor ``` POST https://api.apify.com/v2/acts ``` Creates a new Actor with settings specified in an Actor object passed as JSON in the POST payload. The response is the full Actor object as returned by the endpoint. The HTTP request must have the `Content-Type: application/json` HTTP header! The Actor needs to define at least one version of the source code. For more information, see . If you want to make your Actor [public](https://docs.apify.com/platform/actors/publishing) using `isPublic: true`, you will need to provide the Actor's `title` and the `categories` under which that Actor will be classified in Apify Store. For this, it's best to use the [constants from our apify-shared-js package](https://github.com/apify/apify-shared-js/blob/2d43ebc41ece9ad31cd6525bd523fb86939bf860/packages/consts/src/consts.ts#L452-L471). ## Request ## Responses * 201 * 400 **Response Headers** * **Location** Bad request - invalid input parameters or request body. --- # Source: https://docs.apify.com/platform/integrations/webhooks/ad-hoc-webhooks.md # Ad-hoc webhooks **Set up one-time webhooks for Actor runs initiated through the Apify API or from the Actor's code. Trigger events when the run reaches a specific state.** *** An ad-hoc webhook is a single-use webhook created for a specific Actor run when starting the run using the [Apify API](https://docs.apify.com/api/v2.md). The webhook triggers once when the run transitions to the specified state. Define ad-hoc webhooks using the `webhooks` URL parameter added to the API endpoint that starts an Actor or Actor task: ``` https://api.apify.com/v2/acts/[ACTOR_ID]/runs?token=[YOUR_API_TOKEN]&webhooks=[AD_HOC_WEBHOOKS] ``` replace `AD_HOC_WEBHOOKS` with a base64 encoded stringified JSON array of webhook definitions: ``` [ { eventTypes: ['ACTOR.RUN.FAILED'], requestUrl: 'https://example.com/run-failed', }, { eventTypes: ['ACTOR.RUN.SUCCEEDED'], requestUrl: 'https://example.com/run-succeeded', payloadTemplate: '{"hello": "world", "resource":{{resource}}}', }, ]; ``` ## Create an ad-hoc webhook dynamically You can also create a webhook dynamically from your Actor's code using the Actor's add webhook method: * JavaScript * Python ``` import { Actor } from 'apify'; await Actor.init(); // ... await Actor.addWebhook({ eventTypes: ['ACTOR.RUN.FAILED'], requestUrl: 'https://example.com/run-failed', }); // ... await Actor.exit(); ``` ``` from apify import Actor async def main(): async with Actor: await Actor.add_webhook( event_types=['ACTOR.RUN.FAILED'], request_url='https://example.com/run-failed', ) # ... ``` For more information, check out the [JavaScript SDK documentation](https://docs.apify.com/sdk/js/reference/class/Actor#addWebhook) or the [Python SDK documentation](https://docs.apify.com/sdk/python/reference/class/Actor#add_webhook). To prevent duplicate ad-hoc webhooks in case of Actor restart, use the idempotency key parameter. The idempotency key must be unique across all user webhooks to ensure only one webhook is created for a given value. For example, use the Actor run ID as an idempotency key: * JavaScript * Python ``` import { Actor } from 'apify'; await Actor.init(); // ... await Actor.addWebhook({ eventTypes: ['ACTOR.RUN.FAILED'], requestUrl: 'https://example.com/run-failed', idempotencyKey: process.env.APIFY_ACTOR_RUN_ID, }); // ... await Actor.exit(); ``` ``` import os from apify import Actor async def main(): async with Actor: await Actor.add_webhook( event_types=['ACTOR.RUN.FAILED'], request_url='https://example.com/run-failed', idempotency_key=os.environ['APIFY_ACTOR_RUN_ID'], ) # ... ``` --- # Source: https://docs.apify.com/sdk/js/docs/examples/add-data-to-dataset.md # Add data to dataset Copy for LLM This example saves data to the default dataset. If the dataset doesn't exist, it will be created. You can save data to custom datasets by using [`Actor.openDataset()`](https://docs.apify.com/sdk/js/sdk/js/reference/class/Dataset.md#open) [Run on](https://console.apify.com/actors/kk67IcZkKSSBTslXI?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCB7IEFjdG9yIH0gZnJvbSAnYXBpZnknO1xcbmltcG9ydCB7IENoZWVyaW9DcmF3bGVyIH0gZnJvbSAnY3Jhd2xlZSc7XFxuXFxuYXdhaXQgQWN0b3IuaW5pdCgpO1xcblxcbi8vIENyZWF0ZSBhIGRhdGFzZXQgd2hlcmUgd2Ugd2lsbCBzdG9yZSB0aGUgcmVzdWx0cy5cXG5jb25zdCBjcmF3bGVyID0gbmV3IENoZWVyaW9DcmF3bGVyKHtcXG4gICAgLy8gRnVuY3Rpb24gY2FsbGVkIGZvciBlYWNoIFVSTFxcbiAgICBhc3luYyByZXF1ZXN0SGFuZGxlcih7IHJlcXVlc3QsIGJvZHkgfSkge1xcbiAgICAgICAgLy8gU2F2ZSBkYXRhIHRvIGRlZmF1bHQgZGF0YXNldFxcbiAgICAgICAgYXdhaXQgQWN0b3IucHVzaERhdGEoe1xcbiAgICAgICAgICAgIHVybDogcmVxdWVzdC51cmwsXFxuICAgICAgICAgICAgaHRtbDogYm9keSxcXG4gICAgICAgIH0pO1xcbiAgICB9LFxcbn0pO1xcblxcbi8vIFJ1biB0aGUgY3Jhd2xlclxcbmF3YWl0IGNyYXdsZXIucnVuKFtcXG4gICAgeyB1cmw6ICdodHRwOi8vd3d3LmV4YW1wbGUuY29tL3BhZ2UtMScgfSxcXG4gICAgeyB1cmw6ICdodHRwOi8vd3d3LmV4YW1wbGUuY29tL3BhZ2UtMicgfSxcXG4gICAgeyB1cmw6ICdodHRwOi8vd3d3LmV4YW1wbGUuY29tL3BhZ2UtMycgfSxcXG5dKTtcXG5cXG5hd2FpdCBBY3Rvci5leGl0KCk7XFxuXCJ9Iiwib3B0aW9ucyI6eyJidWlsZCI6ImxhdGVzdCIsImNvbnRlbnRUeXBlIjoiYXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOCIsIm1lbW9yeSI6MTAyNCwidGltZW91dCI6MTgwfX0.fhpAfqCjjEMd7THx-jtJurjuRe7si1RztaBrOcDRcQ8\&asrc=run_on_apify) ``` import { Actor } from 'apify'; import { CheerioCrawler } from 'crawlee'; await Actor.init(); // Create a dataset where we will store the results. const crawler = new CheerioCrawler({ // Function called for each URL async requestHandler({ request, body }) { // Save data to default dataset await Actor.pushData({ url: request.url, html: body, }); }, }); // Run the crawler await crawler.run([ { url: 'http://www.example.com/page-1' }, { url: 'http://www.example.com/page-2' }, { url: 'http://www.example.com/page-3' }, ]); await Actor.exit(); ``` Each item in this dataset will be saved to its own file in the following directory: ``` {PROJECT_FOLDER}/storage/datasets/default/ ``` --- # Source: https://docs.apify.com/academy/node-js/add-external-libraries-web-scraper.md # How to add external libraries to Web Scraper Sometimes you need to use some extra JavaScript in your [Web Scraper](https://apify.com/apify/web-scraper) page functions. Whether it is to work with dates and times using [Moment.js](https://momentjs.com/), or to manipulate the DOM using [jQuery](https://jquery.com/), libraries save precious time and make your code more concise and readable. Web Scraper already provides a way to add jQuery to your page functions. All you need to do is to check the Inject jQuery input option. There's also the option to Inject Underscore, a popular helper function library. In this tutorial, we'll learn how to inject any JavaScript library into your page functions, with the only limitation being that the library needs to be available somewhere on the internet as a downloadable file (typically a CDN). ## Injecting Moment.js Moment.js is a very popular library for working with date and time. It helps you with the parsing, manipulation, and formatting of datetime values in multiple locales and has become the de-facto standard for this kind of work in JavaScript. To inject Moment.js into our page function (or any other library using the same method), we first need to find a link to download it from. We can find it in [Moment.js' documentation](https://momentjs.com/docs/#/use-it/browser/) under the CDN links. > [https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js](https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js) Now we have two options. Inject the library using plain JavaScript, or if you prefer working with jQuery, use a jQuery helper. ## Injecting a library with plain JavaScript ``` async function pageFunction(context) { const libraryUrl = 'https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js'; // Inject Moment.js\ await new Promise((resolve) => { const script = document.createElement('script'); script.src = libraryUrl; script.addEventListener('load', resolve); document.body.append(script); }); // Confirm that it works.\ const now = moment().format('ddd, hA'); context.log.info(`NOW: ${now}`); } ``` We're creating a script element in the page's DOM and waiting for the script to load. Afterwards, we confirm that the library has been successfully loaded by using one of its functions. ## Injecting a library using jQuery After you select the Inject jQuery input option, jQuery will become available in your page function as `context.jQuery` . ``` async function pageFunction(context) { const libraryUrl = 'https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js'; const $ = context.jQuery; // Inject Moment.js\ await $.getScript(libraryUrl); // Confirm that it works.\ const now = moment().format('ddd, hA'); context.log.info(`NOW: ${now}`); } ``` With jQuery, we're using the `$.getScript()` helper to fetch the script for us and wait for it to load. ## Dealing with errors Some websites employ security measures that disallow loading external scripts within their pages. Luckily, those measures can be overridden with Web Scraper. If you are encountering errors saying that your library cannot be loaded due to a security policy, select the Ignore CORS and CSP input option at the very bottom of Web Scraper input and the errors should go away. Happy scraping! --- # Source: https://docs.apify.com/academy/apify-actors/adding-rapidapi-project.md # Adding your RapidAPI project to Apify If you've published an API project on [RapidAPI](https://rapidapi.com/), you can expand your project's visibility by listing it on Apify Store. This gives you access to Apify's developer community and ecosystem. *** ## Why add your API project to Apify By publishing your API project on Apify, you'll reach thousands of active users in Apify Store. You'll also get access to the Apify platform's infrastructure: managed hosting, data storage, scheduling, advanced web scraping and crawling capabilities, and integrated proxy management. These tools help you reach more users and enhance your API's functionality. ## Step-by-step guide The approach is demonstrated on an app built on top of [Express.js](https://expressjs.com/), but with a few adaptations to the code, any API framework will work. You'll deploy your API as an [Apify Actor](https://apify.com/actors) - a serverless cloud program that runs on the Apify platform. Actors can handle everything from simple automation to running web servers. ### Prerequisites You’ll need an [Apify account](https://console.apify.com/sign-in) - *it’s free and no credit card is required*. For simple migration and deployment, we recommend installing the Apify CLI: ``` curl -fsSL https://apify.com/install-cli.sh | bash ``` Other ways to install the CLI Check the [CLI installation page](https://docs.apify.com/cli/docs/installation) for more details and all the options. ### Step 1: Initialize the Actor structure Once you have the Apify CLI, run the following command: ``` apify init ``` The command sets up an Actor project in your current directory by creating `actor.json` (Actor configuration) and storage files (Dataset and Key-value store). ### Step 2: Add Actor logic The initialization of the Actor is the first important thing. The second is the correct mapping of the PORT. Check the following example for inspiration: ``` await Actor.init(); // Initializes the Actor const app = express(); const PORT = Actor.config.get('containerPort'); // Specifies the PORT const DATA_FILE = path.join(__dirname, 'data', 'items.json'); app.use(express.json()); // Rest of the logic ``` Readiness checks The Apify platform performs readiness checks by sending GET requests to `/` with the `x-apify-container-server-readiness-probe` header. For better resource efficiency, consider checking for this header and returning a simple response early, rather than processing it as a full request. This optimization is particularly useful for resource-intensive Actors. ``` app.get('*', (req, res) => { if (req.headers['x-apify-container-server-readiness-probe']) { console.log('Readiness probe'); res.send('Hello, readiness probe!\n'); } }); ``` ### Step 3: Test your Actor locally Once you’ve added the Actor logic, test your Actor locally with the following command: ``` apify run ``` Now, check that your server is running. Check one of your endpoints, for example `/health`. ### Step 4: Deploy your Actor to Apify Now push your Actor to [Apify Console](https://console.apify.com/). You’ll be able to do this only if you’re logged in to your Apify account with the CLI. Run `apify info` to check, and if you’re not logged in yet, run `apify login`. This only needs to be done once. To push your project, run the following command: ``` apify push ``` ### Step 5: Run your Actor After pushing your Actor to the platform, in the terminal you’ll see an output similar to this: ``` 2025-10-03T07:57:13.671Z ACTOR: Build finished. Actor build detail https://console.apify.com/actors/a0c... Actor detail https://console.apify.com/actors/aOc... Success: Actor was deployed to Apify cloud and built there. ``` You can click the **Actor detail** link, or go to **Apify Console > My Actors**, and click on your Actor. Now, click on the Settings tab, and enable **Actor Standby**: ![Standby Actor](/assets/images/standby-46f0cc8b9b154e5a15f88cf43aa24005.png) Two modes of Actors Actors can run in two modes: as batch processing jobs that execute a single task and stop, or in **Standby mode** as a web server. For use cases like deploying an API that needs to respond to incoming requests in real-time, Standby mode is the best choice. It keeps your Actor running continuously and ready to handle HTTP requests like a standard web server. Once you’ve saved the settings, go to the **Standby** tab, and click the **Test endpoint** button. It will start the Actor, and you can test it. Once the Actor is running, you're done with the migration! ## Next steps Ready to monetize your Actor and start earning? Check out these guides: * [Set up monetization for your Actor](https://docs.apify.com/platform/actors/publishing/monetize) * [Publish your Actor on Apify Store](https://docs.apify.com/platform/actors/publishing/publish) You can also extend your Actor with custom logic and leverage additional Apify platform features, such as storage or web scraping capabilities. --- # Source: https://docs.apify.com/academy/advanced-web-scraping.md # Advanced web scraping In the [Web scraping basics for JavaScript devs](https://docs.apify.com/academy/scraping-basics-javascript.md) course, we have learned the necessary basics required to create a scraper. In the following courses, we learned more about specific practices and techniques that will help us to solve most of the problems we will face. In this course, we will take all of that knowledge, add a few more advanced concepts, and apply them to learn how to build a production-ready web scraper. ## What does production-ready mean To scrape large and complex websites, we need to scale two essential aspects of the scraper: crawling and data extraction. Big websites can have millions of pages and the data we want to extract requires more sophisticated parsing techniques than just selecting elements by CSS selectors or using APIs as they are. We will also touch on monitoring, performance, anti-scraping protections, and debugging. If you've managed to follow along with all of the courses prior to this one, then you're more than ready to take these upcoming lessons on 😎 ## First up First, we will explore [advanced crawling section](https://docs.apify.com/academy/advanced-web-scraping/crawling/sitemaps-vs-search.md) that will help us to find all pages or products on the website. --- # Source: https://docs.apify.com/legal/affiliate-program-terms-and-conditions.md # Apify Affiliate Program Terms and Conditions Effective date: May 14, 2024 Latest version effective from: July 5, 2025 *** **Apify Technologies s.r.o.**, with its registered seat at Vodičkova 704/36, 110 00 Prague 1, Czech Republic, Company reg. no. 04788290, recorded in the Commercial Register kept by the Municipal Court of Prague, File No.: C 253224 ("**we**" or "**Apify**") thanks you ("**you**" or the "**Affiliate Partner**") for your interest in joining the Apify's Affiliate Program (the "**Affiliate Program**"). These terms and conditions (the "**Affiliate Program Terms**") shall govern your rights and obligations in relation to your participation in the Affiliate Program in addition to [Apify General Terms and Conditions](https://docs.apify.com/legal/general-terms-and-conditions.md) (the "**General Terms**"). Terms starting with a capital letter used in these Affiliate Program Terms have the meaning defined either here or in the General Terms. Provisions of the General Terms regarding liability, indemnity, governing law and choice of jurisdiction are incorporated herein by reference. ## 1. Joining the Affiliate Program 1.1. You may join the Affiliate Program by creating an account on Apify's [FirstPromoter portal](https://apify.firstpromoter.com/) ("**FirstPromoter**"). By ticking the box "*I agree to the Apify Affiliate Program terms*", you claim that you are over 18 years old and agree to adhere to these Affiliate Program Terms, in addition to the General Terms. If you act on behalf of a company when accepting these Affiliate Program Terms, you also hereby declare to be authorized to perform such legal actions on behalf of the company (herein the term "**you**" shall mean the relevant company). ## 2. Apify's obligations 2.1. Upon joining the Affiliate Program, Apify will make available to you your unique referral link (the "**Referral Link**") and promotional materials, which you may use in promoting Apify's services. 2.2. Apify shall pay to the Affiliate Partner a commission (the "**Commission**") for referred users' use of the Platform according to the provisions below. ## 3. Referred Customers 3.1. "**Referred Customer**" is a natural person or a company who subscribed to Apify's Platform using the Referral Link in compliance with these Affiliate Program Terms. 3.2. Tracking of the potential Referred Customer is performed by cookies lasting 45 days. If the cookies expire or are deleted, a customer may not be recognised as a Referred Customer. 3.3. If the Affiliate Partner identifies any customer that, in their opinion, shall be considered Referred Customer but has not been recognised by the tracking, the Affiliate Partner may report this information to Apify together with sufficient evidence. Apify shall in its discretion in good faith consider the Affiliate Partner's report and evidence, and decide whether or not such a customer shall be deemed Referred Customer. 3.4. In case of any uncertain or suspicious circumstances, Apify shall have the right to ultimately decide whether a customer is to be deemed Referred Customer or not, in its sole discretion. ## 4. Commission 4.1. Unless agreed otherwise, the Commission shall be computed as 20% of all payments made by each Referred Customer to Apify in the first 3 months from the date when that Referred Customer started paying for Services (as defined in the General Terms) and then increased to 30% for all payments made by each Referred Customer to Apify, up to 2,500 USD per Referred Customer. ## 5. Payment terms **5.1.** Apify shall pay the earned Commission to the Affiliate Partner monthly, within 15 business days after the end of each calendar month, based on an invoice that shall be issued to Apify. The minimum Commission payable is 100 USD. Commission in any given calendar month lower than 100 USD will be rolled over to the following month. 5.2. The Commission may be paid either via PayPal or bank transfer. The Affiliate Partner shall specify the chosen payment method. 5.3. Invoices are generated automatically through FirstPromoter by Apify. The Affiliate Partner shall provide and maintain up-to-date information required for this purpose in the portal. Apify may request that the Affiliate Partner issues an invoice using a different method, if the method through FirstPromoter portal is not available (e.g. due to missing Affiliate Partner's personal information). Apify shall not be obliged to pay any Commission until a valid invoice has been issued or generated. 5.4. Affiliate acknowledges and agrees that Apify makes no representation or guarantee of any kind regarding revenue, business, profit, or customers under these Affiliate Program Terms. ## 6. Affiliate Partner's obligations 6.1. The Affiliate Partner must not promote Apify or use its Referral Link in any of the following ways: 1. in any materials or in connection with any services that are illegal, infringing on third party rights, fraudulent, harassing, defamatory, discriminatory or violent; 2. use any paid advertisements and/or advertise via any pay-per-click advertisement systems (e.g., Google Ads, Facebook Ads or LinkedIn Ads); 3. bid on the "Apify" keyword for any pay-per-click advertisement systems (e.g., Google Ads), including any misspellings, capitalizations or in combination with any other text; 4. for self-referral, i.e., its own or its friends, affiliates, related persons or business partners sign-ups to the Platform; 5. in any content that's available on the Platform, Website or any other assets owned, operated or maintained by Apify; or 6. for any illegal activity, including, without limitation, fraud or money laundering. Any customer referred in breach of this clause 6.1 shall not be considered a Referred Customer. 6.2. For avoidance of doubt, the Affiliate Partner shall not be an agent of Apify. Nothing in these Affiliate Program Terms shall be construed as authorization to act or make representations on behalf of Apify. ## 7. License 7.1. Apify hereby grants to the Affiliate Partner a limited, worldwide, revocable, non-exclusive, non-sublicensable and non-transferable license to use Apify's trademark, logo, trade name, service names and copyrighted material (the "**Intellectual Property Assets**") in its marketing, advertising or other content while promoting Apify services in accordance with this Affiliate Program Terms. 7.2. The Affiliate Partner shall not alter, modify, adapt, translate, or create derivative works from the whole or any part of the Intellectual Property Assets or permit any part of the Intellectual Property Assets to be merged, combined with, or otherwise incorporated into any other product, unless the Affiliate Partner obtained prior written consent from Apify. The Affiliate Partner shall not use any language or display the Intellectual Property Assets in such a way as to create the impression that the Intellectual Property Assets belong to the Affiliate Partner. 7.3. The Affiliate Partner shall not attack, question, or contest the validity of Apify's ownership of Intellectual Property Assets. 7.4. If any infringement of any Intellectual Property Assets comes to the Affiliate Partner's attention, whether actual or threatened, the Affiliate Partner agrees to inform Apify as soon as possible. The Affiliate Partner also agrees to notify us of any claim by anyone that our products infringe the rights of any other person. The Affiliate Partner shall, at our request and expense, provide its cooperation to Apify in doing any reasonably required steps to address such claims. 7.5. Apify reserves all rights not expressly granted in this Agreement, and does not transfer any right, title, or interest to any intellectual property rights. ## 8. Apify Open Source Fair Share Program Additional Terms 8.1. If your Referral Links are placed on your open-source GitHub repository (e.g. as Apify badge or "Run of Apify" button), your Commission for Referred Customers can also be paid via corresponding GitHub Sponsors account, if requested by you. 8.2. We will automatically attribute Users who sign up for Apify through your open-source Actor page in Apify Store to you as Referred Customers. ## 9. Termination 9.1. The Affiliate Partner may terminate its participation in the Affiliate Program at any time and for any reason by providing Apify a written notice. Commission earned during that calendar month when the Affiliate ceased to be part of the Affiliate Program will be paid out in the usual term after the end of that calendar month. 9.2. Apify may terminate the Affiliate Partner's participation in the Affiliate Program with immediate effect if the Affiliate Partner breaches any provision of these Affiliate Program Terms or any other terms agreed between the Affiliate Partner and Apify. All commissions shall be forfeited and the Affiliate Partner will not be entitled to any reimbursement. 9.3. Apify may terminate the Affiliate Partner's participation in the Affiliate Program at any time and for any reason by providing the Affiliate Partner with at least a thirty (30) days written notice. Commission earned during that calendar month when the Affiliate Partner ceased to be a part of the Affiliate Program will be paid out in the usual term after the end of that calendar month. 9.4. These Affiliate Program Terms shall terminate together with the termination of the Affiliate Partner's participation in the Affiliate Program. ## 10. Amendments 10.1. We may unilaterally amend the Affiliate Program Terms. We shall notify you of such an amendment at least 30 days in advance before its effectiveness. Should you disagree with such an amendment, you may withdraw from the Affiliate Program until the effective date of the amendments. Otherwise, you will be deemed to agree with the announced amendments. --- # Source: https://docs.apify.com/academy/actor-marketing-playbook/promote-your-actor/affiliates.md # Affiliates The Apify Affiliate Program offers you a way to earn recurring commissions while helping others discover automation and web scraping solutions. Whether you promote Apify Store or refer customers to Apify's professional services, you can monetize your expertise and network. The program rewards collaboration with up to 30% recurring commission and up to $2,500 per customer for professional services referrals. With no time limits on commissions, transparent tracking, and flexible payout options, it's built for long-term partnerships. *** ## How the program works The Apify Affiliate Program lets you promote three main offerings: 1. *Apify Store*: recommend Actors from the marketplace that help businesses automate lead generation, pricing intelligence, content aggregation, and more. 2. *Apify platform*: promote the platform's features, including scheduling, monitoring, data export options, proxies, and integrations. 3. *Professional services*: refer customers who need custom web scraping solutions to Apify's Professional Services team and earn up to $2,500 per closed deal. ### Commission structure * *20% commission* for the first 3 months of each customer's subscription * *30% commission* from month 4 onwards for as long as they remain customers * *Up to $2,500 per customer* for professional services referrals * *No time limits on commissions* - you earn as long as your referrals stay active ### Free trial advantage Apify offers a $5 free trial that renews monthly, giving your referrals time to test the tools before subscribing. This increases conversion rates and helps you earn more consistent commissions. *** ## How to succeed as an affiliate ### Use word of mouth Tell clients, business contacts, or colleagues how Apify solves their lead generation, data collection, and automation challenges. Personal recommendations carry weight, especially when you can speak to real use cases. ### Create educational content Use your platform to demonstrate value: * Blog posts: write tutorials, case studies, or problem-solving guides that feature Apify tools * Video content: record demos, walkthroughs, or quick tips showing how Actors work * Podcasts: discuss automation workflows and mention specific Actors that solve common problems * Social media: share favorite Actors, tools, or workflows with your audience ### Engage your community If you run a forum, Discord server, or an online group, position Apify as a resource for solving automation and data collection challenges. Answer questions and recommend relevant Actors when they fit the problem. ### Teach and inspire If you teach AI automation, engineering, marketing, or lead generation, include Apify in your curriculum. Show students how to use Actors in webinars, online courses, or workshops. *** ## Benefits beyond commissions ### Exclusive perks for top performers High-performing affiliates and their referrals can access: * Exclusive discounts on platform usage * Free prepaid credits * Early access to new tools and features ### Co-marketing opportunities Collaborate with Apify on: * Joint marketing campaigns * Workshops and webinars * Partner success stories * Industry events and conferences These opportunities help you build visibility and strengthen relationships with your audience. *** ## Payment and tracking ### Transparent dashboard Track referrals in real-time through a dashboard that shows: * Active referrals * Commission earnings * Conversion rates * Payment history ### Payment options Receive payouts via: * Bank transfer * PayPal You'll receive your first payment within 30 days of your first successful referral. *** ## Best practices for affiliate success 1. *Know your audience*: understand their pain points and recommend solutions that genuinely help them. Tailor your messaging to their technical level and needs. 2. *Be authentic*: promote tools you've used or understand. Personal experience builds trust and credibility. 3. *Provide context*: explain how Apify solves specific problems rather than just listing features. Use real examples and use cases. 4. *Follow up*: engage with people who click your links. Answer questions and provide additional resources to help them get started. 5. *Combine strategies*: use multiple channels to promote Apify. Cross-reference blog posts in videos, mention tutorials in newsletters, and share content on social media. 6. *Track what works*: monitor which content and channels drive the most conversions, then double down on what performs best. *** ## Getting started To join the Apify Affiliate Program: 1. Sign up through the [Apify Affiliate program page](https://apify.com/partners/affiliate) 2. Access your unique tracking links and promotional materials 3. Start sharing with your network 4. Monitor your referrals and earnings through the dashboard Maximize your impact Combine affiliate promotion with other marketing strategies covered in this guide, including SEO, social media, blogs, and video tutorials. The more touchpoints you create, the higher your conversion potential. --- # Source: https://docs.apify.com/platform/integrations/agno.md # Agno Integration **Integrate Apify with Agno to power AI agents with web scraping, automation, and data insights.** *** ## What is Agno? [Agno](https://docs.agno.com/) is an open-source framework for building intelligent AI agents. It provides a flexible architecture to create agents with custom tools, enabling seamless integration with external services like Apify for tasks such as web scraping, data extraction and automation. Agno documentation Check out the [Agno documentation](https://docs.agno.com/introduction) for more details on building AI agents. ## How to use Apify with Agno This guide shows how to integrate Apify Actors with Agno to empower your AI agents with real-time web data. We'll use the [RAG Web Browser](https://apify.com/apify/rag-web-browser) Actor to fetch web content and the [Google Places Crawler](https://apify.com/compass/crawler-google-places) Actor to extract location-based data. It is very easy to use with any other Actor by just passing the name of the Actor. See and choose from thousands of Actors in the [Apify Store](https://apify.com/store). ### Prerequisites * *Apify API token*: Obtain your API token from the [Apify console](https://console.apify.com/account/integrations). * *OpenAI API key*: Get your API key from the [OpenAI platform](https://platform.openai.com/account/api-keys). Alternative LLM providers While our examples use OpenAI, Agno supports other LLM providers as well. You'll need to adjust the environment variables and configuration according to your chosen provider. Check out the [Agno models documentation](https://docs.agno.com/models/introduction) for details on supported providers and configuration. * *Python environment*: Ensure Python is installed (version 3.8+ recommended). * *Required packages*: Install the following dependencies in your terminal: ``` pip install agno apify-client ``` ## Basic integration example Start by setting up an Agno agent with Apify tools. This example uses the RAG Web Browser Actor to extract content from a specific URL. ``` import os from agno.agent import Agent from agno.tools.apify import ApifyTools os.environ["APIFY_API_TOKEN"] = "YOUR_APIFY_API_TOKEN" # Replace with your Apify API token os.environ["OPENAI_API_KEY"] = "YOUR_OPENAI_API_KEY" # Replace with your OpenAI API key # Initialize the agent with Apify tools agent = Agent( tools=[ApifyTools( actors=["apify/rag-web-browser"])], show_tool_calls=True, markdown=True ) # Fetch and display web content agent.print_response("Extract key details from https://docs.agno.com/introduction", markdown=True) ``` Running this code will scrape the specified URL and return formatted content your agent can use. ### Advanced scenario: Travel planning agent Combine multiple Apify Actors to create a powerful travel planning agent. This example uses the RAG Web Browser and Google Places Crawler to gather travel insights and local business data. ``` import os from agno.agent import Agent from agno.tools.apify import ApifyTools os.environ["APIFY_API_TOKEN"] = "YOUR_APIFY_API_TOKEN" # Replace with your Apify API token os.environ["OPENAI_API_KEY"] = "YOUR_OPENAI_API_KEY" # Replace with your OpenAI API key # Create a travel planning agent agent = Agent( name="Travel Planner", instructions=[ "You are a travel planning assistant. Use web data and location insights to provide detailed travel recommendations." ], tools=[ ApifyTools( actors=[ "apify/rag-web-browser", # For general web research "compass/crawler-google-places" # For location-based data ] ) ], show_tool_calls=True, markdown=True ) # Plan a trip to Tokyo agent.print_response( """ I'm traveling to Tokyo next month. 1. Research the best time to visit and top attractions. 2. Find a highly rated sushi restaurant near Shinjuku. Compile a travel guide with this information. """, markdown=True ) ``` This agent will fetch travel-related data and restaurant recommendations, providing a comprehensive travel guide: 1. Use the RAG Web Browser to research Tokyo travel details. 2. Use the Google Places Crawler to find a top sushi restaurant. 3. Combine the results into a comprehensive guide. Apify Store Browse the [Apify Store](https://apify.com/store) to find additional Actors for tasks like social media scraping, e-commerce data extraction, or news aggregation. ### Available Apify tools Agno supports any Apify Actor via the ApifyTools class. You can specify a single Actor ID or a list of Actor IDs to register multiple tools for your agent at once. ## Configuration options `apify_api_token` (string, default: `None`) : Apify API token (or set via APIFY\_API\_TOKEN environment variable) `actors` (string or List\[string], default: `None`) : Single Actor ID or list of Actor IDs to register ## Resources * [How to build an AI Agent](https://blog.apify.com/how-to-build-an-ai-agent/) * [Agno Framework Documentation](https://docs.agno.com) * [Apify Platform Documentation](https://docs.apify.com) * [Apify Actor Documentation](https://docs.apify.com/actors) * [Apify Store - Browse available Actors](https://apify.com/store) * [Agno Apify Toolkit Documentation](https://docs.agno.com/tools/toolkits/others/apify#apify) --- # Source: https://docs.apify.com/academy/ai/ai-agents.md # AI agent tutorial **In this section of the Apify Academy, we show you how to build an AI agent with the CrewAI Python framework. You’ll learn how to create an agent for Instagram analysis and integrate it with LLMs and Apify Actors.** *** AI agents are goal-oriented systems that make independent decisions. They interact with environments using predefined tools and workflows to automate complex tasks. On Apify, AI agents are built as Actors—serverless cloud programs for web scraping, data processing, and AI deployment. Apify evolved from running scrapers in the cloud to supporting LLMs that follow predefined workflows with dynamically defined goals. ## Prerequisites To build an effective AI agent, you need prompts to guide it, tools for external interactions, a large language model (LLM) to connect the components, an agentic framework to handle LLM behavior, and a platform to run, deploy, and scale the solution. ## Benefits of using Apify for AI agents Apify provides a complete platform for building and deploying AI agents with the following benefits: * *Serverless execution* - without infrastructure management * *Stateful execution* - with agent memory capabilities * *Monetization options* - through usage-based charging * *Extensive tool ecosystem* - with thousands of available Actors * *Scalability and reliability* - for production environments * *Pre-integrated tools* - for web scraping and automation ## Building an AI agent ### Step 1: Define the use case This tutorial creates a social media analysis agent that analyzes Instagram posts based on user queries using the [Instagram Scraper Actor](https://apify.com/apify/instagram-scraper). *Example:* * *Input:* "Analyze the last 10 posts from @openai and summarize AI trends." * *Output:* Trend analysis based on post content. ### Step 2: Configure input and output Define the input format (URL, JSON configuration, or text query) and output format (text response or structured data) for your agent. *Example input:* * User query: "Analyze @openai posts for AI trends" * OpenAI model selection (e.g., `gpt-4`) *Example output:* * Text response with insights * Data stored in Apify [Dataset](https://docs.apify.com/platform/storage/dataset.md) Agent memory Agents can include memory for storing information between conversations. Single-task agents typically do not require memory. ### Step 3: Set up the development environment Install the Apify CLI, which allows you to create, run, and deploy Actors from your local machine. ``` npm install -g @apify/cli ``` Create a new Actor project from the CrewAI template and navigate into the new directory. ``` apify create agent-actor -t python-crewai cd agent-actor ``` ### Step 4: Understand the project structure The template includes: * `.actor/` – Actor configuration files. * `actor.json` – The Actor's definition. * `input_schema.json` – Defines the UI for the Actor's input. * `dataset_schema.json` – Defines the structure of the output data. * `pay_per_event.json` – Configuration for monetization. * `src/` – Source code * `main.py` – The main script for Actor execution, agent, and task definition. * `tools.py` – Implementations of the tools the agent can use. * `models.py` – Pydantic models for structured tool output. * `ppe_utils.py` – Helper functions for pay-per-event monetization. ### Step 5: Define input and output schemas Update `.actor/input_schema.json` to define the Actor's inputs. This schema generates a user interface for running the Actor on the Apify platform. ``` { "title": "Instagram Analysis Agent Input", "type": "object", "schemaVersion": 1, "properties": { "query": { "title": "Query", "type": "string", "description": "Task for the agent to perform", "example": "Analyze @openai posts for AI trends" }, "modelName": { "title": "Model Name", "type": "string", "description": "OpenAI model to use", "default": "gpt-4" } }, "required": ["query"] } ``` Define the dataset schema in `.actor/dataset_schema.json`. This helps structure the data pushed to the dataset. ``` { "title": "Instagram Analysis Output", "type": "object", "properties": { "query": { "title": "Query", "type": "string" }, "response": { "title": "Response", "type": "string" } } } ``` ### Step 6: Configure tools The Instagram post scraper tool is implemented using the [Instagram Scraper Actor](https://apify.com/apify/instagram-scraper). The tool returns structured output as Pydantic models defined in `src/models.py`: ``` class InstagramPost(BaseModel): id: str url: str caption: str timestamp: datetime likes_count: int comments_count: int ``` The tool is defined in `src/tools.py` and includes: * Tool description and argument schema for the agent * Integration with Instagram Scraper Actor * Data retrieval and formatting ### Step 7: Implement the agent The agent implementation in `src/main.py` includes: 1. Handle Actor input: Read the user's query and any other parameters from the Actor input. ``` async def main(): async with Actor: actor_input = await Actor.get_input() query = actor_input.get("query") model_name = actor_input.get("modelName", "gpt-4") ``` 2. Define the agent: Instantiate the agent, giving it a role, a goal, and access to the tools you configured. ``` agent = Agent( role="Social Media Analyst", goal="Analyze Instagram posts and provide insights", backstory="Expert in social media analysis and trend identification", tools=[instagram_scraper_tool], llm=ChatOpenAI(model=model_name) ) ``` 3. Create task and crew: Define the task for the agent to complete based on the user's query. ``` task = Task( description=query, agent=agent, expected_output="Detailed analysis with insights" ) crew = Crew( agents=[agent], tasks=[task] ) ``` 4. Execute and save results: Kick off the crew to run the task and save the final result to the Actor's default dataset. ``` result = crew.kickoff() await Actor.push_data({ "query": query, "response": str(result) }) ``` ### Step 8: Test locally Run the agent on your local machine using the Apify CLI. Ensure you have set any required environment variables (e.g., `OPENAI_API_KEY`). ``` apify run ``` ### Step 9: Deploy to Apify Push your Actor's code to the Apify platform. ``` apify push ``` After deployment: 1. Navigate to your Actor's settings. 2. Set `OPENAI_API_KEY` as a secret environment variable. 3. Rebuild the Actor version to apply the changes. ### Step 10: Test the deployed agent Run the agent on the platform with a sample query and monitor the results in the output dataset. ``` Analyze the posts of the @openai and @googledeepmind and summarize me current trends in the AI. ``` Troubleshooting Common issues and solutions: * *Agent fails to call tools:* Check that the tool descriptions in src/tools.py are clear and the argument schemas are correct. * *Instagram scraper fails:* Verify that the Instagram usernames exist and are public. Check the scraper Actor's run logs for specific errors. * *Missing API key:* Ensure OPENAI\_API\_KEY is set as a secret environment variable in your Actor's Settings. ## Monetizing your AI agent Apify's pay-per-event (PPE) pricing model allows charging users based on specific triggered events through the API or SDKs. How pay-per-event pricing works If you want more details about PPE pricing, refer to our [PPE documentation](https://docs.apify.com/platform/actors/publishing/monetize/pay-per-event.md). ### Step 1: Define chargeable events You can configure charges for events like the Actor starting, a task completing successfully, or custom events such as specific API calls. Example event definition: ``` { "eventName": "task-completed", "description": "Charge for completed analysis task", "price": 0.10 } ``` ### Step 2: Implement charging in code Add charging logic to your code: ``` await Actor.charge({ "eventName": "task-completed", "amount": 1 }) ``` ### Step 3: Configure PPE settings 1. Enable pay-per-event monetization in Actor settings. 2. Define events from `pay_per_event.json`. 3. Set pricing for each event. ### Step 4: Publish the agent Before making your agent public on [Apify Store](https://apify.com/store), complete the following checklist: * Update README with usage instructions. * Validate `input_schema.json` and `dataset_schema.json`. * Verify `OPENAI_API_KEY` environment variable is handled correctly. * Check monetization settings on the Actor publication page. * Test the Actor thoroughly. * Set your Actor's visibility to public. ## Next steps To continue developing AI agents: 1. *Use the CrewAI template:* Start with `apify create agent-actor -t python-crewai` 2. *Explore other templates:* Visit the Apify templates page for alternatives 3. *Review existing agents:* Check the AI agents collection on Apify Store 4. *Publish and monetize:* Deploy with `apify push` and enable monetization --- # Source: https://docs.apify.com/platform/integrations/make/ai-crawling.md # Make - AI crawling Actor integration ## Apify Scraper for AI Crawling Apify Scraper for AI Crawling from [Apify](https://apify.com/) lets you extract text content from websites to feed AI models, LLM applications, vector databases, or Retrieval Augmented Generation (RAG) pipelines. It supports rich formatting using Markdown, cleans the HTML of irrelevant elements, downloads linked files, and integrates with AI ecosystems like LangChain, LlamaIndex, and other LLM frameworks. To use these modules, you need an [Apify account](https://console.apify.com) and an [API token](https://docs.apify.com/platform/integrations/api#api-token). You can find your token in the [Apify Console](https://console.apify.com/) under **Settings > Integrations**. After connecting, you can automate content extraction at scale and incorporate the results into your AI workflows. ## Connect Apify Scraper for AI Crawling 1. Create an account at [Apify](https://console.apify.com/). You can sign up using your email, Gmail, or GitHub account. ![Sign up page](/assets/images/wcc-signup-05f272efdc2e70fddd89ff59d8600031.png) 2. To connect your Apify account to Make, you can use an OAuth connection (recommended) or an Apify API token. To get the Apify API token, navigate to **[Settings > API & Integrations](https://console.apify.com/settings/integrations)** in the Apify Console. ![Apify Console token for Make.png](/assets/images/apify-console-token-for-make-cf75dbeb5effdcab9bc204cee94cdb6a.png) 3. Find your token under **Personal API tokens** section. You can also create a new API token with multiple customizable permissions by clicking on **+ Create a new token**. 4. Click the **Copy** icon next to your API token to copy it to your clipboard. Then, return to your Make scenario interface. ![Apify token on Make.png](/assets/images/Apify_token_on_Make-78f67b559503d92cffb17e5abffd18d2.png) 5. In Make, click **Add** to open the **Create a connection** dialog of the chosen Apify Scraper module. 6. In the **API token** field, paste the API token you copied from Apify. Provide a clear **Connection name**, and click **Save**. ![Make API token](/assets/images/apify-token-for-module-on-make-6f80f8f08cdad0946d3bb7130ab2d087.png) Once connected, you can build workflows to automate website extraction and integrate results into your AI applications. ## Apify Scraper for Website Content modules After connecting the app, you can use one of the two modules as native scrapers to extract website content. ### Standard Settings Module The Standard Settings module is a streamlined component of the Website Content Crawler that allows you to quickly extract content from websites using optimized default settings. This module is perfect for extracting content from blogs, documentation sites, knowledge bases, or any text-rich website to feed into AI models. #### How it works The crawler starts with one or more **Start URLs** you provide, typically the top-level URL of a documentation site, blog, or knowledge base. It then: * Crawls these start URLs * Finds links to other pages on the site * Recursively crawls those pages as long as their URL is under the start URL * Respects URL patterns for inclusion/exclusion * Automatically skips duplicate pages with the same canonical URL * Provides various settings to customize crawling behavior (crawler type, max pages, depth, concurrency, etc.) Once a web page is loaded, the Actor processes its HTML to ensure quality content extraction: * Waits for dynamic content to load if using a headless browser * Can scroll to a certain height to ensure all page content is loaded * Can expand clickable elements to reveal hidden content * Removes DOM nodes matching specific CSS selectors (like navigation, headers, footers) * Optionally keeps only content matching specific CSS selectors * Removes cookie warnings using browser extensions * Transforms the page using the selected HTML transformer to extract the main content #### Output data For each crawled web page, you'll receive: * *Page metadata*: URL, title, description, canonical URL * *Cleaned text content*: The main article content with irrelevant elements removed * *Markdown formatting*: Structured content with headers, lists, links, and other formatting preserved * *Crawl information*: Loaded URL, referrer URL, timestamp, HTTP status * *Optional file downloads*: PDFs, DOCs, and other linked documents Sample output (shortened) ``` { "url": "https://docs.apify.com/academy/scraping-basics-javascript", "crawl": { "loadedUrl": "https://docs.apify.com/academy/scraping-basics-javascript", "loadedTime": "2025-04-22T14:33:20.514Z", "referrerUrl": "https://docs.apify.com/academy", "depth": 1, "httpStatusCode": 200 }, "metadata": { "canonicalUrl": "https://docs.apify.com/academy/scraping-basics-javascript", "title": "Web scraping basics for JavaScript devs | Apify Documentation", "description": "Learn how to use JavaScript to extract information from websites in this practical course, starting from the absolute basics.", "languageCode": "en", "markdown": "# Web scraping basics for JavaScript devs\n\nWelcome to our comprehensive web scraping tutorial for beginners. This guide will take you through the fundamentals of extracting data from websites, with practical examples and exercises.\n\n## What is web scraping?\n\nWeb scraping is the process of extracting data from websites. It involves making HTTP requests to web servers, downloading HTML pages, and parsing them to extract the desired information.\n\n## Why learn web scraping?\n\n- **Data collection**: Gather information for research, analysis, or business intelligence\n- **Automation**: Save time by automating repetitive data collection tasks\n- **Integration**: Connect web data with your applications or databases\n- **Monitoring**: Track changes on websites automatically\n\n## Getting started\n\nTo begin web scraping, you'll need to understand the basics of HTML, CSS selectors, and HTTP. This tutorial will guide you through these concepts step by step.\n\n...", "text": "Web scraping basics for JavaScript devs\n\nWelcome to our comprehensive web scraping tutorial for beginners. This guide will take you through the fundamentals of extracting data from websites, with practical examples and exercises.\n\nWhat is web scraping?\n\nWeb scraping is the process of extracting data from websites. It involves making HTTP requests to web servers, downloading HTML pages, and parsing them to extract the desired information.\n\nWhy learn web scraping?\n\n- Data collection: Gather information for research, analysis, or business intelligence\n- Automation: Save time by automating repetitive data collection tasks\n- Integration: Connect web data with your applications or databases\n- Monitoring: Track changes on websites automatically\n\nGetting started\n\nTo begin web scraping, you'll need to understand the basics of HTML, CSS selectors, and HTTP. This tutorial will guide you through these concepts step by step.\n\n..." } } ``` ### Advanced Settings Module The Advanced Settings module provides complete control over the content extraction process, allowing you to fine-tune every aspect of the crawling and transformation pipeline. This module is ideal for complex websites, JavaScript-heavy applications, or when you need precise control over content extraction. #### Key features * *Multiple Crawler Options*: Choose between headless browsers (Playwright) or faster HTTP clients (Cheerio) * *Custom Content Selection*: Specify exactly which elements to keep or remove * *Advanced Navigation Control*: Set crawling depth, scope, and URL patterns * *Dynamic Content Handling*: Wait for JavaScript-rendered content to load * *Interactive Element Support*: Click expandable sections to reveal hidden content * *Multiple Output Formats*: Save content as Markdown, HTML, or plain text * *Proxy Configuration*: Use proxies to handle geo-restrictions or avoid IP blocks * *Content Transformation Options*: Multiple algorithms for optimal content extraction #### How it works The Advanced Settings module provides granular control over the entire crawling process: 1. *Crawler Selection*: Choose from Playwright (Firefox/Chrome), or Cheerio based on website complexity 2. *URL Management*: Define precise scoping with include/exclude URL patterns 3. *DOM Manipulation*: Control which HTML elements to keep or remove 4. *Content Transformation*: Apply specialized algorithms for content extraction 5. *Output Formatting*: Select from multiple formats for AI model compatibility #### Configuration options Advanced Settings offers numerous configuration options, including: * *Crawler Type*: Select the rendering engine (browser or HTTP client) * *Content Extraction Algorithm*: Choose from multiple HTML transformers * *Element Selectors*: Specify which elements to keep, remove, or click * *URL Patterns*: Define URL inclusion/exclusion patterns with glob syntax * *Crawling Parameters*: Set concurrency, depth, timeouts, and retries * *Proxy Configuration*: Configure proxy settings for robust crawling * *Output Options*: Select content formats and storage options #### Output data In addition to the standard output fields, Advanced Settings provides: * *Multiple Format Options*: Content in Markdown, HTML, or plain text * *Debug Information*: Detailed extraction diagnostics and snapshots * *HTML Transformations*: Results from different content extraction algorithms * *File Storage Options*: Flexible storage for HTML, screenshots, or downloaded files Looking for more than just AI crawling? You can use other native Make apps powered by Apify: * [TikTok Data](https://docs.apify.com/platform/integrations/make/tiktok.md) * [Google Search](https://docs.apify.com/platform/integrations/make/search.md) * [Google Maps Emails Data](https://docs.apify.com/platform/integrations/make/maps.md) * [YouTube Data](https://docs.apify.com/platform/integrations/make/youtube.md) * [Amazon](https://docs.apify.com/platform/integrations/make/amazon.md) And more! Because you can access any of thousands of our scrapers on Apify Store by using the [general Apify connections](https://www.make.com/en/integrations/apify). --- # Source: https://docs.apify.com/platform/integrations/airbyte.md # Airbyte integration **Learn how to integrate your Apify datasets with Airbyte.** *** Airbyte is an open-source data integration platform that allows you to move your data between different sources and destinations using pre-built connectors, which are maintained either by Airbyte itself or by its community. One of these connectors is the Apify Dataset connector, which makes it simple to move data from Apify datasets to any supported destination. To use Airbyte's Apify connector you need to: * Have an Apify account. * Have an Airbyte account. ## Set up Apify connector in Airbyte Once you have all the necessary accounts set up, you need to set up the Apify connector. To do so, you will need to navigate to **Sources** tab in Airbyte and select **Apify Dataset** ![Airbyte sources tab](/assets/images/airbyte-sources-7915e8b8c9b5959862c7c52c1505067f.png) You will need to provide a **dataset ID** and your Apify API Token. You can find both of these in [Apify Console](https://console.apify.com). ![Airbyte source setup](/assets/images/airbyte-source-setup-8c9f9311148dad47f6c80bdbfe9cf3f1.png) To find your **dataset ID**, you need to navigate to the **Storage** tab in Apify Console. Copy it and paste it in Airbyte. ![Datasets in app](/assets/images/datasets-app-2249b1a36efd9e35b15c68ae64f99ac7.png) To find your Apify API token, you need to navigate to the **Settings** tab and select **Integrations**. Copy it and paste it in the relevant field in Airbyte. ![Integrations token](/assets/images/apify-integrations-token-a480c4034e9658f9989b7c661ee0fad5.png) And that's it! You now have Apify datasets set up as a Source, and you can use Airbyte to transfer your datasets to one of the available destinations. To learn more about how to setup a Connection, visit [Airbyte's documentation](https://docs.airbyte.com/using-airbyte/getting-started/set-up-a-connection) --- # Source: https://docs.apify.com/platform/integrations/airtable.md # Airtable integration **Learn how to integrate Apify with Airtable. This article shows you how to use the Apify extension on Airtable.** *** [Airtable](https://www.airtable.com/) is a cloud-based platform for organizing, managing, and collaborating on data. With the Apify integration for Airtable, you can automatically upload Actor run results to Airtable after a successful run. This integration uses OAuth 2.0, a secure authorization protocol, to connect your Airtable account to Apify and manage data transfers. ## Connect Apify with Airtable To use the Apify integration for Airtable, ensure you have: * An [Apify account](https://console.apify.com/) * An [Airtable account](https://www.airtable.com/) ## Types of integration You can integrate Apify with Airtable using one of two options: * *Apify extension* on Airtable website. * *Console integration* on the Actor page. This guide explains how to use the *Apify extension*. For console integration instructions, see the [Console integration](https://docs.apify.com/platform/integrations/airtable/console.md) documentation ## Setup ### Install Apify extension Go to [Airtable](https://airtable.com) and open the base you would like to work with. Press the **Tools** dropdown in the top right corner and click **Extensions**. ![Access the extensions tab on Airtable UI by pressing tools button](/assets/images/airtable_tools_button-97e8312a2de4dee3486a59846cccc25e.png) Search for Apify extension and install it ![Search for the Apify extension on Airtable](/assets/images/airtable_search_apify_extension-55d37506218ef2a1bc40db96e920122c.png) Open the Apify extension and login using OAuth 2.0 with your Apify account. If you dont have an account, visit [Apify registration](https://console.apify.com/sign-up) page. ![Open Apify extension and login](/assets/images/airtable_login-730de1f8e5f8d8c81dac5142be8218db.png) ## Extension overview The Apify extension helps you map and import data into your Airtable base. ### Features The extension provides the following capabilities: * Run Actors * Run tasks * Get dataset items * Map and import the data into your base ![Apify extension overview](/assets/images/airtable_overview-f520e2f269afc4a1cd2a4466e2e8b039.png) ### Run Actor 1. Select any Actor from **Apify store** or **recently used Actors** ![Select Actor screen](/assets/images/airtable_actor_select-9e370b7eaa0f3a36237df7c28139794c.png) 2. Fill in the Actor input form. ![Configure Actor screen](/assets/images/airtable_configure_actor-4df721d03570aefc09a86675b56de3b8.png) 3. Run the Actor and wait for results ![Run the Actor](/assets/images/airtable_actor_run-50a70bdc1245024200fb4e5d0bde4817.png) ### Run task You can select and run any saved Apify task directly from the extension to reuse preconfigured inputs. ![Run task](/assets/images/airtable_task-4381890f7ba3e022f7c5c2bc0f943570.png) ### Get dataset items Retrieve items from any Apify dataset and import them into your Airtable base with a single click. ![Get dataset](/assets/images/airtable_dataset-fbe6da8509ec634034235eec569211fb.png) ### Map data to Airtable This section explains how to map your Actor run results or dataset items into your Airtable base. #### Understanding mapping rows The Apify extension provides UI elements that allow you to map dataset fields to Airtable fields. ![Run the Actor](/assets/images/airtable_mapping_row-b2cf0e9b2bcf1f5781468a89cbbe8f02.png) **Source:** The dataset field from Apify. **Target:** The target Airtable field label. For **new** mode, this creates new fields in your table. **Field Type:** The type of the target Airtable field. For **new** mode, you must specify this field type. #### Select fields to map The preview window next to the mapping rows will help you view and pick fields from the dataset. A period (`.`) in field labels indicates nested elements within an object. ``` { crawl: { depth: 'the field you selected', } } ``` ![Preview dataset fields](/assets/images/airtable_field_previews-d957ceda06800df4067eee29c5793b54.png) #### Automatic field matching The Apify extension examines the field labels in your table and matches them with dataset fields, providing a default list of mappings. *How it works*: For a source field like `crawl.depth`, the extension checks for fields in your table with labels matching either `depth` or `crawl.depth`. When it finds a match, it automatically adds a mapping row. #### Import operations 1. **CREATE**: Creates a new table for each run of this integration. 2. **APPEND**: Adds new records to the specified table. If the table doesn't exist, a new one is created. 3. **OVERWRITE**: Replaces all records in the specified table with new data. If the table doesn't exist, a new one is created. #### Filter duplicate records To prevent duplicate records, select a **Unique ID** on the data mapping step. The unique ID is added to the list of mapping rows. Ensure it points to the correct field in your table. During import, the extension filters data by existing values in the table. ![Select unique ID](/assets/images/airtable_unique_id-56f97681a59d1a2ff9a42d14ec3f08ce.png) #### Preview Mapped Data Preview the results and start the import ![Preview Mapped Data](/assets/images/airtable_preview-a9b08f9eb595d9a98bcfba6b59c5c138.png) --- # Source: https://docs.apify.com/platform/integrations/make/amazon.md # Make - Amazon Actor integration ## Apify Scraper for Amazon Data The Amazon Scraper module from [Apify](https://apify.com) allows you to extract product, search, or category data from Amazon. To use the module, you need an [Apify account](https://console.apify.com) and an [API token](https://docs.apify.com/platform/integrations/api#api-token), which you can find in the Apify Console under **Settings > Integrations**. After connecting, you can automate data extraction and incorporate the results into your workflows. ## Connect Apify Scraper for Amazon Data modules to Make 1. Create an account at [Apify](https://console.apify.com/). You can sign up using your email, Gmail, or GitHub account. ![Sign up page](/assets/images/image-dfc813ec1133c63789d9ee81a0e21a5f.png) 2. To connect your Apify account to Make, you can use an OAuth connection (recommended) or an Apify API token. To get the Apify API token, navigate to **[Settings > API & Integrations](https://console.apify.com/settings/integrations)** in the Apify Console. ![Apify Console token for Make.png](/assets/images/apify-console-token-for-make-cf75dbeb5effdcab9bc204cee94cdb6a.png) 3. Find your token under **Personal API tokens** section. You can also create a new API token with multiple customizable permissions by clicking on **+ Create a new token**. 4. Click the **Copy** icon next to your API token to copy it to your clipboard. Then, return to your Make scenario interface. ![Apify token on Make.png](/assets/images/Apify_token_on_Make-78f67b559503d92cffb17e5abffd18d2.png) 5. In Make, click **Add** to open the **Create a connection** dialog of the chosen Apify Scraper module. 6. In the **API token** field, paste the API token you copied from Apify. Provide a clear **Connection name**, and click **Save**. ![Make API token](/assets/images/image1-e02e5cbfa882177befb386f0341fe3d3.png) Once connected, you can build workflows to automate Amazon data extraction and integrate results into your applications. ## Apify Scraper for Amazon Data module After connecting the app, you can use the Search module as a native scraper to extract public Amazon data. Here’s what you get: ### Extract Amazon data Get data via [Apify's Amazon Scraper](https://apify.com/junglee/free-amazon-product-scraper). Fill in the URLs of products, searches, or categories you want to gather information about. For Amazon URLs, you can extract: * *Product title* * *Amazon ASIN number* * *Brand name* * *Number of reviews* * *Image* * *Description* * *Price value and currency* Example ``` [ { "title": "Logitech M185 Wireless Mouse, 2.4GHz with USB Mini Receiver, 12-Month Battery Life, 1000 DPI Optical Tracking, Ambidextrous PC/Mac/Laptop - Swift Grey", "asin": "B004YAVF8I", "brand": "Logitech", "stars": 4.5, "reviewsCount": 37418, "thumbnailImage": "https://m.media-amazon.com/images/I/5181UFuvoBL.__AC_SX300_SY300_QL70_FMwebp_.jpg", "breadCrumbs": "Electronics›Computers & Accessories›Computer Accessories & Peripherals›Keyboards, Mice & Accessories›Mice", "description": "Logitech Wireless Mouse M185. A simple, reliable mouse with plug-and-play wireless, a 1-year battery life and 3-year limited hardware warranty.(Battery life may vary based on user and computing conditions.) System Requirements: Windows Vista Windows 7 Windows 8 Windows 10|Mac OS X 10.5 or later|Chrome OS|Linux kernel 2.6+|USB port", "price": { "value": 13.97, "currency": "$" }, "url": "https://www.amazon.com/dp/B004YAVF8I" }, { "title": "Logitech MX Master 3S - Wireless Performance Mouse with Ultra-fast Scrolling, Ergo, 8K DPI, Track on Glass, Quiet Clicks, USB-C, Bluetooth, Windows, Linux, Chrome - Graphite", "asin": "B09HM94VDS", "brand": "Logitech", "stars": 4.5, "reviewsCount": 9333, "thumbnailImage": "https://m.media-amazon.com/images/I/41+eEANAv3L._AC_SY300_SX300_.jpg", "breadCrumbs": "Electronics›Computers & Accessories›Computer Accessories & Peripherals›Keyboards, Mice & Accessories›Mice", "description": "Logitech MX Master 3S Performance Wireless Mouse Introducing Logitech MX Master 3S – an iconic mouse remastered. Now with Quiet Clicks(2) and 8K DPI any-surface tracking for more feel and performance than ever before. Product details: Weight: 4.97 oz (141 g) Dimensions: 2 x 3.3 x 4.9 in (51 x 84.3 x 124.9 mm) Compatible with Windows, macOS, Linux, Chrome OS, iPadOS, Android operating systems (8) Rechargeable Li-Po (500 mAh) battery Sensor technology: Darkfield high precision Buttons: 7 buttons (Left/Right-click, Back/Forward, App-Switch, Wheel mode-shift, Middle click), Scroll Wheel, Thumbwheel, Gesture button Wireless operating distance: 33 ft (10 m) (9)Footnotes: (1) 4 mm minimum glass thickness (2) Compared to MX Master 3, MX Master 3S has 90% less Sound Power Level left and right click, measured at 1m (3) Compared to regular Logitech mouse without an electromagnetic scroll wheel (4) Compared to Logitech Master 2S mouse with Logitech Options installed and Smooth scrolling enabled (5) Requires Logi Options+ software, available for Windows and macOS (6) Not compatible with Logitech Unifying technology (7) Battery life may vary based on user and computing conditions. (8) Device basic functions will be supported without software for operating systems other than Windows and macOS (9) Wireless range may vary depending on operating environment and computer setup", "price": { "value": 89.99, "currency": "$" }, "url": "https://www.amazon.com/dp/B09HM94VDS" }, { "title": "Apple Magic Mouse - White Multi-Touch Surface ", "asin": "B0DL72PK1P", "brand": "Apple", "stars": 4.6, "reviewsCount": 18594, "thumbnailImage": "", "breadCrumbs": "", "description": null, "price": { "value": 78.99, "currency": "$" }, "url": "https://www.amazon.com/dp/B0DL72PK1P" } ] ``` Search data sample ``` [ { "title": "Logitech MK270 Wireless Keyboard And Mouse Combo For Windows, 2.4 GHz Wireless, Compact Mouse, 8 Multimedia And Shortcut Keys, For PC, Laptop - Black", "asin": "B079JLY5M5", "brand": "Logitech", "stars": 4.5, "reviewsCount": 107637, "thumbnailImage": "https://m.media-amazon.com/images/I/61gSpxZTZZL.__AC_SX300_SY300_QL70_ML2_.jpg", "breadCrumbs": "Electronics›Computers & Accessories›Computer Accessories & Peripherals›Keyboards, Mice & Accessories›Keyboard & Mouse Combos", "description": "The stylish Logitech MK270 Wireless Keyboard and Mouse Combo is perfect for the home office or workplace. Ditch the touchpad for this full size keyboard and mouse. Easily connect using Logitech's plug and forget receiver—just plug it into the USB port, and you're ready to work. There's no lengthy installation procedure to slow you down. When you're on the move, the receiver stores comfortably inside the mouse. Both the keyboard and mouse included in the MK270 combo use wireless 2.4GHz connectivity to provide seamless, interruption free use. Use the keyboard within a 10 m range without keyboard lag. Work for longer with the MK270's long battery life. The keyboard can be used for up to 24 months, and the mouse for 12 months, without replacing batteries. The Logitech MK270 keyboard includes 8 hotkeys that are programmable to your most used applications to boost your productivity.", "price": { "value": 21.98, "currency": "$" }, "url": "https://www.amazon.com/dp/B079JLY5M5" }, { "title": "Wireless Keyboard and Mouse Combo - Round Keycaps, Full-Size Retro Typewriter Keyboard with Detachable Wrist Rest, Sleep Mode & Tilt Legs, 2.4GHz Cordless Connection for Mac/Windows/PC (Hot Pink)", "asin": "B0CQJV4BW3", "brand": "SABLUTE", "stars": 4.3, "reviewsCount": 928, "thumbnailImage": "https://m.media-amazon.com/images/I/61NOammUF2L.__AC_SY300_SX300_QL70_FMwebp_.jpg", "breadCrumbs": "Electronics›Computers & Accessories›Computer Accessories & Peripherals›Keyboards, Mice & Accessories›Keyboard & Mouse Combos", "description": null, "price": { "value": 39.99, "currency": "$" }, "url": "https://www.amazon.com/dp/B0CQJV4BW3" }, { "title": "Redragon S101 Gaming Keyboard, M601 Mouse, RGB Backlit Gaming Keyboard, Programmable Backlit Gaming Mouse, Value Combo Set [New Version]", "asin": "B00NLZUM36", "brand": "Redragon", "stars": 4.6, "reviewsCount": 46346, "thumbnailImage": "https://m.media-amazon.com/images/I/71QDJHG1PqL.__AC_SX300_SY300_QL70_FMwebp_.jpg", "breadCrumbs": "Video Games›PC›Accessories›Gaming Keyboards", "description": null, "price": { "value": 39.99, "currency": "$" }, "url": "https://www.amazon.com/dp/B00NLZUM36" } ] ``` Product data sample ``` [ { "title": "Amazon Basics Wired Keyboard, Full-Sized, QWERTY Layout, Black", "asin": "B07WJ5D3H4", "brand": "Amazon Basics", "stars": 4.5, "reviewsCount": 7606, "thumbnailImage": "https://m.media-amazon.com/images/I/71ehwfAM4-L.__AC_SY300_SX300_QL70_FMwebp_.jpg", "breadCrumbs": "Electronics›Computers & Accessories›Computer Accessories & Peripherals›Keyboards, Mice & Accessories›Keyboards", "description": "Product DescriptionFeaturing a standard US QWERTY layout, the keyboard provides comfort and familiarity, while the sleek black design complements any tech setup or decor seamlessly. This wired keyboard and mouse set is great for those seeking a wired keyboard and mouse for home or office use. The mouse and keyboard combo offers a practical plug-and-play solution, compatible with multiple versions of Windows, including 2000, XP, Vista, 7, 8, and 10/11.From the ManufacturerAmazon Basics", "price": { "value": 18.04, "currency": "$" }, "url": "https://www.amazon.com/dp/B07WJ5D3H4" } ] ``` Category data sample ``` [ { "title": "Logitech M185 Wireless Mouse, 2.4GHz with USB Mini Receiver, 12-Month Battery Life, 1000 DPI Optical Tracking, Ambidextrous PC/Mac/Laptop - Swift Grey", "asin": "B004YAVF8I", "brand": "Logitech", "stars": 4.5, "reviewsCount": 37418, "thumbnailImage": "https://m.media-amazon.com/images/I/5181UFuvoBL.__AC_SX300_SY300_QL70_FMwebp_.jpg", "breadCrumbs": "Electronics›Computers & Accessories›Computer Accessories & Peripherals›Keyboards, Mice & Accessories›Mice", "description": "Logitech Wireless Mouse M185. A simple, reliable mouse with plug-and-play wireless, a 1-year battery life and 3-year limited hardware warranty.(Battery life may vary based on user and computing conditions.) System Requirements: Windows Vista Windows 7 Windows 8 Windows 10|Mac OS X 10.5 or later|Chrome OS|Linux kernel 2.6+|USB port", "price": { "value": 13.97, "currency": "$" }, "url": "https://www.amazon.com/dp/B004YAVF8I" }, { "title": "Logitech MX Master 3S - Wireless Performance Mouse with Ultra-fast Scrolling, Ergo, 8K DPI, Track on Glass, Quiet Clicks, USB-C, Bluetooth, Windows, Linux, Chrome - Graphite", "asin": "B09HM94VDS", "brand": "Logitech", "stars": 4.5, "reviewsCount": 9333, "thumbnailImage": "https://m.media-amazon.com/images/I/41+eEANAv3L._AC_SY300_SX300_.jpg", "breadCrumbs": "Electronics›Computers & Accessories›Computer Accessories & Peripherals›Keyboards, Mice & Accessories›Mice", "description": "Logitech MX Master 3S Performance Wireless Mouse Introducing Logitech MX Master 3S – an iconic mouse remastered. Now with Quiet Clicks(2) and 8K DPI any-surface tracking for more feel and performance than ever before. Product details: Weight: 4.97 oz (141 g) Dimensions: 2 x 3.3 x 4.9 in (51 x 84.3 x 124.9 mm) Compatible with Windows, macOS, Linux, Chrome OS, iPadOS, Android operating systems (8) Rechargeable Li-Po (500 mAh) battery Sensor technology: Darkfield high precision Buttons: 7 buttons (Left/Right-click, Back/Forward, App-Switch, Wheel mode-shift, Middle click), Scroll Wheel, Thumbwheel, Gesture button Wireless operating distance: 33 ft (10 m) (9)Footnotes: (1) 4 mm minimum glass thickness (2) Compared to MX Master 3, MX Master 3S has 90% less Sound Power Level left and right click, measured at 1m (3) Compared to regular Logitech mouse without an electromagnetic scroll wheel (4) Compared to Logitech Master 2S mouse with Logitech Options installed and Smooth scrolling enabled (5) Requires Logi Options+ software, available for Windows and macOS (6) Not compatible with Logitech Unifying technology (7) Battery life may vary based on user and computing conditions. (8) Device basic functions will be supported without software for operating systems other than Windows and macOS (9) Wireless range may vary depending on operating environment and computer setup", "price": { "value": 89.99, "currency": "$" }, "url": "https://www.amazon.com/dp/B09HM94VDS" }, { "title": "Apple Magic Mouse - White Multi-Touch Surface ", "asin": "B0DL72PK1P", "brand": "Apple", "stars": 4.6, "reviewsCount": 18594, "thumbnailImage": "https://m.media-amazon.com/images/I/41U6Q0T5toL.__AC_SY445_SX342_QL70_FMwebp_.jpg", "breadCrumbs": "", "description": null, "price": { "value": 78.99, "currency": "$" }, "url": "https://www.amazon.com/dp/B0DL72PK1P" } ] ``` ## Other scrapers available There are other native Make Apps powered by Apify. You can check out Apify Scraper for: * [TikTok Data](https://docs.apify.com/platform/integrations/make/tiktok.md) * [Google Search](https://docs.apify.com/platform/integrations/make/search.md) * [Google Maps Emails Data](https://docs.apify.com/platform/integrations/make/maps.md) * [YouTube Data](https://docs.apify.com/platform/integrations/make/youtube.md) * [AI crawling](https://docs.apify.com/platform/integrations/make/ai-crawling.md) And more! Because you can access any of thousands of our scrapers on Apify Store by using the [general Apify connections](https://www.make.com/en/integrations/apify). --- # Source: https://docs.apify.com/academy/node-js/analyzing-pages-and-fixing-errors.md # How to analyze and fix errors when scraping a website **Learn how to deal with random crashes in your web-scraping and automation jobs. Find out the essentials of debugging and fixing problems in your crawlers.** *** Debugging is absolutely essential in programming. Even if you don't call yourself a programmer, having basic debugging skills will make building crawlers easier. It will also help you save money by allowing you to avoid hiring an expensive developer to solve your issue for you. This quick lesson covers the absolute basics by discussing some of the most common problems and the simplest tools for analyzing and fixing them. ## Possible causes It is often tricky to see the full scope of what can go wrong. We assume that once the code is set up correctly, it will keep working. Unfortunately, that is rarely true in the realm of web scraping and automation. Websites change, they introduce new [anti-scraping technologies](https://docs.apify.com/academy/anti-scraping.md), programming tools change and, in addition, people make mistakes. Here are the most common reasons your working solution may break. * The website changes its layout or [data feed](https://www.datafeedwatch.com/academy/data-feed). * A site's layout changes depending on location or uses [A/B testing](https://www.youtube.com/watch?v=XDoKXaGrUxE&feature=youtu.be). * A page starts to block you (recognizes you as a bot). * The website [loads its data later dynamically](https://docs.apify.com/academy/node-js/dealing-with-dynamic-pages.md), so the code works only sometimes, if you are slow or lucky enough. * You made a mistake when updating your code. * Your [proxies](https://docs.apify.com/academy/anti-scraping/mitigation/proxies.md) aren't working. * You have upgraded your [dependencies](https://www.quora.com/What-is-a-dependency-in-coding) (other software that your software relies upon), and the new versions no longer work (this is harder to debug). ## Diagnosing/analyzing the issue Web scraping and automation are very specific types of programming. It is not possible to rely on specialized debugging tools, since the code does not output the same results every time. However, there are still many ways to diagnose issues in a crawler. > Many issues are edge cases, which occur in one of a thousand pages or are time-dependent. Because of this, you cannot rely only on [determinism](https://en.wikipedia.org/wiki/Deterministic_algorithm). ### Logging Logging is an essential tool for any programmer. When used correctly, it helps you capture a surprising amount of information. Here are some general rules for logging: * Usually, **many logs** is better than **no logs** at all. * Putting more information into one line, rather than logging multiple short lines, helps reduce the overall log size. * Focus on numbers. Log how many items you extract from a page, etc. * Structure your logs and use the same structure in all your logs. * Append the current page's URL to each log. This lets you immediately open that page and review it. Here's an example of what a structured log message might look like: ``` [CATEGORY]: Products: 20, Unique products: 4, Next page: true --- https://apify.com/store ``` The log begins with the **page type**. Usually, we use labels such as **\[CATEGORY]** and **\[DETAIL]**. Then, we log important numbers and other information. Finally, we add the page's URL, so we can check if the log is correct. #### Logging errors Errors require a different approach because, if your code crashes, your usual logs will not be called. Instead, exception handlers will print the error, but these are usually ugly messages with a [stack trace](https://en.wikipedia.org/wiki/Stack_trace) that only the experts will understand. You can overcome this by adding [try/catch blocks](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch) into your code. In the catch block, explain what happened and re-throw the error (so the request is automatically retried). ``` try { // Sensitive code block // ... } catch (error) { // You know where the code crashed so you can explain here throw new Error('Request failed during login with an error', { cause: error }); } ``` ### Saving snapshots By snapshots, we mean **screenshots** if you use a [browser with Puppeteer/Playwright](https://docs.apify.com/academy/puppeteer-playwright.md) and HTML saved into a [key-value store](https://crawlee.dev/api/core/class/KeyValueStore) that you can display in your own browser. Snapshots are useful throughout your code but especially important in error handling. Note that an error can happen only in a few pages out of a thousand and look completely random. You cannot do much else than to save and analyze a snapshot. Snapshots can tell you if: * A website has changed its layout. This can also mean A/B testing or different content for different locations. * You have been blocked—you open a [CAPTCHA](https://en.wikipedia.org/wiki/CAPTCHA) or an **Access Denied** page. * Data load later dynamically—the page is empty. * The page was redirected—the content is different. You can learn how to take snapshots in Puppeteer or Playwright in [this short lesson](https://docs.apify.com/academy/puppeteer-playwright/page/page-methods.md) #### When to save snapshots The most common approach is to save on error. We can enhance our previous try/catch block like this: ``` import { puppeteerUtils } from 'crawlee'; // ... // storeId is ID of current key value store, where we save snapshots const storeId = Actor.getEnv().defaultKeyValueStoreId; try { // Sensitive code block // ... } catch (error) { // Change the way you save it depending on what tool you use const randomNumber = Math.random(); const key = `ERROR-LOGIN-${randomNumber}`; await puppeteerUtils.saveSnapshot(page, { key }); const screenshotLink = `https://api.apify.com/v2/key-value-stores/${storeId}/records/${key}.jpg`; // You know where the code crashed so you can explain here throw new Error('Request failed during login with an error', { cause: error }); } // ... ``` To make the error snapshot descriptive, we name it **ERROR-LOGIN**. We add a random number so the next **ERROR-LOGIN**s would not overwrite this one and we can see all the snapshots. If you can use an ID of some sort, it is even better. **Beware:** * The snapshot's **name** (key) can only contain letter, number, dot and dash characters. Other characters will cause an error, which makes the random number a safe pick. * Do not overdo the snapshots. Once you get out of the testing phase, limit them to critical places. Saving snapshots uses resources. ### Error reporting Logging and snapshotting are great tools but once you reach a certain run size, it may be hard to read through them all. For a large project, it is handy to create a more sophisticated reporting system. ## With the Apify SDK This example extends our snapshot solution above by creating a [named dataset](https://docs.apify.com/platform/storage/usage.md#named-and-unnamed-storages) (named datasets have infinite retention), where we will accumulate error reports. Those reports will explain what happened and will link to a saved snapshot, so we can do a quick visual check. ``` import { Actor } from 'apify'; import { puppeteerUtils } from 'crawlee'; await Actor.init(); // ... // Let's create reporting dataset // If you already have one, this will continue adding to it const reportingDataset = await Actor.openDataset('REPORTING'); try { // Sensitive code block // ... } catch (error) { // Change the way you save it depending on what tool you use const randomNumber = Math.random(); const key = `ERROR-LOGIN-${randomNumber}`; // The store gets removed with the run after data retention period so the links will stop working eventually // You can store the snapshots infinitely in a named KV store by adding `keyValueStoreName` option await puppeteerUtils.saveSnapshot(page, { key }); // To create the reporting URLs, we need to know the Key-Value store and run IDs const { actorRunId, defaultKeyValueStoreId } = Actor.getEnv(); // We create a report object const report = { errorType: 'login', errorMessage: error.toString(), // .html and .jpg file extensions are added automatically by the saveSnapshot function htmlSnapshotUrl: `https://api.apify.com/v2/key-value-stores/${defaultKeyValueStoreId}/records/${key}.html`, screenshotUrl: `https://api.apify.com/v2/key-value-stores/${defaultKeyValueStoreId}/records/${key}.jpg`, runUrl: `https://console.apify.com/actors/runs/${actorRunId}`, }; // And we push the report to our reporting dataset await reportingDataset.pushData(report); // You know where the code crashed so you can explain here throw new Error('Request failed during login with an error', { cause: error }); } // ... await Actor.exit(); ``` --- # Source: https://docs.apify.com/academy/anti-scraping.md # Anti-scraping protections **Understand the various anti-scraping measures different sites use to prevent bots from accessing them, and how to appear more human to fix these issues.** *** If at any point in time you've strayed away from the Academy's demo content, and into the Wild West by writing some scrapers of your own, you may have been hit with anti-scraping measures. This is extremely common in the scraping world; however, the good thing is that there are always solutions. This section covers the essentials of mitigating anti-scraping protections, such as proxies, HTTP headers and cookies, and a few other things to consider when working on a reliable and scalable crawler. Proper usage of the methods taught in the next lessons will allow you to extract data which is specific to a certain location, enable your crawler to browse websites as a logged-in user, and more. In development, it is crucial to check and adjust the configurations related to our next lessons' topics, as doing this can fix blocking issues on the majority of websites. ## Quick start If you don't have time to read about the theory behind anti-scraping protections to fine-tune your scraping project and instead you need to get unblocked ASAP, here are some quick tips: * Use high-quality proxies. [Residential proxies](https://docs.apify.com/platform/proxy/residential-proxy.md) are the least blocked. You can find many providers out there like Apify, BrightData, Oxylabs, NetNut, etc. * Set **real-user-like HTTP settings** and **browser fingerprints**. [Crawlee](https://crawlee.dev/) uses statistically generated realistic HTTP headers and browser fingerprints by default for all of its crawlers. * Use a browser to pass bot capture challenges. We recommend [Playwright with Firefox](https://crawlee.dev/docs/examples/playwright-crawler-firefox) because it is not that common for scraping. You can also play with [non-headless mode](https://crawlee.dev/api/playwright-crawler/interface/PlaywrightCrawlerOptions#headless) and adjust other [fingerprint settings](https://crawlee.dev/api/browser-pool/interface/FingerprintGeneratorOptions). * Consider extracting data from **[private APIs](https://docs.apify.com/academy/api-scraping.md)** or **mobile app APIs**. They are usually much less protected. * Increase the number of request retries significantly to at least 10 with [maxRequestRetries: 10](https://crawlee.dev/api/basic-crawler/interface/BasicCrawlerOptions#maxRequestRetries). Rotate sessions after every error with [maxErrorScore: 1](https://crawlee.dev/api/core/interface/SessionOptions#maxErrorScore) * If you cannot afford to use browsers for performance reasons, you can try [Playwright.request](https://playwright.dev/docs/api/class-playwright#playwright-request) or [curl-impersonate](https://www.npmjs.com/package/node-libcurl) as the HTTP library for [Cheerio](https://crawlee.dev/api/cheerio-crawler/class/CheerioCrawler) or [Basic](https://crawlee.dev/api/basic-crawler/class/BasicCrawler) Crawlers, instead of its default [got-scraping](https://crawlee.dev/docs/guides/got-scraping) HTTP back end. These libraries have access to native code which offers much finer control over the HTTP traffic and mimics real browsers more than what can be achieved with plain Node.js implementation like `got-scraping`. These libraries should become part of Crawlee itself in the future. In the vast majority of cases, this configuration should lead to success. Success doesn't mean that all requests will go through unblocked, that is not realistic. Some IP addresses and fingerprint combinations will still be blocked but the automatic retry system takes care of that. If you can get at least 10% of your requests through, you can still scrape the whole website with enough retries. The default [SessionPool](https://crawlee.dev/api/core/class/SessionPool) configuration will preserve the working sessions and eventually the success rate will increase. If the above tips didn't help, you can try to fiddle with the following: * Try different browsers. Crawlee & Playwright support Chromium, Firefox and WebKit out of the box. You can also try the [Brave browser](https://brave.com) which [can be configured for Playwright](https://blog.apify.com/unlocking-the-potential-of-brave-and-playwright-for-browser-automation/). * Don't use browsers at all. Sometimes the anti-scraping protections are extremely sensitive to browser behavior but will allow plain HTTP requests (with the right headers) just fine. Don't forget to match the specific [HTTP headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers) for each request. * Decrease concurrency. Slower scraping means you can blend in better with the rest of the traffic. * Add human-like behavior. Don't traverse the website like a bot (paginating quickly from 1 to 100). Instead, visit various types of pages, add time randomizations and you can even introduce some mouse movements and clicks. * Try Puppeteer with the [puppeteer-extra-plugin-stealth](https://github.com/berstend/puppeteer-extra/tree/master/packages/puppeteer-extra-plugin-stealth) plugin. Generally, Crawlee's default configuration should have stronger bypassing but some features might land first in the stealth plugin. * Find different sources of the data. The data might be rendered to the HTML but you could also find it in JavaScript (inlined in the HTML or in files) or in the API responses. Especially the APIs are often much less protected (if you use the right headers). * Reverse engineer the JavaScript challenges that run on the page so you can figure out how the bypass them. This is a very advanced topic that you can read about online. We plan to introduce more content about this. Keep in mind that there is no silver bullet solution. You can find many anti-scraping systems and each of them behaves differently depending the website's configuration. That is why "trying a few things" usually leads to success. You will find more details about these tricks in the [mitigation](https://docs.apify.com/academy/anti-scraping/mitigation.md) section below. ## First of all, why do websites want to block bots? What's up with that?! A website might have a variety of reasons to block bots from accessing it. Here are a few of the main ones: * To prevent the possibility of malicious bots from crawling the site to steal sensitive data like passwords or personal data about users. * In order to avoid server performance hits due to bots making a large amount of requests to the website at a single time. * To avoid their competitors to gain market insights about their business. * To prevent bots from scraping their content and selling it to other websites or re-publishing it. * To not skew their analytics data with bot traffic. * If it is a social media website, they might be attempting to keep away bots programmed to mass create fake profiles (which are usually sold later). > We recommend checking out [this article about legal and ethical ramifications of web scraping](https://blog.apify.com/is-web-scraping-legal/). Unfortunately for these websites, they have to make compromises and tradeoffs. While super strong anti-bot protections will surely prevent the majority of bots from accessing their content, there is also a higher chance of regular users being flagged as bots and being blocked as well. Because of this, different sites have different scraping-difficulty levels based on the anti-scraping measures they take. > Going into this topic, it's important to understand that there is no one silver bullet solution to bypassing protections against bots. Even if two websites are using Cloudflare (for example), one of them might be significantly more difficult to scrape due to harsher CloudFlare configurations. It is all about configuration, not the anti-scraping tool itself. ## The principles of anti-scraping protections Anti-scraping protections can work on many different layers and use a large amount of bot-identification techniques. 1. **Where you are coming from** - The IP address of the incoming traffic is always available to the website. Proxies are used to emulate a different IP addresses but their quality matters a lot. 2. **How you look** - With each request, the website can analyze its HTTP headers, TLS version, ciphers, and other information. Moreover, if you use a browser, the website can also analyze the whole browser fingerprint and run challenges to classify your hardware (like graphics hardware acceleration). 3. **What you are scraping** - The same data can be extracted in many ways from a website. You can get the initial HTML or you can use a browser to render the full page or you can reverse engineer internal APIs. Each of those endpoints can be protected differently. 4. **How you behave** - The website can see patterns in how you are ordering your requests, how fast you are scraping, etc. It can also analyze browser behavior like mouse movement, clicks or key presses. These are the 4 main principles that anti-scraping protections are based on. Not all websites use all of these principles but they encompass the possibilities websites have to track and block bots. All techniques that help you mitigate anti-scraping protections are based on making yourself blend in with the crowd of regular users with each of these principles. A bot can usually be detected in one of two ways, which follow two different types of web scraping: 1. Crawlers using **HTTP requests** 2. Crawlers using **browser automation** (usually with a headless browser) Once a bot is detected, there are some countermeasures a website takes to prevent it from re-accessing it. The protection techniques are divided into two main categories: 1. Uses only the **information provided within the HTTP request**, such as headers, IP addresses, TLS versions, ciphers, etc. 2. Uses **JavaScript evaluation to collect browser fingerprint**, or even track the user behavior on the website. These JavaScript evaluations can also track mouse movement or keys pressed. Based on the information gathered, they can decide if the user is a bot or a human. This method is often paired with the first one. Once one of these methods detects that the user is a bot, it will take countermeasures depending on how advanced its techniques are. A common workflow of a website after it has detected a bot goes as follows: 1. The bot is added to the "greylist" (a list of suspicious IP addresses, fingerprints or any other value that can be used to uniquely identify the bot). 2. A [Turing test](https://en.wikipedia.org/wiki/Turing_test) is provided to the bot. Typically a **captcha**. If the bot succeeds, it is added to the whitelist. 3. If the captcha is failed, the bot is added to the blacklist. One thing to keep in mind while navigating through this course is that advanced anti-scraping methods are able to identify non-humans not only by one value (such as a single header value, or IP address), but are able to identify them through more complex things such as header combinations. Watch a conference talk by [Ondra Urban](https://github.com/mnmkng), which provides an overview of various anti-scraping measures and tactics for circumventing them. [YouTube video player](https://www.youtube-nocookie.com/embed/aXil0K-M-Vs) Several years old? Although the talk, given in 2021, features some outdated code examples, it still serves well as a general overview. ## Common anti-scraping measures Because we here at Apify scrape for a living, we have discovered many popular and niche anti-scraping techniques. We've compiled them into a short and comprehensible list here to help understand the roadblocks before this course teaches you how to get around them. > Not all issues you encounter are caused by anti-scraping systems. Sometimes, it's a configuration issue. Learn [how to effectively debug your programs here](https://docs.apify.com/academy/node-js/analyzing-pages-and-fixing-errors.md). ### IP rate-limiting This is the most straightforward and standard protection, which is mainly implemented to prevent DDoS attacks, but it also works for blocking scrapers. Websites using rate limiting don't allow to more than some defined number of requests from one IP address in a certain time span. If the max-request number is low, then there is a high potential for false-positive due to IP address uniqueness, such as in large companies where hundreds of employees can share the same IP address. > Learn more about rate limiting in our [rate limiting guide](https://docs.apify.com/academy/anti-scraping/techniques/rate-limiting.md) ### Header checking This type of bot identification is based on the given fact that humans are accessing web pages through browsers, which have specific header sets which they send along with every request. The most commonly known header that helps to detect bots is the `User-Agent` header, which holds a value that identifies which browser is being used, and what version it's running. Though `User-Agent` is the most commonly used header for the **Header checking** method, other headers are sometimes used as well. The evaluation is often also run based on the header consistency, and includes a known combination of browser headers. ### URL analysis Solely based on the way how the bots operate. It compares data-rich page visits and the other page visits. The ratio of the data-rich and regular pages has to be high to identify the bot and reduce false positives successfully. ### Regular structure changes By definition, this is not an anti-scraping method, but it can heavily affect the reliability of a scraper. If your target website drastically changes its CSS selectors, and your scraper is heavily reliant on selectors, it could break. In principle, websites using this method change their HTML structure or CSS selectors randomly and frequently, making the parsing of the data harder, and requiring more maintenance of the bot. One of the best ways of avoiding the possible breaking of your scraper due to website structure changes is to limit your reliance on data from HTML elements as much as possible (see [API Scraping](https://docs.apify.com/academy/api-scraping.md) and [JavaScript objects within HTML](https://docs.apify.com/academy/node-js/js-in-html.md)) ### IP session consistency This technique is commonly used to entirely block the bot from accessing the website altogether. It works on the principle that every entity that accesses the site gets a token. This token is then saved together with the IP address and HTTP request information such as User-Agent and other specific headers. If the entity makes another request, but without the session token, the IP address is added on the greylist. ### Interval analysis This technique is based on analyzing the time intervals of the visit of a website. If the times are very similar, the entity is added to the greylist. This method’s premise is that the bot runs in regular intervals by, for example, a Cron job that starts every Monday. It is a long-term strategy, so it should be used as an extension. This technique needs only the information from the HTTP request to identify the frequency of the visits. ### Browser fingerprinting One of the most successful and advanced methods is collecting the browser's "fingerprint", which is a fancy name for information such as fonts, audio codecs, canvas fingerprint, graphics card, and more. Browser fingerprints are highly unique, so they are a reliable means of identifying a specific user (or bot). If the fingerprint provides different/inconsistent information, the user is added to the greylist. > It's important to note that this method also blocks all users that cannot evaluate JavaScript (such as bots sending only static HTTP requests), and combines both of the fundamental methods mentioned earlier. ### Honeypots The honeypot approach is based on providing links that only bots can see. A typical example is hidden pagination. Usually, the bot needs to go through all the pages in the pagination, so the website's last "fake" page has a hidden link for the user, but has the same selector as the real one. Once the bot visits the link, it is automatically blacklisted. This method needs only the HTTP information. ## First up In our [first section](https://docs.apify.com/academy/anti-scraping/techniques.md), we'll be discussing more in-depth about the various anti-scraping methods and techniques websites use, as well as how to mitigate these protections. --- # Source: https://docs.apify.com/academy/api-scraping.md # API scraping **Learn all about how the professionals scrape various types of APIs with various configurations, parameters, and requirements.** *** API scraping is locating a website's API endpoints, and fetching the desired data directly from their API, as opposed to parsing the data from their rendered HTML pages. > **Note:** In the next few lessons, we'll be using [SoundCloud's website](https://soundcloud.com) as an example target, but the techniques described here can be applied to any site. In this module, we will discuss the benefits and drawbacks of API scraping, how to locate an API, how to utilize its potential features, and how to work around some common roadblocks. ## What's an API? An API is a custom service that lives on the server of any given website. They provide an intuitive way for the website's client-side pages to send and receive data to and from the server, where it can be stored in a database, manipulated, or used to perform an operation. Though not **all** sites have APIs, many do, especially those built as complex web applications. Learn more about APIs [in this article](https://blog.apify.com/what-is-an-api/). ## Different types of APIs Websites use APIs which can be either REST or GraphQL. While REST is a vague architectural style based only on conventions, GraphQL is a specification. The REST APIs usually consists of many so-called endpoints, to which you can send your requests. In the responses you are provided with information about various resources, such as users, products, etc. Examples of typical REST API requests: ``` GET https://api.example.com/users/123 GET https://api.example.com/comments/abc123?limit=100 POST https://api.example.com/orders ``` In a GraphQL API, all requests are `POST` and point to a single URL, typically something like `https://api.example.com/graphql`. To get data, you send along a query in the GraphQL query language, optionally with variables. Example of such query: ``` query($number_of_repos: Int!) { viewer { name repositories(last: $number_of_repos) { nodes { name } } } } ``` ## Advantages of API scraping
### 1. More reliable Since the data is coming directly from the site's API, as opposed to the parsing of HTML content based on CSS selectors, it can be relied on more, as it is less likely to change. Typically, websites change their APIs much less frequently than they change the structure/selectors of their pages. ### 2. Configurable Most APIs accept query parameters such as `maxPosts` or `fromCountry`. These parameters can be mapped to the configuration options of the scraper, which makes creating a scraper that supports various requirements and use-cases much easier. They can also be utilized to filter and/or limit data results. ### 3. Fast and efficient Especially for [dynamic sites](https://blog.apify.com/what-is-a-dynamic-page/), in which a headless browser would otherwise be required (it can sometimes be slow and cumbersome), scraping their API can prove to be much quicker and more efficient. ### 4. Easy on the target website Depending on the website, sending large amounts of requests to their pages could result in a slight performance decrease on their end. By using their API instead, not only does your scraper run better, but it is less demanding of the target website. ## Disadvantages of API Scraping
### 1. Sometimes requires special tokens Many APIs will require the session cookie, an API key, or some other special value to be included within the header of the request in order to receive any data back. For certain projects, this can be a challenge. ### 2. Potential overhead For complex APIs that require certain headers and/or payloads in order to make a successful request, return encoded data, have rate limits, or that use GraphQL, there can be a slight overhead in figuring out how to utilize them in a scraper. ## Extra challenges
### 1. Different data formats APIs come in all different shapes and sizes. That means every API will vary in not only the quality of the data that it returns, but also the format that it is in. The two most common formats are JSON and HTML. JSON responses are ideal, as they can be manipulated in JavaScript code. In general, no serious parsing is necessary, and the data can be filtered and formatted to fit a scraper's dataset schema. APIs which output HTML generally return the raw HTML of a small component of the page which is already hydrated with data. In these cases, it is still worth using the API, as it is still more efficient than making a request to the entire page; even though the data does still need to be parsed from the HTML response. ### 2. Encoded data Sometimes, a response will look something like this: ``` { "title": "Scraping Academy Message", "message": "SGVsbG8hIFlvdSBoYXZlIHN1Y2Nlc3NmdWxseSBkZWNvZGVkIHRoaXMgYmFzZTY0IGVuY29kZWQgbWVzc2FnZSEgV2UgaG9wZSB5b3UncmUgbGVhcm5pbmcgYSBsb3QgZnJvbSB0aGUgQXBpZnkgU2NyYXBpbmcgQWNhZGVteSE=" } ``` Or some other encoding format. This example's `message` has some data encoded in [Base64](https://en.wikipedia.org/wiki/Base64), which is one of the most common encoding types. For testing out Base64 encoding and decoding, you can use [base64encode.org](https://www.base64encode.org/) and [base64decode.org](https://www.base64decode.org/). Within a project where base64 decoding/encoding is necessary, the [Node.js Buffer Class](https://nodejs.org/api/buffer.html) can be used like so: ``` const value = 'SGVsbG8hIFlvdSBoYXZlIHN1Y2Nlc3NmdWxseSBkZWNvZGVkIHRoaXMgYmFzZTY0IGVuY29kZWQgbWVzc2FnZSEgV2UgaG9wZSB5b3UncmUgbGVhcm5pbmcgYSBsb3QgZnJvbSB0aGUgQXBpZnkgU2NyYXBpbmcgQWNhZGVteSE='; const decoded = Buffer.from(value, 'base64').toString('utf-8'); console.log(decoded); ``` ## First up Get started with this course by learning some general knowledge about API scraping in the [General API Scraping](https://docs.apify.com/academy/api-scraping/general-api-scraping.md) section! This section will teach you everything you need to know about scraping APIs before moving into more complex sections. --- # Source: https://docs.apify.com/platform/integrations/api.md # Source: https://docs.apify.com/academy/api.md # Source: https://docs.apify.com/api.md https://docs.apify.com [Academy](https://docs.apify.com/academy)[Platform](https://docs.apify.com/platform) [API](https://docs.apify.com/api) * [Reference](https://docs.apify.com/api/v2) * [Client for JavaScript](https://docs.apify.com/api/client/js/) * [Client for Python](https://docs.apify.com/api/client/python/) [SDK](https://docs.apify.com/sdk) * [SDK for JavaScript](https://docs.apify.com/sdk/js/) * [SDK for Python](https://docs.apify.com/sdk/python/) [CLI](https://docs.apify.com/cli/) [Open source](https://docs.apify.com/open-source) * [Crawlee](https://crawlee.dev) * [Fingerprint Suite](https://github.com/apify/fingerprint-suite) * [impit](https://github.com/apify/impit) * [MCP CLI](https://github.com/apify/mcp-cli) * [Actor whitepaper](https://whitepaper.actor) * [proxy-chain](https://github.com/apify/proxy-chain) * [Apify on GitHub](https://github.com/apify) [Chat on Discord](https://discord.com/invite/jyEM2PRvMU)[Go to Console](https://console.apify.com) # Apify API documentation Learn how to use the [Apify platform](https://docs.apify.com/platform.md) programmatically. ## REST API The Apify API is built around HTTP REST, uses predictable resource-oriented URLs, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. [View API reference](https://docs.apify.com/api/v2.md) cURL ``` # Prepare Actor input and run it synchronously echo '{ "searchStringsArray": ["Apify"] }' | curl -X POST -d @- \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -L 'https://api.apify.com/v2/acts/compass~crawler-google-places/run-sync-get-dataset-items' ``` ## API clients The client libraries are a more convenient way to interact with the Apify platform than the HTTP REST API. ##### ![](/img/javascript-40x40.svg)![](/img/javascript-40x40.svg)JavaScript ##### ![](/img/python-40x40.svg)![](/img/python-40x40.svg)Python ### JavaScript API client For web browser, JavaScript/TypeScript applications, Node.js, Deno, or Bun.[Star](https://github.com/apify/apify-client-js) [Get started](https://docs.apify.com/api/client/js/docs)[View reference](https://docs.apify.com/api/client/js/reference) ``` npm install apify-client ``` ``` // Easily run Actors, await them to finish using the convenient .call() method, and retrieve results from the resulting dataset. const { ApifyClient } = require('apify-client'); const client = new ApifyClient({ token: 'MY-APIFY-TOKEN', }); // Starts an actor and waits for it to finish. const { defaultDatasetId } = await client.actor('john-doe/my-cool-actor').call(); // Fetches results from the actor's dataset. const { items } = await client.dataset(defaultDatasetId).listItems(); ``` ## Related articles https://blog.apify.com/web-scraping-with-client-side-vanilla-javascript/ [Web scraping with client-side Vanilla JavaScript](https://blog.apify.com/web-scraping-with-client-side-vanilla-javascript/) [Read more](https://blog.apify.com/web-scraping-with-client-side-vanilla-javascript/) https://blog.apify.com/apify-python-api-client/ [Apify ❤️ Python, so we’re releasing a Python API client](https://blog.apify.com/apify-python-api-client/) [Read more](https://blog.apify.com/apify-python-api-client/) https://blog.apify.com/api-for-dummies/ [API for dummies](https://blog.apify.com/api-for-dummies/) [Read more](https://blog.apify.com/api-for-dummies/) Learn * [Academy](https://docs.apify.com/academy) * [Platform](https://docs.apify.com/platform) API * [Reference](https://docs.apify.com/api/v2) * [Client for JavaScript](https://docs.apify.com/api/client/js/) * [Client for Python](https://docs.apify.com/api/client/python/) SDK * [SDK for JavaScript](https://docs.apify.com/sdk/js/) * [SDK for Python](https://docs.apify.com/sdk/python/) Other * [CLI](https://docs.apify.com/cli/) * [Open source](https://docs.apify.com/open-source) More * [Crawlee](https://crawlee.dev) * [GitHub](https://github.com/apify) * [Discord](https://discord.com/invite/jyEM2PRvMU) * [Trust Center](https://trust.apify.com) https://apify.com --- # Source: https://docs.apify.com/academy/apify-actors.md # Tutorials on Apify Actors **Learn how to deploy your API project to the Apify platform.** *** This tutorial shows you how to add your existing RapidAPI project to Apify, giving you access to managed hosting, data storage, and a broader user base through Apify Store while maintaining your RapidAPI presence. * [Adding your RapidAPI project to Apify](https://docs.apify.com/academy/apify-actors/adding-rapidapi-project.md) --- # Source: https://docs.apify.com/academy/expert-scraping-with-apify/apify-api-and-client.md # Apify API & client **Gain an in-depth understanding of the two main ways of programmatically interacting with the Apify platform - through the API, and through a client.** *** You can use one of the two main ways to programmatically interact with the Apify platform: by directly using [Apify's RESTful API](https://docs.apify.com/api/v2.md), or by using the [JavaScript](https://docs.apify.com/api/client/js) and [Python](https://docs.apify.com/api/client/python) API clients. In the next two lessons, we'll be focusing on the first two. > Apify's API and JavaScript API client allow us to do anything a regular user can do when interacting with the platform's web interface, only programmatically. ## Learning 🧠 * Scroll through the [Apify API docs](https://docs.apify.com/api/v2.md) (there's a whole lot there, so you're not expected to memorize everything). * Read about the Apify client in [Apify's docs](https://docs.apify.com/api/client/js). It can also be seen on [GitHub](https://github.com/apify/apify-client-js) and [npm](https://www.npmjs.com/package/apify-client). * Learn about the [Actor.newClient()](https://docs.apify.com/sdk/js/reference/class/Actor#newClient) function in the Apify SDK. * Skim through [this article](https://help.apify.com/en/articles/2868670-how-to-pass-data-from-web-scraper-to-another-actor) about API integration (this article is old; however, still relevant). ## Knowledge check 📝 1. What is the relationship between the Apify API and the Apify client? Are there any significant differences? 2. How do you pass input when running an Actor or task via API? 3. Do you need to install the `apify-client` npm package when already using the `apify` package? ## Our task We'll be creating another new Actor, which will have two jobs: 1. Programmatically call the task for the Amazon Actor. 2. Export its results into CSV format under a new key called **OUTPUT.csv** in the default key-value store. Though it's a bit unintuitive, this is a perfect activity for learning how to use both the Apify API and the Apify JavaScript client. The new Actor should take the following input values, which be mapped to parameters in the API calls: ``` { // How much memory to allocate to the Amazon Actor // Must be a power of 2 "memory": 4096, // Whether to use the JavaScript client to make the // call, or to use the API "useClient": false, // The fields in each item to return back. All other // fields should be omitted "fields": ["title", "itemUrl", "offer"], // The maximum number of items to return back "maxItems": 10 } ``` [Solution](https://docs.apify.com/academy/expert-scraping-with-apify/solutions/using-api-and-client.md) ## Next up [Lesson VI](https://docs.apify.com/academy/expert-scraping-with-apify/migrations-maintaining-state.md) will teach us everything we need to know about migrations and how to handle them properly to avoid losing any state; therefore, increasing the reliability of our `demo-actor` Amazon scraper. --- # Source: https://docs.apify.com/academy/getting-started/apify-api.md # The Apify API **Learn how to use the Apify API to programmatically call your Actors, retrieve data stored on the platform, view Actor logs, and more!** *** [Apify's API](https://docs.apify.com/api/v2.md) is your ticket to the Apify platform without even needing to access the [Apify Console](https://console.apify.com?asrc=developers_portal) web-interface. The API is organized around RESTful HTTP endpoints. In this lesson, we'll be learning how to use the Apify API to call an Actor and view its results. We'll be using the Actor we created in the previous lesson, so if you haven't already gotten that one set up, go ahead do that before moving forward if you'd like to follow along. ## Finding your endpoint Within one of your Actors on the [Apify Console](https://console.apify.com?asrc=developers_portal) (we'll use the **adding-actor** from the previous lesson), click on the **API** button in the top right-hand corner: ![The \"API\" button on an Actor\'s page on the Apify Console](/assets/images/api-tab-1fb75598685ed64e58605cd51734d19c.jpg) You should see a long list of API endpoints that you can copy and paste elsewhere, or even test right within the **API** modal. Go ahead and copy the endpoint labeled **Run Actor synchronously and get dataset items**. It should look something like this: ``` https://api.apify.com/v2/acts/YOUR_USERNAME~adding-actor/run-sync?token=YOUR_TOKEN ``` Single endpoint In this lesson, we'll only be focusing on this one endpoint, as it is the most popularly used one, however, don't let this limit your curiosity! Take a look at the other endpoints in the **API** window to learn about everything you can do to your Actor programmatically. Now, let's move over to our favorite HTTP client (in this lesson we'll use [Insomnia](https://insomnia.rest/) in order to prepare and send the request, but you can use [Postman](https://www.postman.com/), [Bruno](https://www.usebruno.com/), [Httpie](https://httpie.io/) or any other client you like). ## Providing input Our **adding-actor** takes in two input values (`num1` and `num2`). When using the Actor on the platform, provide these fields either through the UI generated by the **INPUT\_SCHEMA.json**, or directly in JSON format. When providing input when making an API call to run an Actor, the input must be provided in the **body** of the POST request as a JSON object. ![Providing input](/assets/images/provide-input-16fe316e976462f5e2d9ede9158b6b8b.jpg) ## Parameters Let's say we want to run our **adding-actor** via API and view its results in CSV format at the end. We'll achieve this by passing the **format** parameter with a value of **csv** to change the output format: ``` https://api.apify.com/v2/acts/YOUR_USERNAME~adding-actor/run-sync-get-dataset-items?token=YOUR_TOKEN_HERE&format=csv ``` Additional parameters can be passed to this endpoint. You can learn about them in our [API documentation](https://docs.apify.com/api/v2/act-run-sync-get-dataset-items-post.md) Token security Network components can record visited URLs, so it's more secure to send the token as a HTTP header, not as a parameter. The header should look like `Authorization: Bearer YOUR_TOKEN`. Popular HTTP clients, such as Postman or Insomnia, provide a convenient way to configure the Authorization header for all your API requests. ## Sending the request If you're not using an HTTP client, you can send the request through your terminal with this command: ``` curl -d '{"num1":1, "num2":8}' -H "Content-Type: application/json" -X POST "https://api.apify.com/v2/acts/YOUR_USERNAME~adding-actor/run-sync-get-dataset-items?token=YOUR_TOKEN_HERE&format=csv" ``` Here's the response we got: ![API response](/assets/images/api-csv-response-486ba68d3939c6f5c9328f8fefa5c7a2.png) And there it is! The Actor was run with our inputs of **num1** and **num2**, then the dataset results were returned back to us in CSV format. ## Apify API's many features What we've done in this lesson only scratches the surface of what the Apify API can do. Right from Insomnia, or from any HTTP client, you can manage [datasets](https://docs.apify.com/api/v2/storage-datasets.md) and [key-value stores](https://docs.apify.com/api/v2/storage-key-value-stores.md), add to [request queues](https://docs.apify.com/api/v2/storage-request-queues.md), [update Actors](https://docs.apify.com/api/v2/act-put.md), and much more! Basically, whatever you can do on the platform's web interface, you also do through the API. ## Next up [Next up](https://docs.apify.com/academy/getting-started/apify-client.md), we'll be learning about how to use Apify's JavaScript and Python clients to interact with the API right within our code. --- # Source: https://docs.apify.com/academy/tools/apify-cli.md # The Apify CLI **Learn about, install, and log into the Apify CLI - your best friend for interacting with the Apify platform via your terminal.** *** The https://docs.apify.com/cli helps you create, develop, build and run Apify Actors, and manage the Apify cloud platform from any computer. It can be used to automatically generate the boilerplate for different types of projects, initialize projects, remotely call Actors on the platform, and run your own projects. ## Installing To install the Apify CLI, you'll first need npm, which comes preinstalled with Node.js. If you haven't yet installed Node, https://docs.apify.com/academy/web-scraping-for-beginners/data-extraction/computer-preparation.md. Additionally, make sure you've got an Apify account, as you will need to log in to the CLI to gain access to its full potential. Open up a terminal instance and run the following command: ``` npm i -g apify-cli ``` This will install the CLI via npm. ## Logging in After the CLI has finished installing, navigate to the https://console.apify.com?asrc=developers_portal and click on **Settings**. Then, within your account settings, click **Integrations**. The page should look like this: ![Integrations tab on the Apify platform](/assets/images/settings-integrations-bcf75452aa36a2cb05b72fda836b070a.jpg) > We've censored out the **User ID** in the image because it is private information which should not be shared with anyone who is not trusted. The same goes for your **Personal API Token**. Copy the **Personal API Token** and return to your terminal, entering this command: ``` apify login -t YOUR_TOKEN_HERE ``` If you see a log which looks like this, ``` Success: You are logged in to Apify as YOUR_USERNAME! ``` If you see a log which looks like **Success: You are logged in to Apify as YOUR\_USERNAME!**, you're in! --- # Source: https://docs.apify.com/academy/getting-started/apify-client.md # Apify client **Interact with the Apify API in your code by using the apify-client package, which is available for both JavaScript and Python.** *** Now that you've gotten your toes wet with interacting with the Apify API through raw HTTP requests, you're ready to become familiar with the **Apify client**, which is a package available for both JavaScript and Python that allows you to interact with the API in your code without explicitly needing to make any GET or POST requests. This lesson will provide code examples for both Node.js and Python, so regardless of the language you are using, you can follow along! ## Examples You can access `apify-client` examples in the Console Actor detail page. Click the **API** button and then the **API Client** dropdown button. ![API button](/assets/images/api-button-16287c6b358ebf6ad02c35f2ece5c333.png) ## Installing and importing If you are going to use the client in Node.js, use this command within one of your projects to install the package through npm: ``` npm install apify-client ``` In Python, you can install it from PyPI with this command: ``` pip install apify-client ``` After installing the package, let's make a file named `client.js` (or `client.py` for Python) and import the Apify client like so: * Node.js * Python ``` // client.js import { ApifyClient } from 'apify-client'; ``` ``` # client.py from apify_client import ApifyClient ``` ## Running an Actor In the last lesson, we ran the **adding-actor** and retrieved its dataset items. That's exactly what we're going to do now; however, by using the Apify client instead. Before we can use the client though, we must create a new instance of the `ApifyClient` class and pass it our API token from the [Integrations page](https://console.apify.com/account?tab=integrations&asrc=developers_portal) on the Apify Console: * Node.js * Python ``` const client = new ApifyClient({ token: 'YOUR_TOKEN', }); ``` ``` client = ApifyClient(token='YOUR_TOKEN') ``` Environment variables If you are planning on publishing your code to a public GitHub/Gitlab repository or anywhere else online, be sure to set your API token as en environment variable, and never hardcode it directly into your script. Now that we've got our instance, we can point to an Actor using the [client.actor()](https://docs.apify.com/api/client/js/reference/class/ApifyClient#actor) function, then call the Actor with some input with the [.call()](https://docs.apify.com/api/client/js/reference/class/ApifyClient#actor) function - the first parameter of which is the input for the Actor. * Node.js * Python ``` const run = await client.actor('YOUR_USERNAME/adding-actor').call({ num1: 4, num2: 2, }); ``` ``` run = client.actor('YOUR_USERNAME/adding-actor').call(run_input={ 'num1': 4, 'num2': 2 }) ``` Learn more Learn more about the `.call()` function in our [API documentation](https://docs.apify.com/api/client/js/reference/class/ApifyClient#actor). ## Downloading dataset items Once an Actor's run has completed, it will return a **run info** object that looks something like this: ![Run info object](/assets/images/run-info-5744283cdcb67851aa05d10ef782d69d.jpg) The `run` variable we created in the last section points to the **run info** object of the run we created with the `.call()` function, which means that through this variable, we can access the run's `defaultDatasetId`. This ID can then be passed into the `client.dataset()` function. * Node.js * Python ``` const dataset = client.dataset(run.defaultDatasetId); ``` ``` dataset = client.dataset(run['defaultDatasetId']) ``` Finally, we can download the items in the dataset by using the **list items** function, then log them to the console. * Node.js * Python ``` const { items } = await dataset.listItems(); console.log(items); ``` ``` items = dataset.list_items().items print(items) ``` The final code for running the Actor and fetching its dataset items looks like this: * Node.js * Python ``` // client.js import { ApifyClient } from 'apify-client'; const client = new ApifyClient({ token: 'YOUR_TOKEN', }); const run = await client.actor('YOUR_USERNAME/adding-actor').call({ num1: 4, num2: 2, }); const dataset = client.dataset(run.defaultDatasetId); const { items } = await dataset.listItems(); console.log(items); ``` ``` # client.py from apify_client import ApifyClient client = ApifyClient(token='YOUR_TOKEN') actor = client.actor('YOUR_USERNAME/adding-actor').call(run_input={ 'num1': 4, 'num2': 2 }) dataset = client.dataset(run['defaultDatasetId']) items = dataset.list_items().items print(items) ``` ## Updating an Actor If you check the **Settings** tab within your **adding-actor**, you'll notice that the default timeout being set to the Actor is **360 seconds**. This is a bit overkill considering the fact that the Actor is only adding two numbers together - the run should never take more than 20 seconds (even this is a generous number). The default memory being allocated to the Actor is **256 MB**, which is reasonable for our purposes. Let's change these two Actor settings via the Apify client using the [actor.update()](https://docs.apify.com/api/client/js/reference/class/ActorClient#update) function. This function will call the **update Actor** endpoint, which can take `defaultRunOptions` as an input property. You can find the shape of the `defaultRunOptions` in the [API documentation](https://docs.apify.com/api/v2/act-put.md). Perfect! First, we'll create a pointer to our Actor, similar to before (except this time, we won't be using `.call()` at the end): * Node.js * Python ``` const actor = client.actor('YOUR_USERNAME/adding-actor'); ``` ``` actor = client.actor('YOUR_USERNAME/adding-actor') ``` Then, we'll call the `.update()` method on the `actor` variable we created and pass in our new **default run options**: * Node.js * Python ``` await actor.update({ defaultRunOptions: { build: 'latest', memoryMbytes: 256, timeoutSecs: 20, }, }); ``` ``` actor.update(default_run_build='latest', default_run_memory_mbytes=256, default_run_timeout_secs=20) ``` After running the code, go back to the **Settings** page of **adding-actor**. If your default options now look like this, then it worked!: ![New run defaults](/assets/images/new-defaults-ba42f0ce8c11e3b3a26e55d07f2d77b5.jpg) ## Overview You can do so much more with the Apify client than running Actors, updating Actors, and downloading dataset items. The purpose of this lesson was to get you comfortable using the client in your own projects, as it's the absolute best developer tool for integrating the Apify platform with an external system. For a more in-depth understanding of the Apify API client, give these a quick lookover: * [API client for JavaScript](https://docs.apify.com/api/client/js) * [API client for Python](https://docs.apify.com/api/client/python) ## Next up Now that you're familiar and a bit more comfortable with the Apify platform, you're ready to start deploying your code to Apify! In the [next section](https://docs.apify.com/academy/deploying-your-code.md), you'll learn how to take any project written in any programming language and turn it into an Actor. --- # Source: https://docs.apify.com/academy/node-js/apify-free-google-serp-api.md # Apify's free Google SERP API You need to regularly grab SERP data about your target keywords? Apify provides a free SERP API that includes organic search, ads, people also ask, etc. Free Apify accounts come with unlimited proxy access and $5 of credit. To get started, head over to the [Google Search Results Scraper](https://apify.com/apify/google-search-scraper) page and click the `Try me` button. You'll be taken to a page where you can enter the search query, region, language and other settings. ![Apify Google SERP API](/assets/images/gserp-api-2621c8ee29f74544ef0ec986a4a8989a.png) Hit `Save & Run` and you'll have the downloaded data as soon as the query finishes. To have it run at a regular frequency, you can set up the task to run on an [automatic schedule](https://docs.apify.com/platform/schedules.md#setting-up-a-new-schedule). To run from the API, send a [synchronous POST request](https://docs.apify.com/api/v2/actor-task-run-sync-get-dataset-items-post.md) to an endpoint such as `https://api.apify.com/v2/acts/TASK_NAME_OR_ID/runs?token=YOUR_TOKEN`. Include any required input in a JSON object in the request's body. Keep in mind that, as Google search uses a non-deterministic algorithm, output results may vary even if the input settings are exactly the same. --- # Source: https://docs.apify.com/sdk/js/docs/guides/apify-platform.md # Source: https://docs.apify.com/academy/apify-platform.md # Introduction to the Apify platform **Learn all about the Apify platform, all of the tools it offers, and how it can improve your overall development experience.** *** The [Apify platform](https://apify.com) was built to serve large-scale and high-performance web scraping and automation needs. It provides easy access to compute instances ([Actors](https://docs.apify.com/academy/getting-started/actors.md)), convenient request and result storages, proxies, scheduling, webhooks and more - all accessible through the **Console** web interface, [Apify's API](https://docs.apify.com/api/v2.md), or our [JavaScript](https://docs.apify.com/api/client/js) and [Python](https://docs.apify.com/api/client/python) API clients. ## Category outline In this category, you'll learn how to become an Apify platform developer from the ground up. From creating your first account, to developing Actors, this is your one-stop-shop for understanding how the platform works, and how to work with it. ## First up We'll start off this category light, by showing you how to create an Apify account and get everything ready for development with the platform. [Let's go!](https://docs.apify.com/academy/getting-started.md) --- # Source: https://docs.apify.com/academy/apify-scrapers.md # Tutorials on ready-made Apify scrapers **Discover Apify's ready-made web scraping and automation tools. Compare Web Scraper, Cheerio Scraper and Puppeteer Scraper to decide which is right for you.** *** Scraping and crawling the web can be difficult and time-consuming without the right tools. That's why Apify provides ready-made solutions to crawl and scrape any website. They are based on our [Actors](https://apify.com/actors), the [Apify SDK](https://docs.apify.com/sdk/js) and [Crawlee](https://crawlee.dev/). Don't let the number of options confuse you. Unless you're really sure you need to use a specific tool, go ahead and use **Web Scraper** ([apify/web-scraper](https://docs.apify.com/academy/apify-scrapers/web-scraper.md)). It is the easiest to pick up and can handle almost anything. Look at **Puppeteer Scraper** ([apify/puppeteer-scraper](https://docs.apify.com/academy/apify-scrapers/puppeteer-scraper.md)) or **Cheerio Scraper** ([apify/cheerio-scraper](https://docs.apify.com/academy/apify-scrapers/cheerio-scraper.md)) only after you know your target websites well and need to optimize your scraper. [Visit the Scraper introduction tutorial to get started!](https://docs.apify.com/academy/apify-scrapers/getting-started.md) ## Web Scraper Web Scraper is a ready-made solution for scraping the web using the Chrome browser. It takes away all the work necessary to set up a browser for crawling, controls the browser automatically and produces machine-readable results in several common formats. Underneath, it uses the Puppeteer library to control the browser, but you don't need to worry about that. Using a web UI and a little of basic JavaScript, you can tweak it to serve almost any scraping need. [Visit the Web Scraper tutorial to get started!](https://docs.apify.com/academy/apify-scrapers/web-scraper.md) ## Cheerio Scraper Cheerio Scraper is a ready-made solution for crawling the web using plain HTTP requests to retrieve HTML pages and then parsing and inspecting the HTML using the [cheerio](https://www.npmjs.com/package/cheerio) library. It's blazing fast. Cheerio is a server-side version of the popular jQuery library that does not run in the browser but instead constructs a DOM out of an HTML string and then provides the user an API to work with that DOM. Cheerio Scraper is ideal for scraping websites that do not rely on client-side JavaScript to serve their content. It can be as much as 20 times faster than using a full-browser solution like Puppeteer. [Visit the Cheerio Scraper tutorial to get started!](https://docs.apify.com/academy/apify-scrapers/cheerio-scraper.md) ## Puppeteer Scraper Puppeteer Scraper is the most powerful scraper tool in our arsenal (aside from developing your own Actors). It uses the Puppeteer library to programmatically control a headless Chrome browser, and it can make it do almost anything. If using Web Scraper does not cut it, Puppeteer Scraper is what you need. Puppeteer is a Node.js library, so knowledge of Node.js and its paradigms is expected when working with Puppeteer Scraper. [Visit the Puppeteer Scraper tutorial to get started!](https://docs.apify.com/academy/apify-scrapers/puppeteer-scraper.md) --- # Source: https://docs.apify.com/api/client/python/docs/concepts/asyncio-support.md # Asyncio support Copy for LLM The package provides an asynchronous version of the client, [`ApifyClientAsync`](https://docs.apify.com/api/client/python/api/client/python/reference/class/ApifyClientAsync.md), which allows you to interact with the Apify API using Python's standard async/await syntax. This enables you to perform non-blocking operations, see the Python [asyncio documentation](https://docs.python.org/3/library/asyncio-task.html) for more information. The following example demonstrates how to run an Actor asynchronously and stream its logs while it is running: ``` import asyncio from apify_client import ApifyClientAsync TOKEN = 'MY-APIFY-TOKEN' async def main() -> None: apify_client = ApifyClientAsync(TOKEN) actor_client = apify_client.actor('my-actor-id') # Start the Actor and get the run ID run_result = await actor_client.start() run_client = apify_client.run(run_result['id']) log_client = run_client.log() # Stream the logs async with log_client.stream() as async_log_stream: if async_log_stream: async for bytes_chunk in async_log_stream.aiter_bytes(): print(bytes_chunk) if __name__ == '__main__': asyncio.run(main()) ``` --- # Source: https://docs.apify.com/platform/actors/development/automated-tests.md # Automated tests for Actors **Learn how to automate ongoing testing and make sure your Actors perform over time. See code examples for configuring the Actor Testing Actor.** *** Automated testing is crucial for maintaining the reliability and performance of your Actors over time. This guide will help you set up automated tests using the [Actor Testing Actor](https://apify.com/pocesar/actor-testing). ## Set up automated tests 1. Prepare test tasks - Create 1–5 separate testing tasks for your Actor. 2. Configure Actor testing - Set up a task using the Actor Testing Actor. 3. Validate tests - Run the test task multiple times until all tests pass. 4. Schedule tests - Set up a recurring schedule for your tests. 5. Monitor results - Review and address any issues on a weekly basis. ## Create test tasks Example of Actor testing tasks When creating test tasks: * Include a test for your Actor's default configuration * Set a low `maxItem` value to conserve credits * For large data tests, reduce test frequency to conserve credits ## Configure the Actor Testing Actor Follow the [setup guide](https://apify.com/pocesar/actor-testing) in the Actor's README. Here are some recommended test scenarios: * Run status * Crash information from the log * Information from statistics (runtime, retries) * Information about and from within the dataset * Information about the key-value store ``` await expectAsync(runResult).toHaveStatus('SUCCEEDED'); ``` ``` await expectAsync(runResult).withLog((log) => { // Neither ReferenceError or TypeErrors should ever occur // in production code – they mean the code is over-optimistic // The errors must be dealt with gracefully and displayed with a helpful message to the user expect(log) .withContext(runResult.format('ReferenceError')) .not.toContain('ReferenceError'); expect(log) .withContext(runResult.format('TypeError')) .not.toContain('TypeError'); }); ``` ``` await expectAsync(runResult).withStatistics((stats) => { // In most cases, you want it to be as close to zero as possible expect(stats.requestsRetries) .withContext(runResult.format('Request retries')) .toBeLessThan(3); // What is the expected run time for the number of items? expect(stats.crawlerRuntimeMillis) .withContext(runResult.format('Run time')) .toBeWithinRange(1 * 60000, 10 * 60000); }); ``` ``` await expectAsync(runResult).withDataset(({ dataset, info }) => { // If you're sure, always set this number to be your exact maxItems expect(info.cleanItemCount) .withContext(runResult.format('Dataset cleanItemCount')) .toBe(3); // or toBeGreaterThan(1) or toBeWithinRange(1,3) // Make sure the dataset isn't empty expect(dataset.items) .withContext(runResult.format('Dataset items array')) .toBeNonEmptyArray(); const results = dataset.items; // Check dataset items to have the expected data format for (const result of results) { expect(result.directUrl) .withContext(runResult.format('Direct url')) .toStartWith('https://www.yelp.com/biz/'); expect(result.bizId) .withContext(runResult.format('Biz ID')) .toBeNonEmptyString(); } }); ``` ``` await expectAsync(runResult).withKeyValueStore(({ contentType }) => { // Check for the proper content type of the saved key-value item expect(contentType) .withContext(runResult.format('KVS contentType')) .toBe('image/gif'); }, // This also checks for existence of the key-value key { keyName: 'apify.com-scroll_lossless-comp' }, ); ``` --- # Source: https://docs.apify.com/academy/node-js/avoid-eacces-error-in-actor-builds.md # Avoid EACCES error in Actor builds with a custom Dockerfile Sometimes when building an Actor using a custom Dockerfile, you might receive errors like: ``` Missing write access to ... ``` or ``` EACCES: permission denied ``` This problem is usually caused by the fact that by default, the `COPY` Dockerfile instruction copies files as the root user (with UID and GID of 0), while your Dockerfile probably uses another user to copy files and run commands. To fix this problem, make sure the `COPY`  instruction in Dockerfile uses the `--chown` flag. For example, instead of ``` COPY . ./ ``` use ``` COPY --chown=myuser:myuser . ./ ``` where `myuser` is the user and group defined by the `USER`  instruction in the base Docker image. To learn more, see [Dockerfile documentation](https://docs.docker.com/reference/dockerfile/#copy). Hope this helps! --- # Source: https://docs.apify.com/platform/integrations/aws_bedrock.md # Amazon Bedrock integrations **Learn how to integrate Apify with Amazon Bedrock Agents to provide web data for AI agents.** *** [Amazon Bedrock](https://aws.amazon.com/bedrock/) is a fully managed service that provides access to large language models (LLMs), allowing users to create and manage retrieval-augmented generative (RAG) pipelines, and create AI agents to plan and perform actions. AWS Bedrock supports a wide range of models from providers such as A21 Labs, Anthropic, Cohere, Meta, and Mistral AI. These models are designed to handle complex, multistep tasks across systems, knowledge bases, and APIs, making them versatile for various use cases. In this tutorial, we’ll demonstrate how to create and use AWS Bedrock AI agent and integrate it with Apify Actors. The AI agent will be configured to either answer questions from an internal LLM knowledge or to leverage the [RAG Web Browser](https://apify.com/apify/rag-web-browser) to perform internet searches for relevant information. This approach enables the agent to provide more comprehensive and accurate responses by combining internal knowledge with real-time data from the web. ## AWS Bedrock AI agents Amazon Bedrock allows you to create AI agents powered by large language models to analyze user input and determine the required data sources, and execute actions needed to fulfill the user requests. Before getting started, ensure you have: * An active AWS Account. * An Apify account and an [API token](https://docs.apify.com/platform/integrations/api#api-token). * Granted access to any Large Language Model from Amazon Bedrock. To add access to a LLM, follow this [guide](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access-modify.html). We'll use **Anthropic Claude 3.5 Sonnet** in this example. The overall process for creating an agent includes the following [steps](https://docs.aws.amazon.com/bedrock/latest/userguide/agents.html): * Provide a name and description for the agent. * Specify instructions for the agent. * Set up actions in action groups by defining function details or using an OpenAPI schema. * Configure a Lambda function to implement the defined function or OpenAPI schema. * Select a model for the agent to orchestrate with. * (Optional) Add knowledge bases for the agent. * (Optional) Configure advanced prompts for the agent for better control. The following image illustrates the key components of an AWS Bedrock AI agent: ![AWS-Bedrock-AI-Agent](/assets/images/aws-bedrock-ai-agent-1122d56e1c1d39a22a99fe0febe7bad5.png) ### Building an Agent To begin, open the Amazon Bedrock console and select agents from the left navigation panel. On the next screen, click Create agent to start building your agent. ![aws-bedrock-menu.png](/assets/images/aws-bedrock-menu-1d4b2f7fa5e1fa1923fd99ab1c197208.png) #### Step 1: Provide agent details Enter a name and description for your agent. This will create a new agent and open the Agent Builder page. On this page, you can: * Select the LLM model to use. * Add knowledge bases. * Set up actions. * Provide instructions for the agent. For example, you can use the following instructions: ``` You are a smart and helpful assistant. Answer question based on the search results. Use an expert, friendly, and informative tone Always use RAG Web Browser if you need to retrieve the latest search results and answer questions. ``` ![AWS-Bedrock-Create-Agent](/assets/images/aws-bedrock-create-agent-19992787dcaa17536564c2c06a80d272.png) #### Step 2: Create actions After saving the agent, preparing it, and testing it in the embedded chat window, you’ll notice that it cannot yet retrieve real-time search data from the internet. To enable this functionality, you need to create actions that integrate the agent with Apify and provide the necessary search data. Navigate to the **Actions Groups**, where you can define a set of actions. Actions can be created by either: * Providing function details, or * Using an OpenAPI schema, which will be implemented via a Lambda function. For this example, use the following settings: * Action type - Define with API schema * Action group invocation - Create a new Lambda function * Action group schema - Define via in-line editor ![AWS-Bedrock-Agent-Builder-Create-Action](/assets/images/aws-bedrock-agent-builder-create-action-cdca260e1099e97663d98613fb0b6c0d.png) In the in-line editor, paste the OpenAPI schema of the [RAG Web Browser](https://raw.githubusercontent.com/apify/rag-web-browser/refs/heads/master/docs/standby-openapi-3.0.0.json). At this point, the Agent is almost ready to integrate with Apify. Save the action to create a new, empty Lambda function. The final step is to update the Lambda function to implement the OpenAPI schema and enable real-time web search capabilities. #### Step 3: Lambda function 1. Open the Lambda function you created and copy-paste the [Python lambda function](https://raw.githubusercontent.com/apify/rag-web-browser/refs/heads/master/docs/aws-lambda-call-rag-web-browser.py). 2. Replace `APIFY_API_TOKEN` in the code with your Apify API token. Alternatively, store the token as an environment variable: * Go to the Configuration tab. * Select Environment Variables. * Add a new variable by specifying a key and value. 3. Configure the Lambda function: * Set the memory allocation to 128 MB and timeout duration to 60 seconds. 4. Save the Lambda function and deploy it. #### Step 4: Test the agent 1. Return to the **AWS Bedrock console** and prepare the agent for testing in the embedded chat window. 2. Test the agent by entering a query, for example: "What is the latest news about AWS Bedrock" 3. Based on your query, the agent will determine the appropriate action to take. You can view the agent's reasoning in the **Trace Step view**. For instance: ``` { "rationale": { "text": "To answer this question about the latest news for AWS Bedrock, I'll need to use the RAG Web Browser function to search for and retrieve the most recent information. I'll craft a search query that specifically targets AWS Bedrock news.", "traceId": "845d524a-b82c-445b-9e36-66d887b3b25e-0" } } ``` The agent will use the RAG Web Browser to gather relevant information and provide a response to the user query. ![aws-bedrock-agent-chat.png](/assets/images/aws-bedrock-agent-chat-0cab59d11394bd7c88a284cc5b7f59fc.png) ### Limitations and debugging When integrating agent in AWS Bedrock, you may encounter some limitations and issues. * **Model access**: Ensure that you have access to the model you want to use in the agent. If you don't have access, you can request it from the model provider. * **Lambda function**: Ensure that the Lambda function is correctly implemented and deployed. Check the function logs for any errors. * **Environment variables**: Ensure that the `APIFY_API_TOKEN` is correctly set in the Lambda function. * **Memory and timeout**: Ensure that the Lambda function has enough memory and timeout to call the RAG Web Browser. * **Agent trace**: Use the agent trace view to debug the agent's reasoning and actions. * **Response Size**: AWS Bedrock enforces a 25KB limit on response bodies. Limit results and truncate text as needed to stay within this constraint. ## Resources * [Amazon Bedrock Agents](https://aws.amazon.com/bedrock/agents/) * [Amazon Bedrock Agents Quickstart](https://github.com/build-on-aws/amazon-bedrock-agents-quickstart) * [Apify - RAG Web Browser](https://apify.com/apify/rag-web-browser) --- # Source: https://docs.apify.com/platform/actors/development/programming-interface/basic-commands.md # Basic commands **Learn how to use basic commands of the Apify SDK for both JavaScript and Python.** *** This page covers essential commands for the Apify SDK in JavaScript & Python. These commands are designed to be used within a running Actor, either in a local environment or on the Apify platform. ## Initialize your Actor Before using any Apify SDK methods, initialize your Actor. This step prepares the Actor to receive events from the Apify platform, sets up machine and storage configurations, and clears previous local storage states. * JavaScript * Python Use the `init()` method to initialize your Actor. Pair it with `exit()` to properly terminate the Actor. For more information on `exit()`, go to . ``` import { Actor } from 'apify'; await Actor.init(); console.log('Actor starting...'); // ... await Actor.exit(); ``` Alternatively, use the `main()` function for environments that don't support top-level awaits. The `main()` function is syntax-sugar for `init()` and `exit()`. It will call `init()` before it executes its callback and `exit()` after the callback resolves. ``` import { Actor } from 'apify'; Actor.main(async () => { console.log('Actor starting...'); // ... }); ``` In Python, use an asynchronous context manager with the `with` keyword. The `init()` method will be called before the code block is executed, and the `exit()` method will be called after the code block is finished. ``` from apify import Actor async def main(): async with Actor: Actor.log.info('Actor starting...') # ... ``` ## Get input Access the Actor's input object, which is stored as a JSON file in the Actor's default key-value store. The input is an object with properties. If the Actor defines the input schema, the input object is guaranteed to conform to it. * JavaScript * Python ``` import { Actor } from 'apify'; await Actor.init(); const input = await Actor.getInput(); console.log(input); // prints: {'option1': 'aaa', 'option2': 456} await Actor.exit(); ``` ``` from apify import Actor async def main(): async with Actor: actor_input: dict = await Actor.get_input() or {} Actor.log.info(actor_input) # prints: {'option1': 'aaa', 'option2': 456} ``` Usually, the file is called `INPUT`, but the exact key is defined in the `ACTOR_INPUT_KEY` environment variable. ## Key-value store access Use the [Key-value store](https://docs.apify.com/platform/storage/key-value-store.md) to read and write arbitrary files * JavaScript * Python ``` import { Actor } from 'apify'; await Actor.init(); // Save object to store (stringified to JSON) await Actor.setValue('my_state', { something: 123 }); // Save binary file to store with content type await Actor.setValue('screenshot.png', buffer, { contentType: 'image/png' }); // Get a record from the store (automatically parsed from JSON) const value = await Actor.getValue('my_state'); // Access another key-value store by its name const store = await Actor.openKeyValueStore('screenshots-store'); await store.setValue('screenshot.png', buffer, { contentType: 'image/png' }); await Actor.exit(); ``` ``` from apify import Actor async def main(): async with Actor: # Save object to store (stringified to JSON) await Actor.set_value('my_state', {'something': 123}) # Get a record from the store (automatically parsed from JSON) value = await Actor.get_value('my_state') # Log the obtained value Actor.log.info(f'value = {value}') # prints: value = {'something': 123} ``` ## Push results to the dataset Store larger results in a [Dataset](https://docs.apify.com/platform/storage/dataset.md), an append-only object storage Note that Datasets can optionally be equipped with the schema that ensures only certain kinds of objects are stored in them. * JavaScript * Python ``` import { Actor } from 'apify'; await Actor.init(); // Append result object to the default dataset associated with the run await Actor.pushData({ someResult: 123 }); await Actor.exit(); ``` ``` from apify import Actor async def main(): async with Actor: # Append result object to the default dataset associated with the run await Actor.push_data({'some_result': 123}) ``` ## Exit Actor When an Actor's main process terminates, the Actor run is considered finished. The process exit code determines Actor's final status: * Exit code `0`: Status `SUCCEEDED` * Exit code not equal to `0`: Status `FAILED` By default, the platform sets a generic status message like *Actor exit with exit code 0*. However, you can provide more informative message using the SDK's exit methods. ### Basic exit Use the `exit()` method to terminate the Actor with a custom status message: * JavaScript * Python ``` import { Actor } from 'apify'; await Actor.init(); // ... // Actor will finish with 'SUCCEEDED' status await Actor.exit('Succeeded, crawled 50 pages'); ``` ``` from apify import Actor async def main(): async with Actor: # Actor will finish with 'SUCCEEDED' status await Actor.exit(status_message='Succeeded, crawled 50 pages') # INFO Exiting actor ({"exit_code": 0}) # INFO [Terminal status message]: Succeeded, crawled 50 pages ``` ### Immediate exit To exit immediately without calling exit handlers: * JavaScript * Python ``` import { Actor } from 'apify'; await Actor.init(); // ... // Exit right away without calling `exit` handlers at all await Actor.exit('Done right now', { timeoutSecs: 0 }); ``` ``` from apify import Actor async def main(): async with Actor: # Exit right away without calling `exit` handlers at all await Actor.exit(event_listeners_timeout_secs=0, status_message='Done right now') # INFO Exiting actor ({"exit_code": 0}) # INFO [Terminal status message]: Done right now ``` ### Failed exit To indicate a failed run: * JavaScript * Python ``` import { Actor } from 'apify'; await Actor.init(); // ... // Actor will finish with 'FAILED' status await Actor.exit('Could not finish the crawl, try increasing memory', { exitCode: 1 }); ``` ``` from apify import Actor async def main(): async with Actor: # Actor will finish with 'FAILED' status await Actor.exit(status_message='Could not finish the crawl, try increasing memory', exit_code=1) # INFO Exiting actor ({"exit_code": 1}) # INFO [Terminal status message]: Could not finish the crawl, try increasing memory ``` ### Preferred exit methods The SDK provides convenient methods for exiting Actors: * Use `exit()` with custom messages to inform users about the Actor's achievements or issues. * Use `fail()` as a shortcut for `exit()` when indicating an error. It defaults to an exit code of `1` and emits the `exit` event, allowing components to perform cleanup or state persistence. * The `exit()` method also emits the `exit` event, enabling cleanup or state persistence. Example of a failed exit using a shorthand method: * JavaScript * Python ``` import { Actor } from 'apify'; await Actor.init(); // ... // Or nicer way using this syntactic sugar: await Actor.fail('Could not finish the crawl, try increasing memory'); ``` ``` from apify import Actor async def main(): async with Actor: # ... or nicer way using this syntactic sugar: await Actor.fail(status_message='Could not finish the crawl. Try increasing memory') # INFO Exiting actor ({"exit_code": 1}) # INFO [Terminal status message]: Could not finish the crawl. Try increasing memory ``` ### Exit event handlers (JavaScript only) In JavaScript, you can register handlers for the `exit` event: * JavaScript * Python ``` import { Actor } from 'apify'; await Actor.init(); // Register a handler to be called on exit. // Note that the handler has `timeoutSecs` to finish its job. Actor.on('exit', ({ statusMessage, exitCode, timeoutSecs }) => { // Perform cleanup... }); await Actor.exit(); ``` ``` # 😔 Custom handlers are not supported in the Python SDK yet. ``` --- # Source: https://docs.apify.com/sdk/js/docs/examples/basic-crawler.md # Basic crawler Copy for LLM This is the most bare-bones example of the Apify SDK, which demonstrates some of its building blocks such as the [`BasicCrawler`](https://crawlee.dev/api/basic-crawler/class/BasicCrawler). You probably don't need to go this deep though, and it would be better to start with one of the full-featured crawlers like [`CheerioCrawler`](https://crawlee.dev/api/cheerio-crawler/class/CheerioCrawler) or [`PlaywrightCrawler`](https://crawlee.dev/api/playwright-crawler/class/PlaywrightCrawler). The script simply downloads several web pages with plain HTTP requests using the [`got-scraping`](https://github.com/apify/got-scraping) npm package and stores their raw HTML and URL in the default dataset. In local configuration, the data will be stored as JSON files in `./storage/datasets/default`. [Run on](https://console.apify.com/actors/kk67IcZkKSSBTslXI?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCB7IEFjdG9yIH0gZnJvbSAnYXBpZnknO1xcbmltcG9ydCB7IEJhc2ljQ3Jhd2xlciB9IGZyb20gJ2NyYXdsZWUnO1xcbmltcG9ydCB7IGdvdFNjcmFwaW5nIH0gZnJvbSAnZ290LXNjcmFwaW5nJztcXG5cXG5hd2FpdCBBY3Rvci5pbml0KCk7XFxuXFxuLy8gQ3JlYXRlIGEgZGF0YXNldCB3aGVyZSB3ZSB3aWxsIHN0b3JlIHRoZSByZXN1bHRzLlxcbi8vIENyZWF0ZSBhIEJhc2ljQ3Jhd2xlciAtIHRoZSBzaW1wbGVzdCBjcmF3bGVyIHRoYXQgZW5hYmxlc1xcbi8vIHVzZXJzIHRvIGltcGxlbWVudCB0aGUgY3Jhd2xpbmcgbG9naWMgdGhlbXNlbHZlcy5cXG5jb25zdCBjcmF3bGVyID0gbmV3IEJhc2ljQ3Jhd2xlcih7XFxuICAgIC8vIFRoaXMgZnVuY3Rpb24gd2lsbCBiZSBjYWxsZWQgZm9yIGVhY2ggVVJMIHRvIGNyYXdsLlxcbiAgICBhc3luYyByZXF1ZXN0SGFuZGxlcih7IHJlcXVlc3QgfSkge1xcbiAgICAgICAgY29uc3QgeyB1cmwgfSA9IHJlcXVlc3Q7XFxuICAgICAgICBjb25zb2xlLmxvZyhgUHJvY2Vzc2luZyAke3VybH0uLi5gKTtcXG5cXG4gICAgICAgIC8vIEZldGNoIHRoZSBwYWdlIEhUTUwgdmlhIEFwaWZ5IHV0aWxzIGdvdFNjcmFwaW5nXFxuICAgICAgICBjb25zdCB7IGJvZHkgfSA9IGF3YWl0IGdvdFNjcmFwaW5nKHsgdXJsIH0pO1xcblxcbiAgICAgICAgLy8gU3RvcmUgdGhlIEhUTUwgYW5kIFVSTCB0byB0aGUgZGVmYXVsdCBkYXRhc2V0LlxcbiAgICAgICAgYXdhaXQgQWN0b3IucHVzaERhdGEoe1xcbiAgICAgICAgICAgIHVybDogcmVxdWVzdC51cmwsXFxuICAgICAgICAgICAgaHRtbDogYm9keSxcXG4gICAgICAgIH0pO1xcbiAgICB9LFxcbn0pO1xcblxcbi8vIFRoZSBpbml0aWFsIGxpc3Qgb2YgVVJMcyB0byBjcmF3bC4gSGVyZSB3ZSB1c2UganVzdCBhIGZldyBoYXJkLWNvZGVkIFVSTHMuXFxuYXdhaXQgY3Jhd2xlci5ydW4oW1xcbiAgICB7IHVybDogJ2h0dHA6Ly93d3cuZ29vZ2xlLmNvbS8nIH0sXFxuICAgIHsgdXJsOiAnaHR0cDovL3d3dy5leGFtcGxlLmNvbS8nIH0sXFxuICAgIHsgdXJsOiAnaHR0cDovL3d3dy5iaW5nLmNvbS8nIH0sXFxuICAgIHsgdXJsOiAnaHR0cDovL3d3dy53aWtpcGVkaWEuY29tLycgfSxcXG5dKTtcXG5cXG5jb25zb2xlLmxvZygnQ3Jhd2xlciBmaW5pc2hlZC4nKTtcXG5cXG5hd2FpdCBBY3Rvci5leGl0KCk7XFxuXCJ9Iiwib3B0aW9ucyI6eyJidWlsZCI6ImxhdGVzdCIsImNvbnRlbnRUeXBlIjoiYXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOCIsIm1lbW9yeSI6MTAyNCwidGltZW91dCI6MTgwfX0.-TdH8qt-fjSHPGoP8mJHr2LqYkhq6aWUhY9IdesMFrM\&asrc=run_on_apify) ``` import { Actor } from 'apify'; import { BasicCrawler } from 'crawlee'; import { gotScraping } from 'got-scraping'; await Actor.init(); // Create a dataset where we will store the results. // Create a BasicCrawler - the simplest crawler that enables // users to implement the crawling logic themselves. const crawler = new BasicCrawler({ // This function will be called for each URL to crawl. async requestHandler({ request }) { const { url } = request; console.log(`Processing ${url}...`); // Fetch the page HTML via Apify utils gotScraping const { body } = await gotScraping({ url }); // Store the HTML and URL to the default dataset. await Actor.pushData({ url: request.url, html: body, }); }, }); // The initial list of URLs to crawl. Here we use just a few hard-coded URLs. await crawler.run([ { url: 'http://www.google.com/' }, { url: 'http://www.example.com/' }, { url: 'http://www.bing.com/' }, { url: 'http://www.wikipedia.com/' }, ]); console.log('Crawler finished.'); await Actor.exit(); ``` --- # Source: https://docs.apify.com/sdk/python/docs/guides/beautifulsoup-httpx.md # Using BeautifulSoup with HTTPX Copy for LLM In this guide, you'll learn how to use the [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/) library with the [HTTPX](https://www.python-httpx.org/) library in your Apify Actors. ## Introduction[](#introduction) [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/) is a Python library for extracting data from HTML and XML files. It provides simple methods and Pythonic idioms for navigating, searching, and modifying a website's element tree, enabling efficient data extraction. [HTTPX](https://www.python-httpx.org/) is a modern, high-level HTTP client library for Python. It provides a simple interface for making HTTP requests and supports both synchronous and asynchronous requests. To create an Actor which uses those libraries, start from the [BeautifulSoup & Python](https://apify.com/templates/categories/python) Actor template. This template includes the [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/) and [HTTPX](https://www.python-httpx.org/) libraries preinstalled, allowing you to begin development immediately. ## Example Actor[](#example-actor) Below is a simple Actor that recursively scrapes titles from all linked websites, up to a specified maximum depth, starting from URLs provided in the Actor input. It uses [HTTPX](https://www.python-httpx.org/) for fetching pages and [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/) for parsing their content to extract titles and links to other pages. [Run on](https://console.apify.com/actors/HH9rhkFXiZbheuq1V?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCBhc3luY2lvXFxuZnJvbSB1cmxsaWIucGFyc2UgaW1wb3J0IHVybGpvaW5cXG5cXG5pbXBvcnQgaHR0cHhcXG5mcm9tIGJzNCBpbXBvcnQgQmVhdXRpZnVsU291cFxcblxcbmZyb20gYXBpZnkgaW1wb3J0IEFjdG9yLCBSZXF1ZXN0XFxuXFxuXFxuYXN5bmMgZGVmIG1haW4oKSAtPiBOb25lOlxcbiAgICAjIEVudGVyIHRoZSBjb250ZXh0IG9mIHRoZSBBY3Rvci5cXG4gICAgYXN5bmMgd2l0aCBBY3RvcjpcXG4gICAgICAgICMgUmV0cmlldmUgdGhlIEFjdG9yIGlucHV0LCBhbmQgdXNlIGRlZmF1bHQgdmFsdWVzIGlmIG5vdCBwcm92aWRlZC5cXG4gICAgICAgIGFjdG9yX2lucHV0ID0gYXdhaXQgQWN0b3IuZ2V0X2lucHV0KCkgb3Ige31cXG4gICAgICAgIHN0YXJ0X3VybHMgPSBhY3Rvcl9pbnB1dC5nZXQoJ3N0YXJ0X3VybHMnLCBbeyd1cmwnOiAnaHR0cHM6Ly9hcGlmeS5jb20nfV0pXFxuICAgICAgICBtYXhfZGVwdGggPSBhY3Rvcl9pbnB1dC5nZXQoJ21heF9kZXB0aCcsIDEpXFxuXFxuICAgICAgICAjIEV4aXQgaWYgbm8gc3RhcnQgVVJMcyBhcmUgcHJvdmlkZWQuXFxuICAgICAgICBpZiBub3Qgc3RhcnRfdXJsczpcXG4gICAgICAgICAgICBBY3Rvci5sb2cuaW5mbygnTm8gc3RhcnQgVVJMcyBzcGVjaWZpZWQgaW4gQWN0b3IgaW5wdXQsIGV4aXRpbmcuLi4nKVxcbiAgICAgICAgICAgIGF3YWl0IEFjdG9yLmV4aXQoKVxcblxcbiAgICAgICAgIyBPcGVuIHRoZSBkZWZhdWx0IHJlcXVlc3QgcXVldWUgZm9yIGhhbmRsaW5nIFVSTHMgdG8gYmUgcHJvY2Vzc2VkLlxcbiAgICAgICAgcmVxdWVzdF9xdWV1ZSA9IGF3YWl0IEFjdG9yLm9wZW5fcmVxdWVzdF9xdWV1ZSgpXFxuXFxuICAgICAgICAjIEVucXVldWUgdGhlIHN0YXJ0IFVSTHMgd2l0aCBhbiBpbml0aWFsIGNyYXdsIGRlcHRoIG9mIDAuXFxuICAgICAgICBmb3Igc3RhcnRfdXJsIGluIHN0YXJ0X3VybHM6XFxuICAgICAgICAgICAgdXJsID0gc3RhcnRfdXJsLmdldCgndXJsJylcXG4gICAgICAgICAgICBBY3Rvci5sb2cuaW5mbyhmJ0VucXVldWluZyB7dXJsfSAuLi4nKVxcbiAgICAgICAgICAgIG5ld19yZXF1ZXN0ID0gUmVxdWVzdC5mcm9tX3VybCh1cmwsIHVzZXJfZGF0YT17J2RlcHRoJzogMH0pXFxuICAgICAgICAgICAgYXdhaXQgcmVxdWVzdF9xdWV1ZS5hZGRfcmVxdWVzdChuZXdfcmVxdWVzdClcXG5cXG4gICAgICAgICMgQ3JlYXRlIGFuIEhUVFBYIGNsaWVudCB0byBmZXRjaCB0aGUgSFRNTCBjb250ZW50IG9mIHRoZSBVUkxzLlxcbiAgICAgICAgYXN5bmMgd2l0aCBodHRweC5Bc3luY0NsaWVudCgpIGFzIGNsaWVudDpcXG4gICAgICAgICAgICAjIFByb2Nlc3MgdGhlIFVSTHMgZnJvbSB0aGUgcmVxdWVzdCBxdWV1ZS5cXG4gICAgICAgICAgICB3aGlsZSByZXF1ZXN0IDo9IGF3YWl0IHJlcXVlc3RfcXVldWUuZmV0Y2hfbmV4dF9yZXF1ZXN0KCk6XFxuICAgICAgICAgICAgICAgIHVybCA9IHJlcXVlc3QudXJsXFxuXFxuICAgICAgICAgICAgICAgIGlmIG5vdCBpc2luc3RhbmNlKHJlcXVlc3QudXNlcl9kYXRhWydkZXB0aCddLCAoc3RyLCBpbnQpKTpcXG4gICAgICAgICAgICAgICAgICAgIHJhaXNlIFR5cGVFcnJvcignUmVxdWVzdC5kZXB0aCBpcyBhbiB1bmV4cGVjdGVkIHR5cGUuJylcXG5cXG4gICAgICAgICAgICAgICAgZGVwdGggPSBpbnQocmVxdWVzdC51c2VyX2RhdGFbJ2RlcHRoJ10pXFxuICAgICAgICAgICAgICAgIEFjdG9yLmxvZy5pbmZvKGYnU2NyYXBpbmcge3VybH0gKGRlcHRoPXtkZXB0aH0pIC4uLicpXFxuXFxuICAgICAgICAgICAgICAgIHRyeTpcXG4gICAgICAgICAgICAgICAgICAgICMgRmV0Y2ggdGhlIEhUVFAgcmVzcG9uc2UgZnJvbSB0aGUgc3BlY2lmaWVkIFVSTCB1c2luZyBIVFRQWC5cXG4gICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlID0gYXdhaXQgY2xpZW50LmdldCh1cmwsIGZvbGxvd19yZWRpcmVjdHM9VHJ1ZSlcXG5cXG4gICAgICAgICAgICAgICAgICAgICMgUGFyc2UgdGhlIEhUTUwgY29udGVudCB1c2luZyBCZWF1dGlmdWwgU291cC5cXG4gICAgICAgICAgICAgICAgICAgIHNvdXAgPSBCZWF1dGlmdWxTb3VwKHJlc3BvbnNlLmNvbnRlbnQsICdodG1sLnBhcnNlcicpXFxuXFxuICAgICAgICAgICAgICAgICAgICAjIElmIHRoZSBjdXJyZW50IGRlcHRoIGlzIGxlc3MgdGhhbiBtYXhfZGVwdGgsIGZpbmQgbmVzdGVkIGxpbmtzXFxuICAgICAgICAgICAgICAgICAgICAjIGFuZCBlbnF1ZXVlIHRoZW0uXFxuICAgICAgICAgICAgICAgICAgICBpZiBkZXB0aCA8IG1heF9kZXB0aDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgbGluayBpbiBzb3VwLmZpbmRfYWxsKCdhJyk6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmtfaHJlZiA9IGxpbmsuZ2V0KCdocmVmJylcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlua191cmwgPSB1cmxqb2luKHVybCwgbGlua19ocmVmKVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiBsaW5rX3VybC5zdGFydHN3aXRoKCgnaHR0cDovLycsICdodHRwczovLycpKTpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFjdG9yLmxvZy5pbmZvKGYnRW5xdWV1aW5nIHtsaW5rX3VybH0gLi4uJylcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19yZXF1ZXN0ID0gUmVxdWVzdC5mcm9tX3VybChcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5rX3VybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VyX2RhdGE9eydkZXB0aCc6IGRlcHRoICsgMX0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCByZXF1ZXN0X3F1ZXVlLmFkZF9yZXF1ZXN0KG5ld19yZXF1ZXN0KVxcblxcbiAgICAgICAgICAgICAgICAgICAgIyBFeHRyYWN0IHRoZSBkZXNpcmVkIGRhdGEuXFxuICAgICAgICAgICAgICAgICAgICBkYXRhID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICd1cmwnOiB1cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpdGxlJzogc291cC50aXRsZS5zdHJpbmcgaWYgc291cC50aXRsZSBlbHNlIE5vbmUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2gxcyc6IFtoMS50ZXh0IGZvciBoMSBpbiBzb3VwLmZpbmRfYWxsKCdoMScpXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnaDJzJzogW2gyLnRleHQgZm9yIGgyIGluIHNvdXAuZmluZF9hbGwoJ2gyJyldLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoM3MnOiBbaDMudGV4dCBmb3IgaDMgaW4gc291cC5maW5kX2FsbCgnaDMnKV0sXFxuICAgICAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgICAgICAjIFN0b3JlIHRoZSBleHRyYWN0ZWQgZGF0YSB0byB0aGUgZGVmYXVsdCBkYXRhc2V0LlxcbiAgICAgICAgICAgICAgICAgICAgYXdhaXQgQWN0b3IucHVzaF9kYXRhKGRhdGEpXFxuXFxuICAgICAgICAgICAgICAgIGV4Y2VwdCBFeGNlcHRpb246XFxuICAgICAgICAgICAgICAgICAgICBBY3Rvci5sb2cuZXhjZXB0aW9uKGYnQ2Fubm90IGV4dHJhY3QgZGF0YSBmcm9tIHt1cmx9LicpXFxuXFxuICAgICAgICAgICAgICAgIGZpbmFsbHk6XFxuICAgICAgICAgICAgICAgICAgICAjIE1hcmsgdGhlIHJlcXVlc3QgYXMgaGFuZGxlZCB0byBlbnN1cmUgaXQgaXMgbm90IHByb2Nlc3NlZCBhZ2Fpbi5cXG4gICAgICAgICAgICAgICAgICAgIGF3YWl0IHJlcXVlc3RfcXVldWUubWFya19yZXF1ZXN0X2FzX2hhbmRsZWQobmV3X3JlcXVlc3QpXFxuXFxuXFxuaWYgX19uYW1lX18gPT0gJ19fbWFpbl9fJzpcXG4gICAgYXN5bmNpby5ydW4obWFpbigpKVxcblwifSIsIm9wdGlvbnMiOnsiYnVpbGQiOiJsYXRlc3QiLCJjb250ZW50VHlwZSI6ImFwcGxpY2F0aW9uL2pzb247IGNoYXJzZXQ9dXRmLTgiLCJtZW1vcnkiOjEwMjQsInRpbWVvdXQiOjE4MH19.30-Z9WmlG6JbrRuux1nDy2CBsFvflstBVxSmJuSoJCA\&asrc=run_on_apify) ``` import asyncio from urllib.parse import urljoin import httpx from bs4 import BeautifulSoup from apify import Actor, Request async def main() -> None: # Enter the context of the Actor. async with Actor: # Retrieve the Actor input, and use default values if not provided. actor_input = await Actor.get_input() or {} start_urls = actor_input.get('start_urls', [{'url': 'https://apify.com'}]) max_depth = actor_input.get('max_depth', 1) # Exit if no start URLs are provided. if not start_urls: Actor.log.info('No start URLs specified in Actor input, exiting...') await Actor.exit() # Open the default request queue for handling URLs to be processed. request_queue = await Actor.open_request_queue() # Enqueue the start URLs with an initial crawl depth of 0. for start_url in start_urls: url = start_url.get('url') Actor.log.info(f'Enqueuing {url} ...') new_request = Request.from_url(url, user_data={'depth': 0}) await request_queue.add_request(new_request) # Create an HTTPX client to fetch the HTML content of the URLs. async with httpx.AsyncClient() as client: # Process the URLs from the request queue. while request := await request_queue.fetch_next_request(): url = request.url if not isinstance(request.user_data['depth'], (str, int)): raise TypeError('Request.depth is an unexpected type.') depth = int(request.user_data['depth']) Actor.log.info(f'Scraping {url} (depth={depth}) ...') try: # Fetch the HTTP response from the specified URL using HTTPX. response = await client.get(url, follow_redirects=True) # Parse the HTML content using Beautiful Soup. soup = BeautifulSoup(response.content, 'html.parser') # If the current depth is less than max_depth, find nested links # and enqueue them. if depth < max_depth: for link in soup.find_all('a'): link_href = link.get('href') link_url = urljoin(url, link_href) if link_url.startswith(('http://', 'https://')): Actor.log.info(f'Enqueuing {link_url} ...') new_request = Request.from_url( link_url, user_data={'depth': depth + 1}, ) await request_queue.add_request(new_request) # Extract the desired data. data = { 'url': url, 'title': soup.title.string if soup.title else None, 'h1s': [h1.text for h1 in soup.find_all('h1')], 'h2s': [h2.text for h2 in soup.find_all('h2')], 'h3s': [h3.text for h3 in soup.find_all('h3')], } # Store the extracted data to the default dataset. await Actor.push_data(data) except Exception: Actor.log.exception(f'Cannot extract data from {url}.') finally: # Mark the request as handled to ensure it is not processed again. await request_queue.mark_request_as_handled(new_request) if __name__ == '__main__': asyncio.run(main()) ``` ## Conclusion[](#conclusion) In this guide, you learned how to use the [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/) with the [HTTPX](https://www.python-httpx.org/) in your Apify Actors. By combining these libraries, you can efficiently extract data from HTML or XML files, making it easy to build web scraping tasks in Python. See the [Actor templates](https://apify.com/templates/categories/python) to get started with your own scraping tasks. If you have questions or need assistance, feel free to reach out on our [GitHub](https://github.com/apify/apify-sdk-python) or join our [Discord community](https://discord.com/invite/jyEM2PRvMU). Happy scraping! --- # Source: https://docs.apify.com/academy/scraping-basics-javascript/legacy/best-practices.md # Best practices when writing scrapers **Understand the standards and best practices that we here at Apify abide by to write readable, scalable, and maintainable code.** Archived course This is an archive of our old course. Check out our new [Web scraping basics for JavaScript devs](https://docs.apify.com/academy/scraping-basics-javascript.md) course instead! We plan to completely retire this old course in a few months. *** Every developer has their own style, which evolves as they grow and learn. While one dev might prefer a more [functional](https://en.wikipedia.org/wiki/Functional_programming) style, another might find an [imperative](https://en.wikipedia.org/wiki/Imperative_programming) approach to be more intuitive. We at Apify understand this, and have written this best practices lesson with that in mind. The goal of this lesson is not to force you into a specific paradigm or to make you think that you're doing things wrong, but instead to provide you some insight into the standards and best practices that we at Apify follow to ensure readable, maintainable, scalable code. ## Code style When it comes to your code style when writing scrapers, there are some general things we recommend. ### Clean code Praise [clean code](https://blog.risingstack.com/javascript-clean-coding-best-practices-node-js-at-scale/)! Use proper variable and function names that are descriptive of what they are, and split your code into smaller [pure](https://en.wikipedia.org/wiki/Pure_function) functions. ### Constant variables Define any [constant variables](https://softwareengineering.stackexchange.com/questions/250619/best-practices-reasons-for-string-constants-in-javascript) that globally apply to the scraper in a single file named **constants.js**, from where they will all be imported. Constant variable names should be in `UPPERCASE_WITH_UNDERSCORES` style. > If you have a whole lot of constant variables, they can be in a folder named **constants** organized into different files. ### Use ES6 JavaScript If you're writing your scraper in JavaScript, use [ES6](https://www.w3schools.com/js/js_es6.asp) features and ditch the old ones which they replace. This means using `const` and `let` instead of `var`, `includes` instead of `indexOf`, etc. > To learn more about some of the most popular (and awesome) ES6+ features, check out [this](https://medium.com/@matthiasvstephens/why-is-es6-so-awesome-88bff6857849) article. ### No magic numbers Avoid using [magic numbers](https://en.wikipedia.org/wiki/Magic_number_(programming)) as much as possible. Either declare them as a **constant** variable in your **constants.js** file, or if they are only used once, add a comment explaining what the number is. Don't write code like this: ``` const x = (y) => (y - 32) * (5 / 9); ``` That is quite confusing due to the nondescriptive naming and the magic numbers. Do this instead: ``` // Converts a fahrenheit value to celsius const fahrenheitToCelsius = (celsius) => (celsius - 32) * (5 / 9); ``` ### Use comments! Don't be shy to add comments to your code! Even when using descriptive function and variable naming, it might still be a good idea to add a comment in places where you had to make a tough decision or chose an unusual choice. > If you're a true pro, use [JSDoc](https://jsdoc.app/) to comment and document your code. ## Logging Logging helps you understand exactly what your scraper is doing. Generally, having more logs is better than having fewer. Especially make sure to log your `catch` blocks - no error should pass unseen unless there is a good reason. For scrapers that will run longer than usual, keep track of some useful stats (such as **itemsScraped** or **errorsHit**) and log them to the console on an interval. The meaning of your log messages should make sense to an outsider who is not familiar with the inner workings of your scraper. Avoid log lines with just numbers or just URLs - always identify what the number/string means. Here is an example of an "incorrect" log message: ``` 300 https://example.com/1234 1234 ``` And here is that log message translated into something that makes much more sense to the end user: ``` Index 1234 --- https://example.com/1234 --- took 300 ms ``` ## Input When it comes to accepting input into a scraper, two main best practices should be followed. ### Set limits When allowing your users to pass input properties which could break the scraper (such as **timeout** set to **0**), be sure to disallow ridiculous values. Set a maximum/minimum number allowed, maximum array input length, etc. ### Validate Validate the input provided by the user! This should be the very first thing your scraper does. If the fields in the input are missing or in an incorrect type/format, either parse the value and correct it programmatically or throw an informative error telling the user how to fix the error. > On the Apify platform, you can use the [input schema](https://docs.apify.com/academy/deploying-your-code/input-schema.md) to both validate inputs and generate a clean UI for those using your scraper. ## Error handling Errors are bound to occur in scrapers. Perhaps it got blocked, or perhaps the data scraped was corrupted in some way. Whatever the reason, a scraper shouldn't completely crash when an error occurs. Use `try...catch` blocks to catch errors and log useful messages. The log messages should indicate where the error happened, and what type of error happened. Bad error log message: ``` Cannot read property “0” from undefined ``` Good error log message: ``` Could not parse an address, skipping the page. Url: https://www.example-website.com/people/1234 ``` This doesn't mean that you should absolutely litter your code with `try...catch` blocks, but it does mean that they should be placed in error-prone areas (such as API calls or testing a string with a specific regular expression). > If the error that has occurred renders that run of the scraper completely useless, exit the process immediately. Logging is the minimum you should be doing though. For example, if you have an entire object of scraped data and just the **price** field fails to be parsed, you might not want to throw away the rest of that data. Rather, it could still be pushed to the output and a log message like this could appear: ``` We could not parse the price of product: Men's Trainers Orange, pushing anyways. ``` This really depends on your use case though. If you want 100% clean data, you might not want to push incomplete objects and just retry (ideally) or log an error message instead. ## Recap Wow, that's a whole lot of things to abide by! How will you remember all of them? Try to follow these three points: 1. Describe your code as you write it with good naming, constants, and comments. It **should read like a book**. 2. Add log messages at points throughout your code so that when it's running, you (and everyone else) know what's going on. 3. Handle errors appropriately. Log the error and either retry, or continue on. Only throw if the error will be caught or if the error is absolutely detrimental to the scraper's run. --- # Source: https://docs.apify.com/platform/console/billing.md # Billing **The Billings page is the central place for all information regarding your invoices, billing information regarding usage in the current billing cycle, historical usage, subscriptions & limits.** *** ## Current period The **Current period** tab is a comprehensive resource for understanding your platform usage during the ongoing billing cycle. It provides an overview of your total usage and indicates the start and end dates of the current billing period. In addition to this, the tab features a **Plan Consumption** Graph. It shows how much of your free or paid plan has been utilized up to this point. The graph offers a broad perspective of your overall usage. Apart from the platform usage breakdown graph, this tab provides more detailed information on the usage of different platform services. You can explore the sections under the graph. You can access detailed statistics related to **Actors**, **Data transfer**, **Proxy**, and **Storage**. ![Apify Console current period view](/assets/images/console-billing-current-period-f7ddf37de35ec4984e7adc94d53253c4.png) ## Historical usage The **Historical usage** tab provides a detailed view of your monthly platform usage, excluding any free Actor compute units or discounts from your subscription plan. You can navigate through the months by selecting from a dropdown list or using arrows to move one month backward or forward. The tab features an adjustable bar chart. This chart can be customized to display statistics either on a monthly or daily basis. Additionally, you can view these statistics as absolute or cumulative numbers, providing flexibility in how you analyze your usage data. Monthly usage data Since billing cycles can shift, the data in the **Historical usage** tab is shown for calendar months. ![Apify Console historical usage view](/assets/images/console-billing-historical-usage-edb29c979c540b2855b0675151b35b07.png) Below the bar chart, there is a table titled **Usage by Actors**. This table presents a detailed breakdown of the Compute units used per Actor and the associated costs. It clearly explains how each Actor contributes to your overall platform usage and expenses. ![Apify Console historical usage by Actor view](/assets/images/console-billing-historical-usage-by-actors-8b4651fe15d6fd802a67a7fb9eb8510e.png) ## Subscription The **Subscriptions** tab offers a central location to manage various aspects of your subscription plan. Here, you can access details about your current plan and explore options to upgrade to a different one. Unused credits Unused prepaid usage does not rollover, it expires at the end of the billing cycle. This tab also allows you to manage your payment methods. Additionally, you can adjust your billing details to ensure they remain up-to-date. Another feature of this tab is the visibility of any special offers currently applied to your account. Plan add-ons *This option is available only if you are on a subscription plan*. You can extend your subscription plans with add-ons, like extra proxies, Actor memory, and more. Navigate to [Subscription](https://console.apify.com/billing/subscription) section in Apify Console, and click the **Buy add-ons** button to explore the available options. ![Apify Console subscription view](/assets/images/console-billing-subscription-19a02e019587c65ed35a361401aa53af.png) ## Pricing The **Pricing** tab offers a way to quickly check all unit pricing for various platform services related to Apify usage for your account. ![Apify Console pricing view](/assets/images/console-billing-pricing-12b7a203be3cb84dd3ea9a401f453553.png) ## Invoices The **Invoices** tab is where you can find your current and previous invoices for Apify platform usage. This is your source of truth for any questions regarding previous charges and subscriptions. ![Apify Console invoices view](/assets/images/console-billing-invoices-9e5a3c2fb15ec83fd1bdbc5e0ac00100.png) ## Limits The **Limits** tab displays the usage limits for the Apify platform based on your current subscription plan. As you approach the defined limits, you will receive a notification about potential service suspension or overage charges. If your usage exceeds the specified limits, Apify platform services will be suspended to prevent incurring charges beyond your subscription plan. You can adjust the platform usage limits and enable overage, allowing you to continue using the platform beyond your subscription plan on a *pay-as-you-go* basis. Any usage, beyond your plan will be charged as overage to your account. Immediate overage invoicing If your overage platform usage reaches *200$* before your next billing cycle, you will be invoiced for the overage charges immediately. Otherwise, the overage charges will be added to your next subscription invoice. ![Apify Console limits view](/assets/images/console-billing-limits-704e7245ae3d1878b814415aa29b89f7.png) --- # Source: https://docs.apify.com/academy/node-js/block-requests-puppeteer.md # Block requests in Puppeteer Improve Performance: Use `blockRequests` Unfortunately, in the recent version of Puppeteer, request interception disables the native cache and slows down the Actor significantly. Therefore, it's not recommended to follow the examples shown in this article. Instead, use [blockRequests](https://crawlee.dev/api/puppeteer-crawler/namespace/puppeteerUtils#BlockRequestsOptions) *utility function from* [Crawlee](https://crawlee.dev). It works through different paths and doesn't slow down your process. When using Puppeteer, often a webpage will load many resources that are not actually necessary for your use case. For example page could be loading many tracking libraries, that are completely unnecessary for most crawlers, but will cause the page to use more traffic and load slower. For example for this web page: [https://edition.cnn.com/](https://edition.cnn.com/) If we run an Actor that measures extracted downloaded data from each response until the page is fully loaded, we get these results: ![Actor loading](/assets/images/actor-load-e6fc832092a1c94156fd96b3522c2c3b.png) Now if we want to optimize this to keep the webpage looking the same, but ignore unnecessary requests, then after ``` const page = await browser.newPage(); ``` we could can use this piece of code ``` await page.setRequestInterception(true); page.on('request', (request) => { if (someCondition) request.abort(); else request.continue(); }); ``` Where `someCondition` is a custom condition (not actually implemented in the code above) that checks whether a request should be aborted. For our example we will only disable some tracking scripts and then check if everything looks the same. Here is the code used: ``` await page.setRequestInterception(true); page.on('request', (request) => { const url = request.url(); const filters = [ 'livefyre', 'moatad', 'analytics', 'controltag', 'chartbeat', ]; const shouldAbort = filters.some((urlPart) => url.includes(urlPart)); if (shouldAbort) request.abort(); else request.continue(); }); ``` With this code set up this is the output: ![Improved Actor loading](/assets/images/improved-actor-loading-a1e7b6b855bb90ba1780f19f3653a34c.png) And except for different ads, the page should look the same. From this we can see that just by blocking a few analytics and tracking scripts the page was loaded nearly 25 seconds faster and downloaded 35% less data (approximately since the data is measured after it's decompressed). Hopefully this helps you make your solutions faster and use fewer resources. --- # Source: https://docs.apify.com/academy/actor-marketing-playbook/promote-your-actor/blogs-and-blog-resources.md # Blogs and blog resources **Blogs remain a powerful tool for promoting your Actors and establishing authority in the field. With social media, SEO, and other platforms, you might wonder if blogging is still relevant. The answer is a big yes. Writing blog posts can help you engage your users, share expertise, and drive organic traffic to your Actor.** ## Why blogs still matter 1. SEO. Blog posts are great for boosting your Actor’s search engine ranking. Well-written content with relevant keywords can attract users searching for web scraping or automation solutions. For example, a blog about “how to scrape social media profiles” could drive people to your Actor who might not find it on Google otherwise. 2. Establishing authority. When you write thoughtful, well-researched blog posts, you position yourself as an expert in your niche. This builds trust and makes it more likely users will adopt your Actors. 3. Long-form content. Blogs give you the space to explain the value of your Actor in-depth. This is especially useful for complex tools that need more context than what can fit into a README or product description. 4. Driving traffic. Blog posts can be shared across social media, linked in webinars, and included in your Actor’s README. This creates multiple avenues for potential users to discover your Actor. ## Good topics for blog posts 1. Problem-solving guides. Write about the specific problems your Actor solves. For example, if you’ve created an Actor that scrapes e-commerce reviews, write a post titled "How to automate e-commerce review scraping in 5 minutes". Focus on the pain points your tool alleviates. 2. Actor use cases. Show real-world examples of how your Actor can be applied. These can be case studies or hypothetical scenarios like "Using web scraping to track competitor pricing." 3. Tutorials and step-by-step guides. Tutorials showing how to use your Actor or similar tools are always helpful. Step-by-step guides make it easier for beginners to start using your Actor with minimal hassle. 4. Trends. If you’ve noticed emerging trends in web scraping or automation, write about them. Tie your Actor into these trends to highlight its relevance. 5. Feature announcements or updates. Have you recently added new features to your Actor? Write a blog post explaining how these features work and what makes them valuable. 🪄 These days, blog posts always need to be written with SEO in mind. Yeah, it's annoying to use keywords, but think of it this way: even if there's the most interesting customer story and amazing programming insights, but nobody can find it, it won't have the impact you want. Do try to optimize your posts with relevant keywords and phrases — across text, structure, and even images — to ensure they reach your target audience. *** ## Factors to consider when writing a blog 1. Audience. Know your target audience. Are they developers, small business owners, or data analysts? Tailor your writing to match their technical level and needs. 2. SEO. Incorporate relevant keywords naturally throughout your post. Don’t overstuff your content, but make sure it ranks for search queries like "web scraping tools", "automation solutions", or "how to scrape LinkedIn profiles". Remember to include keywords in H2 and H3 headings. 3. Clarity and simplicity. Avoid jargon, especially if your target audience includes non-technical users. Use simple language to explain how your Actor works and why it’s beneficial. 4. Visuals. Include screenshots, GIFs, or even videos to demonstrate your Actor’s functionality. Visual content makes your blog more engaging and easier to follow. 5. Call to action (CTA). Always end your blog with a clear CTA. Whether it’s "try our Actor today" or "download the demo", guide your readers to the next step. 6. Engage with comments. If readers leave comments or questions, engage with them. Answer their queries and use the feedback to improve both your blog and Actor. *** ## Best places to publish blogs There are a variety of platforms where you can publish your blog posts to reach the right audience: 1. [dev.to](http://dev.to/): It's a developer-friendly platform where technical content gets a lot of visibility, and a great place to publish how-to guides, tutorials, and technical breakdowns of your Actor. 2. Medium: Allows you to reach a broader, less technical audience. It’s also good for writing about general topics like automation trends or how to improve data scraping practices. 3. ScrapeDiary: Run by Apify, [scrapediary.com](http://scrapediary.com) is a blog specifically geared toward Apify community devs and web scraping topics. Publishing here is a great way to reach users already interested in scraping and automation. Contact us if you want to publish a blog post there. 4. Personal blogs or company websites. If you have your own blog or a company site, post there. It’s the most direct way to control your content and engage your established audience. *** ## Not-so-obvious SEO tips for blog posts Everybody knows you should include keywords wherever it looks natural. Some people know the structure of the blog post should be hierarchical and follow an H1 - H2 - H3 - H4 structure with only one possible H1. Here are some unobvious SEO tips for writing a blog post that can help boost its visibility and ranking potential: ### 1. Keep URL length concise and strategic Optimal length. Keep your URL short and descriptive. URLs between 50-60 characters perform best, so aim for 3-4 words. Avoid unnecessary words like "and", "of", or long prepositions. Include keywords. Ensure your primary keyword is naturally integrated into the URL. This signals relevance to both users and search engines. Avoid dates. Don’t include dates or numbers in the URL to keep the content evergreen, as dates can make the post seem outdated over time. ### 2. Feature a video at the top of the post Engagement boost. Videos significantly increase the time users spend on a page, positively influencing SEO rankings. Blog posts with videos in them generally do better SEO-wise. Thumbnail optimization. Use an optimized thumbnail with a clear title and engaging image to increase click-through rates. ### 3. Alt text for images with a keyword focus Descriptive alt text. Include a short, descriptive alt text for every image with one or two keywords where it makes sense. This also improves accessibility. Optimize file names. Name your images with SEO-friendly keywords before uploading (e.g., "web-scraping-tools.png" rather than "IMG12345\_screenshot1.png"). This helps search engines understand the content of your images. File format and size. Use web-optimized formats like WebP or compressed JPEGs/PNGs to ensure fast page loading, which is a key SEO factor. Lazy loading images. Use lazy loading to only load images when the user scrolls to them, reducing initial page load times, which can help your SEO ranking. ### 4. Interlinking for better user experience and SEO Internal links. Use contextual links to other relevant blog posts or product pages on your site. This not only helps with SEO but also keeps users engaged longer on your site, reducing bounce rates. Anchor text. When linking internally, use keyword-rich anchor text that describes what users will find on the linked page. Content depth. By interlinking, you can show Google that your site has a strong internal structure and is a hub of related, authoritative content. ### 5. Target the 'People Also Ask' section of Google results with an FAQ Answer common questions. Including an FAQ section that answers questions people search for can help you rank in the "People Also Ask" section of Google. Research questions that come up in this feature related to your topic and address them in your content. Provide clear, concise answers to the FAQs, typically between 40-60 words, since these match the format used in "People Also Ask". Don't bother using FAQ schema. Google doesn't react to those anymore unless you’re a .gov or .edu domain. ### 6. Optimize for readability and structure Short paragraphs and subheadings. Make your blog post easy to scan by using short paragraphs and meaningful subheadings that contain keywords. Bullet points and lists. Include bullet points and numbered lists to break up content and make it more digestible. Search engines prioritize well-structured content. Readability tools. Use tools like Hemingway Editor or Grammarly to improve readability. Content that is easy to read tends to rank higher, as it keeps readers engaged. ## Referring to blogs in your Actor’s ecosystem To drive traffic to your blog and keep users engaged, reference your blog posts across various touchpoints: 1. README. Add links to your blog posts in your Actor’s README. If you’ve written a tutorial or feature guide, include it under a "Further reading" section. 2. Input schema. Use your input schema to link to blog posts. For instance, if a certain field in your Actor has complex configurations, add a link to a blog post that explains how to use it. 3. YouTube videos. If you’ve created tutorial videos about your Actor, link them in your blog and vice versa. Cross-promoting these assets will increase your overall engagement. 4. Webinars and live streams. Mention your blog posts during webinars, especially if you’re covering a topic that’s closely related. Include the links in follow-up emails after the event. 5. Social media. Share your blog posts on Twitter, LinkedIn, or other social platforms. Include snippets or key takeaways to entice users to click through. 🔄 Remember, you can always turn your blog into a video and vice versa. You can also use parts of blog posts for social media promotion. ## Additional tips for blog success 1. Consistency. Regular posting helps build an audience and makes sure you keep at it. Try to stick to a consistent schedule, whether it’s weekly, bi-weekly, or monthly. As Woody Allen said, “80 percent of success is showing up”. 2. Guest blogging. Reach out to other blogs or platforms like [dev.to](http://dev.to/) for guest blogging opportunities. This helps you tap into new audiences. 3. Repurpose content. Once you’ve written a blog post, repurpose it. Turn it into a YouTube video, break it down into social media posts, or use it as the base for a webinar. 4. Monitor performance. Use analytics to track how your blog is performing. Are people reading it? Is it driving traffic to your Actor? What keywords is it ranking for? Who are your competitors? Use this data to refine your content strategy. --- # Source: https://docs.apify.com/academy/anti-scraping/techniques/browser-challenges.md # Browser challenges > Learn how to navigate browser challenges like Cloudflare's to effectively scrape data from protected websites. ## Browser challenges Browser challenges are a type of security measure that relies on browser fingerprints. These challenges typically involve a JavaScript program that collects both static and dynamic browser fingerprints. Static fingerprints include attributes such as User-Agent, video card, and number of CPU cores available. Dynamic fingerprints, on the other hand, might involve rendering fonts or objects in the canvas (known as a [canvas fingerprint](https://docs.apify.com/academy/anti-scraping/techniques/fingerprinting.md#with-canvases)), or playing audio in the [AudioContext](https://docs.apify.com/academy/anti-scraping/techniques/fingerprinting.md#from-audiocontext). We were covering the details in the previous [fingerprinting](https://docs.apify.com/academy/anti-scraping/techniques/fingerprinting.md) lesson. While some browser challenges are relatively straightforward - for example, loading an image and checking if it renders correctly - others can be much more complex. One well-known example of a complex browser challenge is Cloudflare's browser screen check. In this challenge, Cloudflare visually inspects the browser screen and blocks the first request if any inconsistencies are found. This approach provides an extra layer of protection against automated attacks. Many online protections incorporate browser challenges into their security measures, but the specific techniques used can vary. ## Cloudflare browser challenge One of the most well-known browser challenges is the one used by Cloudflare. Cloudflare has a massive dataset of legitimate canvas fingerprints and User-Agent pairs, which they use in conjunction with machine learning algorithms to detect any device property spoofing. This might include spoofed User-Agent headers, operating systems, or GPUs. ![Cloudflare browser check](https://images.ctfassets.net/slt3lc6tev37/55EYMR81XJCIG5uxLjQQOx/252a98adf90fa0ff2f70437cc5c0a3af/under-attack-mode_enabled.gif) When you encounter a Cloudflare browser challenge, the platform checks your canvas fingerprint against the expected value. If there is a mismatch, the request is blocked. However, if your canvas fingerprint matches the expected value, Cloudflare issues a cookie that allows you to continue scraping - even without the browser - until the cookie is invalidated. It's worth noting that Cloudflare's protection is highly customizable, and can be adjusted to be extremely strict or relatively loose. This makes it a powerful tool for website owners who want to protect against automated traffic, while still allowing legitimate traffic to flow through. If you want to learn how to bypass Cloudflare challenge visit the [Bypassing Cloudflare challenge](https://docs.apify.com/academy/anti-scraping/mitigation/cloudflare-challenge.md) article. ## Next up In the [next lesson](https://docs.apify.com/academy/anti-scraping/techniques/captchas.md), we'll be covering **CAPTCHAs**, which were mentioned throughout this lesson. It's important to note that attempting to solve a captcha programmatically is the last resort - always try to avoid being presented with the captcha in the first place by using the techniques mentioned in this lesson. --- # Source: https://docs.apify.com/academy/puppeteer-playwright/browser-contexts.md # VI - Creating multiple browser contexts **Learn what a browser context is, how to create one, how to emulate devices, and how to use browser contexts to automate multiple sessions at one time.** *** A [BrowserContext](https://playwright.dev/docs/api/class-browsercontext) is an isolated incognito session within a **Browser** instance. This means that contexts can have different device/screen size configurations, different language and color scheme settings, etc. It is useful to use multiple browser instances when dealing with automating logging into multiple accounts simultaneously (therefore requiring multiple sessions), or in any cases where multiple sessions are required. When we create a **Browser** object by using the `launch()` function, a single [browser context](https://playwright.dev/docs/browser-contexts) is automatically created. In order to create more, we use the [browser.newContext()](https://playwright.dev/docs/api/class-browser#browser-new-context) function in Playwright, and [browser.createIncognitoBrowserContext](https://pptr.dev/#?product=Puppeteer&version=v14.1.0&show=api-browsercreateincognitobrowsercontextoptions) in Puppeteer. * Playwright * Puppeteer ``` const myNewContext = await browser.newContext(); ``` ``` const myNewContext = await browser.createIncognitoBrowserContext(); ``` ## Persistent vs non-persistent browser contexts In both examples above, we are creating a new **non-persistent** browser context, which means that once it closes, all of its cookies, cache, etc. will be lost. For some cases, that's okay, but in most situations, the performance hit from this is too large. This is why we have **persistent** browser contexts. Persistent browser contexts open up a bit slower and they store all their cache, cookies, session storage, and local storage in a file on disk. In Puppeteer, the **default** browser context is the persistent one, while in Playwright we have to use [BrowserType.launchPersistentContext()](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-persistent-context) instead of `BrowserType.launch()` in order for the default context to be persistent. * Playwright * Puppeteer ``` import { chromium } from 'playwright'; // Here, we launch a persistent browser context. The first // argument is the location to store the data. const browser = await chromium.launchPersistentContext('./persistent-context', { headless: false }); const page = await browser.newPage(); await browser.close(); ``` ``` import puppeteer from 'puppeteer'; const browser = await puppeteer.launch({ headless: false }); // This page will be under the default context, which is persistent. // Cache, cookies, etc. will be stored on disk and persisted const page = await browser.newPage(); await browser.close(); ``` ## Using browser contexts In both Playwright and Puppeteer, various devices (iPhones, iPads, Androids, etc.) can be emulated by using [playwright.devices](https://playwright.dev/docs/api/class-playwright#playwright-devices) or [puppeteer.devices](https://pptr.dev/#?product=Puppeteer&version=v14.1.0&show=api-puppeteerdevices). We'll be using this to create two different browser contexts, one emulating an iPhone, and one emulating an Android device: * Playwright * Puppeteer ``` import { chromium, devices } from 'playwright'; // Launch the browser const browser = await chromium.launch({ headless: false }); const iPhone = devices['iPhone 11 Pro']; // Create a new context for our iPhone emulation const iPhoneContext = await browser.newContext({ ...iPhone }); // Open a page on the newly created iPhone context const iPhonePage = await iPhoneContext.newPage(); const android = devices['Galaxy Note 3']; // Create a new context for our Android emulation const androidContext = await browser.newContext({ ...android }); // Open a page on the newly created Android context const androidPage = await androidContext.newPage(); // The code in the next step will go here await browser.close(); ``` ``` import puppeteer from 'puppeteer'; // Launch the browser const browser = await puppeteer.launch({ headless: false }); const iPhone = puppeteer.devices['iPhone 11 Pro']; // Create a new context for our iPhone emulation const iPhoneContext = await browser.createIncognitoBrowserContext(); // Open a page on the newly created iPhone context const iPhonePage = await iPhoneContext.newPage(); // Emulate the device await iPhonePage.emulate(iPhone); const android = puppeteer.devices['Galaxy Note 3']; // Create a new context for our Android emulation const androidContext = await browser.createIncognitoBrowserContext(); // Open a page on the newly created Android context const androidPage = await androidContext.newPage(); // Emulate the device await androidPage.emulate(android); // The code in the next step will go here await browser.close(); ``` Then, we'll make both `iPhonePage` and `androidPage` visit [deviceinfo.me](https://www.deviceinfo.me/), which is a website that displays the type of device you have, the operating system you're using, and more device and location-specific information. ``` // Go to deviceinfo.me on both at the same time await Promise.all([iPhonePage.goto('https://www.deviceinfo.me/'), androidPage.goto('https://www.deviceinfo.me/')]); // Wait for 10 seconds on both before shutting down await Promise.all([iPhonePage.waitForTimeout(10000), androidPage.waitForTimeout(10000)]); ``` Let's go ahead and run our code and analyze the data on each **deviceinfo.me** page. Here's what we see: ![deviceinfo.me results for both browser contexts](/assets/images/dual-contexts-1cf77aac6062264d0ba205af600f5c5a.jpg) We see that **deviceinfo.me** detects both contexts as using different devices, despite the fact they're visiting the same page at the same time. This shows firsthand that different browser contexts can have totally different configurations, as they all have separate sessions. ## Accessing browser contexts When working with multiple browser contexts, it can be difficult to keep track of all of them and making changes becomes a repetitive job. This is why the **Browser** instance returned from the `launch()` function also has a `contexts()` function (`browserContexts()` in Puppeteer). This function returns an array of all the contexts that are currently attached to the browser. Let's go ahead and use this function to loop through all of our browser contexts and make them log **Site visited** to the console whenever the website is visited: * Playwright * Puppeteer ``` for (const context of browser.contexts()) { // In Playwright, lots of events are supported in the "on" function of // a BrowserContext instance context.on('request', (req) => req.url() === 'https://www.deviceinfo.me/' && console.log('Site visited')); } ``` ``` for (const context of browser.browserContexts()) { // In Puppeteer, only three events are supported in the "on" function // of a BrowserContext instance context.on('targetchanged', () => console.log('Site visited')); } ``` After adding this above our `page.goto`s and running the code once again, we see this logged to the console: ``` Site visited Site visited ``` Cool! We've modified both our `iPhoneContext` and `androidContext`, as well as our default context, to log the message. > Note that the Puppeteer code and Playwright code are slightly different in the examples above. The Playwright code will log **Site visited** any time the specific URL is visited, while the Puppeteer code will log any time the target URL is changed to anything. Finally, in Puppeteer, you can use the `browser.defaultBrowserContext()` function to grab hold of the default context at any point. ## Wrap up Thus far in this course, you've learned how to launch a browser, open a page, run scripts on a page, extract data from a page, intercept requests made on the page, use proxies, and use multiple browser contexts. Stay tuned for new lessons! --- # Source: https://docs.apify.com/academy/scraping-basics-javascript/legacy/data-extraction/browser-devtools.md # Starting with browser DevTools **Learn about browser DevTools, a valuable tool in the world of web scraping, and how you can use them to extract data from a website.** Archived course This is an archive of our old course. Check out our new [Web scraping basics for JavaScript devs](https://docs.apify.com/academy/scraping-basics-javascript.md) course instead! We plan to completely retire this old course in a few months. *** Even though DevTools stands for developer tools, everyone can use them to inspect a website. Each major browser has its own DevTools. We will use Chrome DevTools as an example, but the advice is applicable to any browser, as the tools are extremely similar. To open Chrome DevTools, you can press **F12** or right-click anywhere in the page and choose **Inspect**. Now go to [Wikipedia](https://www.wikipedia.org/) and open your DevTools there. ![Wikipedia with Chrome DevTools open](/assets/images/browser-devtools-wikipedia-d20b19ea46ed30572858ddc63d9e0f23.png) ## Elements tab When you first open Chrome DevTools on Wikipedia, you will start on the Elements tab (In Firefox it's called the **Inspector**). You can use this tab to inspect the page's HTML on the left hand side, and its CSS on the right. The items in the HTML view are called **elements**. ![Elements tab in Chrome DevTools](/assets/images/browser-devtools-elements-tab-fb7aa7fc2b9442bb7fd94dbc6955e4c8.png) > On a screen that is narrow or has a small resolution, the CSS information can appear under the HTML tab, not on the right. Each element is enclosed in an HTML tag. For example `
`, `

`, and `` are all tags. When you add something inside of those tags, like `

Hello!

` you create an element. You can also see elements inside other elements in the **Elements** tab. This is called nesting, and it gives the page its structure. At the bottom, there's the **JavaScript console**, which is a powerful tool which can be used to manipulate the website. If the console is not there, you can press **ESC** to toggle it. All of this might look super complicated at first, but don't worry, there's no need to understand everything yet - we'll walk you through all the important things you need to know. ![Console in Chrome DevTools](/assets/images/browser-devtools-console-0752bf16933c5b7b8858dac3bbd80694.png) ## Selecting an element In the top left corner of DevTools, there's a little arrow icon with a square. ![Chrome DevTools element selection tool](/assets/images/browser-devtools-element-selection-c1cf8032d6d23ad5941c7ebf2b0f1ae5.png) Click it and then hover your mouse over **The Free Encyclopedia**, Wikipedia's subtitle. DevTools will show you information about the HTML element being hovered over. Now click the element. It will be selected in the **Elements** tab, which allows for further inspection of the element and its content. ![Chrome DevTools element hover effect](/assets/images/browser-devtools-hover-b85b0699eef969e79c92fda46154bbe2.png) ## Interacting with an element After you select the subtitle element, right-click the highlighted element in the Elements tab to show a menu with available actions. For now, select **Store as global variable** (**Use in Console** in Firefox). You'll see that a new variable called `temp1` (`temp0` in Firefox) appeared in your DevTools Console. You can now use the Console to access the element's properties using JavaScript. For example, if you wanted to scrape the text inside the element, you could use the `textContent` property to get it. Copy and paste (or type) the following command into your Console and press Enter. The text of your `temp1` element - The Free Encyclopedia - will display in the Console. ``` temp1.textContent; ``` Now run this command to get the HTML of the element: ``` temp1.outerHTML; ``` And finally, run the next command to change the text of the element. ``` temp1.textContent = 'Hello World!'; ``` By changing HTML elements from the Console, you can change what's displayed on the page. This change only happens on your own computer so don't worry, you haven't hacked Wikipedia. ![Chrome DevTools JavaScript command execution](/assets/images/browser-devtools-console-commands-9f82a9905f884595024c32ee4519760a.png) > In JavaScript, the web page is called `document`. From the Console you can interact with it in many ways. Go through [document basics](https://developer.mozilla.org/en-US/docs/Web/API/Document_object_model/Using_the_Document_Object_Model) to learn more. ## Next up In this lesson, we learned the absolute basics of interaction with a page using the DevTools. In the [next lesson](https://docs.apify.com/academy/scraping-basics-javascript/legacy/data-extraction/using-devtools.md), you will learn how to extract data from it. We will extract data about the on-sale products on the [Warehouse store](https://warehouse-theme-metal.myshopify.com). It isn't a real store, but a full-featured demo of a Shopify online store. And that is perfect for our purposes. Shopify is one of the largest e-commerce platforms in the world, and it uses all the latest technologies that a real e-commerce web application would use. Learning to scrape a Shopify store is useful, because you can immediately apply the learnings to millions of websites. --- # Source: https://docs.apify.com/academy/puppeteer-playwright/browser.md # I - Launching a browser **Understand what the Browser object is in Puppeteer/Playwright, how to create one, and a bit about how to interact with one.** *** In order to automate a browser in Playwright or Puppeteer, we need to open one up programmatically. Playwright supports Chromium, Firefox, and Webkit (Safari), while Puppeteer only supports Chromium based browsers. For ease of understanding, we've chosen to use Chromium in the Playwright examples to keep things working on the same plane. Let's start by using the `launch()` function in the **index.js** file we created in the intro to this course: * Playwright * Puppeteer ``` import { chromium } from 'playwright'; await chromium.launch(); console.log('launched!'); ``` ``` import puppeteer from 'puppeteer'; await puppeteer.launch(); console.log('launched!'); ``` When we run this code with the command `node index.js`, a browser will open up; however, we won't actually see anything. This is because the default mode of a browser after `launch()`ing it is **headless**, meaning that it has no visible UI. > If you run this code right now, it will hang. Use **control^** + **C** to force quit the program. ## Launch options In order to see what's actually happening, we can pass an **options** object ([Puppeteer](https://pptr.dev/#?product=Puppeteer&version=v13.7.0&show=api-puppeteerlaunchoptions), [Playwright](https://playwright.dev/docs/api/class-browsertype#browser-type-launch)) with **headless** set to **false**. * Playwright * Puppeteer ``` import { chromium } from 'playwright'; const browser = await chromium.launch({ headless: false }); await browser.newPage(); ``` ``` import puppeteer from 'puppeteer'; const browser = await puppeteer.launch({ headless: false }); await browser.newPage(); ``` Now we'll actually see a browser open up. ![Chromium browser opened by Puppeteer/Playwright](/assets/images/chromium-844298b27f771e8c1bb0441bf5572180.jpg) You can pass a whole lot more options to the `launch()` function. We'll be getting into those a little bit later on. ## Browser methods The `launch()` function also returns a **Browser** object ([Puppeteer](https://pptr.dev/#?product=Puppeteer&version=v13.7.0&show=api-class-browser), [Playwright](https://playwright.dev/docs/api/class-browser)), which is a representation of the browser. This object has many methods, which allow us to interact with the browser from our code. One of them is `close()`. Until now, we've been using **control^** + **C** to force quit the process, but with this function, we'll no longer have to do that. * Playwright * Puppeteer ``` import { chromium } from 'playwright'; const browser = await chromium.launch({ headless: false }); await browser.newPage(); // code will be here in the future await browser.close(); ``` ``` import puppeteer from 'puppeteer'; const browser = await puppeteer.launch({ headless: false }); await browser.newPage(); // code will be here in the future await browser.close(); ``` ## Next up Now that we can open a browser, let's move onto the [next lesson](https://docs.apify.com/academy/puppeteer-playwright/page.md) where we will learn how to create pages and visit websites programmatically. --- # Source: https://docs.apify.com/platform/integrations/bubble.md # Bubble integration **Learn how to integrate your Apify Actors with Bubble for automated workflows and notifications.** *** [Bubble](https://bubble.io/) is a no-code platform that allows you to build web applications without writing code. With the [Apify integration for Bubble](https://bubble.io/plugin/apify-1749639212621x698168698147962900), you can easily connect your Apify Actors to your Bubble applications to automate workflows and display scraped data. Explore the live demo Open the demo Bubble app to check out the integration end-to-end before building your own: [apify-28595.bubbleapps.io](https://apify-28595.bubbleapps.io) ## Get started To use the Apify integration for Bubble, you will need: * An [Apify account](https://console.apify.com/) * A [Bubble account](https://bubble.io/) * A Bubble application where you want to use the integration ## Install the Apify plugin for Bubble To integrate Apify with your Bubble application, you first need to install the Apify plugin from the Bubble plugin marketplace. ![Apify Plugin Download](/assets/images/plugin_install_preview-cf91187a70dc083a37333cefb62fe678.png) 1. Go to your Bubble application dashboard and navigate to the **Plugins** tab. 2. Click the **Add plugins** button. 3. Search for **Apify** in the plugin marketplace. 4. And then click **Install**. ## Configure the Apify plugin After installing the plugin, you'll need to provide your API token when setting up Apify actions. ### Get your Apify API token In Apify Console, go to **Settings → API & Integrations** and copy your API token. ![Apify API token](/assets/images/apify_api_token-2b80e6a9870851b2376e3a0475fe3a5e.png) ### Store the token securely in Bubble For security, avoid hardcoding the token in action settings. Store it on the `User` data type with Privacy rules so only the current user can access their own token. 1. In Bubble, go to **Data → Data types**, open `User`. 2. Add a new field, for example `apify_api_token` (type: text). * ![Bubble data type](/assets/images/data_type_api_key-894d47e3d788e476f3eb5291cdb63fda.png) 3. Go to **Data → Privacy** and check if only the **Current User** is allowed to view their own `apify_api_token`. * ![Bubble data type](/assets/images/data_privacy-1a1bde669350b771d8601064c00e62de.png) ### Point Apify actions to the saved token When configuring Apify actions in a workflow (check out screenshot below), set the token field dynamically to: * `Current User's apify_api_token` * ![Current User\'s API token](/assets/images/data_select_user_api_key-6454a1f03c1b966a3ddc08da96a75855.png) ## Using the integration Once the plugin is configured, you can start building automated workflows. ### Actions vs data calls Apify's Bubble plugin exposes two ways to interact with Apify: * **Actions (workflow steps)**: Executed inside a Bubble workflow (both page workflows and backend workflows). Use these to trigger side effects like running an Actor or Task, or creating a webhook. They run during the workflow execution and can optionally wait for the result (if timeout is greater than 0). * Examples: **Run Actor**, **Run Actor Task**, **Create Webhook**, **Delete Webhook**. * Location in Bubble: **Workflow editor → Add an action → Plugins → Apify** * ![Apify Plugin\'s actions](/assets/images/plugin_actions-4acb01aea79f54042521fb4263f3935d.png) * **Data calls (data sources)**: Used as data sources in element properties and expressions. They fetch data from Apify and return it as lists/objects that you can bind to UI (for example, a repeating group) or use inside expressions. * Examples: **Fetch Data From Dataset JSON As Data**, **List Actor Runs**, **Get Record As Text/Image/File** from key-value store, **List User Datasets/Actors/Tasks**. * Location in Bubble: In any property input where a data source is expected click **Insert dynamic data**, under **Data sources** select **Get Data from an External API**, and choose the desired Apify data call. * ![Apify Plugin\'s data calls](/assets/images/data_calls_preview-54f00c0451c9219fddb32654ed113d61.png) Inline documentation Each Apify plugin action and data call input in Bubble includes inline documentation describing what the parameter is for and the expected format. If you're unsure, check the field's help text in the Bubble editor. ### Dynamic values in inputs and data calls Dynamic values are available across Apify plugin fields. Use Bubble's **Insert dynamic data** to bind values from your app. * For instance you can source values from: * **Page/UI elements**: inputs, dropdowns, multi-selects, radio buttons, checkboxes * **Database Things and fields** * **Current User** * **Previous workflow steps** (e.g., Step 2's Run Actor result's `defaultDatasetId` or `runId`) * **Get Data from an External API**: data calls #### Examples ##### Use a page input in an Action's JSON field (Input overrides) ``` { "url": "Input URL's value" } ``` Inserting dynamic data When inserting dynamic data, Bubble replaces the selected text. Place your cursor exactly where you want the expression in the JSON; avoid selecting the entire field. ## Run Apify plugin actions from Bubble events Create workflows that run Apify plugin actions in response to events in your Bubble app, such as button clicks or form submissions. 1. Open the **Workflow** tab and create a new workflow (for example, **When Run button is clicked**). * You can also click `Add workflow` button: * ![Adding workflow to button](/assets/images/button_adding_workflow-c53bed872e00cdd6f2b5295b64304655.png) * Or you can create it manually: `Workflows` → `+ New` → `An element is clicked` * ![Create workflow](/assets/images/create_workflow-7382207ef7663f35076cc04fbaddbe5e.png) * Then select the correct UI button. * ![Adding workflow to button](/assets/images/button_creating_workflow-158f7201546a2365cc573b18c6646e44.png) 2. Click `Add an action` → `Plugins` → choose one of the Apify actions: * For example `Run Actor` (run a specific Actor by ID) * ![Add action to workflow](/assets/images/add_action_to_workflow-5b8ab7a719fd6a7b09b7403c73af6c28.png) 3. Configure the action: * **API token**: set to `Current User's apify_api_token` () * **Actor or Task**: paste an Actor ID * **Input overrides**: provide JSON and use dynamic expressions from page elements or things * **Timeout**: set in seconds (0 means no limit). Due to Bubble workflow time limits, set this explicitly. If you do not want to restrict the call duration, set it to 0. ### Where to find your IDs Find IDs directly in Apify Console. Each resource page shows the ID in the API panel and in the page URL. * **Actor ID**: Actor detail page → API panel or URL. * Example URL: `https://console.apify.com/actors/` * Actor name format: owner/name (e.g., `apify/website-scraper`) * **Task ID**: Task detail page → API panel or URL. * Example URL: `https://console.apify.com/actors/tasks/` * **Dataset ID**: Storage → Datasets → Dataset detail → API panel or URL. * Example URL: `https://console.apify.com/storage/datasets/` * Also available in the table in `Storage → Datasets` page * **Key-value store ID**: Storage → Key-value stores → Store detail → API panel or URL. * Example URL: `https://console.apify.com/storage/key-value-stores/` * Also available in the table in `Storage → Key-value stores` page * **Webhook ID**: Actors → Actor → Integrations. * Example URL: `https://console.apify.com/actors//integrations/` You can also discover IDs via the plugin responses and data calls (e.g., **List User Datasets**, **List Actor Runs**), which return objects with `id` fields you can pass into other actions/data calls. ## Display Apify data in your application Populate elements in your Bubble application with information from your Apify account or Actor run data. There are two common approaches: ### Display data * This example appends the text result of an Actor run; it's a basic bind to the element’s text. * Create / select the UI visual element — in this example, `Text`. * In the Appearance tab, click the input area, select Insert dynamic data, and, according to your case, find the source — in this example, it's the `key_value_storages's recordContentText` custom state, where I set the result of the API call * ![Display text data](/assets/images/text_dynamic_content-049036322c6ca388a75f4c29c97937b1.png) ### Display list of data * This example lists the current user's datasets and displays them in a repeating group. * Add a **Repeating group** to the page. 1. Add data to a variable: create a custom state (for example, on the page) that will hold the list of datasets, and set it to the plugin's **List User Datasets** data call. * ![Step 1 — Set variable with user\'s datasets](/assets/images/user_dataset_repeating_group_set-946b636162411634bb07743be1a80b03.png) 2. Set the type: in the repeating group's settings, set **Type of content** to match the dataset object your variable returns. * ![Step 2 — Repeating group type of content](/assets/images/user_dataset_repeating_group-41aa54845047ec23a03a79099a7cff74.png) 3. Bind the variable: set the repeating group's **Data source** to the variable from Step 1. * ![Step 3 — Repeating group data source](/assets/images/user_dataset_repeating_group_source-3cf20959b52881f8f8d309683b86af3b.png) * Inside the repeating group cell, bind dataset fields (for example, `Current cell's item name`, `id`, `createdAt`). * ![Step 4 — Repeating group data cell](/assets/images/user_dataset_repeating_group_cell-bef0311e8cec626e0bc3419c139256a6.png) ## Long‑running scrapes and Bubble time limits (async pattern) Bubble workflows have execution time limits. Long scrapes (for example, **Scrape Single URL**) may time out if you wait for them. Use this asynchronous pattern. ### Prerequisite: Enable Bubble API and construct the webhook URL To receive webhooks from Apify, enable Bubble's public API workflows and copy your API root URL: 1. In Bubble, go to **Settings → API** and enable **This app exposes a Workflow API**. 2. Copy the **Workflow API root URL**. It looks like `https://your-app.bubbleapps.io/version-test/api/1.1/wf`. 3. Create a backend workflow named `webhook`. Its full URL will be `https://your-app.bubbleapps.io/version-test/api/1.1/wf/webhook`. Use this URL as the Apify webhook target. Configure the webhook's authentication as needed (e.g., a shared secret or query string token) and verify it inside your Bubble workflow before processing. 1. Trigger the scrape without waiting * In a workflow, add **Run Actor** (or **Run Actor Task**) and set **timeout** to 0. * Actor ID: `aYG0l9s7dbB7j3gbS` (`apify/website-content-crawler`). * Input: copy the Actor's input from the Actor's Input page, and map `crawlerType` and `url` to values from your UI. * ![Run scraping actor](/assets/images/step1_scraping-41ccba46a0ea3d216259106de1cebe92.png) 2. Notify Bubble when the run finishes * Create an Apify **Webhook** with event `ACTOR.RUN.SUCCEEDED`. * Set `actorId` from the Step 1 result. * Set `databaseId` from the Step 1 result, where Actor will store the result. * Set `idempotencyKey` to random value. * Set `requestUrl` to your Bubble backend workflow URL, for example: `https://your-app.bubbleapps.io/version-test/api/1.1/wf/webhook`. * ![Create a webhook](/assets/images/step2_scraping-bff76f237fa66dbe0521b78e3e13bb53.png) 3. Receive the webhook in Bubble and store the dataset ID * Create a public data type, for example, `ScrapingResults`. * Add a text field, for example, `result`, to store the dataset ID from the webhook. * ![Create a datatype with new field](/assets/images/step3_scraping-6a10330945aeb586eaafdecb3193de79.png) * Create the backend workflow (`webhook`) that Bubble exposes at `/api/1.1/wf/webhook`. The workflow name defines the API route. * ![Create a backend webhook](/assets/images/step4_scraping-46a0b4102826631f224a90c0ca9f9d0b.png) * In that workflow, for each received webhook call, create a new thing in `ScrapingResults` and set `result` to the dataset ID from the request body. This stores one `datasetId` per call for later processing. * ![Add new result](/assets/images/step5_scraping-27d487511588ee6fc6a261c8d44628ba.png) 4. Pick up the results asynchronously * In a (periodic) backend workflow, search `ScrapingResults` for pending entries (or for the expected `datasetId`). * If found, read its `result` (the `datasetId`), fetch items via the appropriate action (for example, **Fetch Data From Dataset JSON As Action**), update the UI or save to your DB, and then delete that `ScrapingResults` entry to avoid reprocessing. * If not found yet, do nothing and check again later. * ![Do every time](/assets/images/step6_scraping-b9b4629c95166135bd4a55d00c1b8501.png) This approach avoids Bubble timeouts, keeps the UI responsive, and scales to larger scrapes. ## Example use cases * *E-commerce price monitoring* - Schedule a daily workflow to run a price-scraping Actor on competitor sites. Store the results in your Bubble database, display them in a dashboard, and set up alerts for significant price changes. * *Lead generation automation* - Trigger a workflow on form submission to run an Actor that enriches lead data, such as pulling company details from a domain. Save the enriched information to your database and automate follow-up actions like email campaigns. * *Content aggregation* - Configure regular Actor runs to gather articles or posts from multiple sources. ## Available Apify actions and data sources ::: tip Check out the documentation Each API call links to the Apify documentation. To learn more about any plugin action or data call, go to the **Plugins** page in your app, select the Apify plugin, and use the documentation links in the field descriptions. ::: The Apify plugin provides two main types of operations: **Data calls** (data sources): * [Fetch Data From Dataset Text As Data](https://docs.apify.com/api/v2/dataset-items-get) * [Fetch Data From Dataset File As Data](https://docs.apify.com/api/v2/dataset-items-get) * [Fetch Data From Dataset Json As Data](https://docs.apify.com/api/v2/dataset-items-get) * [List User Datasets](https://docs.apify.com/api/v2/datasets-get) * [List Key-Value Stores](https://docs.apify.com/api/v2/key-value-stores-get) * [List Store Keys](https://docs.apify.com/api/v2/key-value-store-keys-get) * [Get Record As File](https://docs.apify.com/api/v2/key-value-store-record-get) * [Get Record As Image File](https://docs.apify.com/api/v2/key-value-store-record-get) * [List Store Actors](https://docs.apify.com/api/v2/store-get) * [List User Actors](https://docs.apify.com/api/v2/acts-get) * [List User Tasks](https://docs.apify.com/api/v2/actor-tasks-get) * [Scrape Single URL As File As Data](https://docs.apify.com/api/v2/act-run-sync-get-dataset-items-post) * [Scrape Single URL As Json As Data](https://docs.apify.com/api/v2/act-run-sync-get-dataset-items-post) * [List Actor Runs](https://docs.apify.com/api/v2/act-runs-get) * [List Specific Actor Runs](https://docs.apify.com/api/v2/act-runs-get) * [List Webhooks](https://docs.apify.com/api/v2/webhooks-get) **Actions** (workflow steps): * [Fetch Data From Dataset Text As Action](https://docs.apify.com/api/v2/dataset-items-get) * [Fetch Data From Dataset File As Action](https://docs.apify.com/api/v2/dataset-items-get) * [Get Record As Text](https://docs.apify.com/api/v2/key-value-store-record-get) * [Scrape Single URL As File As Action](https://docs.apify.com/api/v2/act-run-sync-get-dataset-items-post) * [Scrape Single URL As Json As Action](https://docs.apify.com/api/v2/act-run-sync-get-dataset-items-post) * [Run Actor](https://docs.apify.com/api/v2/act-runs-post) * [Run Actor Task](https://docs.apify.com/api/v2/actor-task-runs-post) * [Create Webhook](https://docs.apify.com/api/v2/webhooks-post) * [Delete Webhook](https://docs.apify.com/api/v2/webhook-delete) ## Use the latest version of the plugin To stay up to date with new features, make sure you're using the latest version of the plugin. You can check this on the **Plugins** page by selecting the Apify plugin and choosing the latest version from the drop-down menu. You'll also see a brief note describing what's changed in that version. ## Troubleshooting ### Authentication errors Ensure your API token is correctly set in the action (preferably as `Current User's apify_api_token`) and that it has the necessary permissions. ### Missing Actors or Tasks If your Actor or Task doesn't appear in list responses, run it at least once in the Apify Console so it becomes discoverable. ### Timeout errors Bubble workflows have execution time limits. For long‑running Actors, set the **timeout** to 0 and process results asynchronously via a webhook and a backend workflow or scheduled event. See the section for a step‑by‑step guide. ### Data format issues Check that your JSON input is valid when providing **Input overrides** and that dynamic expressions resolve to valid JSON values. Verify the structure of the dataset output when displaying it in your app. If you have any questions or need help, feel free to reach out to us on our [developer community on Discord](https://discord.com/invite/jyEM2PRvMU). --- # Source: https://docs.apify.com/platform/actors/development/quick-start/build-with-ai.md # Build Actors with AI **Learn how to develop new Actors or improve existing ones using AI code generation and vibe coding tools.** *** This guide provides best practices for building new Actors or improving existing ones using AI code generation and vibe coding tools such as Cursor, Claude Code, or Visual Studio Code, by providing the AI agents with the right instructions and context. ## AI coding assistant instructions Use the following prompt in your AI coding assistant such as [Cursor](https://www.cursor.com/), [Claude Code](https://www.claude.com/product/claude-code) or [GitHub Copilot](https://github.com/features/copilot): Use pre-built prompt for your AI coding assistant Show promptCopy prompt The prompt guides AI coding assistants such as Cursor, Claude Code or GitHub Copilot to help users create and deploy an Apify Actor step by step. It walks through setting up the Actor structure, configuring all required files, installing dependencies, running it locally, logging in, and pushing it to the Apify platform and following Apify’s best practices. ### Quick Start 1. Create directory: `mkdir my-new-actor` 2. Open the directory in *Cursor*, *Claude Code*, *VS Code with GitHub Copilot*, etc. 3. Copy the prompt above and paste it into your AI coding assistant (Agent or Chat) 4. Run it, and develop your first actor with the help of AI Avoid copy-pasting The AI will follow the guide step-by-step, and you'll avoid copy-pasting from tools like ChatGPT or Claude. ## Use Actor templates with AGENTS.md All [Actor Templates](https://apify.com/templates) have AGENTS.md that will help you with AI coding. You can use the [Apify CLI](https://docs.apify.com/cli/docs) to create Actors from Actor Templates. ``` apify create ``` If you do not have Apify CLI installed, see the [installation guide](https://docs.apify.com/cli/docs/installation). The command above will guide you through Apify Actor initialization, where you select an Actor Template that works for you. The result is an initialized Actor (with AGENTS.md) ready for development. ## Use Apify MCP Server The Apify MCP Server has tools to search and fetch documentation. If you set it up in your AI editor, it will help you improve the generated code by providing additional context to the AI. Use Apify MCP server configuration We have prepared the [Apify MCP server configuration](https://mcp.apify.com/), which you can configure for your needs. * Cursor * VS Code * Claude To add Apify MCP server to Cursor manually: 1. Create or open the `.cursor/mcp.json` file. 2. Add the following to the configuration file: ``` { "mcpServers": { "apify": { "url": "https://mcp.apify.com/?tools=docs" } } } ``` VS Code supports MCP through MCP-compatible extensions like *GitHub Copilot*, *Cline*, or *Roo Code*. 1. Install an MCP-compatible extension (e.g., GitHub Copilot, Cline). 2. Locate the extension's MCP settings or configuration file (often `mcp.json`). * For *GitHub Copilot*: Run the **MCP: Open User Configuration** command. * For *MCP-compatible extension*: Go to the MCP Servers tab in the extension interface. 3. Add the Apify server configuration: ``` { "mcpServers": { "apify": { "url": "https://mcp.apify.com/?tools=docs" } } } ``` 1) Go to **Settings** > **Connectors** in Claude. 2) Click **Add custom connector**. 3) Set the name to `Apify` and the URL to `https://mcp.apify.com/?tools=docs`. 4) When chatting, select the **+** button and choose the **Apify** connector to add documentation context. ## Provide context to assistants Every page in the Apify documentation has a **** button. You can use it to add additional context to your AI assistant, or even open the page in ChatGPT, Claude, or Perplexity and ask additional questions. ![Copy for LLM](/assets/images/copy-for-ai-58e407ad80447fe3b2d318bbc151e07d.png) ## Use `/llms.txt` files The entire Apify documentation is available in Markdown format for use with LLMs and AI coding tools. Two consolidated files are available: * `https://docs.apify.com/llms.txt`: A Markdown file with an index of all documentation pages in Markdown format, based on the [llmstxt.org](https://llmstxt.org/) standard. * `https://docs.apify.com/llms-full.txt`: All Apify documentation consolidated in a single Markdown file. Access Markdown source Add `.md` to any documentation page URL to view its Markdown source. Example: `https://docs.apify.com/platform/actors` > `https://docs.apify.com/platform/actors.md` Provide link to AI assistants LLMs don't automatically discover `llms.txt` files, you need to add the link manually to improve the quality of answers. ## Best practices * *Small tasks*: Don't ask AI for many tasks at once. Break complex problems into smaller pieces. Solve them step by step. * *Iterative approach*: Work iteratively with clear steps. Start with a basic implementation and gradually add complexity. * *Versioning*: Version your changes often using git. This lets you track changes, roll back if needed, and maintain a clear history. * *Security*: Don't expose API keys, secrets, or sensitive information in your code or conversations with LLM assistants. --- # Source: https://docs.apify.com/platform/actors/development/builds-and-runs.md # Builds and runs **Learn about Actor builds and runs, their lifecycle, versioning, and other properties.** *** Actor **builds** and **runs** are fundamental concepts within the Apify platform. Understanding them is crucial for effective use of the platform. ## Building an Actor When you start the build process for your Actor, you create a *build*. A build is a Docker image containing your source code and the required dependencies needed to run the Actor: ## Running an Actor To create a *run*, you take your *build* and start it with some input: ## Lifecycle Actor builds and runs share a common lifecycle. Each build and run begins with the initial status **READY** and progress through one or more transitional statuses to reach a terminal status. *** | Status | Type | Description | | ---------- | ------------ | ------------------------------------------- | | READY | initial | Started but not allocated to any worker yet | | RUNNING | transitional | Executing on a worker machine | | SUCCEEDED | terminal | Finished successfully | | FAILED | terminal | Run failed | | TIMING-OUT | transitional | Timing out now | | TIMED-OUT | terminal | Timed out | | ABORTING | transitional | Being aborted by user | | ABORTED | terminal | Aborted by user | --- # Source: https://docs.apify.com/platform/actors/development/builds-and-runs/builds.md # Builds **Learn about Actor build numbers, versioning, and how to use specific Actor version in runs. Understand an Actor's lifecycle and manage its cache.** *** ## Understand Actor builds Before an Actor can be run, it needs to be built. The build process creates a snapshot of a specific version of the Actor's settings, including its [source code](https://docs.apify.com/platform/actors/development/actor-definition/source-code.md) and [environment variables](https://docs.apify.com/platform/actors/development/programming-interface/environment-variables.md). This snapshot is then used to create a Docker image containing everything the Actor needs for its run, such as `npm` packages, web browsers, etc. ### Build numbers Each build is assigned a unique build number in the format *MAJOR.MINOR.BUILD* (e.g. *1.2.345*): * *MAJOR.MINOR* corresponds to the Actor version number * *BUILD* is an automatically incremented number starting at **1**. ### Build resources By default, builds have the following resource allocations: * Timeout: *1800* seconds * Memory: `4096 MB` Check out the [Resource limits](https://docs.apify.com/platform/actors/running.md) section for more details. ## Versioning To support active development, Actors can have multiple versions of source code and associated settings, such as the base image and environment. Each version is denoted by a version number of the form *MAJOR.MINOR*, following [Semantic Versioning](https://semver.org/) principles. For example, an Actor might have: * Production version *1.1* * Beta version *1.2* that contains new features but is still backward compatible * Development version *2.0* that contains breaking changes. ## Tags Tags simplify the process of specifying which build to use when running an Actor. Instead of using a version number, you can use a tag such as *latest* or *beta*. Tags are unique, meaning only one build can be associated with a specific tag. To set a tag for builds of a specific Actor version: 1. Set the `Build tag` property. 2. When a new build of that version is successfully finished, it's automatically assigned the tag. By default, the builds are set to the *latest* tag. ## Cache To speed up builds triggered via API, you can use the `useCache=1` parameter. This instructs the build process to use cached Docker images and layers instead of pulling the latest copies and building each layer from scratch. Note that the cached images and layers might not always be available on the server building the image, the `useCache` parameter only functions on a best-effort basis. Clean builds Running builds from the Console By default, the Console uses cached data when starting a build. You can also run a clean build without using the cache. To run a clean build: 1. Go to your Actor page. 2. Select **Source** > **Code**. 3. Locate the **Start** button. Next to it, click on the arrow & choose **Clean build** --- # Source: https://docs.apify.com/academy/expert-scraping-with-apify/bypassing-anti-scraping.md # Bypassing anti-scraping methods **Learn about bypassing anti-scraping methods using proxies and proxy/session rotation together with Crawlee and the Apify SDK.** *** Effectively bypassing anti-scraping software is one of the most crucial, but also one of the most difficult skills to master. The different types of [anti-scraping protections](https://docs.apify.com/academy/anti-scraping.md) can vary a lot on the web. Some websites aren't even protected at all, some require only moderate IP rotation, and some cannot even be scraped without using advanced techniques and workarounds. Additionally, because the web is evolving, anti-scraping techniques are also evolving and becoming more advanced. It is generally quite difficult to recognize the anti-scraping protections a page may have when first inspecting it, so it is important to thoroughly investigate a site prior to writing any lines of code, as anti-scraping measures can significantly change your approach as well as complicate the development process of an Actor. As your skills expand, you will be able to spot anti-scraping measures quicker, and better evaluate the complexity of a new project. You might have already noticed that we've been using the **RESIDENTIAL** proxy group in the `proxyConfiguration` within our Amazon scraping Actor. But what does that mean? This is a proxy group from [Apify Proxy](https://apify.com/proxy) which has been preventing us from being blocked by Amazon this entire time. We'll be learning more about proxies and Apify Proxy in this lesson. ## Learning 🧠 * Skim [this page](https://apify.com/proxy) for a general idea of Apify Proxy. * Give the [proxy documentation](https://docs.apify.com/platform/proxy.md) a solid readover (feel free to skip most of the examples). * Check out the [anti-scraping guide](https://docs.apify.com/academy/anti-scraping.md). * Gain a solid understanding of the [SessionPool](https://crawlee.dev/api/core/class/SessionPool). * Look at a few Actors on the [Apify store](https://apify.com/store). How are they utilizing proxies? ## Knowledge check 📝 1. What are the different types of proxies that Apify proxy offers? What are the main differences between them? 2. Which proxy groups do users get on the free plan? Can they access the proxy from their computer? 3. How can you prevent an error from occurring if one of the proxy groups that a user has is removed? What are the best practices for these scenarios? 4. Does it make sense to rotate proxies when you are logged into a website? 5. Construct a proxy URL that will select proxies **only from the US**. 6. What do you need to do to rotate a proxy (one proxy usually has one IP)? How does this differ for CheerioCrawler and PuppeteerCrawler? 7. Name a few different ways how a website can prevent you from scraping it. ## Our task This time, we're going to build a trivial proxy-session manager for our Amazon scraping Actor. A session should be used a maximum of 5 times before being rotated; however, if a request fails, the IP should be rotated immediately. Additionally, the proxies used by our scraper should now only be from the US. [Solution](https://docs.apify.com/academy/expert-scraping-with-apify/solutions/rotating-proxies.md) ## Next up Up [next](https://docs.apify.com/academy/expert-scraping-with-apify/saving-useful-stats.md), we'll be learning about how to save useful stats about our run, which becomes more and more useful as a project scales. --- # Source: https://docs.apify.com/academy/node-js/caching-responses-in-puppeteer.md # How to optimize Puppeteer by caching responses **Learn why it is important for performance to cache responses in memory when intercepting requests in Puppeteer and how to implement it in your code.** *** > In the latest version of Puppeteer, the request-interception function inconveniently disables the native cache and significantly slows down the crawler. Therefore, it's not recommended to follow the examples shown in this article unless you have a very specific use-case where the default browser cache is not enough (e.g. cashing over multiple scraper runs) When running crawlers that go through a single website, each open page has to load all resources again. The problem is that each resource needs to be downloaded through the network, which can be slow and/or unstable (especially when proxies are used). For this reason, in this article, we will take a look at how to use memory to cache responses in Puppeteer (only those that contain header **cache-control** with **max-age** above **0**). In this example, we will use a scraper which goes through top stories on the CNN website and takes a screenshot of each opened page. The scraper is very slow right now because it waits till all network requests are finished and because the posts contain videos. If the scraper runs with disabled caching, these statistics will show at the end of the run: ![Bad run stats](/assets/images/bad-scraper-stats-b38622928fa3b188cae38d285750451e.png) As you can see, we used 177MB of traffic for 10 posts (that is how many posts are in the top-stories column) and 1 main page. From the screenshot above, it's clear that most of the traffic is coming from script files (124MB) and documents (22.8MB). For this kind of situation, it's always good to check if the content of the page is cache-able. You can do that using Chromes Developer tools. ## Understanding and reproducing the issue If we go to the CNN website, open up the tools and go to the **Network** tab, we will find an option to disable caching. ![Disabling cache in the Network tab](/assets/images/cnn-network-tab-0ca18e39872e758ab7f60f2cd601e0f1.png) Once caching is disabled, we can take a look at how much data is transferred when we open the page. This is visible at the bottom of the developer tools. ![5.3MB of data transferred](/assets/images/slow-no-cache-0681379c53774a230ff67f2ec4704f7c.png) If we uncheck the disable-cache checkbox and refresh the page, we will see how much data we can save by caching responses. ![642KB of data transferred](/assets/images/fast-with-cache-1a683d4e3a74468186b8d004c5fba276.png) By comparison, the data transfer appears to be reduced by 88%! ## Solving the problem by creating an in-memory cache We can now emulate this and cache responses in Puppeteer. All we have to do is to check, when the response is received, whether it contains the **cache-control** header, and whether it's set with a **max-age** higher than **0**. If so, then we'll save the headers, URL, and body of the response to memory, and on the next request check if the requested URL is already stored in the cache. The code will look like this: ``` // On top of your code const cache = {}; // The code below should go between newPage function and goto function await page.setRequestInterception(true); page.on('request', async (request) => { const url = request.url(); if (cache[url] && cache[url].expires > Date.now()) { await request.respond(cache[url]); return; } request.continue(); }); page.on('response', async (response) => { const url = response.url(); const headers = response.headers(); const cacheControl = headers['cache-control'] || ''; const maxAgeMatch = cacheControl.match(/max-age=(\d+)/); const maxAge = maxAgeMatch && maxAgeMatch.length > 1 ? parseInt(maxAgeMatch[1], 10) : 0; if (maxAge) { if (cache[url] && cache[url].expires > Date.now()) return; let buffer; try { buffer = await response.buffer(); } catch (error) { // some responses do not contain buffer and do not need to be caught return; } cache[url] = { status: response.status(), headers: response.headers(), body: buffer, expires: Date.now() + (maxAge * 1000), }; } }); ``` > If the code above looks completely foreign to you, we recommending going through our free [Puppeteer/Playwright course](https://docs.apify.com/academy/puppeteer-playwright.md). After implementing this code, we can run the scraper again. ![Good run results](/assets/images/good-run-results-38dc359a0a3b4cdf6b7611255218d234.png) Looking at the statistics, caching responses in Puppeteer brought the traffic down from 177MB to 13.4MB, which is a reduction of data transfer by 92%. The related screenshots can be found [in the Apify storage](https://my.apify.com/storage/key-value/iWQ3mQE2XsLA2eErL). It did not speed up the crawler, but that is only because the crawler is set to wait until the network is nearly idle, and CNN has a lot of tracking and analytics scripts that keep the network busy. ## Implementation in Crawlee Since most of you are likely using [Crawlee](https://crawlee.dev), here is what response caching would look like using `PuppeteerCrawler`: [Run on](https://console.apify.com/actors/7tWSD8hrYzuc9Lte7?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCB7IERhdGFzZXQsIFB1cHBldGVlckNyYXdsZXIgfSBmcm9tICdjcmF3bGVlJztcXG5cXG5jb25zdCBjYWNoZSA9IHt9O1xcblxcbmNvbnN0IGNyYXdsZXIgPSBuZXcgUHVwcGV0ZWVyQ3Jhd2xlcih7XFxuICAgIHByZU5hdmlnYXRpb25Ib29rczogW2FzeW5jICh7IHBhZ2UgfSkgPT4ge1xcbiAgICAgICAgYXdhaXQgcGFnZS5zZXRSZXF1ZXN0SW50ZXJjZXB0aW9uKHRydWUpO1xcblxcbiAgICAgICAgcGFnZS5vbigncmVxdWVzdCcsIGFzeW5jIChyZXF1ZXN0KSA9PiB7XFxuICAgICAgICAgICAgY29uc3QgdXJsID0gcmVxdWVzdC51cmwoKTtcXG4gICAgICAgICAgICBpZiAoY2FjaGVbdXJsXSAmJiBjYWNoZVt1cmxdLmV4cGlyZXMgPiBEYXRlLm5vdygpKSB7XFxuICAgICAgICAgICAgICAgIGF3YWl0IHJlcXVlc3QucmVzcG9uZChjYWNoZVt1cmxdKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXF1ZXN0LmNvbnRpbnVlKCk7XFxuICAgICAgICB9KTtcXG5cXG4gICAgICAgIHBhZ2Uub24oJ3Jlc3BvbnNlJywgYXN5bmMgKHJlc3BvbnNlKSA9PiB7XFxuICAgICAgICAgICAgY29uc3QgdXJsID0gcmVzcG9uc2UudXJsKCk7XFxuICAgICAgICAgICAgY29uc3QgaGVhZGVycyA9IHJlc3BvbnNlLmhlYWRlcnMoKTtcXG4gICAgICAgICAgICBjb25zdCBjYWNoZUNvbnRyb2wgPSBoZWFkZXJzWydjYWNoZS1jb250cm9sJ10gfHwgJyc7XFxuICAgICAgICAgICAgY29uc3QgbWF4QWdlTWF0Y2ggPSBjYWNoZUNvbnRyb2wubWF0Y2goL21heC1hZ2U9KFxcXFxkKykvKTtcXG4gICAgICAgICAgICBjb25zdCBtYXhBZ2UgPSBtYXhBZ2VNYXRjaCAmJiBtYXhBZ2VNYXRjaC5sZW5ndGggPiAxID8gcGFyc2VJbnQobWF4QWdlTWF0Y2hbMV0sIDEwKSA6IDA7XFxuXFxuICAgICAgICAgICAgaWYgKG1heEFnZSkge1xcbiAgICAgICAgICAgICAgICBpZiAoIWNhY2hlW3VybF0gfHwgY2FjaGVbdXJsXS5leHBpcmVzID4gRGF0ZS5ub3coKSkgcmV0dXJuO1xcblxcbiAgICAgICAgICAgICAgICBsZXQgYnVmZmVyO1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgYnVmZmVyID0gYXdhaXQgcmVzcG9uc2UuYnVmZmVyKCk7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2gge1xcbiAgICAgICAgICAgICAgICAgICAgLy8gc29tZSByZXNwb25zZXMgZG8gbm90IGNvbnRhaW4gYnVmZmVyIGFuZCBkbyBub3QgbmVlZCB0byBiZSBjYWNoZWRcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICBjYWNoZVt1cmxdID0ge1xcbiAgICAgICAgICAgICAgICAgICAgc3RhdHVzOiByZXNwb25zZS5zdGF0dXMoKSxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHJlc3BvbnNlLmhlYWRlcnMoKSxcXG4gICAgICAgICAgICAgICAgICAgIGJvZHk6IGJ1ZmZlcixcXG4gICAgICAgICAgICAgICAgICAgIGV4cGlyZXM6IERhdGUubm93KCkgKyBtYXhBZ2UgKiAxMDAwLFxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICB9XSxcXG4gICAgcmVxdWVzdEhhbmRsZXI6IGFzeW5jICh7IHBhZ2UsIHJlcXVlc3QgfSkgPT4ge1xcbiAgICAgICAgYXdhaXQgRGF0YXNldC5wdXNoRGF0YSh7XFxuICAgICAgICAgICAgdGl0bGU6IGF3YWl0IHBhZ2UudGl0bGUoKSxcXG4gICAgICAgICAgICB1cmw6IHJlcXVlc3QudXJsLFxcbiAgICAgICAgICAgIHN1Y2NlZWRlZDogdHJ1ZSxcXG4gICAgICAgIH0pO1xcbiAgICB9LFxcbn0pO1xcblxcbmF3YWl0IGNyYXdsZXIucnVuKFsnaHR0cHM6Ly9hcGlmeS5jb20vc3RvcmUnLCAnaHR0cHM6Ly9hcGlmeS5jb20nXSk7XFxuXCJ9Iiwib3B0aW9ucyI6eyJidWlsZCI6ImxhdGVzdCIsImNvbnRlbnRUeXBlIjoiYXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOCIsIm1lbW9yeSI6NDA5NiwidGltZW91dCI6MTgwfX0.JN2lYfrYhuU1Kj6T5Ya9YEuVQboRB4s5BbGj-WHjpVw&asrc=run_on_apify) ``` import { Dataset, PuppeteerCrawler } from 'crawlee'; const cache = {}; const crawler = new PuppeteerCrawler({ preNavigationHooks: [async ({ page }) => { await page.setRequestInterception(true); page.on('request', async (request) => { const url = request.url(); if (cache[url] && cache[url].expires > Date.now()) { await request.respond(cache[url]); return; } request.continue(); }); page.on('response', async (response) => { const url = response.url(); const headers = response.headers(); const cacheControl = headers['cache-control'] || ''; const maxAgeMatch = cacheControl.match(/max-age=(\d+)/); const maxAge = maxAgeMatch && maxAgeMatch.length > 1 ? parseInt(maxAgeMatch[1], 10) : 0; if (maxAge) { if (!cache[url] || cache[url].expires > Date.now()) return; let buffer; try { buffer = await response.buffer(); } catch { // some responses do not contain buffer and do not need to be cached return; } cache[url] = { status: response.status(), headers: response.headers(), body: buffer, expires: Date.now() + maxAge * 1000, }; } }); }], requestHandler: async ({ page, request }) => { await Dataset.pushData({ title: await page.title(), url: request.url, succeeded: true, }); }, }); await crawler.run(['https://apify.com/store', 'https://apify.com']); ``` --- # Source: https://docs.apify.com/sdk/js/docs/examples/call-actor.md # Call actor Copy for LLM This example demonstrates how to start an Apify actor using [`Actor.call()`](https://docs.apify.com/sdk/js/sdk/js/reference/class/Actor.md#call) and how to call the Apify API using [`Actor.newClient()`](https://docs.apify.com/sdk/js/sdk/js/reference/class/Actor.md#newClient). The script gets a random weird word and its explanation from [randomword.com](https://randomword.com/) and sends it to your email using the [`apify/send-mail`](https://apify.com/apify/send-mail) actor. To make the example work, you'll need an [Apify account](https://console.apify.com/). Go to the [Settings - Integrations](https://console.apify.com/account?tab=integrations) page to obtain your API token and set it to the [`APIFY_TOKEN`](https://docs.apify.com/sdk/js/sdk/js/docs/guides/environment-variables.md#APIFY_TOKEN) environment variable, or run the script using the Apify CLI. If you deploy this actor to the Apify Cloud, you can do things like set up a scheduler to run your actor early in the morning. To see what other actors are available, visit the [Apify Store](https://apify.com/store). > To run this example on Apify Platform, use the `apify/actor-node-puppeteer-chrome` image for your Dockerfile. ``` import { Actor } from 'apify'; import { launchPuppeteer } from 'crawlee'; await Actor.init(); // Launch the web browser. const browser = await launchPuppeteer(); console.log('Obtaining own email address...'); const apifyClient = Actor.newClient(); const { email } = await apifyClient.user().get(); // Load randomword.com and get a random word console.log('Fetching a random word.'); const page = await browser.newPage(); await page.goto('https://randomword.com/'); const randomWord = await page.$eval('#shared_section', (el) => el.outerHTML); // Send random word to your email. For that, you can use an actor we already // have available on the platform under the name: apify/send-mail. // The second parameter to the Actor.call() invocation is the actor's // desired input. You can find the required input parameters by checking // the actor's documentation page: https://apify.com/apify/send-mail console.log(`Sending email to ${user.email}...`); await Actor.call('apify/send-mail', { to: email, subject: 'Random Word', html: `

Random Word

${randomWord}`, }); console.log('Email sent. Good luck!'); // Close Browser await browser.close(); await Actor.exit(); ``` --- # Source: https://docs.apify.com/legal/candidate-referral-program-terms.md # Apify Candidate Referral Program Last Updated: April 14, 2025 *** Apify Technologies s.r.o., as the announcer (“**Apify**”), is constantly looking for new employees and prefers to recruit people based on credible references.Therefore, Apify is announcing this public candidate referral program. Apify undertakes that any individual (“**You**”) who: is neither: * currently employed by Apify; * a person who carries out business in human resources; * a recruiting agency, or a person cooperating with recruiting agency in any other capacity; and recommends to Apify a suitable job candidate (“**Candidate**”): * for any open full-time position published on the Apify Job page available at: [https://apify.com/jobs](https://apify.com/jobs); * who is not already in Apify’s applicant database, and is not active in the recruitment process (in which case you will be informed by Apify); * with whom Apify concludes an employment contract that establishes full-time employment between Apify and the Candidate (any candidates hired on a “DPP/DPČ” basis are excluded from this program); * who confirms that he/she was recommended to Apify by you and * whose employment with Apify is not terminated during the probationary period; will receive a reward of **CZK 20,000** from Apify for each such Candidate. If the Candidate is hired in a capacity other than full-time engagement, the reward will be prorated accordingly. If the Candidate transfers from part-time and/or “DPP/DPČ” to full-time engagement, you will not be entitled to any additional reward. A person will be considered a Candidate recommended by you only if you send the Candidate’s CV and contact details to the email address jobs\[at]apify\[dot]com. As it’s very important for Apify to respond promptly and avoid any inconveniences, Apify cannot accept any other method of recommendation. Sending resumes and information directly to jobs\[at]apify\[dot]com ensures that the entire Apify recruiting team receives the referral and can take care of the Candidate. When submitting the resume, please provide as much supporting information as possible about why Apify should hire the Candidate. You shall become entitled to the reward after the Candidate’s probationary period successfully passes. Apify will issue a protocol confirming the payout of the reward. Reward payment is based on your signature of the protocol. It is payable by bank transfer to the account specified in the protocol within thirty (30) days from the date of the protocol signature. Please note that the reward is subject to the applicable taxes. You are solely responsible for any related tax obligations (such as tax returns, etc.). You may recommend more than one Candidate. If you and someone else recommend one Candidate for the same open position in parallel, the reward will be provided to the individual who recommended the Candidate first for that specific open position. The current list of open positions is available on the Apify Job page: [https://apify.com/jobs](https://apify.com/jobs). This Apify Candidate Referral Program is effective from its publication and remains in effect as long as it is published on the website [www.apify.com](http://www.apify.com). Apify reserves the right to modify or revoke this Candidate Referral Program and its terms at any time and at its sole discretion by removing it from the website [www.apify.com](http://www.apify.com). --- # Source: https://docs.apify.com/academy/anti-scraping/techniques/captchas.md # Captchas **Learn about the reasons a bot might be presented a captcha, the best ways to avoid CAPTCHASs in the first place, and how to programmatically solve them.** *** In general, a website will present a user (or scraper) a captcha for 2 main reasons: 1. The website always does captcha checks to access the desired content. 2. One of the website's anti-bot measures (or the [WAF](https://docs.apify.com/academy/anti-scraping/techniques/firewalls.md)) has flagged the user as suspicious. ## Dealing with CAPTCHAs When you've hit a captcha, your first thought should not be how to programmatically solve it. Rather, you should consider the factors as to why you received the captcha in the first place: your bot didn't appear enough like a real user to avoid being presented the challenge. Have you expended all of the possible options to make your scraper appear more human-like? Are you: * Using [proxies](https://docs.apify.com/academy/anti-scraping/mitigation/proxies.md)? * Making the request with the proper headers and cookies? * Generating and using a custom [browser fingerprint](https://docs.apify.com/academy/anti-scraping/techniques/fingerprinting.md)? * Trying different general scraping methods (HTTP scraping, browser scraping)? If you are using browser scraping, have you tried using a different browser? ## Solving CAPTCHASs If you've tried everything you can to avoid being presented the captcha and are still facing this roadblock, there are methods to programmatically solve CAPTCHASs. Tons of different types of CAPTCHASs exist, but one of the most popular is Google's [reCAPTCHA](https://www.google.com/recaptcha/about/). ![Google's reCAPTCHA](https://miro.medium.com/max/1400/1*4NhFKMxr-qXodjYpxtiE0w.gif) **reCAPTCHA**s can be solved using the [Anti CAPTCHA reCAPTCHA](https://apify.com/petr_cermak/anti-captcha-recaptcha) Actor on the Apify platform (note that this method requires an account on [anti-captcha.com](https://anti-captcha.com)). Another popular captcha is the [Geetest slider captcha](https://www.geetest.com/en/adaptive-captcha-demo). You can learn how to solve these types of CAPTCHASs in Puppeteer by reading this [guide on solving Geetest slider CAPTCHAs](https://filipvitas.medium.com/how-to-solve-geetest-slider-captcha-with-js-ac764c4e9905). Amazon's captcha can similarly also be solved programmatically. ## Wrap up In this course, you've learned about some of the most common (and some of the most advanced) anti-scraping techniques. Keep in mind that as the web (and technology in general) evolves, this section of the **Anti scraping** course will evolve as well. In the [next section](https://docs.apify.com/academy/anti-scraping/mitigation.md), we'll be discussing how to mitigate the anti-scraping techniques you learned about in this section. --- # Source: https://docs.apify.com/sdk/js/docs/examples/capture-screenshot.md # Capture a screenshot using Puppeteer Copy for LLM tip To run this example on the Apify Platform, select the `apify/actor-node-puppeteer-chrome` image for your Dockerfile. This example captures a screenshot of a web page using `Puppeteer`. It would look almost exactly the same with `Playwright`. * Page Screenshot * Crawler Utils Screenshot Using `page.screenshot()`: [Run on](https://console.apify.com/actors/7tWSD8hrYzuc9Lte7?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCB7IEFjdG9yIH0gZnJvbSAnYXBpZnknO1xcbmltcG9ydCB7IGxhdW5jaFB1cHBldGVlciB9IGZyb20gJ2NyYXdsZWUnO1xcblxcbmF3YWl0IEFjdG9yLmluaXQoKTtcXG5cXG5jb25zdCB1cmwgPSAnaHR0cDovL3d3dy5leGFtcGxlLmNvbS8nO1xcbi8vIFN0YXJ0IGEgYnJvd3NlclxcbmNvbnN0IGJyb3dzZXIgPSBhd2FpdCBsYXVuY2hQdXBwZXRlZXIoKTtcXG5cXG4vLyBPcGVuIG5ldyB0YWIgaW4gdGhlIGJyb3dzZXJcXG5jb25zdCBwYWdlID0gYXdhaXQgYnJvd3Nlci5uZXdQYWdlKCk7XFxuXFxuLy8gTmF2aWdhdGUgdG8gdGhlIFVSTFxcbmF3YWl0IHBhZ2UuZ290byh1cmwpO1xcblxcbi8vIENhcHR1cmUgdGhlIHNjcmVlbnNob3RcXG5jb25zdCBzY3JlZW5zaG90ID0gYXdhaXQgcGFnZS5zY3JlZW5zaG90KCk7XFxuXFxuLy8gU2F2ZSB0aGUgc2NyZWVuc2hvdCB0byB0aGUgZGVmYXVsdCBrZXktdmFsdWUgc3RvcmVcXG5hd2FpdCBBY3Rvci5zZXRWYWx1ZSgnbXkta2V5Jywgc2NyZWVuc2hvdCwgeyBjb250ZW50VHlwZTogJ2ltYWdlL3BuZycgfSk7XFxuXFxuLy8gQ2xvc2UgUHVwcGV0ZWVyXFxuYXdhaXQgYnJvd3Nlci5jbG9zZSgpO1xcblxcbmF3YWl0IEFjdG9yLmV4aXQoKTtcXG5cIn0iLCJvcHRpb25zIjp7ImJ1aWxkIjoibGF0ZXN0IiwiY29udGVudFR5cGUiOiJhcHBsaWNhdGlvbi9qc29uOyBjaGFyc2V0PXV0Zi04IiwibWVtb3J5Ijo0MDk2LCJ0aW1lb3V0IjoxODB9fQ.xy-Qn13nROyNEPEB6pUG8xQ1VfIjq56rsat4wKqhq9o\&asrc=run_on_apify) ``` import { Actor } from 'apify'; import { launchPuppeteer } from 'crawlee'; await Actor.init(); const url = 'http://www.example.com/'; // Start a browser const browser = await launchPuppeteer(); // Open new tab in the browser const page = await browser.newPage(); // Navigate to the URL await page.goto(url); // Capture the screenshot const screenshot = await page.screenshot(); // Save the screenshot to the default key-value store await Actor.setValue('my-key', screenshot, { contentType: 'image/png' }); // Close Puppeteer await browser.close(); await Actor.exit(); ``` Using `puppeteerUtils.saveSnapshot()`: [Run on](https://console.apify.com/actors/7tWSD8hrYzuc9Lte7?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCB7IEFjdG9yIH0gZnJvbSAnYXBpZnknO1xcbmltcG9ydCB7IGxhdW5jaFB1cHBldGVlciwgdXRpbHMgfSBmcm9tICdjcmF3bGVlJztcXG5cXG5hd2FpdCBBY3Rvci5pbml0KCk7XFxuXFxuY29uc3QgdXJsID0gJ2h0dHA6Ly93d3cuZXhhbXBsZS5jb20vJztcXG4vLyBTdGFydCBhIGJyb3dzZXJcXG5jb25zdCBicm93c2VyID0gYXdhaXQgbGF1bmNoUHVwcGV0ZWVyKCk7XFxuXFxuLy8gT3BlbiBuZXcgdGFiIGluIHRoZSBicm93c2VyXFxuY29uc3QgcGFnZSA9IGF3YWl0IGJyb3dzZXIubmV3UGFnZSgpO1xcblxcbi8vIE5hdmlnYXRlIHRvIHRoZSBVUkxcXG5hd2FpdCBwYWdlLmdvdG8odXJsKTtcXG5cXG4vLyBDYXB0dXJlIHRoZSBzY3JlZW5zaG90XFxuYXdhaXQgdXRpbHMucHVwcGV0ZWVyLnNhdmVTbmFwc2hvdChwYWdlLCB7IGtleTogJ215LWtleScsIHNhdmVIdG1sOiBmYWxzZSB9KTtcXG5cXG4vLyBDbG9zZSBQdXBwZXRlZXJcXG5hd2FpdCBicm93c2VyLmNsb3NlKCk7XFxuXFxuYXdhaXQgQWN0b3IuZXhpdCgpO1xcblwifSIsIm9wdGlvbnMiOnsiYnVpbGQiOiJsYXRlc3QiLCJjb250ZW50VHlwZSI6ImFwcGxpY2F0aW9uL2pzb247IGNoYXJzZXQ9dXRmLTgiLCJtZW1vcnkiOjQwOTYsInRpbWVvdXQiOjE4MH19.QSyAaQjtq2wJi2-pHooiFMBrLOELGoFYIBj8kQcDYtA\&asrc=run_on_apify) ``` import { Actor } from 'apify'; import { launchPuppeteer, utils } from 'crawlee'; await Actor.init(); const url = 'http://www.example.com/'; // Start a browser const browser = await launchPuppeteer(); // Open new tab in the browser const page = await browser.newPage(); // Navigate to the URL await page.goto(url); // Capture the screenshot await utils.puppeteer.saveSnapshot(page, { key: 'my-key', saveHtml: false }); // Close Puppeteer await browser.close(); await Actor.exit(); ``` This example captures a screenshot of multiple web pages when using `PuppeteerCrawler`: * Page Screenshot * Crawler Utils Screenshot Using `page.screenshot()`: [Run on](https://console.apify.com/actors/7tWSD8hrYzuc9Lte7?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCB7IEFjdG9yIH0gZnJvbSAnYXBpZnknO1xcbmltcG9ydCB7IFB1cHBldGVlckNyYXdsZXIgfSBmcm9tICdjcmF3bGVlJztcXG5cXG5hd2FpdCBBY3Rvci5pbml0KCk7XFxuXFxuLy8gQ3JlYXRlIGEgUHVwcGV0ZWVyQ3Jhd2xlclxcbmNvbnN0IGNyYXdsZXIgPSBuZXcgUHVwcGV0ZWVyQ3Jhd2xlcih7XFxuICAgIGFzeW5jIHJlcXVlc3RIYW5kbGVyKHsgcmVxdWVzdCwgcGFnZSB9KSB7XFxuICAgICAgICAvLyBDYXB0dXJlIHRoZSBzY3JlZW5zaG90IHdpdGggUHVwcGV0ZWVyXFxuICAgICAgICBjb25zdCBzY3JlZW5zaG90ID0gYXdhaXQgcGFnZS5zY3JlZW5zaG90KCk7XFxuICAgICAgICAvLyBDb252ZXJ0IHRoZSBVUkwgaW50byBhIHZhbGlkIGtleVxcbiAgICAgICAgY29uc3Qga2V5ID0gcmVxdWVzdC51cmwucmVwbGFjZSgvWzovXS9nLCAnXycpO1xcbiAgICAgICAgLy8gU2F2ZSB0aGUgc2NyZWVuc2hvdCB0byB0aGUgZGVmYXVsdCBrZXktdmFsdWUgc3RvcmVcXG4gICAgICAgIGF3YWl0IEFjdG9yLnNldFZhbHVlKGtleSwgc2NyZWVuc2hvdCwgeyBjb250ZW50VHlwZTogJ2ltYWdlL3BuZycgfSk7XFxuICAgIH0sXFxufSk7XFxuXFxuLy8gUnVuIHRoZSBjcmF3bGVyXFxuYXdhaXQgY3Jhd2xlci5ydW4oW1xcbiAgICB7IHVybDogJ2h0dHA6Ly93d3cuZXhhbXBsZS5jb20vcGFnZS0xJyB9LFxcbiAgICB7IHVybDogJ2h0dHA6Ly93d3cuZXhhbXBsZS5jb20vcGFnZS0yJyB9LFxcbiAgICB7IHVybDogJ2h0dHA6Ly93d3cuZXhhbXBsZS5jb20vcGFnZS0zJyB9LFxcbl0pO1xcblxcbmF3YWl0IEFjdG9yLmV4aXQoKTtcXG5cIn0iLCJvcHRpb25zIjp7ImJ1aWxkIjoibGF0ZXN0IiwiY29udGVudFR5cGUiOiJhcHBsaWNhdGlvbi9qc29uOyBjaGFyc2V0PXV0Zi04IiwibWVtb3J5Ijo0MDk2LCJ0aW1lb3V0IjoxODB9fQ.V_BcbfCWH__rcmGznaMSLm6R1wTtqF583QKH4Z3n5Uc\&asrc=run_on_apify) ``` import { Actor } from 'apify'; import { PuppeteerCrawler } from 'crawlee'; await Actor.init(); // Create a PuppeteerCrawler const crawler = new PuppeteerCrawler({ async requestHandler({ request, page }) { // Capture the screenshot with Puppeteer const screenshot = await page.screenshot(); // Convert the URL into a valid key const key = request.url.replace(/[:/]/g, '_'); // Save the screenshot to the default key-value store await Actor.setValue(key, screenshot, { contentType: 'image/png' }); }, }); // Run the crawler await crawler.run([ { url: 'http://www.example.com/page-1' }, { url: 'http://www.example.com/page-2' }, { url: 'http://www.example.com/page-3' }, ]); await Actor.exit(); ``` Using `puppeteerUtils.saveSnapshot()`: [Run on](https://console.apify.com/actors/7tWSD8hrYzuc9Lte7?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCB7IEFjdG9yIH0gZnJvbSAnYXBpZnknO1xcbmltcG9ydCB7IFB1cHBldGVlckNyYXdsZXIsIHB1cHBldGVlclV0aWxzIH0gZnJvbSAnY3Jhd2xlZSc7XFxuXFxuYXdhaXQgQWN0b3IuaW5pdCgpO1xcblxcbi8vIENyZWF0ZSBhIFB1cHBldGVlckNyYXdsZXJcXG5jb25zdCBjcmF3bGVyID0gbmV3IFB1cHBldGVlckNyYXdsZXIoe1xcbiAgICBhc3luYyByZXF1ZXN0SGFuZGxlcih7IHJlcXVlc3QsIHBhZ2UgfSkge1xcbiAgICAgICAgLy8gQ29udmVydCB0aGUgVVJMIGludG8gYSB2YWxpZCBrZXlcXG4gICAgICAgIGNvbnN0IGtleSA9IHJlcXVlc3QudXJsLnJlcGxhY2UoL1s6L10vZywgJ18nKTtcXG4gICAgICAgIC8vIENhcHR1cmUgdGhlIHNjcmVlbnNob3RcXG4gICAgICAgIGF3YWl0IHB1cHBldGVlclV0aWxzLnNhdmVTbmFwc2hvdChwYWdlLCB7IGtleSwgc2F2ZUh0bWw6IGZhbHNlIH0pO1xcbiAgICB9LFxcbn0pO1xcblxcbi8vIFJ1biB0aGUgY3Jhd2xlclxcbmF3YWl0IGNyYXdsZXIucnVuKFtcXG4gICAgeyB1cmw6ICdodHRwOi8vd3d3LmV4YW1wbGUuY29tL3BhZ2UtMScgfSxcXG4gICAgeyB1cmw6ICdodHRwOi8vd3d3LmV4YW1wbGUuY29tL3BhZ2UtMicgfSxcXG4gICAgeyB1cmw6ICdodHRwOi8vd3d3LmV4YW1wbGUuY29tL3BhZ2UtMycgfSxcXG5dKTtcXG5cXG5hd2FpdCBBY3Rvci5leGl0KCk7XFxuXCJ9Iiwib3B0aW9ucyI6eyJidWlsZCI6ImxhdGVzdCIsImNvbnRlbnRUeXBlIjoiYXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOCIsIm1lbW9yeSI6NDA5NiwidGltZW91dCI6MTgwfX0.udR8araTvFL0crHf63ENyHe6LCZ4yd1J7FwSdJauc5M\&asrc=run_on_apify) ``` import { Actor } from 'apify'; import { PuppeteerCrawler, puppeteerUtils } from 'crawlee'; await Actor.init(); // Create a PuppeteerCrawler const crawler = new PuppeteerCrawler({ async requestHandler({ request, page }) { // Convert the URL into a valid key const key = request.url.replace(/[:/]/g, '_'); // Capture the screenshot await puppeteerUtils.saveSnapshot(page, { key, saveHtml: false }); }, }); // Run the crawler await crawler.run([ { url: 'http://www.example.com/page-1' }, { url: 'http://www.example.com/page-2' }, { url: 'http://www.example.com/page-3' }, ]); await Actor.exit(); ``` In both examples using `page.screenshot()`, a `key` variable is created based on the URL of the web page. This variable is used as the key when saving each screenshot into a key-value store. --- # Source: https://docs.apify.com/legal/challenge-terms-and-conditions.md # Apify $1M Challenge Terms and Conditions Effective date: November 3, 2025 Apify Technologies s.r.o., a company registered in the Czech Republic, with its registered office at Vodičkova 704/36, 110 00 Prague 1, Czech Republic, Company ID No.: 04788290 ("**Apify**", "**we**", "**us**") offers you (also referred to as "**participant**") the opportunity to enroll in the "Apify $1M Challenge" ("**Challenge**"), which is subject to the following "Apify 1M Challenge Terms and Conditions" ("**Challenge Terms**"). As part of the Challenge requires publishing Actors in Apify Store, the Challenge is further governed by [Apify Store Publishing Terms and Conditions](https://docs.apify.com/legal/store-publishing-terms-and-conditions.md) ("**Store Publishing Terms**"), which are incorporated herein by reference. In case of a conflict, these Challenge Terms shall prevail. Terms starting with a capital letter used in these Challenge Terms have the meaning defined either here or in Store Publishing Terms. By joining the Challenge, you accept and agree to be bound by these Challenge Terms. If you agree to these Challenge Terms on behalf of an entity, you represent and warrant that you have the authority to bind that entity to these Challenge Terms, and your agreement to these Challenge Terms will be treated as the agreement of the entity. In that event, "you", "your", or “participant” refer herein to that entity. Participation in this Challenge is free and does not require the purchase of any product or service. ## 1. Participant Eligibility 1.1. The Challenge is open to all Apify Users, regardless of whether they are new to Apify or have an existing account. Notwithstanding the foregoing, Apify employees, individual contractors, and their immediate family members, as well as those in close relationships with Apify employees or individual contractors (a "close person" as defined by the Czech Civil Code), are not eligible to participate. 1.2. To participate in the Challenge, you must register at [https://apify.com/challenge](https://apify.com/challenge) and agree to these Challenge Terms. 1.3. You will be disqualified from the Challenge if you do not comply with Store Publishing Terms or if you conduct any of the following activities: * Fraud and Gaming: Any attempt to manipulate the Actor Quality score, inflate active user numbers, or engage in any fraudulent activity. * Spamming: Promote your new Actors via Apify's Discord, Apify Console messaging, or Actor reviews. * Low-Quality Submissions: Publish too many low-quality or spammy Actors, notwithstanding the fact that you may have published other Actors that are high-quality. 1.4. Individuals or entities are not eligible to participate in the Challenge if they fail our KYC/KYB verification, are listed on any sanctions list, or are incorporated, headquartered, or controlled by residents in Russia. ## 2. Actor Requirements 2.1. Actors published in Apify Store following your registration for the Challenge will be enrolled in the Challenge. Any exceptions to this rule are at our sole discretion. 2.2. Actors must meet a set of "hygienic" criteria, which will be evaluated by us at our sole discretion, such as a unique, legitimate README, a well-defined input and output schema (or using the standby mode), and a minimum "Actor Quality score" of 65/100 as further described in the Documentation. Actor Quality score will be visible in your Insights tab in Apify Console. 2.3. **Ineligible Actors**. The following types of Actors are not eligible for any rewards and may result in disqualification: * Actors that use third-party software under a license that prohibits commercial use or redistribution of the resulting Actor. * Actors for scraping the following services or websites: YouTube, LinkedIn, Instagram, Facebook, TikTok, X, Apollo.io, Amazon, Google Maps, Google Search, Google Trends. Notwithstanding the foregoing, Actors that perform non-scraping functionality (e.g., AI agents, etc.) may be eligible. * "Rental" or Pay per Result Actors. (Eligible Actors must be Pay per Usage or Pay per Event (or both).) * Any existing Actors that have been renamed, substantially re-used, or based on a project existing prior to the Challenge start date. ## 3. Rewards 3.1. **Challenge Bonus (New Actors Reward)**. 3.1.1. The reward shall be $2.00 per Monthly Active User. "Monthly Active User" means any User who ran the submitted Actor within the 30 days immediately preceding the calculation date, provided that the activity occurred on or after the eighth (8th) day following that User's signup date. Excluded from this definition are: (i) Apify internal accounts, (ii) test accounts, and (iii) Users blocked by Apify. 3.1.2. The minimum reward is $100 (at least 50 Monthly Active Users). The maximum reward is $2,000 (for 1,000 or more Monthly Active Users). 3.1.3. On January 31, 2026, a final usage snapshot will be taken. We will create a list of all submitted Actors that meet all Challenge requirements (Sections 2 and 3), ranked by the highest number of Monthly Active Users. 3.1.4. Payouts will be distributed sequentially, starting with the highest-ranked Actor on the list, and continuing down the list until the total distributed rewards reach the Challenge Bonus Pool of $920,000. Once the Challenge Bonus Pool is depleted, no further Actors will receive this reward, regardless of their Monthly Active User count. 3.1.5. Every participant can be rewarded in this way for a maximum of 5 Actors. 3.2. **Weekly Spotlight Reward**. Every week starting from November 17, 2025, we will select one exceptional Actor to receive a one-time $2,000 reward. There are no hard criteria for this reward; it will be either based on the Apify jury's or industry expert's assessment of the Actor's concept, technical solution, or user experience, and/or Apify Community vote. For the avoidance of doubt, Actor requirements and other general conditions according to these Challenge Terms still apply. 3.3. **Top 3 Prizes**. After the Challenge concludes on January 31, 2026, the Apify jury will award a total of $60,000 to the three top participants who demonstrate the highest overall success in the Challenge. Awards will be distributed as follows: * First Place: $30,000 * Second Place: $20,000 * Third Place: $10,000. There are no hard criteria for this reward. For the avoidance of doubt, Actor requirements and other general conditions according to these Challenge Terms still apply. ## 4. Payout Terms 4.1. To receive any payout, you must complete our Know Your Customer (KYC) verification process. If you fail to go through our KYC process within 30 days from receiving the notification about your win, the reward will be forfeited. 4.2. You are responsible for any applicable taxes, payment processing fees, or other charges related to receiving a reward. We are not responsible for covering these costs. We reserve the right to withhold taxes and/or require tax reporting documentation as mandated by law. 4.3. All earned rewards will be paid in US dollars and exclusively via wire transfer or a PayPal account, as specified in the payout billing details provided in your account associated with the rewarded Actor. Our obligation for the payout is fully discharged upon the funds being successfully transferred to the selected payment method. 4.4. We shall have no responsibility or liability whatsoever for the distribution, allocation, or remittance of rewards among multiple contributors, developers, or associated third parties involved in creating the rewarded Actor. All such internal distribution remains the sole responsibility of the participant owning the account associated with the awarded Actor. ## 5. General Terms 5.1. By participating in the Challenge, you grant us the right to use your name and likeness, Apify public profile information, or statements relating to your submitted Actors for advertising and promotional purposes, and promote your submitted Actors, display them on a leaderboard, and use them for marketing purposes related to the Challenge, without any additional compensation. 5.2. By submitting an Actor to the Challenge, you grant us a worldwide, perpetual, royalty-free, transferable, and sublicensable license to modify, publicly perform, and display the Actor (in whole or in part) for purposes of promotion, marketing, evaluation, and operation of the Challenge. Actors will be enrolled automatically. If you want to withdraw your Actor from the Challenge, contact us at [support@apify.com](mailto:support@apify.com). 5.3. We will use the personal information you provide to facilitate your participation in the Challenge. 5.4. If the rewarded participant fails to comply with these Challenge Terms or is found to be ineligible for the reward, we reserve the right to cancel the reward and select an alternative participant to receive the reward. All decisions regarding eligibility, disqualification, and rewards are made at Apify’s sole discretion and are final and binding. 5.5. We reserve the right to modify, suspend, or terminate the Challenge at any time, with or without prior notice. Any changes will be posted on our Website, and continued participation constitutes acceptance of the updated Challenge Terms. 5.6. Participation in the Challenge does not create any employment, partnership, or agency relationship between the participant and Apify. Any rewards or payments are discretionary and contingent upon meeting the eligibility criteria, and do not constitute salary or compensation for services rendered. 5.7. In no event will we be liable to you for any special, incidental, exemplary, punitive or consequential damages arising out of or in connection with your participation in the Challenge, whether such liability arises from any claim based upon contract, warranty, tort (including negligence), strict liability or otherwise, and whether or not we have been advised of the possibility of such loss or damage. Our aggregate liability for direct damages arising with respect to the Challenge will not exceed $25.00. 5.8. These Challenge Terms shall be governed by and construed in accordance with the laws of the Czech Republic, without regard to conflict of law principles. Any disputes shall be resolved exclusively in the courts of Prague, Czech Republic. --- # Source: https://docs.apify.com/academy/scraping-basics-javascript/legacy/challenge.md # Challenge **Test your knowledge acquired in the previous sections of this course by building an Amazon scraper using Crawlee's CheerioCrawler!** Archived course This is an archive of our old course. Check out our new [Web scraping basics for JavaScript devs](https://docs.apify.com/academy/scraping-basics-javascript.md) course instead! We plan to completely retire this old course in a few months. *** Before moving onto the other courses in the academy, we recommend following along with this section, as it combines everything you've learned in the previous lessons into one cohesive project that helps you prove to yourself that you've thoroughly understood the material. We recommend that you make sure you've gone through both the [data extraction](https://docs.apify.com/academy/scraping-basics-javascript/legacy/data-extraction.md) and [crawling](https://docs.apify.com/academy/scraping-basics-javascript/legacy/crawling.md) sections of this course to ensure the smoothest development process. ## Learning 🧠 Before continuing, it is highly recommended to do the following: * Look over [how to build a crawler in Crawlee](https://crawlee.dev/docs/introduction/first-crawler) and ideally **code along**. * Read [this short article](https://docs.apify.com/academy/node-js/request-labels-in-apify-actors) about [request labels](https://crawlee.dev/api/core/class/Request#label) (this will be extremely useful later on). * Check out [this tutorial](https://docs.apify.com/academy/node-js/dealing-with-dynamic-pages.md) about dynamic pages. * Read about the [RequestQueue](https://crawlee.dev/api/core/class/RequestQueue). ## Our task On Amazon, we can use this link to get to the results page of any product we want: ``` https://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=KEYWORD ``` Our crawler's input will look like this: ``` { "keyword": "iphone" } ``` The goal at hand is to scrape all of the products from the first page of results for whatever keyword was provided (for our test case, it will be **iPhone**), then to scrape all available offers of each product and push the results to the dataset. For context, the offers for a product look like this: ![Amazon product offers](/assets/images/product-offers-20910dbac0f5cc3df6089143b924ac5b.jpg) In the end, we'd like our final output to look something like this: ``` [ { "title": "Apple iPhone 6 a1549 16GB Space Gray Unlocked (Certified Refurbished)", "asin": "B07P6Y7954", "itemUrl": "https://www.amazon.com/Apple-iPhone-Unlocked-Certified-Refurbished/dp/B00YD547Q6/ref=sr_1_2?s=wireless&ie=UTF8&qid=1539772626&sr=1-2&keywords=iphone", "description": "What's in the box: Certified Refurbished iPhone 6 Space Gray 16GB Unlocked , USB Cable/Adapter. Comes in a Generic Box with a 1 Year Limited Warranty.", "keyword": "iphone", "sellerName": "Blutek Intl", "offer": "$162.97" }, { "title": "Apple iPhone 6 a1549 16GB Space Gray Unlocked (Certified Refurbished)", "asin": "B07P6Y7954", "itemUrl": "https://www.amazon.com/Apple-iPhone-Unlocked-Certified-Refurbished/dp/B00YD547Q6/ref=sr_1_2?s=wireless&ie=UTF8&qid=1539772626&sr=1-2&keywords=iphone", "description": "What's in the box: Certified Refurbished iPhone 6 Space Gray 16GB Unlocked , USB Cable/Adapter. Comes in a Generic Box with a 1 Year Limited Warranty.", "keyword": "iphone", "sellerName": "PLATINUM DEALS", "offer": "$169.98" }, { "...": "..." } ] ``` > The `asin` is the ID of the product, which is data present on the Amazon website. Each of the items in the dataset will represent a scraped offer and will have the same `title`, `asin`, `itemUrl`, and `description`. The offer-specific fields will be `sellerName` and `offer`. ## First up From this course, you should have all the knowledge to build this scraper by yourself. Give it a try, then come back to compare your scraper with our solution. The challenge can be completed using either [CheerioCrawler](https://crawlee.dev/api/cheerio-crawler/class/CheerioCrawler) or [PlaywrightCrawler](https://crawlee.dev/api/playwright-crawler/class/PlaywrightCrawler). Playwright is significantly slower but doesn't get blocked as much. You will learn the most by implementing both. Let's start off this section by [initializing and setting up](https://docs.apify.com/academy/scraping-basics-javascript/legacy/challenge/initializing-and-setting-up.md) our project with the Crawlee CLI (don't worry, no additional installation is required). --- # Source: https://docs.apify.com/cli/docs/changelog.md # Source: https://docs.apify.com/sdk/python/docs/changelog.md # Source: https://docs.apify.com/sdk/js/reference/changelog.md # Source: https://docs.apify.com/sdk/js/docs/changelog.md # Source: https://docs.apify.com/api/client/python/docs/changelog.md # Source: https://docs.apify.com/api/client/js/docs/changelog.md # Changelog ### [2.22.0](https://github.com/apify/apify-client-js/releases/tag/v2.22.0)[](#2220) ##### [2.22.0](https://github.com/apify/apify-client-js/releases/tag/v2.22.0) (2026-01-27)[](#2220-2026-01-27) ###### 🚀 Features[](#-features) * **actor:** Add 'taggedBuilds' to ActorUpdateOptions ([#830](https://github.com/apify/apify-client-js/pull/830)) ([c2c3560](https://github.com/apify/apify-client-js/commit/c2c35603d44678dcc0cdbf00897c9d4202a5fc67)) by [@l2ysho](https://github.com/l2ysho) * **actor:** Updates ActorStandby type ([#833](https://github.com/apify/apify-client-js/pull/833)) ([10144e8](https://github.com/apify/apify-client-js/commit/10144e868eb484d096ace170c3282b4b8ba2f8be)) by [@l2ysho](https://github.com/l2ysho) ###### 🐛 Bug Fixes[](#-bug-fixes) * Align `LimitsUpdateOptions` type with backend validation logic ([#820](https://github.com/apify/apify-client-js/pull/820)) ([74c1e2a](https://github.com/apify/apify-client-js/commit/74c1e2a7b91b976e1298084f6b6858f965c73fdd)) by [@barjin](https://github.com/barjin) * Fetch key-value store records as attachments ([#821](https://github.com/apify/apify-client-js/pull/821)) ([2073e69](https://github.com/apify/apify-client-js/commit/2073e69a03beec9d3810797334479e3e5951766a)) by [@mvolfik](https://github.com/mvolfik) ###### ⚡ Performance[](#-performance) * Omit `proxy-agent` from the browser bundle ([#816](https://github.com/apify/apify-client-js/pull/816)) ([d948b11](https://github.com/apify/apify-client-js/commit/d948b11e8d65f0d72b98fdbfe64d33eea0253a85)) by [@barjin](https://github.com/barjin) ### [2.21.0](https://github.com/apify/apify-client-js/releases/tag/v2.21.0)[](#2210) ##### [2.21.0](https://github.com/apify/apify-client-js/releases/tag/v2.21.0) (2025-12-11)[](#2210-2025-12-11) ###### 🚀 Features[](#-features-1) * Add CONNECT tunneling support for HTTP proxy in sandboxed environments ([#791](https://github.com/apify/apify-client-js/pull/791)) ([a27d55a](https://github.com/apify/apify-client-js/commit/a27d55a504cdddebb5a4afa594a94784d27d3dba)) by [@tducret](https://github.com/tducret) * Make all `collectionClient.list` methods return value also be `asyncIterator` of relevant data ([#790](https://github.com/apify/apify-client-js/pull/790)) ([f855fd4](https://github.com/apify/apify-client-js/commit/f855fd4a774ee8fe91671711f530203475ee1dbd)) by [@Pijukatel](https://github.com/Pijukatel) * Generated JSDocs based on the API reference ([#797](https://github.com/apify/apify-client-js/pull/797)) ([85653a1](https://github.com/apify/apify-client-js/commit/85653a171fcb699d6e8eb16caa481980ecc50ae8)) by [@jancurn](https://github.com/jancurn) * Make storage clients list methods return value also be asyncIterator of relevant data ([#803](https://github.com/apify/apify-client-js/pull/803)) ([c58ce6f](https://github.com/apify/apify-client-js/commit/c58ce6f11363e1863b53754427aed93a185f4ae1)) by [@Pijukatel](https://github.com/Pijukatel) * Expose `actorPermissionLevel` in Actor client ([#809](https://github.com/apify/apify-client-js/pull/809)) ([513e41c](https://github.com/apify/apify-client-js/commit/513e41ce16bb7a1269513337ee807ff4e3664f47)) by [@stepskop](https://github.com/stepskop) ### [2.20.0](https://github.com/apify/apify-client-js/releases/tag/v2.20.0)[](#2200) ##### [2.20.0](https://github.com/apify/apify-client-js/releases/tag/v2.20.0) (2025-11-20)[](#2200-2025-11-20) ###### 🚀 Features[](#-features-2) * Add redirected actor logs ([#769](https://github.com/apify/apify-client-js/pull/769)) ([a7f4233](https://github.com/apify/apify-client-js/commit/a7f42333796b294266dd7950a2ecf47fa504373c)) by [@Pijukatel](https://github.com/Pijukatel) * Replace `agentkeepalive` with native Node.js HTTP agents for proxy support ([#788](https://github.com/apify/apify-client-js/pull/788)) ([7d2be0f](https://github.com/apify/apify-client-js/commit/7d2be0f832a9cba2f7ada14fa80f66e6ea50b944)) by [@tducret](https://github.com/tducret) ###### 🐛 Bug Fixes[](#-bug-fixes-1) * Actor start and run options and doc ([#785](https://github.com/apify/apify-client-js/pull/785)) ([61f91e5](https://github.com/apify/apify-client-js/commit/61f91e5d2bad1c622a40a11d0d321443e68c4540)) by [@michael-apify](https://github.com/michael-apify) ###### ⚡ Performance[](#-performance-1) * Dynamic imports for certain `node:` packages ([#767](https://github.com/apify/apify-client-js/pull/767)) ([0bf8db7](https://github.com/apify/apify-client-js/commit/0bf8db7ce61c98232d7051bf1f74e70fb89df8a5)) by [@barjin](https://github.com/barjin) * Don't bundle `node:crypto` in the browser bundle ([#782](https://github.com/apify/apify-client-js/pull/782)) ([72a1d3c](https://github.com/apify/apify-client-js/commit/72a1d3c154b1db1e3b6f89b69a0593e44bc5e062)) by [@barjin](https://github.com/barjin) ### [2.19.0](https://github.com/apify/apify-client-js/releases/tag/v2.19.0)[](#2190) ##### [2.19.0](https://github.com/apify/apify-client-js/releases/tag/v2.19.0) (2025-10-20)[](#2190-2025-10-20) ###### 🚀 Features[](#-features-3) * Move restartOnError from Actor to Run options ([#760](https://github.com/apify/apify-client-js/pull/760)) ([8f80f82](https://github.com/apify/apify-client-js/commit/8f80f82c22128fd3378ba00ad29766cf4cc8e3c0)) by [@DaveHanns](https://github.com/DaveHanns) ### [2.18.0](https://github.com/apify/apify-client-js/releases/tag/v2.18.0)[](#2180) ##### [2.18.0](https://github.com/apify/apify-client-js/releases/tag/v2.18.0) (2025-10-09)[](#2180-2025-10-09) ###### 🚀 Features[](#-features-4) * Allowed signature to be passed in kv-store/datasets ([#761](https://github.com/apify/apify-client-js/pull/761)) ([a31e36d](https://github.com/apify/apify-client-js/commit/a31e36d6201f90136da362af2aa10b29efb80bad)) by [@gippy](https://github.com/gippy) * Add startedBefore and startedAfter to run list ([#763](https://github.com/apify/apify-client-js/pull/763)) ([2345999](https://github.com/apify/apify-client-js/commit/23459990598ba01833a21bfe969a1c64f775be00)) by [@danpoletaev](https://github.com/danpoletaev) ###### 🐛 Bug Fixes[](#-bug-fixes-2) * Export missing symbols from env vars and version client ([#756](https://github.com/apify/apify-client-js/pull/756)) ([86b591f](https://github.com/apify/apify-client-js/commit/86b591fe8d2f07b4e746561ee9e055fca6639e1d)) by [@B4nan](https://github.com/B4nan) ### [2.17.0](https://github.com/apify/apify-client-js/releases/tag/v2.17.0)[](#2170) ##### [2.17.0](https://github.com/apify/apify-client-js/releases/tag/v2.17.0) (2025-09-11)[](#2170-2025-09-11) ###### 🚀 Features[](#-features-5) * Add forcePermissionLevel run option ([#743](https://github.com/apify/apify-client-js/pull/743)) ([693808c](https://github.com/apify/apify-client-js/commit/693808c6dbbf24542f8f86f3d49673b75309e9f6)) by [@tobice](https://github.com/tobice) ###### 🐛 Bug Fixes[](#-bug-fixes-3) * Signed storage URLs avoid adding expiresInSecs to query params ([#734](https://github.com/apify/apify-client-js/pull/734)) ([70aff4f](https://github.com/apify/apify-client-js/commit/70aff4fedefc02a1c8c6e5155057e213a8ad6c81)) by [@danpoletaev](https://github.com/danpoletaev) * Presigned resource urls shouldn't follow `baseUrl` ([#745](https://github.com/apify/apify-client-js/pull/745)) ([07b36fb](https://github.com/apify/apify-client-js/commit/07b36fbd46ed74e9c4ad3977cac883af55ad525d)) by [@barjin](https://github.com/barjin) ### [2.16.0](https://github.com/apify/apify-client-js/releases/tag/v2.16.0)[](#2160) ##### [2.16.0](https://github.com/apify/apify-client-js/releases/tag/v2.16.0) (2025-08-26)[](#2160-2025-08-26) ###### Refactor[](#refactor) * \[**breaking**] Rename expiresInMillis to expiresInSecs in create storage content URL ([#733](https://github.com/apify/apify-client-js/pull/733)) ([a190b72](https://github.com/apify/apify-client-js/commit/a190b72f6f62ffb54898fd74c80981a6967d573f)) by [@danpoletaev](https://github.com/danpoletaev) ### [2.15.1](https://github.com/apify/apify-client-js/releases/tag/v2.15.1)[](#2151) ##### [2.15.1](https://github.com/apify/apify-client-js/releases/tag/v2.15.1) (2025-08-20)[](#2151-2025-08-20) ###### 🐛 Bug Fixes[](#-bug-fixes-4) * Add recordPublicUrl to KeyValueListItem type ([#730](https://github.com/apify/apify-client-js/pull/730)) ([42dfe64](https://github.com/apify/apify-client-js/commit/42dfe6484e3504aaf46c516bade3d7ff989782ea)) by [@danpoletaev](https://github.com/danpoletaev) ### [2.15.0](https://github.com/apify/apify-client-js/releases/tag/v2.15.0)[](#2150) ##### [2.15.0](https://github.com/apify/apify-client-js/releases/tag/v2.15.0) (2025-08-12)[](#2150-2025-08-12) ###### 🚀 Features[](#-features-6) * Extend status parameter to an array of possible statuses ([#723](https://github.com/apify/apify-client-js/pull/723)) ([0be893f](https://github.com/apify/apify-client-js/commit/0be893f2401a652908aff1ed305736068ee0b421)) by [@JanHranicky](https://github.com/JanHranicky) ### [2.14.0](https://github.com/apify/apify-client-js/releases/tag/v2.14.0)[](#2140) ##### [2.14.0](https://github.com/apify/apify-client-js/releases/tag/v2.14.0) (2025-08-11)[](#2140-2025-08-11) ###### 🚀 Features[](#-features-7) * Add keyValueStore.getRecordPublicUrl ([#725](https://github.com/apify/apify-client-js/pull/725)) ([d84a03a](https://github.com/apify/apify-client-js/commit/d84a03afe6fd49e38d4ca9a6821681e852c73a2a)) by [@danpoletaev](https://github.com/danpoletaev) ### [2.13.0](https://github.com/apify/apify-client-js/releases/tag/v2.13.0)[](#2130) ##### [2.13.0](https://github.com/apify/apify-client-js/releases/tag/v2.13.0) (2025-08-06)[](#2130-2025-08-06) ###### 🚀 Features[](#-features-8) * Add new methods Dataset.createItemsPublicUrl & KeyValueStore.createKeysPublicUrl ([#720](https://github.com/apify/apify-client-js/pull/720)) ([62554e4](https://github.com/apify/apify-client-js/commit/62554e48a8bf6bf1853f356ac84f046fed5945c1)) by [@danpoletaev](https://github.com/danpoletaev) ###### 🐛 Bug Fixes[](#-bug-fixes-5) * Add `eventData` to `WebhookDispatch` type ([#714](https://github.com/apify/apify-client-js/pull/714)) ([351f11f](https://github.com/apify/apify-client-js/commit/351f11f268a54532c7003ab099bc0d7d8d9c9ad7)) by [@valekjo](https://github.com/valekjo) * KV store createKeysPublicUrl wrong URL ([#724](https://github.com/apify/apify-client-js/pull/724)) ([a48ec58](https://github.com/apify/apify-client-js/commit/a48ec58e16a36cc8aa188524e4a738c40f5b74e9)) by [@danpoletaev](https://github.com/danpoletaev) ### [2.12.6](https://github.com/apify/apify-client-js/releases/tag/v2.12.6)[](#2126) ##### [2.12.6](https://github.com/apify/apify-client-js/releases/tag/v2.12.6) (2025-06-30)[](#2126-2025-06-30) ###### 🚀 Features[](#-features-9) * Allow sorting of Actors collection ([#708](https://github.com/apify/apify-client-js/pull/708)) ([562a193](https://github.com/apify/apify-client-js/commit/562a193b90ce4f2b05bf166da8fe2dddaa87eb6b)) by [@protoss70](https://github.com/protoss70) ###### 🐛 Bug Fixes[](#-bug-fixes-6) * Use appropriate timeouts ([#704](https://github.com/apify/apify-client-js/pull/704)) ([b896bf2](https://github.com/apify/apify-client-js/commit/b896bf2e653e0766ef297f29a35304c1a5f27598)) by [@janbuchar](https://github.com/janbuchar) * Rename option for new sortBy parameter ([#711](https://github.com/apify/apify-client-js/pull/711)) ([f45dd03](https://github.com/apify/apify-client-js/commit/f45dd037c581a6c0e27fd8c036033b99cec1ba89)) by [@protoss70](https://github.com/protoss70) ### [2.12.5](https://github.com/apify/apify-client-js/releases/tag/v2.12.5)[](#2125) ##### [2.12.5](https://github.com/apify/apify-client-js/releases/tag/v2.12.5) (2025-05-28)[](#2125-2025-05-28) ###### 🚀 Features[](#-features-10) * List kv store keys by collection of prefix ([#688](https://github.com/apify/apify-client-js/pull/688)) ([be25137](https://github.com/apify/apify-client-js/commit/be25137575435547aaf2c3849fc772daf0537450)) by [@MFori](https://github.com/MFori) * Add unlockRequests endpoint to RequestQueue client ([#700](https://github.com/apify/apify-client-js/pull/700)) ([7c52c64](https://github.com/apify/apify-client-js/commit/7c52c645e2eb66ad97c8daa9791b080bfc747288)) by [@drobnikj](https://github.com/drobnikj) ###### 🐛 Bug Fixes[](#-bug-fixes-7) * Add missing 'effectivePlatformFeatures', 'createdAt', 'isPaying' to User interface ([#691](https://github.com/apify/apify-client-js/pull/691)) ([e138093](https://github.com/apify/apify-client-js/commit/e1380933476e5336469e5da083d2017147518f88)) by [@metalwarrior665](https://github.com/metalwarrior665) * Move prettier into `devDependencies` ([#695](https://github.com/apify/apify-client-js/pull/695)) ([1ba903a](https://github.com/apify/apify-client-js/commit/1ba903a1bfa7a95a8c54ef53951db502dfa4b276)) by [@hudson-worden](https://github.com/hudson-worden) ### [2.12.4](https://github.com/apify/apify-client-js/releases/tag/v2.12.4)[](#2124) ##### [2.12.4](https://github.com/apify/apify-client-js/releases/tag/v2.12.4) (2025-05-13)[](#2124-2025-05-13) ###### 🚀 Features[](#-features-11) * Allow overriding timeout of `KVS.setRecord` calls ([#692](https://github.com/apify/apify-client-js/pull/692)) ([105bd68](https://github.com/apify/apify-client-js/commit/105bd6888117a6c64b21a725c536d4992dff099c)) by [@B4nan](https://github.com/B4nan) ###### 🐛 Bug Fixes[](#-bug-fixes-8) * Fix `RunCollectionListOptions` status type ([#681](https://github.com/apify/apify-client-js/pull/681)) ([8fbcf82](https://github.com/apify/apify-client-js/commit/8fbcf82bfaca57d087719cf079fc850c6d31daa5)) by [@MatousMarik](https://github.com/MatousMarik) * **actor:** Add missing 'pricingInfos' field to Actor object ([#683](https://github.com/apify/apify-client-js/pull/683)) ([4bd4853](https://github.com/apify/apify-client-js/commit/4bd485369ac42d0b72597638c0316a6ca60f9847)) by [@metalwarrior665](https://github.com/metalwarrior665) ### [2.12.3](https://github.com/apify/apify-client-js/releases/tag/v2.12.3)[](#2123) ##### [2.12.3](https://github.com/apify/apify-client-js/releases/tag/v2.12.3) (2025-04-24)[](#2123-2025-04-24) ###### 🐛 Bug Fixes[](#-bug-fixes-9) * DefaultBuild() returns BuildClient ([#677](https://github.com/apify/apify-client-js/pull/677)) ([8ce72a4](https://github.com/apify/apify-client-js/commit/8ce72a4c90aac421281d14ad0ff25fdecba1d094)) by [@danpoletaev](https://github.com/danpoletaev) ### [2.12.2](https://github.com/apify/apify-client-js/releases/tag/v2.12.2)[](#2122) ##### [2.12.2](https://github.com/apify/apify-client-js/releases/tag/v2.12.2) (2025-04-14)[](#2122-2025-04-14) ###### 🚀 Features[](#-features-12) * Add support for general resource access ([#669](https://github.com/apify/apify-client-js/pull/669)) ([7deba52](https://github.com/apify/apify-client-js/commit/7deba52a5ff96c990254687d6b965fc1a5bf3467)) by [@tobice](https://github.com/tobice) * Add defaultBuild method ([#668](https://github.com/apify/apify-client-js/pull/668)) ([c494b3b](https://github.com/apify/apify-client-js/commit/c494b3b8b664a88620e9f41c902acba533d636cf)) by [@danpoletaev](https://github.com/danpoletaev) ### [2.12.1](https://github.com/apify/apify-client-js/releases/tag/v2.12.1)[](#2121) ##### [2.12.1](https://github.com/apify/apify-client-js/releases/tag/v2.12.1) (2025-03-11)[](#2121-2025-03-11) ###### 🚀 Features[](#-features-13) * Add maxItems and maxTotalChargeUsd to resurrect ([#652](https://github.com/apify/apify-client-js/pull/652)) ([5fb9c9a](https://github.com/apify/apify-client-js/commit/5fb9c9a35d6ccb7313c5cbbd7d09b19a64d70d8e)) by [@novotnyj](https://github.com/novotnyj) ### [2.11.2](https://github.com/apify/apify-client-js/releases/tag/v2.11.2)[](#2112) ##### [2.11.2](https://github.com/apify/apify-client-js/releases/tag/v2.11.2) (2025-02-03)[](#2112-2025-02-03) ###### 🚀 Features[](#-features-14) * Add dataset.statistics ([#621](https://github.com/apify/apify-client-js/pull/621)) ([6aeb2b7](https://github.com/apify/apify-client-js/commit/6aeb2b7fae041468d125a0c8bbb00804e290143a)) by [@MFori](https://github.com/MFori) * Added getOpenApiSpecification() to BuildClient ([#626](https://github.com/apify/apify-client-js/pull/626)) ([6248b28](https://github.com/apify/apify-client-js/commit/6248b2844796f93e22404ddea85ee77c1a5b7d50)) by [@danpoletaev](https://github.com/danpoletaev) ### [2.11.1](https://github.com/apify/apify-client-js/releases/tag/v2.11.1)[](#2111) ##### [2.11.1](https://github.com/apify/apify-client-js/releases/tag/v2.11.1) (2025-01-10)[](#2111-2025-01-10) ###### 🐛 Bug Fixes[](#-bug-fixes-10) * Change type `Build.actorDefinitions` to `Build.actorDefinition` ([#624](https://github.com/apify/apify-client-js/pull/624)) ([611f313](https://github.com/apify/apify-client-js/commit/611f31365727e70f58d899009ff5a05c6b888253)) by [@jirispilka](https://github.com/jirispilka) * Add ActorRunPricingInfo type ([#623](https://github.com/apify/apify-client-js/pull/623)) ([8880295](https://github.com/apify/apify-client-js/commit/8880295f13c1664ab6ae0b8b3f171025317ea011)) by [@janbuchar](https://github.com/janbuchar) ### [2.11.0](https://github.com/apify/apify-client-js/releases/tag/v2.11.0)[](#2110) ##### [2.11.0](https://github.com/apify/apify-client-js/releases/tag/v2.11.0) (2024-12-16)[](#2110-2024-12-16) ###### 🚀 Features[](#-features-15) * **actor-build:** Add actorDefinition type for actor build detail, deprecate inputSchema and readme. ([#611](https://github.com/apify/apify-client-js/pull/611)) ([123c2b8](https://github.com/apify/apify-client-js/commit/123c2b81c945a0ca6922221598aa73c42cc298d6)) by [@drobnikj](https://github.com/drobnikj) * Add `charge` method to the run client for "pay per event" ([#613](https://github.com/apify/apify-client-js/pull/613)) ([3d9c64d](https://github.com/apify/apify-client-js/commit/3d9c64d5442b4f8f27c2b19dd98dd3b758944287)) by [@Jkuzz](https://github.com/Jkuzz) * **request-queue:** Add queueHasLockedRequests and clientKey into RequestQueueClientListAndLockHeadResult ([#617](https://github.com/apify/apify-client-js/pull/617)) ([f58ce98](https://github.com/apify/apify-client-js/commit/f58ce989e431de54eb673e561e407a7066ea2b64)) by [@drobnikj](https://github.com/drobnikj) ###### 🐛 Bug Fixes[](#-bug-fixes-11) * **actor:** Correctly set type for ActorTaggedBuilds ([#612](https://github.com/apify/apify-client-js/pull/612)) ([3bda7ee](https://github.com/apify/apify-client-js/commit/3bda7ee741caf2ccfea249a42ed7512cda36bf0b)) by [@metalwarrior665](https://github.com/metalwarrior665) ### [2.10.0](https://github.com/apify/apify-client-js/releases/tag/v2.10.0)[](#2100) ##### [2.10.0](https://github.com/apify/apify-client-js/releases/tag/v2.10.0) (2024-11-01)[](#2100-2024-11-01) ###### 🚀 Features[](#-features-16) * Add user.updateLimits ([#595](https://github.com/apify/apify-client-js/pull/595)) ([bf97c0f](https://github.com/apify/apify-client-js/commit/bf97c0f5bf8d0cbd8decb60382f0605243b00dd5)) by [@MFori](https://github.com/MFori) * Allow appending custom parts to the user agent ([#602](https://github.com/apify/apify-client-js/pull/602)) ([d07452b](https://github.com/apify/apify-client-js/commit/d07452b7bff83d16b48bf3cfba5b88aa564ffe2b)) by [@B4nan](https://github.com/B4nan) ###### 🐛 Bug Fixes[](#-bug-fixes-12) * Allow `null` when updating dataset/kvs/rq `name` ([#604](https://github.com/apify/apify-client-js/pull/604)) ([0034c2e](https://github.com/apify/apify-client-js/commit/0034c2ee63d6d1c6856c4e7786da43d86a3d63ce)) by [@B4nan](https://github.com/B4nan) ### [v2.9.7](https://github.com/apify/apify-client-js/releases/tag/v2.9.7)[](#v297) ##### What's Changed[](#whats-changed) * feat: Rename maxCostPerRunUsd to maxTotalChargeUsd by [@novotnyj](https://github.com/novotnyj) in [#592](https://github.com/apify/apify-client-js/pull/592) **Full Changelog**: ### [v2.9.6](https://github.com/apify/apify-client-js/releases/tag/v2.9.6)[](#v296) ##### What's Changed[](#whats-changed-1) * fix: Rename maxCostPerRun by [@novotnyj](https://github.com/novotnyj) in [#589](https://github.com/apify/apify-client-js/pull/589) **Full Changelog**: ### [v2.9.5](https://github.com/apify/apify-client-js/releases/tag/v2.9.5)[](#v295) ##### What's Changed[](#whats-changed-2) * fix: add `isDeprecated` to actor update type by [@Jkuzz](https://github.com/Jkuzz) in [#566](https://github.com/apify/apify-client-js/pull/566) * feat: add Actor Standby types by [@jirimoravcik](https://github.com/jirimoravcik) in [#569](https://github.com/apify/apify-client-js/pull/569) * feat: allow `unwind` param to `DatasetClient.listItems()` to be an array by [@fnesveda](https://github.com/fnesveda) in [#576](https://github.com/apify/apify-client-js/pull/576) * feat: add maxCostPerRun param by [@stetizu1](https://github.com/stetizu1) in [#578](https://github.com/apify/apify-client-js/pull/578) ##### New Contributors[](#new-contributors) * [@stetizu1](https://github.com/stetizu1) made their first contribution in [#578](https://github.com/apify/apify-client-js/pull/578) **Full Changelog**: ### [v2.9.4](https://github.com/apify/apify-client-js/releases/tag/v2.9.4)[](#v294) ##### What's Changed[](#whats-changed-3) * fix: add missing `isApifyIntegration` field to `Webhook` type by [@omikader](https://github.com/omikader) in [#523](https://github.com/apify/apify-client-js/pull/523) * feat: add notifications field to Schedule by [@m-murasovs](https://github.com/m-murasovs) in [#545](https://github.com/apify/apify-client-js/pull/545) * feat: added data property to API error object by [@gippy](https://github.com/gippy) in [#559](https://github.com/apify/apify-client-js/pull/559) **Full Changelog**: ### [v2.9.3](https://github.com/apify/apify-client-js/releases/tag/v2.9.3)[](#v293) ##### What's Changed[](#whats-changed-4) * chore: remove warning when parseDateFields reaches depth limit by [@tobice](https://github.com/tobice) in [#521](https://github.com/apify/apify-client-js/pull/521) **Full Changelog**: ### [v2.9.2](https://github.com/apify/apify-client-js/releases/tag/v2.9.2)[](#v292) ##### What's Changed[](#whats-changed-5) * feat: add monthlyUsage() and limits() endpoints to UserClients by [@tobice](https://github.com/tobice) in [#517](https://github.com/apify/apify-client-js/pull/517) * feat: parse monthlyUsage.dailyServiceUsages\[].date as Date by [@tobice](https://github.com/tobice) in [#519](https://github.com/apify/apify-client-js/pull/519) **Full Changelog**: ### [v2.9.1](https://github.com/apify/apify-client-js/releases/tag/v2.9.1)[](#v291) ##### What's Changed[](#whats-changed-6) * fix: ensure axios headers are instance of AxiosHeaders via interceptor by [@B4nan](https://github.com/B4nan) in [#515](https://github.com/apify/apify-client-js/pull/515) **Full Changelog**: ### [v2.9.0](https://github.com/apify/apify-client-js/releases/tag/v2.9.0)[](#v290) ##### What's Changed[](#whats-changed-7) * fix: publish browser bundle by [@B4nan](https://github.com/B4nan) in [#506](https://github.com/apify/apify-client-js/pull/506) * fix: update axios to v1.6 by [@B4nan](https://github.com/B4nan) in [#505](https://github.com/apify/apify-client-js/pull/505) * feat: add `KeyValueStore.recordExists()` method by [@barjin](https://github.com/barjin) in [#510](https://github.com/apify/apify-client-js/pull/510) * feat: add `log()` method to BuildClient by [@tobice](https://github.com/tobice) in [#509](https://github.com/apify/apify-client-js/pull/509) * feat: add `runs()` and `builds()` top level endpoints by [@foxt451](https://github.com/foxt451) in [#468](https://github.com/apify/apify-client-js/pull/468) ##### New Contributors[](#new-contributors-1) * [@tobice](https://github.com/tobice) made their first contribution in [#509](https://github.com/apify/apify-client-js/pull/509) **Full Changelog**: ### [v2.8.6](https://github.com/apify/apify-client-js/releases/tag/v2.8.6)[](#v286) ##### What's Changed[](#whats-changed-8) * fix: replace ReadableStream with Readable by [@foxt451](https://github.com/foxt451) in [#463](https://github.com/apify/apify-client-js/pull/463) * fix: add missing properties to `ActorCollectionCreateOptions` type by [@jirimoravcik](https://github.com/jirimoravcik) in [#486](https://github.com/apify/apify-client-js/pull/486) * feat(request-queue): Limit payload size for batchAddRequests() by [@drobnikj](https://github.com/drobnikj) in [#489](https://github.com/apify/apify-client-js/pull/489) * docs: add code owner for documentation by [@TC-MO](https://github.com/TC-MO) in [#488](https://github.com/apify/apify-client-js/pull/488) ##### New Contributors[](#new-contributors-2) * [@foxt451](https://github.com/foxt451) made their first contribution in [#463](https://github.com/apify/apify-client-js/pull/463) * [@TC-MO](https://github.com/TC-MO) made their first contribution in [#488](https://github.com/apify/apify-client-js/pull/488) **Full Changelog**: --- # Source: https://docs.apify.com/platform/integrations/chatgpt.md # ChatGPT integration **Learn how to integrate Apify Actors with ChatGPT to provide web context in real-time.** *** The *ChatGPT* integration enables you to connect ChatGPT to Apify's extensive library of [Actors](https://apify.com/store) through the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/docs/getting-started/intro). This allows ChatGPT to access real-time web data and automation capabilities by using Apify tools directly in conversations. By default, the Apify MCP server exposes a set of tools that let you search and run any Actor you have access to, including all public Actors and rental Actors you have rented. *Example query*: "Find and run an Actor that scrapes Instagram profiles and gets the profile of @natgeo" In this tutorial, you'll learn how to connect *ChatGPT* to the *Apify MCP server* using a custom connector. ## Prerequisites Before connecting ChatGPT to Apify, you'll need: * *An Apify account* - If you don't have an Apify account already, you can [sign up](https://console.apify.com/sign-up) * *Apify API token* - Get your API token from the **Integrations** section in [Apify Console](https://console.apify.com/account#/integrations). This token authorizes the MCP server to run Actors on your behalf. Make sure to keep it secure. * *An OpenAI account with access to ChatGPT* - You need an OpenAI account to use ChatGPT. * *ChatGPT with Developer mode enabled* - You must enable [Developer Mode](https://platform.openai.com/docs/guides/developer-mode) to add custom connectors (when the Developer mode is active, the message input box is outlined in orange). ## Create an MCP connector 1. In ChatGPT, go to **Settings > Apps & Connectors > Create**. If you don't see the **Create** button, enable Developer mode or reload the page. 2. Fill in the following fields: * **Name** – a user-facing title, e.g., `apify-mcp` * **Description** – a short description of what the connector does * **MCP Server URL** – choose one of the following: * `https://mcp.apify.com` - use the default set of Apify tools * `https://mcp.apify.com?tools=actors,docs,mtrunkat/url-list-download-html` - use specific tools * Refer to [mcp.apify.com](https://mcp.apify.com) for details * **Authentication** – OAuth, you don’t need to provide a client ID or secret. 3. Select **Create** to proceed to the authentication page. You’ll be redirected to the Apify website to authorize ChatGPT to access your Apify account. ![ChatGPT Create connection](/assets/images/chatgpt-connector-34503d19858fd26769e1118c0420e35b.png) Once authorized, you'll return to ChatGPT and see a success message with a list of tools available from the Apify MCP server. Cannot modify tools after creation ChatGPT does not allow modifying the selected tools after the connector is created. If you need to add or remove tools later, you'll need to create a new connector. ## Try the MCP connector in ChatGPT Once your connector is ready: 1. Open a **new chat** in ChatGPT. 2. Click the **+** button near the message composer and select **More**. 3. Choose your **Apify MCP connector** to add it to the conversation. 4. Ask ChatGPT to use Apify tools, for example: > “Search the web and summarize recent trends in AI agents” You’ll need to grant permission for each Apify tool when it’s used for the first time. You should see ChatGPT calling Apify tools — such as the [RAG Web Browser](https://apify.com/apify/rag-web-browser) — to gather information. ![ChatGPT Apify tools](/assets/images/chatgpt-with-rag-web-browser-27398b335899c31c3ee69f9fac9982c3.png) ## Limitations * MCP integration in ChatGPT is still in *beta* and may have some limitations or bugs. * Tool selection and execution can be *slow*, especially with the latest GPT models. * *Custom connectors* are only available in ChatGPT *Developer mode*. * When creating connectors that include social media scrapers (Instagram, TikTok), OpenAI may display a *Safety Scan* warning indicating that some tools might fetch sensitive data. ## Related integrations * [OpenAI Assistants integration](https://docs.apify.com/platform/integrations/openai-assistants.md) - Use Apify Actors with OpenAI Assistants API via function calling * [OpenAI Agents SDK integration](https://docs.apify.com/platform/integrations/openai-agents.md) - Integrate Apify MCP server with OpenAI Agents SDK ## Resources * [ChatGPT Developer mode](https://platform.openai.com/docs/guides/developer-mode) - Learn how to enable Developer Mode in ChatGPT * [Connectors and MCP servers](https://platform.openai.com/docs/guides/tools-connectors-mcp) - Official OpenAI documentation on using MCP servers with ChatGPT * [Apify MCP server](https://mcp.apify.com) - Interactive configuration tool for the Apify MCP server * [Apify MCP documentation](https://docs.apify.com/platform/integrations/mcp.md) - Complete guide to using the Apify MCP server --- # Source: https://docs.apify.com/academy/actor-marketing-playbook/promote-your-actor/checklist.md # Marketing checklist You're a developer, not a marketer. You built something awesome, and now you need people to find it. This checklist breaks down the marketing process into simple, actionable steps. Complete many tasks using AI prompts that generate content in minutes. Each completed task brings you closer to your goals. Tag Apify for broader reach Tag @apify when you share content on X.com (Twitter) or LinkedIn to potentially reach thousands of additional users through Apify's social channels. *** ## Social media promotion ### Share on Twitter/X with a demo Twitter's developer community is active and engaged. A well-crafted tweet with a video demo can reach thousands of potential users. Create a 30-60-second demo video or gif showing your Actor in action. Include relevant hashtags like #webscraping, #API, #automation, and #buildinpublic. Use pre-built prompt for your AI assistant Show promptCopy prompt ### Share on LinkedIn with a demo LinkedIn reaches professionals, decision-makers, and business users with purchasing power. The platform's algorithm favors native video content, giving it 5x more reach than link posts. Create a 30-90-second demo video showing your Actor delivering business value. Upload the video directly to LinkedIn (native videos perform better than YouTube links). Focus your post on the business problem solved, not technical features. Use 3-5 relevant hashtags like #BusinessAutomation, #Productivity, #DataIntelligence, #Efficiency, or #MarketResearch. Use pre-built prompt for your AI assistant Show promptCopy prompt ### Post in relevant Discord and Slack communities Developer communities on Discord and Slack are where your target users spend time. These platforms enable deeper conversations and direct feedback. Join communities related to data for AI, web scraping, automation, data science, or your specific niche. Share your Actor in relevant channels, but always check the community rules first. Consider Apify Discord, web scraping communities, automation groups, and data engineering Slacks. *** ## Video content creation ### Create a tutorial video or walkthrough Video content ranks well on YouTube and Google. It's perfect for developers who prefer visual learning. Videos get embedded and shared, multiplying your reach. Record a 5-10-minute screen recording showing your Actor in action. Use Loom, OBS, or your computer's built-in recorder. Distribute your video across multiple channels: * YouTube * LinkedIn * Twitter/X * Your README and articles **Video structure:** 1. **Introduction (30-45 seconds)** - Greet viewers, explain the problem you're solving, what they'll learn, and time estimate 2. **Outcome preview (30-45 seconds)** - Show the result first, preview the final output 3. **Step-by-step walkthrough (4-7 minutes)** - Navigate to the Actor, set up configuration, show optional features, run the Actor, review results, export the data 4. **Pro tips (30-60 seconds)** - Share 2-3 quick tips you've learned 5. **Wrap up (30-45 seconds)** - Recap, call-to-action, engagement prompt **Recording tips:** Close unnecessary tabs, use a clean browser profile, speak clearly at a moderate pace, pause briefly between steps for easier editing, and use your natural voice. ### Create short-form videos (TikTok, YouTube Shorts, Instagram Reels) Short-form video is one of the fastest-growing content formats with incredible organic reach. Even accounts with zero followers can get thousands of views. These videos showcase your Actor's value in 15-60 seconds and appear in AI-generated answers and search results. Focus on the "wow factor": show the problem (manual work taking forever) versus the solution (your Actor doing it in seconds). Use trending sounds when possible, add text overlays explaining what's happening (most people watch without sound), and include a clear call-to-action at the end. Post the same video across all three platforms to maximize reach. Best practices for short-form videos * Hook viewers in the first 3 seconds (show the result or problem immediately) * Keep it fast-paced * Add captions and text overlays (essential for silent viewing) * Record in portrait mode (9:16 aspect ratio) * End with a clear next step: "Link in bio" or "Search \[Actor Name] on Apify" *** ## Launch and community engagement ### Create a Product Hunt launch Product Hunt drives significant traffic and visibility. A successful launch brings hundreds of users and valuable feedback. Create a Product Hunt listing for your Actor. Schedule it for a weekday morning (Tuesday through Thursday works best). Prepare assets: logo, screenshots, and demo video. Learn more in the [Product Hunt guide](https://docs.apify.com/academy/actor-marketing-playbook/promote-your-actor/product-hunt.md). ### Submit to Hacker News Hacker News drives significant developer traffic and has high domain authority. A front-page post brings thousands of visitors and generates discussions that lead to improvements and feature ideas. Submit your "How I Built This" post, tutorial, or Actor launch with a descriptive title. Post between 8-10 AM EST on weekdays for best results. Engage authentically in comments. The HN community values substance over promotion. ### Promote your Actor on Reddit Reddit ranks highly for almost all keywords and topics. You can get your product mentioned in LLMs by engaging in popular threads. 1. Search `site:reddit.com [ACTOR NAME]` in Google 2. Find relevant Reddit threads 3. Comment authentically and mention your product naturally without being salesy Craft comments that genuinely address the thread topic, naturally mention your Actor as a solution, and add real value to the conversation. Use casual Reddit tone, not corporate speak. ### Cross-post to relevant subreddits Original posts in relevant subreddits (r/webdev, r/datascience, r/SideProject, r/programming, r/automation) drive significant traffic when done thoughtfully. Write a Reddit-native post that explains the problem, your solution, and invites feedback. Use titles like "I built X to solve Y" instead of "Check out my new tool." Follow subreddit self-promotion rules (many require you to be an active community member first). Share both challenges and successes to foster authentic engagement. ### Answer Stack Overflow questions Stack Overflow answers rank well in search and are frequently referenced by AI systems. Providing helpful answers that mention your Actor creates lasting SEO value. Search for questions related to your Actor's use case (e.g. "web scraping", "API integration"). Provide genuinely helpful answers that solve the problem, and mention your Actor as one potential solution. ### Contribute to Quora discussions Quora answers rank well in Google and are often featured in AI-generated answers. People actively seek solutions to problems on this platform. 1. Search `site:quora.com [ACTOR NAME]` or related keywords in Google 2. Find relevant Quora threads 3. Write comprehensive, helpful answers and mention your product naturally without being salesy Write 300-500 word answers that open with a direct response, provide context, offer 2-3 different approaches, mention your Actor as one option, and include personal experience. Use subheadings for readability. Keep tone expert but approachable. *** ## Content marketing ### Write a technical "How I built this" blog post Developers love reading about other developers' journeys. This positions you as an expert, builds trust, and naturally promotes your Actor while providing educational value. It's great for SEO and getting indexed by AI search engines. Share your development process, challenges you faced, and how you solved them. Post on dev.to, Medium, Hashnode, or your personal blog. Learn more in the [Blogs and blog resources guide](https://docs.apify.com/academy/actor-marketing-playbook/promote-your-actor/blogs-and-blog-resources.md). ### Create a "Best X" article for Medium Medium has excellent SEO and a massive audience of professionals and developers. Publishing on Medium and submitting to relevant publications like "Better Programming" or "The Startup" can reach thousands of readers. Medium articles frequently appear in Google search results and AI-generated answers. Write a comprehensive "Best \[CATEGORY]" roundup article (1,800-2,500 words) featuring 6-8 solutions with your Actor prominently positioned. Create a Medium account if you don't have one, and publish it. Use all 5 available tags strategically (e.g. "web scraping", "APIs", "automation", "developer tools", "\[your specific niche]"). Submit your article to relevant Medium publications to multiply your reach by 10x or more. Write in first person with a conversational yet professional tone. Include pros and cons for each solution, add a comparison table, and share your genuine perspective. Use pre-built prompt for your AI assistant Show promptCopy prompt ### Create a "Best X" article for dev.to dev.to is the go-to platform for developers seeking tools and tutorials. It has a highly engaged community and strong domain authority, so your articles rank well in search engines. The community actively comments and shares, boosting visibility. dev.to content is frequently referenced by AI tools. Write a developer-focused "Best \[CATEGORY] for Developers" article (1,500-2,000 words) featuring 6-8 solutions. Create a dev.to account if needed and publish your article. Add relevant tags (up to 4 tags, e.g. #webdev, #api, #productivity, #tools). Engage with comments. The dev.to community values authentic interaction. Write like you're advising a fellow developer: casual and helpful. Be genuinely objective about all tools, include code examples or API snippets where relevant, and use markdown formatting with H2/H3 headers. Use pre-built prompt for your AI assistant Show promptCopy prompt ### Create a "Best X" article for Hashnode Hashnode is a rapidly growing developer blogging platform with excellent SEO and a clean reading experience. It's perfect for technical content with features built for developers (code highlighting, series, custom domains). Articles rank well in search results and are frequently discovered by developers. High-quality content often gets featured on Hashnode's homepage, dramatically increasing visibility. Write a technical "Best \[CATEGORY] for \[SPECIFIC USE CASE]: A Developer's Guide" article (1,500-2,000 words). Create a Hashnode account if you don't have one (you can use a custom domain). Publish your article and add it to relevant Hashnode tags and communities. Include a TL;DR section at the top, use proper heading hierarchy for auto-generated table of contents, and add code examples with proper syntax highlighting. Write with technical authority but remain accessible. Use pre-built prompt for your AI assistant Show promptCopy prompt ### Create a "Best X" article for LinkedIn LinkedIn reaches a professional, business-oriented audience including decision-makers, CTOs, product managers, and team leads who have budget and purchasing authority. LinkedIn articles have strong SEO and are shared within professional networks, multiplying your reach. Content on LinkedIn is frequently indexed by AI systems. Write a business-focused "Best \[CATEGORY] for \[BUSINESS OUTCOME]" article (1,200-1,800 words) featuring 5-7 solutions. Publish it as a LinkedIn Article (use the "Write article" feature, not just a post). After publishing, share the article link in a regular LinkedIn post with a compelling intro to drive traffic. Use a professional, authoritative but accessible tone. Focus on business impact like time savings, cost efficiency, ROI, and productivity gains rather than technical features. Include comparison tables with business-relevant metrics. Use pre-built prompt for your AI assistant Show promptCopy prompt ### Create a "How to use \[Actor]" tutorial for dev.to dev.to is the platform for developer tutorials. It has a massive, engaged community that actively searches for and shares how-to content. Tutorials rank exceptionally well in Google and are frequently referenced by AI systems when developers ask "how to" questions. Write a step-by-step tutorial (1,200-2,000 words) showing developers how to use your Actor to achieve a specific outcome. Create a dev.to account if you don't have one, then publish your article with up to 4 relevant tags (e.g. #tutorial, #webdev, #api, #automation). Structure: Introduction with hook, prerequisites, what they'll achieve, step-by-step guide (access the Actor, configure inputs, run it, view results, download data), understanding results, pro tips, troubleshooting, and next steps. Write like you're helping a friend get started. Use pre-built prompt for your AI assistant Show promptCopy prompt ### Create a "How to use \[Actor]" tutorial for Hashnode Hashnode is perfect for comprehensive technical tutorials with a clean reading experience. It has excellent SEO, strong domain authority, and a growing developer community. The platform is built for technical writing with great code formatting and features like table of contents auto-generation. Write a comprehensive "Complete Guide: How to \[ACHIEVE OUTCOME] Using \[YOUR ACTOR NAME]" tutorial (1,800-2,500 words). Sign up for Hashnode if you haven't already. Publish your article and add it to relevant tags. Include a TL;DR section, detailed step-by-step walkthrough with screenshots, API integration examples with code blocks, advanced usage patterns, troubleshooting guide, and best practices. Write with technical authority, but be thorough and maintain clarity. Use pre-built prompt for your AI assistant Show promptCopy prompt ### Create a "How to use \[Actor]" tutorial for Medium Medium reaches a broader, less technical audience. It's perfect for tutorials that appeal to marketers, entrepreneurs, product managers, no-code users, or less technical users. Medium's strong SEO means your tutorial can rank for years. Submitting to publications like "Better Programming", "The Startup", or "UX Collective" can reach tens of thousands of readers. Write an accessible, engaging tutorial "How I \[ACHIEVED OUTCOME] in Minutes Using \[YOUR ACTOR] (Step-by-Step)" (1,500-2,200 words). Create or log into your Medium account, then publish the article. Use all 5 available tags strategically. Take a story-driven approach with personal context. Write in first person, use simple jargon-free language, and make readers feel "I can do this too." Focus on the outcome and value, not technical complexity. Use pre-built prompt for your AI assistant Show promptCopy prompt ### Create a "How to use \[Actor]" tutorial for LinkedIn LinkedIn tutorials reach professionals, decision-makers, and business users who value productivity and efficiency. LinkedIn articles have strong SEO and professional credibility. They're perfect for tutorials focused on business outcomes, time-saving, or solving professional challenges. Write a professional "How to \[ACHIEVE BUSINESS OUTCOME] in \[TIME] Using \[YOUR ACTOR]: A Professional Guide" tutorial (1,400-2,000 words). Publish it as a LinkedIn Article using the "Write article" feature. After publishing, share the article in a regular LinkedIn post with an engaging business-focused intro. Use professional, consultative tone focused on business value. Emphasize time savings, efficiency, and ROI. Include sections on business case, measuring success, professional best practices, and real-world business applications. Address common professional questions about security, cost, reliability, and team adoption. Use pre-built prompt for your AI assistant Show promptCopy prompt *** ## GitHub and developer resources ### Create a GitHub repository with examples GitHub repos rank well in search and are developer-friendly. A repo with usage examples, tutorials, or integration guides makes it easier for others to adopt and reference your Actor. Create a GitHub repo with code examples, integration guides, or sample projects using your Actor. Include a comprehensive README with use cases, code snippets, and links to your Actor. Your README should include: project title with badges, short description, key features, quick start guide, installation and setup instructions, usage examples with code snippets, use cases section, configuration options, common questions and troubleshooting, links to Apify Store and documentation, contributing guidelines, and license. Use pre-built prompt for your AI assistant Show promptCopy prompt *** ## Quick wins Simple actions you can take right now with minimal effort but immediate impact: * Share your launch on your personal social media accounts (Twitter, LinkedIn, Facebook) * Post about your new Actor on your personal website or blog * Ask friends and colleagues to share * Update your email signature to mention your Actor * Add the Actor to your portfolio if you're a freelancer on UpWork or Fiverr ### Create a content hub Create a free Notion page or GitHub README that lists all your Actors and content with links. Share this hub in your Actor description, social profiles, and email signature. This becomes your content portfolio and makes it easy for people to find all your work. --- # Source: https://docs.apify.com/sdk/js/docs/examples/cheerio-crawler.md # Cheerio crawler Copy for LLM This example demonstrates how to use [`CheerioCrawler`](https://crawlee.dev/api/cheerio-crawler/class/CheerioCrawler) to crawl a list of URLs from an external file, load each URL using a plain HTTP request, parse the HTML using the [Cheerio library](https://www.npmjs.com/package/cheerio) and extract some data from it: the page title and all `h1` tags. [Run on](https://console.apify.com/actors/kk67IcZkKSSBTslXI?runConfig=eyJ1IjoiRWdQdHczb2VqNlRhRHQ1cW4iLCJ2IjoxfQ.eyJpbnB1dCI6IntcImNvZGVcIjpcImltcG9ydCB7IENoZWVyaW9DcmF3bGVyLCBsb2csIExvZ0xldmVsIH0gZnJvbSAnY3Jhd2xlZSc7XFxuXFxuLy8gQ3Jhd2xlcnMgY29tZSB3aXRoIHZhcmlvdXMgdXRpbGl0aWVzLCBlLmcuIGZvciBsb2dnaW5nLlxcbi8vIEhlcmUgd2UgdXNlIGRlYnVnIGxldmVsIG9mIGxvZ2dpbmcgdG8gaW1wcm92ZSB0aGUgZGVidWdnaW5nIGV4cGVyaWVuY2UuXFxuLy8gVGhpcyBmdW5jdGlvbmFsaXR5IGlzIG9wdGlvbmFsIVxcbmxvZy5zZXRMZXZlbChMb2dMZXZlbC5ERUJVRyk7XFxuXFxuLy8gQ3JlYXRlIGFuIGluc3RhbmNlIG9mIHRoZSBDaGVlcmlvQ3Jhd2xlciBjbGFzcyAtIGEgY3Jhd2xlclxcbi8vIHRoYXQgYXV0b21hdGljYWxseSBsb2FkcyB0aGUgVVJMcyBhbmQgcGFyc2VzIHRoZWlyIEhUTUwgdXNpbmcgdGhlIGNoZWVyaW8gbGlicmFyeS5cXG5jb25zdCBjcmF3bGVyID0gbmV3IENoZWVyaW9DcmF3bGVyKHtcXG4gICAgLy8gVGhlIGNyYXdsZXIgZG93bmxvYWRzIGFuZCBwcm9jZXNzZXMgdGhlIHdlYiBwYWdlcyBpbiBwYXJhbGxlbCwgd2l0aCBhIGNvbmN1cnJlbmN5XFxuICAgIC8vIGF1dG9tYXRpY2FsbHkgbWFuYWdlZCBiYXNlZCBvbiB0aGUgYXZhaWxhYmxlIHN5c3RlbSBtZW1vcnkgYW5kIENQVSAoc2VlIEF1dG9zY2FsZWRQb29sIGNsYXNzKS5cXG4gICAgLy8gSGVyZSB3ZSBkZWZpbmUgc29tZSBoYXJkIGxpbWl0cyBmb3IgdGhlIGNvbmN1cnJlbmN5LlxcbiAgICBtaW5Db25jdXJyZW5jeTogMTAsXFxuICAgIG1heENvbmN1cnJlbmN5OiA1MCxcXG5cXG4gICAgLy8gT24gZXJyb3IsIHJldHJ5IGVhY2ggcGFnZSBhdCBtb3N0IG9uY2UuXFxuICAgIG1heFJlcXVlc3RSZXRyaWVzOiAxLFxcblxcbiAgICAvLyBJbmNyZWFzZSB0aGUgdGltZW91dCBmb3IgcHJvY2Vzc2luZyBvZiBlYWNoIHBhZ2UuXFxuICAgIHJlcXVlc3RIYW5kbGVyVGltZW91dFNlY3M6IDMwLFxcblxcbiAgICAvLyBMaW1pdCB0byAxMCByZXF1ZXN0cyBwZXIgb25lIGNyYXdsXFxuICAgIG1heFJlcXVlc3RzUGVyQ3Jhd2w6IDEwLFxcblxcbiAgICAvLyBUaGlzIGZ1bmN0aW9uIHdpbGwgYmUgY2FsbGVkIGZvciBlYWNoIFVSTCB0byBjcmF3bC5cXG4gICAgLy8gSXQgYWNjZXB0cyBhIHNpbmdsZSBwYXJhbWV0ZXIsIHdoaWNoIGlzIGFuIG9iamVjdCB3aXRoIG9wdGlvbnMgYXM6XFxuICAgIC8vIGh0dHBzOi8vc2RrLmFwaWZ5LmNvbS9kb2NzL3R5cGVkZWZzL2NoZWVyaW8tY3Jhd2xlci1vcHRpb25zI2hhbmRsZXBhZ2VmdW5jdGlvblxcbiAgICAvLyBXZSB1c2UgZm9yIGRlbW9uc3RyYXRpb24gb25seSAyIG9mIHRoZW06XFxuICAgIC8vIC0gcmVxdWVzdDogYW4gaW5zdGFuY2Ugb2YgdGhlIFJlcXVlc3QgY2xhc3Mgd2l0aCBpbmZvcm1hdGlvbiBzdWNoIGFzIFVSTCBhbmQgSFRUUCBtZXRob2RcXG4gICAgLy8gLSAkOiB0aGUgY2hlZXJpbyBvYmplY3QgY29udGFpbmluZyBwYXJzZWQgSFRNTFxcbiAgICBhc3luYyByZXF1ZXN0SGFuZGxlcih7IHJlcXVlc3QsICQgfSkge1xcbiAgICAgICAgbG9nLmRlYnVnKGBQcm9jZXNzaW5nICR7cmVxdWVzdC51cmx9Li4uYCk7XFxuXFxuICAgICAgICAvLyBFeHRyYWN0IGRhdGEgZnJvbSB0aGUgcGFnZSB1c2luZyBjaGVlcmlvLlxcbiAgICAgICAgY29uc3QgdGl0bGUgPSAkKCd0aXRsZScpLnRleHQoKTtcXG4gICAgICAgIGNvbnN0IGgxdGV4dHMgPSBbXTtcXG4gICAgICAgICQoJ2gxJykuZWFjaCgoaW5kZXgsIGVsKSA9PiB7XFxuICAgICAgICAgICAgaDF0ZXh0cy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGV4dDogJChlbCkudGV4dCgpLFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSk7XFxuXFxuICAgICAgICAvLyBTdG9yZSB0aGUgcmVzdWx0cyB0byB0aGUgZGF0YXNldC4gSW4gbG9jYWwgY29uZmlndXJhdGlvbixcXG4gICAgICAgIC8vIHRoZSBkYXRhIHdpbGwgYmUgc3RvcmVkIGFzIEpTT04gZmlsZXMgaW4gLi9zdG9yYWdlL2RhdGFzZXRzL2RlZmF1bHRcXG4gICAgICAgIGF3YWl0IEFjdG9yLnB1c2hEYXRhKHtcXG4gICAgICAgICAgICB1cmw6IHJlcXVlc3QudXJsLFxcbiAgICAgICAgICAgIHRpdGxlLFxcbiAgICAgICAgICAgIGgxdGV4dHMsXFxuICAgICAgICB9KTtcXG4gICAgfSxcXG5cXG4gICAgLy8gVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgaWYgdGhlIHBhZ2UgcHJvY2Vzc2luZyBmYWlsZWQgbW9yZSB0aGFuIG1heFJlcXVlc3RSZXRyaWVzKzEgdGltZXMuXFxuICAgIGZhaWxlZFJlcXVlc3RIYW5kbGVyKHsgcmVxdWVzdCB9KSB7XFxuICAgICAgICBsb2cuZGVidWcoYFJlcXVlc3QgJHtyZXF1ZXN0LnVybH0gZmFpbGVkIHR3aWNlLmApO1xcbiAgICB9LFxcbn0pO1xcblxcbi8vIFJ1biB0aGUgY3Jhd2xlciBhbmQgd2FpdCBmb3IgaXQgdG8gZmluaXNoLlxcbmF3YWl0IGNyYXdsZXIucnVuKCk7XFxuXFxubG9nLmRlYnVnKCdDcmF3bGVyIGZpbmlzaGVkLicpO1xcblwifSIsIm9wdGlvbnMiOnsiYnVpbGQiOiJsYXRlc3QiLCJjb250ZW50VHlwZSI6ImFwcGxpY2F0aW9uL2pzb247IGNoYXJzZXQ9dXRmLTgiLCJtZW1vcnkiOjEwMjQsInRpbWVvdXQiOjE4MH19.dOZILM56nUwSSVMoLgQB0brbbjQm2W2FDao35eLD72s\&asrc=run_on_apify) ``` import { CheerioCrawler, log, LogLevel } from 'crawlee'; // Crawlers come with various utilities, e.g. for logging. // Here we use debug level of logging to improve the debugging experience. // This functionality is optional! log.setLevel(LogLevel.DEBUG); // Create an instance of the CheerioCrawler class - a crawler // that automatically loads the URLs and parses their HTML using the cheerio library. const crawler = new CheerioCrawler({ // The crawler downloads and processes the web pages in parallel, with a concurrency // automatically managed based on the available system memory and CPU (see AutoscaledPool class). // Here we define some hard limits for the concurrency. minConcurrency: 10, maxConcurrency: 50, // On error, retry each page at most once. maxRequestRetries: 1, // Increase the timeout for processing of each page. requestHandlerTimeoutSecs: 30, // Limit to 10 requests per one crawl maxRequestsPerCrawl: 10, // This function will be called for each URL to crawl. // It accepts a single parameter, which is an object with options as: // https://sdk.apify.com/docs/typedefs/cheerio-crawler-options#handlepagefunction // We use for demonstration only 2 of them: // - request: an instance of the Request class with information such as URL and HTTP method // - $: the cheerio object containing parsed HTML async requestHandler({ request, $ }) { log.debug(`Processing ${request.url}...`); // Extract data from the page using cheerio. const title = $('title').text(); const h1texts = []; $('h1').each((index, el) => { h1texts.push({ text: $(el).text(), }); }); // Store the results to the dataset. In local configuration, // the data will be stored as JSON files in ./storage/datasets/default await Actor.pushData({ url: request.url, title, h1texts, }); }, // This function is called if the page processing failed more than maxRequestRetries+1 times. failedRequestHandler({ request }) { log.debug(`Request ${request.url} failed twice.`); }, }); // Run the crawler and wait for it to finish. await crawler.run(); log.debug('Crawler finished.'); ``` --- # Source: https://docs.apify.com/academy/apify-scrapers/cheerio-scraper.md # This scraping tutorial will go into the nitty gritty details of extracting data from **[https://apify.com/store](https://apify.com/store)** using **Cheerio Scraper** ([apify/cheerio-scraper](https://apify.com/apify/cheerio-scraper)). If you arrived here from the [Getting started with Apify scrapers](https://docs.apify.com/academy/apify-scrapers/getting-started.md), tutorial, great! You are ready to continue where we left off. If you haven't seen the Getting started yet, check it out, it will help you learn about Apify and scraping in general and set you up for this tutorial, because this one builds on topics and code examples discussed there. ## Getting to know our tools In the [Getting started with Apify scrapers](https://docs.apify.com/academy/apify-scrapers/getting-started.md) tutorial, we've confirmed that the scraper works as expected, so now it's time to add more data to the results. To do that, we'll be using the [Cheerio](https://github.com/cheeriojs/cheerio) library. This may not sound familiar, so let's try again. Does [jQuery](https://jquery.com/) ring a bell? If it does you're in luck, because Cheerio is like jQuery that doesn't need an actual browser to run. Everything else is the same. All the functions you already know are there and even the familiar `$` is used. If you still have no idea what either of those are, don't worry. We'll walk you through using them step by step. > [Check out the Cheerio docs](https://github.com/cheeriojs/cheerio) to learn more about it. Now that's out of the way, let's open one of the Actor detail pages in the Store, for example the **Web Scraper** ([apify/web-scraper](https://apify.com/apify/web-scraper)) page, and use our DevTools-Fu to scrape some data. > If you're wondering why we're using Web Scraper as an example instead of Cheerio Scraper, it's only because we didn't want to triple the number of screenshots we needed to make. Lazy developers! ## Building our Page function Before we start, let's do a quick recap of the data we chose to scrape: 1. **URL** - The URL that goes directly to the Actor's detail page. 2. **Unique identifier** - Such as **apify/web-scraper**. 3. **Title** - The title visible in the Actor's detail page. 4. **Description** - The Actor's description. 5. **Last modification date** - When the Actor was last modified. 6. **Number of runs** - How many times the Actor was run. ![$1](https://raw.githubusercontent.com/apify/actor-scraper/master/docs/img/scraping-practice.webp) We've already scraped numbers 1 and 2 in the [Getting started with Apify scrapers](https://docs.apify.com/academy/apify-scrapers/getting-started.md) tutorial, so let's get to the next one on the list: title. ### Title ![$1](https://raw.githubusercontent.com/apify/actor-scraper/master/docs/img/title.webp) By using the element selector tool, we find out that the title is there under an `

` tag, as titles should be. Maybe surprisingly, we find that there are actually two `

` tags on the detail page. This should get us thinking. Is there any parent element that includes our `

` tag, but not the other ones? Yes, there is! A `
` element that we can use to select only the heading we're interested in. > Remember that you can press CTRL+F (CMD+F) in the Elements tab of DevTools to open the search bar where you can quickly search for elements using their selectors. And always make sure to use the DevTools to verify your scraping process and assumptions. It's faster than changing the crawler code all the time. To get the title we need to find it using a `header h1` selector, which selects all `

` elements that have a `
` ancestor. And as we already know, there's only one. ``` // Using Cheerio. async function pageFunction(context) { const { $ } = context; // ... rest of your code can come here return { title: $('header h1').text(), }; } ``` ### Description Getting the Actor's description is a little more involved, but still pretty straightforward. We cannot search for a `

` tag, because there's a lot of them in the page. We need to narrow our search down a little. Using the DevTools we find that the Actor description is nested within the `

` element too, same as the title. Moreover, the actual description is nested inside a `` tag with a class `actor-description`. ![$1](https://raw.githubusercontent.com/apify/actor-scraper/master/docs/img/description.webp) ``` async function pageFunction(context) { const { $ } = context; // ... rest of your code can come here return { title: $('header h1').text(), description: $('header span.actor-description').text(), }; } ``` ### Modified date The DevTools tell us that the `modifiedDate` can be found in a `