1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "currentItems": [
12 {
13 "id": "m1",
14 "title": "Downtown Lisbon",
15 "listingCount": 820,
16 "occupancyPct": 78,
17 "avgPrice": 142,
18 "reviewCount": 18400,
19 "demandScore": 88,
20 "competitionScore": 57,
21 "priceRoomPct": 22
22 },
23 {
24 "id": "m2",
25 "title": "Old Town saturated",
26 "listingCount": 3200,
27 "occupancyPct": 54,
28 "avgPrice": 98,
29 "reviewCount": 54000,
30 "demandScore": 62,
31 "competitionScore": 94,
32 "priceRoomPct": 4
33 }
34 ],
35 "previousItems": [
36 {
37 "id": "m1",
38 "title": "Downtown Lisbon",
39 "listingCount": 690,
40 "occupancyPct": 72,
41 "avgPrice": 136,
42 "reviewCount": 14200,
43 "demandScore": 80,
44 "competitionScore": 61,
45 "priceRoomPct": 16
46 }
47 ]
48};
49
50
51const run = await client.actor("quanmatrix/airbnb-market-saturation-pricing-intelligence").call(input);
52
53
54console.log('Results from dataset');
55console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
56const { items } = await client.dataset(run.defaultDatasetId).listItems();
57items.forEach((item) => {
58 console.dir(item);
59});
60
61