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 ],
18 "discoverCategories": true,
19 "inStockOnly": false,
20 "productInputs": [
21 "https://www.gopuff.com/p/banana---1ct/p198176"
22 ],
23 "maxItems": 20,
24 "maxPages": 0,
25 "pageSize": 50,
26 "fetchDetails": false,
27 "incrementalMode": false,
28 "emitUnchanged": false,
29 "emitExpired": false,
30 "maxNotifyListings": 50,
31 "proxyConfiguration": {
32 "useApifyProxy": true,
33 "apifyProxyGroups": [
34 "RESIDENTIAL"
35 ],
36 "apifyProxyCountry": "US"
37 }
38};
39
40
41const run = await client.actor("abotapi/gopuff-prices-assortment-scraper").call(input);
42
43
44console.log('Results from dataset');
45console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
46const { items } = await client.dataset(run.defaultDatasetId).listItems();
47items.forEach((item) => {
48 console.dir(item);
49});
50
51