1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "autocomplete_inputs": [
12 "Paris",
13 "Hilton New York"
14 ],
15 "search_bylocation_inputs": [
16 "Paris, France",
17 "New York City"
18 ],
19 "search_hotels_inputs": [
20 "60763"
21 ],
22 "details_byid_inputs": [
23 "60763",
24 "671150"
25 ],
26 "details_byurl_inputs": [
27 "https://www.tripadvisor.com/Hotel_Review-g60763-d671150-Reviews-The_Empire_Hotel-New_York_City_New_York.html"
28 ],
29 "reviews_inputs": [
30 "671150"
31 ]
32};
33
34
35const run = await client.actor("one-api/tripadvisor-scraper").call(input);
36
37
38console.log('Results from dataset');
39console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
40const { items } = await client.dataset(run.defaultDatasetId).listItems();
41items.forEach((item) => {
42 console.dir(item);
43});
44
45