1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "origin": "Union Station, 30 W Pershing Rd, Kansas City, MO 64108",
10 "destination": "Union Station, 30 W Pershing Rd, Kansas City, MO 64108",
11 "stops": [
12 {
13 "label": "Stop A - River Market",
14 "address": "20 E 5th St, Kansas City, MO 64106",
15 "lat": 39.1088,
16 "lng": -94.5818,
17 "priority": 90,
18 "serviceMinutes": 12,
19 },
20 {
21 "label": "Stop B - Country Club Plaza",
22 "address": "4706 Broadway Blvd, Kansas City, MO 64112",
23 "lat": 39.0419,
24 "lng": -94.5908,
25 "priority": 100,
26 "serviceMinutes": 15,
27 },
28 {
29 "label": "Stop C - Brookside",
30 "address": "6300 Brookside Plaza, Kansas City, MO 64113",
31 "lat": 39.0132,
32 "lng": -94.5919,
33 "priority": 80,
34 "serviceMinutes": 12,
35 },
36 {
37 "label": "Stop D - Westport",
38 "address": "4050 Pennsylvania Ave, Kansas City, MO 64111",
39 "lat": 39.0531,
40 "lng": -94.5905,
41 "priority": 85,
42 "serviceMinutes": 10,
43 },
44 {
45 "label": "Stop E - Crossroads District",
46 "address": "1901 Baltimore Ave, Kansas City, MO 64108",
47 "lat": 39.0902,
48 "lng": -94.5844,
49 "priority": 95,
50 "serviceMinutes": 12,
51 },
52 {
53 "label": "Stop F - 18th & Vine",
54 "address": "1616 E 18th St, Kansas City, MO 64108",
55 "lat": 39.0913,
56 "lng": -94.5632,
57 "priority": 75,
58 "serviceMinutes": 10,
59 },
60 ],
61 "maxStops": 10,
62 "maxMinutes": 120,
63 "serviceMinutesPerStop": 12,
64 "averageSpeedMph": 28,
65 "roadCircuityPercent": 128,
66}
67
68
69run = client.actor("thanh81646/apify-multi-stop-route-and-distance-optimizer").call(run_input=run_input)
70
71
72print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
73for item in client.dataset(run.default_dataset_id).iterate_items():
74 print(item)
75
76