1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "search": {
12 "query": "New York",
13 "checkIn": "",
14 "checkOut": "",
15 "adults": 2,
16 "children": 0,
17 "childAges": [],
18 "rooms": 1,
19 "limit": 20,
20 "offset": 0,
21 "propertyType": "any",
22 "starRatingMin": "any",
23 "reviewScoreMin": "any",
24 "cityCenterDistance": "any",
25 "freeCancellation": false,
26 "breakfastIncluded": false,
27 "internet": false,
28 "parking": false,
29 "airportTransfer": false,
30 "gymFitness": false,
31 "swimmingPool": false,
32 "entireHomesApartments": false,
33 "familyFriendlyProperties": false,
34 "allInclusive": false,
35 "breakfastDinnerIncluded": false,
36 "selfCatering": false,
37 "allMealsIncluded": false,
38 "breakfastLunchIncluded": false,
39 "petsAllowed": false,
40 "freeWifi": false,
41 "paidParking": false,
42 "familyRooms": false,
43 "spaWellness": false,
44 "frontDesk24h": false,
45 "restaurant": false,
46 "bbqFacilities": false,
47 "airportShuttleFree": false,
48 "nonSmokingRooms": false,
49 "wheelchairAccessible": false,
50 "roomService": false,
51 "evChargingStation": false,
52 "airConditioning": false,
53 "kitchenKitchenette": false,
54 "washingMachine": false,
55 "balcony": false,
56 "privateBathroom": false,
57 "terrace": false,
58 "kitchenette": false,
59 "view": false,
60 "bath": false,
61 "flatScreenTv": false,
62 "electricKettle": false,
63 "coffeeTeaMaker": false,
64 "coffeeMachine": false,
65 "soundproofing": false,
66 "desk": false,
67 "cots": false,
68 "doubleBed": false,
69 "twoSingleBeds": false,
70 "familyTravelGroup": false,
71 "travelProud": false,
72 "sustainabilityCertification": false,
73 "acceptsOnlinePayments": false,
74 "upperFloorsElevator": false,
75 "groundFloorUnit": false,
76 "wheelchairAccessibleUnit": false,
77 "walkInShower": false,
78 "adaptedBath": false,
79 "rollInShower": false,
80 "showerChair": false,
81 "emergencyCordBathroom": false,
82 "toiletGrabRails": false,
83 "raisedToilet": false,
84 "loweredSink": false,
85 "auditoryGuidance": false,
86 "tactileSigns": false,
87 "braille": false,
88 "accessibleToiletGrabRails": false,
89 "accessibleEmergencyCordBathroom": false,
90 "accessibleRaisedToilet": false,
91 "accessibleLowerBathroomSink": false,
92 "minBedrooms": "any",
93 "minBathrooms": "any",
94 "minBeds": "any"
95 },
96 "property": {
97 "propertyId": 1397916,
98 "propertyUrl": "",
99 "checkIn": "",
100 "checkOut": "",
101 "adults": 2,
102 "children": 0,
103 "childAges": [],
104 "rooms": 1,
105 "enrichPricing": false,
106 "includeQAndA": false
107 },
108 "reviews": {
109 "propertyId": 1397916,
110 "propertyUrl": "",
111 "limit": 20,
112 "offset": 0,
113 "sortBy": "newest"
114 }
115};
116
117
118const run = await client.actor("crawlio/booking-com-scraper").call(input);
119
120
121console.log('Results from dataset');
122console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
123const { items } = await client.dataset(run.defaultDatasetId).listItems();
124items.forEach((item) => {
125 console.dir(item);
126});
127
128