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 "https://www.toogoodtogo.com/en-us/item/76768600385172800",
21 "46934"
22 ],
23 "allowAutoSignup": true,
24 "fetchDetails": false,
25 "fetchReviews": false,
26 "maxReviews": 20,
27 "reviewsOnly": false,
28 "maxItems": 20,
29 "maxPages": 0,
30 "proxyConfiguration": {
31 "useApifyProxy": true
32 },
33 "incrementalMode": false,
34 "emitUnchanged": false,
35 "emitExpired": false,
36 "maxNotifyListings": 50
37};
38
39
40const run = await client.actor("abotapi/toogoodtogo-surprise-bag-scraper").call(input);
41
42
43console.log('Results from dataset');
44console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
45const { items } = await client.dataset(run.defaultDatasetId).listItems();
46items.forEach((item) => {
47 console.dir(item);
48});
49
50