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();