1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "operation": "search",
12 "location": "Aarhus",
13 "areaLevel": "auto",
14 "locations": [],
15 "propertyTypes": [
16 "villa"
17 ],
18 "maxResults": 100,
19 "priceMin": 0,
20 "priceMax": 0,
21 "roomsMin": 0,
22 "roomsMax": 0,
23 "areaMin": 0,
24 "areaMax": 0,
25 "lotAreaMin": 0,
26 "yearBuiltFrom": 0,
27 "energyLabels": [],
28 "monthlyExpenseMax": 0,
29 "onlyOpenHouse": false,
30 "onlyPriceDrop": false,
31 "soldMonthsBack": "12",
32 "saleTypes": [],
33 "sortBy": "newest",
34 "agentAddressType": "all"
35};
36
37
38const run = await client.actor("sian.agency/boligsiden-property-scraper").call(input);
39
40
41console.log('Results from dataset');
42console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
43const { items } = await client.dataset(run.defaultDatasetId).listItems();
44items.forEach((item) => {
45 console.dir(item);
46});
47
48