Skip to main content

Apify API client for JavaScript.

Apify API client for JavaScript.

Apify API Client for JavaScript is the official library to access Apify API from your browser, Node.js, and TypeScript applications. It provides useful features like automatic retries and convenience functions that improve the Apify API experience.

npm install apify-client

Using Apify Client for JavaScript, you can easily run your own actors or actors from Apify Store and 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'john-doe/my-cool-actor').call();

// Fetches results from the actor's dataset.
const { items } = await client.dataset(defaultDatasetId).listItems();