1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "sourceMode": "sample",
12 "mode": "demo",
13 "startUrls": [
14 {
15 "url": "https://www.shein.com/",
16 "sourceId": "SHEIN-PUBLIC-PAGES",
17 "userData": {
18 "sourceId": "SHEIN-PUBLIC-PAGES"
19 }
20 },
21 {
22 "url": "https://schema.org/Product",
23 "sourceId": "SCHEMA-ORG-PRODUCT",
24 "userData": {
25 "sourceId": "SCHEMA-ORG-PRODUCT"
26 }
27 }
28 ],
29 "maxItems": 25,
30 "outputMode": "sample-records"
31};
32
33
34const run = await client.actor("zentrafoundry/shein-trends-product-monitor").call(input);
35
36
37console.log('Results from dataset');
38console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
39const { items } = await client.dataset(run.defaultDatasetId).listItems();
40items.forEach((item) => {
41 console.dir(item);
42});
43
44