1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "reviews": [
10 {
11 "location": "Harbor Cafe - North",
12 "text": "Long wait at the counter, but the coffee was great.",
13 "stars": 3,
14 },
15 {
16 "location": "Harbor Cafe - North",
17 "text": "Waited 30 minutes for a simple order. Slow service.",
18 "stars": 2,
19 },
20 {
21 "location": "Harbor Cafe - North",
22 "text": "Friendly staff and clean tables.",
23 "stars": 5,
24 },
25 {
26 "location": "Harbor Cafe - North",
27 "text": "Wrong order again and the line was very slow.",
28 "stars": 2,
29 },
30 {
31 "location": "Harbor Cafe - North",
32 "text": "Nice place, a bit pricey.",
33 "stars": 4,
34 },
35 {
36 "location": "Harbor Cafe - South",
37 "text": "Quick service and lovely staff.",
38 "stars": 5,
39 },
40 {
41 "location": "Harbor Cafe - South",
42 "text": "Tables were dirty and the restroom smelled.",
43 "stars": 2,
44 },
45 {
46 "location": "Harbor Cafe - South",
47 "text": "Great coffee, fair price.",
48 "stars": 5,
49 },
50 {
51 "location": "Harbor Cafe - South",
52 "text": "Very noisy inside, hard to talk.",
53 "stars": 3,
54 },
55 {
56 "location": "Harbor Cafe - South",
57 "text": "Dirty floor but fast and polite.",
58 "stars": 3,
59 },
60 ],
61 "customTopics": { "loyalty_program": [
62 "loyalty card",
63 "points",
64 "stamp card",
65 ] },
66 "minReviewsPerLocation": 5,
67}
68
69
70run = client.actor("practical_ai_lab_jp/pal-maps-reviews-issue-matrix").call(run_input=run_input)
71
72
73print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
74for item in client.dataset(run.default_dataset_id).iterate_items():
75 print(item)
76
77