1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "query": "What is the total number of likes and the total number of comments for the latest 10 posts on the @openai Instagram account? From the 10 latest posts, show me the most popular one.",
12 "modelName": "gpt-4o-mini"
13};
14
15
16const run = await client.actor("sasi_gandikota/smart-product-scout").call(input);
17
18
19console.log('Results from dataset');
20console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
21const { items } = await client.dataset(run.defaultDatasetId).listItems();
22items.forEach((item) => {
23 console.dir(item);
24});
25
26