ApifyStorageBackend
Implements
- StorageBackend
Index
Constructors
constructor
Parameters
client: ApifyClient
options: ApifyStorageBackendOptions = {}
Returns ApifyStorageBackend
Methods
createDatasetBackend
Create (or open) a dataset backend. If
idis provided, opens the dataset with that ID. Ifnameis provided, opens an existing dataset with that name or creates a new one. If neither is provided, opens or creates the default dataset.Parameters
optionaloptions: StorageIdentifier
Returns Promise<DatasetBackend<Dictionary>>
createKeyValueStoreBackend
Create (or open) a key-value store backend. If
idis provided, opens the key-value store with that ID. Ifnameis provided, opens an existing store with that name or creates a new one. If neither is provided, opens or creates the default key-value store.Parameters
optionaloptions: StorageIdentifier
Returns Promise<KeyValueStoreBackend>
createRequestQueueBackend
Create (or open) a request queue backend. If
idis provided, opens the request queue with that ID. Ifnameis provided, opens an existing queue with that name or creates a new one. If neither is provided, opens or creates the default request queue.Parameters
optionaloptions: StorageIdentifier
Returns Promise<RequestQueueBackend>
getStorageBackendCacheKey
Partitions crawlee's storage-instance cache by API base URL and token, so the same storage opened through two differently-authenticated backends is cached separately. The request queue access mode is deliberately not part of the key — opening the same queue in
singleandsharedmode at once is not supported, and whichever backend opens it first wins.Returns string
storageExists
Check whether a storage with the given ID exists.
Used internally to resolve ambiguous
idOrNamestrings passed toDataset.open(),KeyValueStore.open(), andRequestQueue.open().Parameters
id: string
type: StorageType
Returns Promise<boolean>
Bridges
apify-client's synchronous resource accessors (dataset(id),keyValueStore(id),requestQueue(id, options?)) to crawlee v4'sStorageBackendinterface (async factory methods accepting anid, aname, or analias).Actorwires this up automatically; construct it directly only to use Apify platform storage with crawlee's storage classes outside ofActor— e.g. to read another run's output with an explicit token: