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 "text": "Food was delicious and the patio is lovely, but we waited 25 minutes just to be seated with a half-empty dining room.",
14 "rating": 3
15 },
16 {
17 "text": "The staff were so warm and welcoming, remembered our names from last time. This is why we keep coming back.",
18 "rating": 5
19 },
20 {
21 "text": "Prices have crept up a lot and portions got smaller. Not the value it used to be.",
22 "rating": 2
23 },
24 {
25 "text": "Tables were sticky and the restroom clearly had not been cleaned. Great food ruined by poor hygiene.",
26 "rating": 2
27 },
28 {
29 "text": "Fast, friendly service and the best coffee in the neighborhood. Cozy atmosphere, perfect for working.",
30 "rating": 5
31 }
32 ]
33};
34
35
36const run = await client.actor("enezli/yelp-review-intelligence").call(input);
37
38
39console.log('Results from dataset');
40console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
41const { items } = await client.dataset(run.defaultDatasetId).listItems();
42items.forEach((item) => {
43 console.dir(item);
44});
45
46