1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "videos": [],
12 "playlists": [],
13 "channels": [],
14 "find": [],
15 "findMode": "snippets",
16 "findContextSeconds": 15,
17 "maxMatches": 10,
18 "maxChars": 0,
19 "startSegment": 0,
20 "formats": [
21 "text",
22 "segments"
23 ],
24 "languages": [
25 "en"
26 ],
27 "preferManual": true,
28 "includeSignals": true,
29 "chunkSize": 1500,
30 "maxItems": 3,
31 "onlyNewItems": false,
32 "maxConcurrency": 3,
33 "proxyConfiguration": {
34 "useApifyProxy": true,
35 "apifyProxyGroups": [
36 "RESIDENTIAL"
37 ]
38 }
39};
40
41
42const run = await client.actor("kizukidata/youtube-transcripts").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