1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "location": "New York",
12 "startUrls": [
13 "https://www.booking.com/hotel/us/trump-international-new-york.en-gb.html"
14 ],
15 "maxHotels": 5,
16 "scrapeReviews": true,
17 "maxReviewsPerHotel": 10,
18 "reviewSortBy": "most_relevant",
19 "analyzeSentiment": true,
20 "aiEnhancement": false,
21 "aiModel": "claude-haiku-4-5",
22 "includeHotelDetails": true,
23 "propertyType": "none",
24 "sortBy": "review_score",
25 "minimumRating": "",
26 "starsCountFilter": "any",
27 "currency": "USD",
28 "language": "en-gb",
29 "checkIn": "",
30 "checkOut": "",
31 "flexWindow": "0",
32 "rooms": 1,
33 "adults": 2,
34 "children": 0,
35 "minMaxPrice": "0-999999",
36 "proxyConfiguration": {
37 "useApifyProxy": true,
38 "apifyProxyGroups": [
39 "RESIDENTIAL"
40 ]
41 }
42};
43
44
45const run = await client.actor("scrapier/bookingscraper").call(input);
46
47
48console.log('Results from dataset');
49console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
50const { items } = await client.dataset(run.defaultDatasetId).listItems();
51items.forEach((item) => {
52 console.dir(item);
53});
54
55