1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "items": [
12 {
13 "captionText": "Garlic butter shrimp (serves 2)\n300g shrimp, peeled\n3 tbsp butter\n4 cloves garlic, minced\n1/2 tsp chili flakes\njuice of 1/2 lemon\nsalt to taste\n\nMelt 2 tbsp butter, cook the shrimp 1-2 min per side and set aside. Add the rest of the butter and the garlic, cook 30 sec, add chili flakes and lemon juice, return the shrimp and toss.",
14 "sourceUrl": "https://www.tiktok.com/@example/video/123"
15 }
16 ],
17 "youtubeUrls": [],
18 "mediaFileUrls": []
19};
20
21
22const run = await client.actor("messnomore/video-to-recipe").call(input);
23
24
25console.log('Results from dataset');
26console.log(`πΎ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
27const { items } = await client.dataset(run.defaultDatasetId).listItems();
28items.forEach((item) => {
29 console.dir(item);
30});
31
32