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": "homes",
13 "locations": [
14 "Oslo"
15 ],
16 "searchQuery": "",
17 "sort": "PUBLISHED_DESC",
18 "maxResults": 50,
19 "publishedToday": false,
20 "priceFrom": 0,
21 "priceTo": 0,
22 "areaFrom": 0,
23 "areaTo": 0,
24 "minBedrooms": 0,
25 "propertyType": "",
26 "ownershipType": "",
27 "energyLabel": "",
28 "sellerType": "",
29 "constructionYearFrom": 0,
30 "constructionYearTo": 0,
31 "includeDetails": false,
32 "listingUrls": [],
33 "searchUrls": []
34};
35
36
37const run = await client.actor("sian.agency/finn-no-property-scraper").call(input);
38
39
40console.log('Results from dataset');
41console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
42const { items } = await client.dataset(run.defaultDatasetId).listItems();
43items.forEach((item) => {
44 console.dir(item);
45});
46
47