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 "organic milk"
14 ],
15 "retailers": [
16 "costco",
17 "safeway"
18 ],
19 "urls": [
20 "https://www.instacart.com/store/costco/s?k=greek+yogurt",
21 "https://www.instacart.com/store/costco/products/19208138"
22 ],
23 "includeDepartments": false,
24 "postalCode": "10001",
25 "inStockOnly": false,
26 "onSaleOnly": false,
27 "fetchDetails": false,
28 "incrementalMode": false,
29 "emitUnchanged": false,
30 "emitExpired": false,
31 "proxy": {
32 "useApifyProxy": true,
33 "apifyProxyGroups": [
34 "RESIDENTIAL"
35 ],
36 "apifyProxyCountry": "US"
37 }
38};
39
40
41const run = await client.actor("abotapi/instacart-grocery-price-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