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 "propertyCategory": "apartments",
13 "dealType": "sale",
14 "region": "any",
15 "cities": [],
16 "maxResults": 200,
17 "keyword": "",
18 "currency": "USD",
19 "minPrice": 0,
20 "maxPrice": 0,
21 "rooms": [],
22 "minArea": 0,
23 "maxArea": 0,
24 "minPlotSotka": 0,
25 "maxPlotSotka": 0,
26 "minYearBuilt": 0,
27 "maxYearBuilt": 0,
28 "condition": "any",
29 "sellerType": "any",
30 "onlyWithPhoto": false,
31 "newBuildingOnly": false,
32 "minskDistricts": [],
33 "metroStations": [],
34 "sort": "newest",
35 "includeDetails": false,
36 "searchUrls": [],
37 "listingUrls": []
38};
39
40
41const run = await client.actor("sian.agency/kufar-property-scraper").call(input);
42
43
44console.log('Results from dataset');
45console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
46const { items } = await client.dataset(run.defaultDatasetId).listItems();
47items.forEach((item) => {
48 console.dir(item);
49});
50
51