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": "Stockholm",
13 "propertyTypes": [
14 "APARTMENTS"
15 ],
16 "maxResults": 100,
17 "soldSince": "12m",
18 "priceMin": 0,
19 "priceMax": 0,
20 "roomsMin": 0,
21 "roomsMax": 0,
22 "livingAreaMin": 0,
23 "livingAreaMax": 0,
24 "maxFee": 0,
25 "constructionYearMin": 0,
26 "includeDetails": false,
27 "listingUrls": [],
28 "searchUrls": [],
29 "locationIds": [],
30 "sort": "NEWEST"
31};
32
33
34const run = await client.actor("sian.agency/hemnet-property-scraper").call(input);
35
36
37console.log('Results from dataset');
38console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
39const { items } = await client.dataset(run.defaultDatasetId).listItems();
40items.forEach((item) => {
41 console.dir(item);
42});
43
44