1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "requests": [
12 {
13 "operation": "route",
14 "fromLat": -6.1754,
15 "fromLon": 106.827,
16 "toLat": -6.1274,
17 "toLon": 106.6577
18 },
19 {
20 "operation": "walking-distance",
21 "fromLat": -6.1754,
22 "fromLon": 106.827,
23 "toLat": -6.178,
24 "toLon": 106.83
25 },
26 {
27 "operation": "eta-batch",
28 "fromLat": -6.1754,
29 "fromLon": 106.827,
30 "destinations": [
31 {
32 "lat": -6.1274,
33 "lon": 106.6577
34 },
35 {
36 "lat": -6.1954,
37 "lon": 106.8206
38 }
39 ]
40 }
41 ]
42};
43
44
45const run = await client.actor("romy/waze-route-eta-scraper").call(input);
46
47
48console.log('Results from dataset');
49console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
50const { items } = await client.dataset(run.defaultDatasetId).listItems();
51items.forEach((item) => {
52 console.dir(item);
53});
54
55