1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "apiKey": "",
12 "channelUrls": [
13 "https://www.youtube.com/@mkbhd"
14 ],
15 "deduplicate": true,
16 "includeReplies": true,
17 "maxCommentsPerVideo": 100,
18 "maxRepliesPerComment": 20,
19 "maxVideosPerChannel": 5,
20 "maxVideosPerSearch": 3,
21 "onlyNew": false,
22 "outputFormat": "full",
23 "proxyMode": "auto",
24 "searchTerms": [
25 "AI tools"
26 ],
27 "sortBy": "newest",
28 "stateStoreName": "youtube-comments-monitor-state",
29 "videoUrls": [
30 "https://www.youtube.com/watch?v=_x58r9TBois"
31 ]
32};
33
34
35const run = await client.actor("commanding_hotdog/youtube-comments-monitor").call(input);
36
37
38console.log('Results from dataset');
39console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
40const { items } = await client.dataset(run.defaultDatasetId).listItems();
41items.forEach((item) => {
42 console.dir(item);
43});
44
45