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/shorts/WhNzhnXO16c"
13 ],
14 "schema": {
15 "type": "object",
16 "properties": {
17 "product_name": {
18 "type": "string",
19 "description": "Name of the product shown"
20 },
21 "price": {
22 "type": "number",
23 "description": "Price shown or said, in dollars"
24 },
25 "claims": {
26 "type": "array",
27 "description": "What the video says about the product",
28 "items": {
29 "type": "string",
30 "description": "One claim"
31 }
32 }
33 }
34 }
35};
36
37
38const run = await client.actor("invideoiq/ai-video-analysis").call(input);
39
40
41console.log('Results from dataset');
42console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
43const { items } = await client.dataset(run.defaultDatasetId).listItems();
44items.forEach((item) => {
45 console.dir(item);
46});
47
48