1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "industry": "dental",
12 "reviews": [
13 {
14 "text": "I waited for an hour past my appointment time. The dentist was good but the staff were rude.",
15 "rating": 2
16 },
17 {
18 "text": "Excellent service, friendly staff and quick appointment. Very clean clinic.",
19 "rating": 5
20 },
21 {
22 "text": "The treatment was expensive and there were hidden fees I wasn't told about.",
23 "rating": 2
24 }
25 ],
26 "businessName": "",
27 "language": "en",
28 "analysisMode": "balanced",
29 "includeRecommendations": true
30};
31
32
33const run = await client.actor("riad_h/industry-review-complaint-analyzer").call(input);
34
35
36console.log('Results from dataset');
37console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
38const { items } = await client.dataset(run.defaultDatasetId).listItems();
39items.forEach((item) => {
40 console.dir(item);
41});
42
43