1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "currentItems": [
12 {
13 "id": "v1",
14 "author": "shopcreator1",
15 "text": "portable blender morning routine #blender #tiktokmademebuyit",
16 "views": 1200000,
17 "likes": 96000,
18 "comments": 3100,
19 "shares": 22000,
20 "hashtags": [
21 "blender",
22 "tiktokmademebuyit"
23 ]
24 },
25 {
26 "id": "v2",
27 "author": "shopcreator2",
28 "text": "desk lamp setup #desksetup #lamp",
29 "views": 340000,
30 "likes": 18000,
31 "comments": 700,
32 "shares": 3100,
33 "hashtags": [
34 "desksetup",
35 "lamp"
36 ]
37 }
38 ],
39 "previousItems": [
40 {
41 "id": "v1",
42 "author": "shopcreator1",
43 "text": "portable blender morning routine #blender #tiktokmademebuyit",
44 "views": 520000,
45 "likes": 39000,
46 "comments": 1600,
47 "shares": 8000,
48 "hashtags": [
49 "blender",
50 "tiktokmademebuyit"
51 ]
52 }
53 ]
54};
55
56
57const run = await client.actor("quanmatrix/tiktok-product-viral-signal-intelligence").call(input);
58
59
60console.log('Results from dataset');
61console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
62const { items } = await client.dataset(run.defaultDatasetId).listItems();
63items.forEach((item) => {
64 console.dir(item);
65});
66
67