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 {
13 "url": "https://www.youtube.com/@veritasium"
14 }
15 ],
16 "searchQueries": [],
17 "maxVideos": 20,
18 "sortBy": "newest",
19 "uploadedAfter": "",
20 "scrapeComments": true,
21 "maxCommentsPerVideo": 100,
22 "scrapeTranscripts": true,
23 "transcriptLanguages": [
24 "en"
25 ],
26 "proxyConfiguration": {
27 "useApifyProxy": true
28 },
29 "maxRequestRetries": 5,
30 "maxConcurrency": 10
31};
32
33
34const run = await client.actor("yasaslive/youtube-channel-comments-transcripts").call(input);
35
36
37console.log('Results from dataset');
38console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
39const { items } = await client.dataset(run.defaultDatasetId).listItems();
40items.forEach((item) => {
41 console.dir(item);
42});
43
44