1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "hotelUrls": [
12 "https://www.tripadvisor.com/Hotel_Review-g187497-d190635-Reviews-Hotel_Arts_Barcelona-Barcelona_Catalonia.html https://www.trip.com/hotels/barcelona-hotel-detail-2192934/hotel-arts-barcelona/ https://www.expedia.com/Barcelona-Hotels-Hotel-Arts-Barcelona.h3780.Hotel-Information"
13 ],
14 "hotelNames": [
15 "The Plaza New York"
16 ],
17 "sources": [
18 "tripadvisor",
19 "google-maps",
20 "expedia",
21 "agoda",
22 "booking-com",
23 "trip-com",
24 "despegar",
25 "zoover",
26 "airbnb"
27 ],
28 "maxReviewsPerSource": 10
29};
30
31
32const run = await client.actor("zaiq/hotel-reviews-scraper").call(input);
33
34
35console.log('Results from dataset');
36console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
37const { items } = await client.dataset(run.defaultDatasetId).listItems();
38items.forEach((item) => {
39 console.dir(item);
40});
41
42