1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "locations": [
12 "Califon, NJ"
13 ],
14 "prices": [
15 "500000"
16 ],
17 "down_payments": [
18 "100000"
19 ],
20 "rents": [
21 "2500"
22 ],
23 "annual_property_taxes": [
24 "0.0125"
25 ],
26 "broker_fees": [
27 "0"
28 ],
29 "buying_closing_costs": [
30 "4"
31 ],
32 "selling_closing_costs": [
33 "6"
34 ],
35 "rates": [
36 "6.31"
37 ],
38 "inflation_rates": [
39 "2"
40 ],
41 "income_tax_rates": [
42 "28"
43 ],
44 "mortgage_terms": [
45 "30"
46 ],
47 "avg_monthly_maintenances": [
48 "4165"
49 ],
50 "monthly_hois": [
51 "233"
52 ],
53 "additional_monthly_utilities": [
54 "100"
55 ],
56 "monthly_renter_insurances": [
57 "1.31"
58 ],
59 "hoas": [
60 "0"
61 ],
62 "rent_appreciations": [
63 "2"
64 ],
65 "home_appreciations": [
66 "2"
67 ],
68 "investment_rors": [
69 "4"
70 ],
71 "capital_gains_exclusions": [
72 "500000"
73 ],
74 "is_veterans": [
75 "false"
76 ]
77};
78
79
80const run = await client.actor("realtorscraper/realtor-buy-vs-rent-calculator").call(input);
81
82
83console.log('Results from dataset');
84console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
85const { items } = await client.dataset(run.defaultDatasetId).listItems();
86items.forEach((item) => {
87 console.dir(item);
88});
89
90