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<ActorListItem>

ActorEnvVarListResult

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

Added in 2.1.0

ActorInput

ActorInput: Dictionary | readonly Dictionary[] | Uint8Array | ArrayBuffer

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

A plain object or an array of plain objects, serialized into the request body, or raw bytes (a Uint8Array such as a Buffer, or an ArrayBuffer) sent as they are, typically with a contentType. An input typed as an interface or a class needs a spread ({ ...input }), or for an interface a type alias, to compile.

ActorRunPricingInfo

Union type representing all possible Actor pricing models.

Added in 2.11.1

ActorUpdateOptions

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

Fields that can be updated when modifying an Actor.

ActorVersionListResult

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

ActorVersionUpdateData

ActorVersionUpdateData: Partial<Version>

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.

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<BuildListItem>

DatasetCollectionClientListResult

DatasetCollectionClientListResult: PaginatedList<DatasetResource> & { 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

ErrorType

ErrorType: 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.

FinalVersion

FinalVersion: Version & { buildTag: NonNullable<Version[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: Schemas[HttpMethod]

HTTP methods the API specification lists: a request queue request's method, and what the HTTP client sends.

HttpRequestBody

HttpRequestBody: string | Buffer | ArrayBuffer | ArrayBufferView | Readable | Blob

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. A Blob body reaches a Node.js transport as a fresh Readable over its bytes for every attempt, and a transport in any other runtime as the Blob itself.

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<KeyValueStoreResource> & { unnamed: boolean }

KeyValueStoreRecordValue

KeyValueStoreRecordValue: JsonValue | ArrayBuffer | TypedArray | Blob | 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, a Blob, 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: RequestResource

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<RequestResource, id> | Pick<RequestResource, uniqueKey>

Added in 2.3.0

RequestQueueCollectionListResult

RequestQueueCollectionListResult: PaginatedList<RequestQueueResource> & { 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

TaggedBuilds

TaggedBuilds: Record<string, TaggedBuildInfo | null>

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

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.

Version

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

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 WebhookResource 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<WebhookResource, isAdHoc | condition | ignoreSslErrors | doNotRetry | requestUrl | payloadTemplate | shouldInterpolateStrings | isApifyIntegration | headersTemplate | description> & { eventTypes: readonly WebhookEventType[] }> & WebhookIdempotencyKey

Data for updating a webhook.