1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "sourceMode": "inline",
12 "records": [
13 {
14 "id": "demo-1",
15 "ownerUsername": "samplecreator",
16 "ownerFullName": "Sample Creator",
17 "caption": "Paid partnership with @northstar. Save 20% when you use code STAR20. Shop now: https://shop.example/products?aff=samplecreator",
18 "url": "https://www.instagram.com/p/DEMO123/",
19 "timestamp": "2026-08-20T10:00:00Z",
20 "likesCount": 4200,
21 "commentsCount": 180,
22 "isPaidPartnership": true,
23 "paidPartnershipPartners": [
24 "northstar"
25 ]
26 }
27 ]
28};
29
30
31const run = await client.actor("scalogik/instagram-sponsorship-promo-intelligence").call(input);
32
33
34console.log('Results from dataset');
35console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
36const { items } = await client.dataset(run.defaultDatasetId).listItems();
37items.forEach((item) => {
38 console.dir(item);
39});
40
41