1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "items": [
12 {
13 "shortCode": "demo1",
14 "url": "https://example.com/demo/demo1",
15 "type": "Image",
16 "ownerUsername": "demo_plant_shop",
17 "caption": "Meet Fern, our easiest plant yet 🌿 Thrives on a shelf, forgives a missed watering. Tap the link in bio to bring one home. #houseplants #easyplants",
18 "hashtags": [
19 "houseplants",
20 "easyplants"
21 ],
22 "likesCount": 420,
23 "commentsCount": 18,
24 "timestamp": "2026-10-14T17:05:00.000Z",
25 "displayUrl": "https://api.apify.com/v2/key-value-stores/5XtbUYaOtYXHaEUdK/records/post1.jpg?signature=Lpk5LeJBzYKygxxyf367"
26 },
27 {
28 "shortCode": "demo2",
29 "url": "https://example.com/demo/demo2",
30 "type": "Sidecar",
31 "ownerUsername": "demo_plant_shop",
32 "caption": "Dark flat? These 3 plants don't mind. Save this for your next shop trip 👇 #houseplants #lowlightplants #plantcare",
33 "hashtags": [
34 "houseplants",
35 "lowlightplants",
36 "plantcare"
37 ],
38 "likesCount": 1310,
39 "commentsCount": 64,
40 "timestamp": "2026-10-17T18:30:00.000Z",
41 "displayUrl": "https://api.apify.com/v2/key-value-stores/5XtbUYaOtYXHaEUdK/records/post2.jpg?signature=hjx7NHRmE7ZtAb5BMtqM"
42 },
43 {
44 "shortCode": "demo3",
45 "url": "https://example.com/demo/demo3",
46 "type": "Image",
47 "ownerUsername": "demo_plant_shop",
48 "caption": "New in: the self-watering pot. Fill it once, forget it for two weeks. #easyplants #plantcare",
49 "hashtags": [
50 "easyplants",
51 "plantcare"
52 ],
53 "likesCount": 510,
54 "commentsCount": 22,
55 "timestamp": "2026-10-21T12:10:00.000Z",
56 "displayUrl": "https://api.apify.com/v2/key-value-stores/5XtbUYaOtYXHaEUdK/records/post3.jpg?signature=18TTpy2MUWKZUJFQlW5Yq"
57 },
58 {
59 "shortCode": "demo4",
60 "url": "https://example.com/demo/demo4",
61 "type": "Sidecar",
62 "ownerUsername": "demo_leafy_corner",
63 "caption": "Why do my leaves turn yellow? Four reasons and a quick fix for each. Which one is yours? Tell us below. #plantcare #plantproblems",
64 "hashtags": [
65 "plantcare",
66 "plantproblems"
67 ],
68 "likesCount": 2240,
69 "commentsCount": 190,
70 "timestamp": "2026-10-15T18:00:00.000Z",
71 "displayUrl": "https://api.apify.com/v2/key-value-stores/5XtbUYaOtYXHaEUdK/records/post2.jpg?signature=hjx7NHRmE7ZtAb5BMtqM"
72 },
73 {
74 "shortCode": "demo5",
75 "url": "https://example.com/demo/demo5",
76 "type": "Image",
77 "ownerUsername": "demo_leafy_corner",
78 "caption": "Weekend drop: hand-glazed pots in three colours. Shop now while stock lasts. #ceramics #plantpots",
79 "hashtags": [
80 "ceramics",
81 "plantpots"
82 ],
83 "likesCount": 880,
84 "commentsCount": 21,
85 "timestamp": "2026-10-18T09:00:00.000Z",
86 "displayUrl": "https://api.apify.com/v2/key-value-stores/5XtbUYaOtYXHaEUdK/records/post3.jpg?signature=18TTpy2MUWKZUJFQlW5Yq"
87 },
88 {
89 "shortCode": "demo6",
90 "url": "https://example.com/demo/demo6",
91 "type": "Image",
92 "ownerUsername": "demo_leafy_corner",
93 "caption": "Our studio this morning. Coffee, soil and a lot of repotting. #behindthescenes #plantpots",
94 "hashtags": [
95 "behindthescenes",
96 "plantpots"
97 ],
98 "likesCount": 960,
99 "commentsCount": 30,
100 "timestamp": "2026-10-22T08:45:00.000Z",
101 "displayUrl": "https://api.apify.com/v2/key-value-stores/5XtbUYaOtYXHaEUdK/records/post1.jpg?signature=Lpk5LeJBzYKygxxyf367"
102 }
103 ],
104 "ownAccount": "demo_plant_shop",
105 "brandBrief": "Leafline is a small online shop for easy-care houseplants and pots, shipping across the EU. Audience: renters aged 22-35 in small, dark flats. Tone: warm, practical, no plant jargon. Goal: followers and visits to the shop. Avoid: fear tactics, discount spam."
106};
107
108
109const run = await client.actor("seasons-ai/instagram-brand-audit").call(input);
110
111
112console.log('Results from dataset');
113console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
114const { items } = await client.dataset(run.defaultDatasetId).listItems();
115items.forEach((item) => {
116 console.dir(item);
117});
118
119