1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "profile": {
12 "id": "praha-2kk-30k",
13 "version": 1,
14 "filters": {
15 "offer_type": "rent",
16 "property_type": "flat",
17 "locations": [
18 {
19 "city": "Praha",
20 "citypart": "Vinohrady"
21 }
22 ],
23 "dispositions": [
24 "2+kk",
25 "2+1"
26 ],
27 "max_rent": 30000,
28 "min_area_m2": 45,
29 "sources": [
30 "sreality",
31 "bezrealitky",
32 "idnes"
33 ],
34 "max_listings": 5
35 },
36 "household": {
37 "occupants": 1
38 },
39 "requirements": {
40 "max_total_monthly": 32000,
41 "max_upfront": null,
42 "elevator": null,
43 "lease_types": [
44 "najem"
45 ],
46 "move_in_by": null,
47 "pets_allowed": null
48 }
49 }
50};
51
52
53const run = await client.actor("vladb/prague-flat-rentals").call(input);
54
55
56console.log('Results from dataset');
57console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
58const { items } = await client.dataset(run.defaultDatasetId).listItems();
59items.forEach((item) => {
60 console.dir(item);
61});
62
63