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 "queries": [
13 "notebook"
14 ],
15 "urls": [
16 "https://www.mercadolivre.com.br/notebook-dell-dc15-i51334u-a50-156-fhd-i5-8gb-512gb-win-11/p/MLB70040749"
17 ],
18 "condition": "any",
19 "freeShippingOnly": false,
20 "fulfillmentOnly": false,
21 "officialStoresOnly": false,
22 "bestSellersOnly": false,
23 "interestFreeInstallments": false,
24 "sortBy": "relevance",
25 "fetchDetails": false,
26 "fetchReviews": false,
27 "maxReviewsPerProduct": 20,
28 "maxItems": 20,
29 "maxPages": 0,
30 "incrementalMode": false,
31 "emitUnchanged": false,
32 "emitExpired": false,
33 "proxy": {
34 "useApifyProxy": true,
35 "apifyProxyGroups": [
36 "RESIDENTIAL"
37 ],
38 "apifyProxyCountry": "BR"
39 },
40 "maxNotifyListings": 50
41};
42
43
44const run = await client.actor("abotapi/mercadolivre-com-br-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