Pass input to an Actor
You can pass input data directly to the call() method to configure and run an Actor in a single step.
The following example shows how to pass input to the apify/instagram-hashtag-scraper Actor and wait for it to finish:
import { ApifyClient } from 'apify-client';
// Client initialization with the API token.
const client = new ApifyClient({ token: 'MY-APIFY-TOKEN' });
const actorClient = client.actor('apify/instagram-hashtag-scraper');
const input = { hashtags: ['rainbow'], resultsLimit: 20 };
// Run the Actor and wait up to 60 seconds for it to finish.
// The input isn't persisted for the next runs.
const run = await actorClient.call(input, { waitSecs: 60 });
console.log(run);