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 "propertyType": "byty",
13 "transaction": "prodej",
14 "regions": [
15 "Hlavní město Praha"
16 ],
17 "dispositions": [],
18 "minPrice": 0,
19 "maxPrice": 0,
20 "minArea": 0,
21 "maxArea": 0,
22 "buildingTypes": [],
23 "ownership": "any",
24 "maxAgeDays": 0,
25 "sort": "-date",
26 "maxResults": 100,
27 "includeDetails": false,
28 "propertyUrls": [],
29 "searchUrls": []
30};
31
32
33const run = await client.actor("sian.agency/sreality-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