1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "reviews": [
10 {
11 "locationId": "store-north",
12 "reviewId": "r001",
13 "rating": 1,
14 "reviewTimestamp": "2026-03-01T09:00:00Z",
15 "responseTimestamp": "2026-03-02T09:00:00Z",
16 },
17 {
18 "locationId": "store-north",
19 "reviewId": "r002",
20 "rating": 2,
21 "reviewTimestamp": "2026-03-01T10:00:00Z",
22 "responseTimestamp": "2026-03-04T10:00:00Z",
23 },
24 {
25 "locationId": "store-north",
26 "reviewId": "r003",
27 "rating": 1,
28 "reviewTimestamp": "2026-03-05T12:00:00Z",
29 },
30 {
31 "locationId": "store-north",
32 "reviewId": "r004",
33 "rating": 5,
34 "reviewTimestamp": "2026-03-06T12:00:00Z",
35 },
36 {
37 "locationId": "store-south",
38 "reviewId": "r101",
39 "rating": 2,
40 "reviewTimestamp": "2026-03-02T08:00:00Z",
41 "responseTimestamp": "2026-03-02T20:00:00Z",
42 },
43 {
44 "locationId": "store-south",
45 "reviewId": "r102",
46 "rating": 1,
47 "reviewTimestamp": "2026-03-09T08:00:00Z",
48 },
49 {
50 "locationId": "store-south",
51 "reviewId": "r103",
52 "rating": 1,
53 "reviewTimestamp": "2026-03-03T08:00:00Z",
54 },
55 ],
56 "asOf": "2026-03-10T00:00:00Z",
57 "locationSlaHours": { "store-south": 24 },
58 "minSampleSize": 3,
59}
60
61
62run = client.actor("practical_ai_lab_jp/pal-maps-service-recovery-sla-audit").call(run_input=run_input)
63
64
65print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
66for item in client.dataset(run.default_dataset_id).iterate_items():
67 print(item)
68
69