1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "snapshot",
12 "searches": [
13 {
14 "name": "E-Bike Berlin",
15 "query": "e-bike",
16 "postcode": "10115",
17 "radiusKm": 30,
18 "priceMin": 300
19 }
20 ],
21 "homePostcode": "10115",
22 "sellerType": "any",
23 "adType": "offer",
24 "priceTypes": [
25 "fixed",
26 "negotiable",
27 "free",
28 "on_request"
29 ],
30 "includeTopAds": false,
31 "excludeJunk": true,
32 "maxItemsPerSearch": 20,
33 "dealThresholdPct": 30,
34 "minCompsForDeal": 8,
35 "priceDropThresholdPct": 10,
36 "hideHighScamRisk": false,
37 "includeItemDetails": false,
38 "alertLanguage": "en",
39 "maxAlertsPerRun": 20,
40 "proxyConfiguration": {
41 "useApifyProxy": true,
42 "apifyProxyGroups": [
43 "RESIDENTIAL"
44 ],
45 "apifyProxyCountry": "DE"
46 }
47};
48
49
50const run = await client.actor("kondasviktor/kleinanzeigen-deal-monitor").call(input);
51
52
53console.log('Results from dataset');
54console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
55const { items } = await client.dataset(run.defaultDatasetId).listItems();
56items.forEach((item) => {
57 console.dir(item);
58});
59
60