1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "reviews": [
12 {
13 "reviewerName": "John D.",
14 "rating": 5,
15 "text": "Amazing service! The team was professional and got the job done quickly. Highly recommend!",
16 "date": "2024-12-15"
17 },
18 {
19 "reviewerName": "Sarah M.",
20 "rating": 2,
21 "text": "Waited too long for service. The work was okay but communication could be better.",
22 "date": "2024-12-14"
23 }
24 ],
25 "businessName": "Acme Plumbing",
26 "ownerName": "Mike",
27 "customTemplates": []
28};
29
30
31const run = await client.actor("alizarin_refrigerator-owner/review-response-generator").call(input);
32
33
34console.log('Results from dataset');
35console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
36const { items } = await client.dataset(run.defaultDatasetId).listItems();
37items.forEach((item) => {
38 console.dir(item);
39});
40
41