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 "demoMode": true
29};
30
31
32const run = await client.actor("alizarin_refrigerator-owner/review-response-generator").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