import { ApifyClient } from 'apify-client'; // Initialize the ApifyClient with API token const client = new ApifyClient({ token: '<YOUR_API_TOKEN>', }); // Prepare Actor input const input = { "username": [ "zelenskyy_official" ], "resultsLimit": 30 }; (async () => { // Run the Actor and wait for it to finish const run = await client.actor("xMc5Ga1oCONPmWJIa").call(input); // Fetch and print Actor results from the run's dataset (if any) console.log('Results from dataset'); const { items } = await client.dataset(run.defaultDatasetId).listItems(); items.forEach((item) => { console.dir(item); }); })();
{ "resultsLimit": 30, "username": [ "zelenskyy_official", "zuck" ] }