1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "locations",
12 "startUrls": [
13 {
14 "url": "https://www.tripadvisor.com/Hotel_Review-g187147-d229968-Reviews-Hotel_Astra_Opera_Astotel-Paris_Ile_de_France.html"
15 },
16 {
17 "url": "https://www.tripadvisor.com/Restaurant_Review-g60827-d425227-Reviews-Geido-Brooklyn_New_York.html"
18 }
19 ],
20 "searchTerms": [
21 "Paris",
22 "Dubai"
23 ],
24 "locations": [
25 "Paris",
26 "Dubai"
27 ],
28 "category": "all",
29 "includeReviews": true,
30 "maxReviewsPerPoi": 10,
31 "maxPois": 50,
32 "maxItems": 10,
33 "locale": "en-US",
34 "maxRetries": 5,
35 "maxConcurrency": 10
36};
37
38
39const run = await client.actor("pro100chok/tripadvisor-all-in-one").call(input);
40
41
42console.log('Results from dataset');
43console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
44const { items } = await client.dataset(run.defaultDatasetId).listItems();
45items.forEach((item) => {
46 console.dir(item);
47});
48
49