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 "Berlin"
14 ],
15 "radiusKm": 5,
16 "withStockOnly": false,
17 "weCareOnly": false,
18 "favoritesOnly": false,
19 "itemInputs": [
20 "123456789"
21 ],
22 "allowAutoSignup": true,
23 "fetchDetails": false,
24 "maxItems": 20,
25 "maxPages": 100,
26 "incrementalMode": false,
27 "emitUnchanged": false,
28 "emitExpired": false,
29 "maxNotifyListings": 50,
30 "proxyConfiguration": {
31 "useApifyProxy": true
32 }
33};
34
35
36const run = await client.actor("abotapi/toogoodtogo-surprise-bag-scraper").call(input);
37
38
39console.log('Results from dataset');
40console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
41const { items } = await client.dataset(run.defaultDatasetId).listItems();
42items.forEach((item) => {
43 console.dir(item);
44});
45
46