1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "groupField": "location",
10 "inlineReviews": [
11 {
12 "location": "Downtown",
13 "rating": 5,
14 "text": "The food was delicious and the coffee was fresh. Friendly staff and a cozy atmosphere. Prices felt fair for the quality.",
15 },
16 {
17 "location": "Downtown",
18 "rating": 5,
19 "text": "Great food and very friendly service. The wait was short and the room was spotless.",
20 },
21 {
22 "location": "Riverside",
23 "rating": 1,
24 "text": "Terrible service. We waited forever, the staff were rude, and the food arrived cold and bland.",
25 },
26 {
27 "location": "Riverside",
28 "rating": 3,
29 "text": "The food was good but the wait was slow and the music was too loud. Parking was difficult.",
30 },
31 {
32 "location": "Riverside",
33 "rating": 5,
34 "text": "Excellent quality and a beautiful, clean space. The staff were attentive and the dessert was amazing.",
35 },
36 {
37 "location": "Downtown",
38 "rating": 2,
39 "text": "Overpriced and disappointing. The portion was tiny, the bathroom was dirty, and the service was slow.",
40 },
41 ],
42 "maxReviews": 2000,
43 "ratingField": "rating",
44 "textField": "text",
45}
46
47
48run = client.actor("delta_tools/review-theme-analyzer").call(run_input=run_input)
49
50
51print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
52for item in client.dataset(run.default_dataset_id).iterate_items():
53 print(item)
54
55