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 "locations": [
13 "Detroit, Michigan"
14 ],
15 "radiusKm": 40,
16 "storeInputs": [
17 "https://app.shopper.flashfood.com/api/v1/stores/629cec56061cc242985326fd",
18 "https://app.shopper.flashfood.com/api/v1/items/?storeIds=629cec56061cc242985326fd",
19 "https://app.shopper.flashfood.com/api/v1/stores?latitude=42.33&longitude=-83.04&maxDistance=10000",
20 "https://flashfood.com/en/locations",
21 "629cec56061cc242985326fd"
22 ],
23 "urls": [
24 "https://app.shopper.flashfood.com/api/v1/stores/629cec56061cc242985326fd",
25 "https://app.shopper.flashfood.com/api/v1/items/?storeIds=629cec56061cc242985326fd",
26 "https://app.shopper.flashfood.com/api/v1/stores?latitude=42.33&longitude=-83.04&maxDistance=10000",
27 "https://flashfood.com/en/locations",
28 "629cec56061cc242985326fd"
29 ],
30 "maxItems": 20,
31 "includeStores": false,
32 "proxyConfiguration": {
33 "useApifyProxy": true
34 },
35 "incrementalMode": false,
36 "emitUnchanged": false,
37 "emitExpired": false,
38 "maxNotifyListings": 50
39};
40
41
42const run = await client.actor("abotapi/flashfood-grocery-deals-scraper").call(input);
43
44
45console.log('Results from dataset');
46console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
47const { items } = await client.dataset(run.defaultDatasetId).listItems();
48items.forEach((item) => {
49 console.dir(item);
50});
51
52