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