1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "operation": "alertsAndJams",
10 "bottomLeft": "40.66615,-74.13732",
11 "topRight": "40.77278,-73.76818",
12 "maxAlerts": 20,
13 "maxJams": 20,
14 "alertTypes": "ACCIDENT,HAZARD,POLICE,ROAD_CLOSED",
15 "sourceCoordinates": "32.0853,34.781767",
16 "destinationCoordinates": "32.794046,34.989571",
17}
18
19
20run = client.actor("parsebird/waze-api").call(run_input=run_input)
21
22
23print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
24for item in client.dataset(run.default_dataset_id).iterate_items():
25 print(item)
26
27