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 "title": "I Tried 5 Cheap Knives. One Shocked Me",
14 "type": "video",
15 "url": "https://example.com/demo/kl1",
16 "thumbnailUrl": "https://api.apify.com/v2/key-value-stores/pRN5toUmxPnE06IBj/records/kl1.jpg?signature=JRenYivYHxvmvSopDhqs",
17 "viewCount": 48200,
18 "likes": 2100,
19 "commentsCount": 312,
20 "date": "2026-10-02T15:00:00.000Z",
21 "duration": "00:11:42",
22 "channelName": "Demo Kitchen Lab",
23 "channelUsername": "demo_kitchen_lab",
24 "channelUrl": "https://example.com/demo/kitchen-lab",
25 "numberOfSubscribers": 48000
26 },
27 {
28 "title": "How to Cook Rice Perfectly Every Time",
29 "type": "video",
30 "url": "https://example.com/demo/kl2",
31 "thumbnailUrl": "https://api.apify.com/v2/key-value-stores/pRN5toUmxPnE06IBj/records/kl2.jpg?signature=qYb9zZFOMS1vgAT3RsRV",
32 "viewCount": 21400,
33 "likes": 880,
34 "commentsCount": 95,
35 "date": "2026-10-09T15:00:00.000Z",
36 "duration": "00:08:15",
37 "channelName": "Demo Kitchen Lab",
38 "channelUsername": "demo_kitchen_lab",
39 "channelUrl": "https://example.com/demo/kitchen-lab",
40 "numberOfSubscribers": 48000
41 },
42 {
43 "title": "Kitchen Lab Q&A: Your Questions Answered",
44 "type": "video",
45 "url": "https://example.com/demo/kl3",
46 "thumbnailUrl": "https://api.apify.com/v2/key-value-stores/pRN5toUmxPnE06IBj/records/kl3.jpg?signature=1GmdHhDYXICv63FSeTTdX",
47 "viewCount": 6200,
48 "likes": 240,
49 "commentsCount": 61,
50 "date": "2026-10-16T15:00:00.000Z",
51 "duration": "00:21:03",
52 "channelName": "Demo Kitchen Lab",
53 "channelUsername": "demo_kitchen_lab",
54 "channelUrl": "https://example.com/demo/kitchen-lab",
55 "numberOfSubscribers": 48000
56 },
57 {
58 "title": "Stop Ruining Your Pasta (3 Mistakes)",
59 "type": "video",
60 "url": "https://example.com/demo/kl4",
61 "thumbnailUrl": "https://api.apify.com/v2/key-value-stores/pRN5toUmxPnE06IBj/records/kl4.jpg?signature=1QblQqnu7vFveYAhQvKO7",
62 "viewCount": 39100,
63 "likes": 1650,
64 "commentsCount": 204,
65 "date": "2026-10-23T15:00:00.000Z",
66 "duration": "00:09:30",
67 "channelName": "Demo Kitchen Lab",
68 "channelUsername": "demo_kitchen_lab",
69 "channelUrl": "https://example.com/demo/kitchen-lab",
70 "numberOfSubscribers": 48000
71 },
72 {
73 "title": "the 10-second garlic trick",
74 "type": "shorts",
75 "url": "https://example.com/demo/kl5",
76 "thumbnailUrl": "https://api.apify.com/v2/key-value-stores/pRN5toUmxPnE06IBj/records/kl5.jpg?signature=JnhbTBlBngg7CTxdF59d",
77 "viewCount": 15300,
78 "likes": 900,
79 "commentsCount": 22,
80 "date": "2026-10-25T18:00:00.000Z",
81 "duration": "00:00:24",
82 "channelName": "Demo Kitchen Lab",
83 "channelUsername": "demo_kitchen_lab",
84 "channelUrl": "https://example.com/demo/kitchen-lab",
85 "numberOfSubscribers": 48000
86 },
87 {
88 "title": "Easy Weeknight Dinner Ideas",
89 "type": "video",
90 "url": "https://example.com/demo/wm1",
91 "thumbnailUrl": "https://api.apify.com/v2/key-value-stores/pRN5toUmxPnE06IBj/records/wm1.jpg?signature=wvHi1RBeLqTJfaC7ReMn",
92 "viewCount": 9800,
93 "likes": 310,
94 "commentsCount": 28,
95 "date": "2026-10-01T17:00:00.000Z",
96 "duration": "00:14:10",
97 "channelName": "Demo Weeknight Meals",
98 "channelUsername": "demo_weeknight_meals",
99 "channelUrl": "https://example.com/demo/weeknight-meals",
100 "numberOfSubscribers": 21000
101 },
102 {
103 "title": "Why Your Stir Fry Is Soggy",
104 "type": "video",
105 "url": "https://example.com/demo/wm2",
106 "thumbnailUrl": "https://api.apify.com/v2/key-value-stores/pRN5toUmxPnE06IBj/records/wm2.jpg?signature=fY4Wb7dXabZSz5J7Ub42",
107 "viewCount": 27500,
108 "likes": 1200,
109 "commentsCount": 140,
110 "date": "2026-10-08T17:00:00.000Z",
111 "duration": "00:07:48",
112 "channelName": "Demo Weeknight Meals",
113 "channelUsername": "demo_weeknight_meals",
114 "channelUrl": "https://example.com/demo/weeknight-meals",
115 "numberOfSubscribers": 21000
116 },
117 {
118 "title": "Meal Prep for the Week in 1 Hour",
119 "type": "video",
120 "url": "https://example.com/demo/wm3",
121 "thumbnailUrl": "https://api.apify.com/v2/key-value-stores/pRN5toUmxPnE06IBj/records/wm3.jpg?signature=1J8PWi0wi3PflW6aQdjp1",
122 "viewCount": 14000,
123 "likes": 520,
124 "commentsCount": 47,
125 "date": "2026-10-15T17:00:00.000Z",
126 "duration": "00:12:20",
127 "channelName": "Demo Weeknight Meals",
128 "channelUsername": "demo_weeknight_meals",
129 "channelUrl": "https://example.com/demo/weeknight-meals",
130 "numberOfSubscribers": 21000
131 },
132 {
133 "title": "fastest fried egg ever?",
134 "type": "shorts",
135 "url": "https://example.com/demo/wm4",
136 "thumbnailUrl": "https://api.apify.com/v2/key-value-stores/pRN5toUmxPnE06IBj/records/wm4.jpg?signature=1mjjEHNxB5M6OPFVip0TR",
137 "viewCount": 22000,
138 "likes": 1400,
139 "commentsCount": 35,
140 "date": "2026-10-22T18:00:00.000Z",
141 "duration": "00:00:18",
142 "channelName": "Demo Weeknight Meals",
143 "channelUsername": "demo_weeknight_meals",
144 "channelUrl": "https://example.com/demo/weeknight-meals",
145 "numberOfSubscribers": 21000
146 }
147 ],
148 "myChannel": "@demo_weeknight_meals",
149 "channelBrief": "Weeknight Meals is a cooking channel for busy people who want dinner on the table in 30 minutes with one pan and supermarket ingredients. Host cooks on camera in a small home kitchen. Tone: friendly, practical, a bit funny, no chef jargon. Goal: more subscribers and longer watch time. Avoid: clickbait we cannot deliver, expensive gadgets, diet claims.",
150 "conceptsCount": 5
151};
152
153
154const run = await client.actor("seasons-ai/youtube-channel-playbook").call(input);
155
156
157console.log('Results from dataset');
158console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
159const { items } = await client.dataset(run.defaultDatasetId).listItems();
160items.forEach((item) => {
161 console.dir(item);
162});
163
164