1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "video_urls": [
12 "https://www.youtube.com/watch?v=veRbckoCwkc"
13 ],
14 "what_to_extract": "Extract detailed information about the supplements discussed, including dosages, benefits, and foundational habits required.",
15 "schema": {
16 "main_topic": {
17 "type": "String",
18 "description": "The overarching theme of the discussion"
19 },
20 "supplements_mentioned": {
21 "type": "Array",
22 "description": "List of all supplements discussed",
23 "items": {
24 "type": "Object",
25 "description": "Information about a specific supplement",
26 "properties": {
27 "name": {
28 "type": "String",
29 "description": "Name of the supplement"
30 },
31 "recommended_dosage_mg": {
32 "type": "Number",
33 "description": "Recommended daily dosage in milligrams"
34 }
35 }
36 }
37 }
38 }
39};
40
41
42const run = await client.actor("invideoiq/ai-video-data-extractor").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