1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "keywords": [
12 "手机壳",
13 "蓝牙耳机"
14 ],
15 "maxItems": 20,
16 "sortBy": "relevance",
17 "searchType": "pcmarket",
18 "targetSellingPrice": 29.99,
19 "cnyExchangeRate": 0.14,
20 "freightPerUnit": 2.5,
21 "dutyPercent": 5,
22 "marketplaceFeePercent": 15,
23 "otherCostPerUnit": 1,
24 "targetMarginPercent": 25,
25 "proxyConfiguration": {
26 "useApifyProxy": true,
27 "apifyProxyGroups": [
28 "RESIDENTIAL"
29 ],
30 "apifyProxyCountry": "CN"
31 }
32};
33
34
35const run = await client.actor("haketa/1688-sourcing-profit-analyzer").call(input);
36
37
38console.log('Results from dataset');
39console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
40const { items } = await client.dataset(run.defaultDatasetId).listItems();
41items.forEach((item) => {
42 console.dir(item);
43});
44
45