1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "categories",
12 "locations": [
13 "78701"
14 ],
15 "categoryInputs": [
16 "https://www.gopuff.com/c/candy/txERmYDy",
17 "https://www.gopuff.com/deals/snack-deals/J9aZuA",
18 "https://www.gopuff.com/",
19 "https://www.gopuff.com/shop",
20 "https://www.gopuff.com/deals"
21 ],
22 "discoverCategories": true,
23 "inStockOnly": false,
24 "productInputs": [
25 "https://www.gopuff.com/p/banana---1ct/p198176"
26 ],
27 "maxItems": 20,
28 "maxPages": 0,
29 "pageSize": 50,
30 "fetchDetails": false,
31 "proxyConfiguration": {
32 "useApifyProxy": true,
33 "apifyProxyGroups": [
34 "RESIDENTIAL"
35 ],
36 "apifyProxyCountry": "US"
37 },
38 "incrementalMode": false,
39 "emitUnchanged": false,
40 "emitExpired": false,
41 "ignoreFieldsForChanges": [],
42 "maxNotifyListings": 50
43};
44
45
46const run = await client.actor("abotapi/gopuff-prices-assortment-scraper").call(input);
47
48
49console.log('Results from dataset');
50console.log(`πΎ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
51const { items } = await client.dataset(run.defaultDatasetId).listItems();
52items.forEach((item) => {
53 console.dir(item);
54});
55
56