1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "currentItems": [
12 {
13 "id": "p1",
14 "username": "brandA",
15 "caption": "5 quick running recovery tips",
16 "likesCount": 9200,
17 "commentsCount": 430,
18 "videoViewCount": 182000,
19 "timestamp": "2026-09-09T12:00:00Z",
20 "type": "Reel"
21 },
22 {
23 "id": "p2",
24 "username": "brandB",
25 "caption": "new trail shoe launch review",
26 "likesCount": 4100,
27 "commentsCount": 190,
28 "videoViewCount": 65000,
29 "timestamp": "2026-09-08T12:00:00Z",
30 "type": "Reel"
31 }
32 ],
33 "previousItems": [
34 {
35 "id": "p1",
36 "username": "brandA",
37 "caption": "5 quick running recovery tips",
38 "likesCount": 6100,
39 "commentsCount": 270,
40 "videoViewCount": 105000,
41 "timestamp": "2026-09-09T12:00:00Z",
42 "type": "Reel"
43 }
44 ]
45};
46
47
48const run = await client.actor("quanmatrix/instagram-content-competitive-gap-intelligence").call(input);
49
50
51console.log('Results from dataset');
52console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
53const { items } = await client.dataset(run.defaultDatasetId).listItems();
54items.forEach((item) => {
55 console.dir(item);
56});
57
58