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 "laptop"
14 ],
15 "searchUrls": [
16 "https://www.walmart.com/search?q=laptop",
17 "https://www.walmart.com/search?q=laptop&page=2",
18 "https://www.walmart.com/search?q=laptop&sort=price_low&facet=brand%3AApple",
19 "https://www.walmart.com/search?q=laptop&min_price=300&max_price=600",
20 "https://www.walmart.com/browse/electronics/3944",
21 "https://www.walmart.com/browse/electronics/3944?page=2",
22 "https://www.walmart.com/cp/electronics/3944",
23 "https://www.walmart.com/shop/deals",
24 "https://www.walmart.com/c/kp/laptops",
25 "https://www.walmart.com/seller/101216456",
26 "https://www.walmart.com/global/seller/101216456"
27 ],
28 "productInputs": [
29 "https://www.walmart.com/ip/Apple-MacBook-Air/19699754154",
30 "https://www.walmart.com/ip/19699754154",
31 "https://www.walmart.com/reviews/product/19699754154"
32 ],
33 "proxy": {
34 "useApifyProxy": true,
35 "apifyProxyGroups": [
36 "RESIDENTIAL"
37 ],
38 "apifyProxyCountry": "US"
39 },
40 "incrementalMode": false,
41 "emitUnchanged": false,
42 "emitExpired": false,
43 "ignoreFieldsForChanges": []
44};
45
46
47const run = await client.actor("abotapi/walmart-scraper").call(input);
48
49
50console.log('Results from dataset');
51console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
52const { items } = await client.dataset(run.defaultDatasetId).listItems();
53items.forEach((item) => {
54 console.dir(item);
55});
56
57