1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "search",
12 "searchQuery": "phone case",
13 "productIds": [
14 "1005010155028387"
15 ],
16 "storeIds": [
17 "1101493050"
18 ],
19 "urls": [
20 "https://www.aliexpress.com/item/1005010155028387.html"
21 ],
22 "region": "com",
23 "currency": "USD",
24 "language": "en_US",
25 "sortBy": "default",
26 "priceMin": 0,
27 "priceMax": 0,
28 "ratingMin": 0,
29 "shipFrom": "",
30 "shipTo": "",
31 "maxItems": 5,
32 "maxPages": 3,
33 "enrichReviews": false,
34 "maxReviewsPerProduct": 0,
35 "useProxy": false,
36 "autoEscalateOnBlock": true,
37 "proxyConfiguration": {
38 "useApifyProxy": true,
39 "apifyProxyGroups": []
40 }
41};
42
43
44const run = await client.actor("crawlerbros/aliexpress-scraper").call(input);
45
46
47console.log('Results from dataset');
48console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
49const { items } = await client.dataset(run.defaultDatasetId).listItems();
50items.forEach((item) => {
51 console.dir(item);
52});
53
54