1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "startUrls": [
12 "https://www.youtube.com/channel/UCsXVk37bltHxD1rDPwtNM8Q",
13 "https://www.youtube.com/channel/UCNIuvl7V8zACPpTmmNIqP2A"
14 ],
15 "youtubeHandles": [
16 "@MrBeast",
17 "@babishculinaryuniverse"
18 ],
19 "keywords": [
20 "pixel art",
21 "web development",
22 "gaming",
23 "cooking",
24 "vlogging",
25 "music",
26 "comedy",
27 "education",
28 "technology",
29 "sports",
30 "news",
31 "entertainment",
32 "beauty",
33 "fashion",
34 "health"
35 ],
36 "sort": "r",
37 "maxItems": 1000,
38 "customMapFunction": (object) => { return {...object} }
39};
40
41
42const run = await client.actor("apidojo/youtube-channel-information-scraper").call(input);
43
44
45console.log('Results from dataset');
46console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
47const { items } = await client.dataset(run.defaultDatasetId).listItems();
48items.forEach((item) => {
49 console.dir(item);
50});
51
52