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 "market": "TR",
13 "searchQueries": [
14 "sneakers"
15 ],
16 "searchUrls": [],
17 "categoryUrls": [],
18 "storeUrls": [],
19 "productUrls": [],
20 "sortBy": "SCORE",
21 "gender": "",
22 "minRating": "",
23 "freeShippingOnly": false,
24 "fastDeliveryOnly": false,
25 "discountedOnly": false,
26 "inStockOnly": false,
27 "couponsOnly": false,
28 "specialOffersOnly": false,
29 "newlyReleasedOnly": false,
30 "officialSellerOnly": false,
31 "includeDetails": false,
32 "includeReviews": false,
33 "maxReviews": 5,
34 "includeQna": false,
35 "maxQna": 5,
36 "maxItems": 3
37};
38
39
40const run = await client.actor("vexaloom-labs/trendyol-product-finder-with-price-and-discount").call(input);
41
42
43console.log('Results from dataset');
44console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
45const { items } = await client.dataset(run.defaultDatasetId).listItems();
46items.forEach((item) => {
47 console.dir(item);
48});
49
50