1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "tiktokProducts": [
12 {
13 "title": "Portable Blender 500ml USB Rechargeable",
14 "price": 29.99,
15 "soldCount": 18500,
16 "rating": 4.6,
17 "reviewCount": 2140,
18 "url": "https://shop.tiktok.com/example-product",
19 "imageUrl": "https://example.com/blender.jpg"
20 }
21 ],
22 "supplierProducts": [
23 {
24 "title": "USB Portable Juicer Blender 500ml Factory Wholesale",
25 "price": 4.2,
26 "moq": 2,
27 "supplierRating": 4.8,
28 "salesCount": 12000,
29 "url": "https://detail.1688.com/example-supplier",
30 "imageUrl": "https://example.com/supplier-blender.jpg"
31 }
32 ],
33 "tiktokDatasetIds": [],
34 "supplierDatasetIds": [],
35 "tiktokSourceActorInput": {},
36 "supplierSourceActorInput": {
37 "query": "{{keyword}}",
38 "maxItems": 20
39 }
40};
41
42
43const run = await client.actor("cuscuslabs/tiktok-shop-1688-arbitrage-finder").call(input);
44
45
46console.log('Results from dataset');
47console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
48const { items } = await client.dataset(run.defaultDatasetId).listItems();
49items.forEach((item) => {
50 console.dir(item);
51});
52
53