1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "currentItems": [
10 {
11 "id": "h1",
12 "title": "Hotel Alpha",
13 "rating": 4.6,
14 "reviewCount": 8200,
15 "complaintRate": 9,
16 "velocityPct": 41,
17 "competitorGap": 18,
18 },
19 {
20 "id": "h2",
21 "title": "Hotel Beta",
22 "rating": 3.7,
23 "reviewCount": 6400,
24 "complaintRate": 37,
25 "velocityPct": 18,
26 "competitorGap": -12,
27 },
28 ],
29 "previousItems": [{
30 "id": "h1",
31 "title": "Hotel Alpha",
32 "rating": 4.3,
33 "reviewCount": 6900,
34 "complaintRate": 14,
35 "velocityPct": 29,
36 "competitorGap": 9,
37 }],
38}
39
40
41run = client.actor("quanmatrix/tripadvisor-reputation-gap-intelligence").call(run_input=run_input)
42
43
44print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
45for item in client.dataset(run.default_dataset_id).iterate_items():
46 print(item)
47
48