1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "urls": [
12 {
13 "url": "https://www.youtube.com/watch?v=5AdKqkNmJj4"
14 },
15 {
16 "url": "https://www.youtube.com/watch?v=iTOAIP9DfYo"
17 },
18 {
19 "url": "https://www.youtube.com/watch?v=pJ9xTMkGxXg"
20 },
21 {
22 "url": "https://www.youtube.com/watch?v=bksYSwtJVM0"
23 },
24 {
25 "url": "https://www.youtube.com/watch?v=Sn7T46fCjLE"
26 },
27 {
28 "url": "https://www.youtube.com/watch?v=zW8Cu4vcReY"
29 },
30 {
31 "url": "https://www.youtube.com/watch?v=K1whvDMDogU"
32 },
33 {
34 "url": "https://www.youtube.com/watch?v=xEg9b3YPJj0"
35 },
36 {
37 "url": "https://www.youtube.com/watch?v=23yNXtR-N1s"
38 },
39 {
40 "url": "https://www.youtube.com/watch?v=CvBR-GoBvzk"
41 }
42 ],
43 "searchKeywords": []
44};
45
46
47const run = await client.actor("supreme_coder/youtube-transcript-scraper").call(input);
48
49
50console.log('Results from dataset');
51console.log(`πΎ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
52const { items } = await client.dataset(run.defaultDatasetId).listItems();
53items.forEach((item) => {
54 console.dir(item);
55});
56
57