- Add
run.update()
method for setting fields on runs. You can update statusMessage of run using this method.
- Fix parsing ApifyError for method called with
forceBuffer
param to true
.
- Fix stream support, related with axios/axios#1045
- Adjust default parallels and retries for batch add requests
- Add methods to list all requests in queue,
requestQueueClient.listRequests()
and requestQueueClient.paginateRequests()
.
The paginate requests returns async iterator, you can use it:
for await (const page of rqClient.paginateRequests()) {
// Do something with page.items
}
- Fix ActorRun - correct type for
status
- Add
origin
param to the last actor/task run endpoints
- Add request queue methods
listAndLockHead()
, prolongRequestLock()
, deleteRequestLock()
- Add exponential backoff to
batchAddRequests
- Add option
minDelayBetweenUnprocessedRequestsRetriesMillis
to batchAddRequests
- Fix: Retries in batch requests insert endpoint
- Add batch delete requests method for request queue (for now experimental)
- Add support for
schema
parameter in key-value store and dataset getOrCreate
function
- Make
RequestQueueClientListItem.method
strictly typed
- Fix: Correct types and validation for
tasks().create
- Fix: Add missing override modifier for error cause
- Fix: Updated incorrect RunCollectionClient list status type
- Added support for the (for now experimental)
view
parameter to the dataset items endpoints
- For TypeScript users, the type for the fields that end in
At
(ex.: createdAt
) have been correctly typed as a Date object instead of a string
- Add option to set custom timeout for RequestQueue client calls.
- Added
ActorEnvVarCollectionClient
and ActorEnvVarClient
- Add export for
PaginatedList
interface.
- Experimental: Add method for request queue batch requests insert endpoint
- For TypeScript users, the input type for Task#start and Task#call is now correctly marked as optional
- For TypeScript users, the input type for Task#start and Task#call have been corrected
(these methods expect an optional input of an object, not an object or an array of objects)
- For TypeScript users, the overloads for KeyValueStore#getRecord have been relaxed and their order has been corrected
- For TypeScript users, the
WebhookEventType
type was corrected to represent its correct value.
- Fix: Unnamed storages can now be created again.
- For TypeScript users, DatasetClients can now take in a generic type parameter that defines the data present in a dataset.
- BREAKING CHANGE: Remove default export for ApifyClient.
Migration from v1.x.x to v2.x.x:
// v2.x.x
const { ApifyClient } = require('apify-client');
// v1.x.x
const ApifyClient = require('apify-client');
- TypeScript rewrite
- Fix: Exposing token on ApifyClient instance
- Changed passing token using request HTTP header instead of the request parameter for every API calls
- Fix: Exposing token on ApifyClient instance
- Changed passing token using request HTTP header instead of the request parameter for every API calls
- Added new method
.test()
to the WebhookClient
class
- Added gracefully parameter for abort run function
- Enabled access to actor run storages via
RunClient
- use new
apify-shared
packages to reduce bundle size
- Fixed invalid max body length setting thanks to a transitive default in
axios
.
- Fixed double stringification of JSON inputs in
.start()
, .call()
and .metamorph()
functions.
- Added missing function serialization to
.metamorph()
. See 1.2.0 release.
- Added function serialization to
.start()
and .call()
function inputs. You can now define input functions as JS functions instead of having to type them out as a string.
- Added validation for resource IDs to be non-empty. This is non-breaking and prevents cryptic errors like
We have bad news: there is no API endpoint at this URL.
- Fixed slow parsing of large responses due to a bug in
axios
.
- Added timeout, memory, and build parameters to
client.run.resurrect()
- Deprecated
disableRedirect
option for kvs.setRecord()
- Updated
apify-shared
version to resolve a sub-dependency vulnerability.
- Fix requests timing out too early due to socket timeouts.
- Fix
.call
and .waitForFinish
waiting infinitely with waitSecs: 0
.
- Add missing validations to
getOrCreate
methods.
- Remove signed URL uploads from
kvs.setRecord()
- Omit query params for direct upload URL calls
- Removed limits on max content/body length.
- Fix
axios
security vulnerability by updating version.
- Update
ow
to 0.22.0
.
- Improve docs.
- Removed the
desc
option from keyValueStoreClient.listKeys()
because Apify API does not support it.
- A complete rewrite of the client. See README.
- Removed legacy Apify Crawler methods that are no longer supported by Apify API.
- Added update method for request queues, datasets and key-value stores.
- Added new method
client.acts.resurrectRun()
that resurrects finished (even failed) actor run.
body
and contentType
parameters of client.tasks.runTask()
were deprecated in favor of new input
parameter.
- Added new methods to get and update input of actor task -
client.tasks.getInput()
and client.tasks.updateInput()
.
- Added
simplified
and skipFailedPages
parameters to datasets.getItems()
to support legacy crawler produced datasets.
- Added parameter retryOnStatusCodes to define an array of HTTP status codes on which
client retries the request. Default value is
[429]
(only rate limit exceeded).
- Fix of non-JSON crawler execution results retrieval
- Added support for clientKey parameter to request queue endpoints.
- Fixed a bug where last retry stats would not be saved correctly.
- Client now retries request in a case of an invalid JSON response (incomplete response payload).
apifyClient.stats.rateLimitErrors
is now an Array
and tracks errors per retry count.
- Added
client.tasks.listWebhooks()
to list task webhooks.
- Added
client.webhooks
providing access to Apify webhooks.
- Added
client.webhookDispatches
providing access to Apify webhook dispatches.
- Added
client.acts.listWebhooks()
to list actor webhooks.
- Added exponential backoff to
datasets.getItems()
in a case of "Unexpected end of JSON input" error
- Added more details to
ApifyClientError
for easier debugging
- Added
client.acts.metamorphRun()
, see documentation for more information.
- Improve
.toString()
message of ApifyClientError
.
- Added
clean
, skipHidden
and skipEmpty
parameters to client.datasets.getItems()
method.
- Increased number of retries for request queue endpoints that may be slower to scale up.
- Fixed getActorVersion method, now returns
null
if version does not exist
- Added
ApifyClient.stats
object that collects various statistics of the API client
- Methods for Apify storages (i.e. key-value stores, datasets and request queues) that use other than GET HTTP method
now require token parameter.
tasks.runTask()
method now allows to overload input and options from actor task configuration.
- All key-value store records with content type
text/*
are now parsed into string.
- Option
promise
to customize Promise implementation is not supported any more.
- All methods now use native promises instead of Bluebird implementation. Make sure that your code doesn't depend on Bluebird.
- All Boolean parameters of v2 endpoints (Actor, Storages) are now truly Boolean and don't accept
1
as true
.
Legacy crawler API hasn't changed.
- Added support for actor versions API.
- Endpoint to get items from dataset now passes
encoding: null
to support XSLX format.
- Added support for actor tasks API.
- Requests repeated more than
expBackOffMaxRepeats/2
times are logged.
- Added
client.tasks
providing access to Apify tasks.
- Upgraded NPM dependencies
- Renamed
ApifyError
to ApifyClientError
- Added support for more content types to
utils.parseBody()
.
- Added support for pre-serialized data (strings) to
Apify.datasets.putItems()
.
- Added
executionId
parameter to getCrawlerSettings method. You can get crawler settings for specific execution with that.
- Thrown error in a case of failed request now contains details such as
URL
, method
, ... .
- All date fields (ending with
At
) such as modifiedAt
, createdAt
, etc. are now parsed to Date
object.
- Added
client.requestQueues
providing access to Apify Request Queue.
- RequestQueue / KeyValueStore / Dataset now support
[username]~[store-name]
instead of store ID.
- Added
client.users.getUser()
method that retrieves own accout details including usage and limits.
- WARNING: Method
datasets.getItems()
now returns object PaginationList with items wrapped inside instead of plain items array. This helps to iterate through all the items using pagination. This change is not backward compatible!
- Support for Function type added to
utils.checkParamOrThrow()
- Updated GitHub repo and Travis CI links