Skip to main content
Version: Next

apify-client

Index

Enumerations

Classes

Interfaces

Type Aliases

Type Aliases

ActorChargeEvents

ActorChargeEvents: Record<string, ActorChargeEvent>

Mapping of event names to their pricing information.

Added in 2.11.1

ActorCollectionListResult

ActorCollectionListResult: PaginatedList<ActorCollectionListItem>

ActorEnvVarListResult

ActorEnvVarListResult: Pick<PaginatedList<ActorEnvironmentVariable>, total | items>

Added in 2.1.0

ActorInput

ActorInput: object

Input for an Actor run, as taken by ActorClient.start, ActorClient.call, ActorClient.validateInput and RunClient.metamorph.

An object or an array. Declared as object rather than an index-signature type such as Dictionary, which would reject a caller's own interface.

ActorRunPricingInfo

Union type representing all possible Actor pricing models.

Added in 2.11.1

ActorTaggedBuilds

ActorTaggedBuilds: Record<string, ActorTaggedBuild | null>

Mapping of build tags (e.g. 'latest', 'beta') to their corresponding build information.

ActorUpdateOptions

ActorUpdateOptions: Partial<Pick<Actor, name | description | isPublic | isDeprecated | seoTitle | seoDescription | title | restartOnError | versions | categories | defaultRunOptions | actorStandby | actorPermissionLevel | taggedBuilds>>

Fields that can be updated when modifying an Actor.

ActorVersion

A version of an Actor, discriminated on where its source code comes from.

ActorVersionListResult

ActorVersionListResult: Pick<PaginatedList<FinalActorVersion>, total | items>

ActorVersionUpdateData

ActorVersionUpdateData: Partial<ActorVersion>

Fields that can be changed on an existing Actor version.

All of them are optional, because the endpoint leaves untouched whatever the payload does not mention. The version union enforces the pairing: a sourceType can only be sent next to the source location it implies, never next to one of the other three.

AllowedHttpMethods

AllowedHttpMethods: Schemas[HttpMethod]

HTTP methods supported by Request Queue requests.

ApifyApiErrorType

ApifyApiErrorType: Schemas[ErrorType]

Machine-readable type of an error returned by the Apify API, carried by ApifyApiError.type.

Declared here, next to the other spec-derived types, and re-exported from ./apify_api_error.

ApifyResponseType

ApifyResponseType: parsed | buffer | stream

How HttpClient.call hands back the response body.

  • parsed (the default) decodes it by content type: JSON becomes an object, text and XML become a string, anything else stays a Buffer (an ArrayBuffer in the browser).
  • buffer skips the decoding and hands back the raw bytes.
  • stream hands back a Readable with the body unread. Node.js only.

BuildCollectionClientListResult

BuildCollectionClientListResult: PaginatedList<BuildCollectionClientListItem>

DatasetCollectionClientListResult

DatasetCollectionClientListResult: PaginatedList<Dataset> & { unnamed: boolean }

Dictionary

Dictionary<T>: Record<PropertyKey, T>

Generic dictionary type (key-value map).


Type parameters

  • T = unknown

    The type of values in the dictionary

Added in 2.0.4

FinalActorVersion

FinalActorVersion: ActorVersion & { buildTag: NonNullable<ActorVersion[buildTag]> }

An Actor version as the API returns it, where the build tag is always set.

Required would not be enough: it strips undefined but leaves the null the spec allows on buildTag, so a caller would still have to null-check a field this type promises is set. It is unwrapped with NonNullable instead.

HttpCompressionAlgorithm

HttpCompressionAlgorithm: brotli | gzip

Compression algorithms the compression option of ApifyClient accepts by name. Each name selects the matching built-in compressor with its default quality: 'brotli' a BrotliHttpCompressor, 'gzip' a GzipHttpCompressor. The Apify API also accepts deflate and identity, which a custom HttpCompressor covers.

HttpMethod

HttpMethod: GET | POST | PUT | PATCH | DELETE | HEAD | OPTIONS

HTTP methods the Apify API accepts.

HttpRequestBody

HttpRequestBody: string | Buffer | ArrayBuffer | ArrayBufferView | Readable

A request body as the transport receives it: already serialized, and compressed when that paid off. A Readable is passed through untouched and is only available in Node.js.

HttpResponseBody

HttpResponseBody: Buffer | ArrayBuffer | Readable | undefined

A response body as the transport hands it back: the raw bytes, a Readable when the request asked for a streamed response, or undefined when the response carried no body.

HttpResponseHeaders

HttpResponseHeaders: Record<string, string | string[] | undefined>

Response headers keyed by lowercase header name. A header the server sent more than once may arrive as an array.

KeyValueStoreCollectionListResult

KeyValueStoreCollectionListResult: PaginatedList<KeyValueStore> & { unnamed: boolean }

KeyValueStoreRecordValue

KeyValueStoreRecordValue: JsonValue | ArrayBuffer | TypedArray | Readable

A value that setRecord accepts.

Anything JSON-serializable, or binary content the client uploads as bytes instead of JSON-encoding it: a Buffer, an ArrayBuffer, a typed array, or a readable stream. Buffer is a Uint8Array, so TypedArray covers it.

LimitsUpdateOptions

LimitsUpdateOptions: { maxMonthlyUsageUsd: number } | { dataRetentionDays: number }

Added in 2.10.0

RequestInterceptorFunction

RequestInterceptorFunction: Parameters<AxiosInterceptorManager<InternalAxiosRequestConfig>[use]>[0]

An axios request interceptor. It runs on every attempt, right before the request is handed to axios, and sees the request as the shared pipeline prepared it: headers merged and the body already serialized and compressed.

RequestQueueClientGetRequestResult

RequestQueueClientGetRequestResult: RequestQueueClientRequestSchema

Result of getting a single request from the queue.

GET /v2/request-queues/{queueId}/requests/{requestId} answers with the whole request rather than a queue-head projection.

RequestQueueClientRequestToDelete

RequestQueueClientRequestToDelete: Pick<RequestQueueClientRequestSchema, id> | Pick<RequestQueueClientRequestSchema, uniqueKey>

Added in 2.3.0

RequestQueueCollectionListResult

RequestQueueCollectionListResult: PaginatedList<RequestQueue> & { unnamed: boolean }

RequestQueueListRequestsFilter

RequestQueueListRequestsFilter: locked | pending

Added in 2.23.2

RequestQueueRequestsAsyncIterable

RequestQueueRequestsAsyncIterable<T>: AsyncIterable<T>

Type parameters

  • T

Added in 2.5.1

ReturnTypeFromOptions

ReturnTypeFromOptions<Options>: Options[stream] extends true ? Readable : Options[buffer] extends true ? Buffer : JsonValue

Helper type to determine the return type based on getRecord options.

Returns Readable if stream option is true, Buffer if buffer option is true, otherwise returns JsonValue.


Type parameters

Added in 2.0.6

ScheduleAction

Union type representing all possible scheduled actions.

ScheduleCreateOrUpdateData

ScheduleCreateOrUpdateData: Partial<Pick<Schedule, name | title | cronExpression | timezone | isEnabled | isExclusive | description | notifications> & { actions: DistributiveOptional<ScheduleAction, id>[] }>

Data for creating or updating a Schedule.

Added in 2.6.2

TaskStartOptions

TaskStartOptions: Omit<ActorStartOptions, contentType | forcePermissionLevel>

Options for starting a Task.

Similar to ActorStartOptions but without contentType (Task input is predefined) and forcePermissionLevel.

Added in 2.0.4

TaskUpdateData

TaskUpdateData: Partial<Pick<Task, name | title | description | options | input | actorStandby | isPublic>> & { publicConfig?: Omit<TaskPublicConfig, publishedAt> }

Fields that can be updated when modifying a Task.

Timeout

Timeout: TimeoutTier | noTimeout | number

Timeout of a single API request.

A tier name picks the duration configured for that tier on the ApifyClient constructor, a number is an exact duration in seconds, and 'noTimeout' lets the request run for as long as it takes. A tier or an explicit duration above timeoutMaxSecs is capped at it, and the client logs a warning when that happens. The timeout applies to each attempt separately, and doubles with every retry up to the same cap.

With 'noTimeout' the client never aborts the request, so a connection that stalls is not retried either.

TimeoutTier

TimeoutTier: short | medium | long

Preconfigured timeout tiers. Every client method picks the tier that fits the expected duration of its request: short for simple metadata reads and writes, medium for listing, batch and trigger operations, long for downloads, uploads and streaming. The duration of each tier is set on the ApifyClient constructor.

WebhookCondition

Condition that determines when a webhook should be triggered.

The spec models this as one flat object with all three ids optional and nullable. The published type stays a union of single-id variants: exactly one of them applies to any given webhook, and this same type backs WebhookUpdateData, where the flat shape would let a caller send none of them or all three at once.

WebhookEventType

WebhookEventType: typeof WEBHOOK_EVENT_TYPES[keyof typeof WEBHOOK_EVENT_TYPES]

Event types that can trigger webhooks.

Declared here rather than in ./resource_clients/webhook so that both Webhook and WebhookDispatch can reference it without closing an import cycle. It is re-exported from there, so the public name and import path are unchanged.

WebhookUpdateData

WebhookUpdateData: Partial<Pick<Webhook, isAdHoc | condition | ignoreSslErrors | doNotRetry | requestUrl | payloadTemplate | shouldInterpolateStrings | isApifyIntegration | headersTemplate | description> & { eventTypes: readonly WebhookEventType[] }> & WebhookIdempotencyKey

Data for updating a webhook.