1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "reviews": [
10 {
11 "text": "Lovely dinner, the duck was perfect and the staff were warm. We will come back.",
12 "rating": 5,
13 "placeName": "Sample Bistro",
14 "category": "Restaurant",
15 },
16 {
17 "text": "Food was good but we waited 50 minutes for our mains and nobody apologized.",
18 "rating": 3,
19 "placeName": "Sample Bistro",
20 "category": "Restaurant",
21 },
22 {
23 "text": "Overpriced for tiny portions. Our table next to the door was freezing.",
24 "rating": 2,
25 "placeName": "Sample Bistro",
26 "category": "Restaurant",
27 },
28 {
29 "text": "Found a hair in my salad and the waiter just shrugged. Never again.",
30 "rating": 1,
31 "placeName": "Sample Bistro",
32 "category": "Restaurant",
33 },
34 {
35 "text": "Great wine list and a cozy atmosphere, a bit noisy on Friday night.",
36 "rating": 4,
37 "placeName": "Sample Bistro",
38 "category": "Restaurant",
39 },
40 ],
41 "businessType": "auto",
42 "maxReviews": 500,
43 "maxReviewsPerPlace": 100,
44}
45
46
47run = client.actor("sherwood/review-analyzer").call(run_input=run_input)
48
49
50print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
51for item in client.dataset(run.default_dataset_id).iterate_items():
52 print(item)
53
54