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 "section": "homesForSale",
13 "locations": [
14 "Helsinki"
15 ],
16 "sortBy": "newest",
17 "maxResults": 50,
18 "minPrice": 0,
19 "maxPrice": 0,
20 "minSizeSqm": 0,
21 "maxSizeSqm": 0,
22 "rooms": "any",
23 "propertyType": "any",
24 "minYearBuilt": 0,
25 "maxYearBuilt": 0,
26 "newDevelopmentOnly": false,
27 "fullDetails": false,
28 "listingUrls": [],
29 "agencyQuery": ""
30};
31
32
33const run = await client.actor("sian.agency/oikotie-property-scraper").call(input);
34
35
36console.log('Results from dataset');
37console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
38const { items } = await client.dataset(run.defaultDatasetId).listItems();
39items.forEach((item) => {
40 console.dir(item);
41});
42
43