1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "places": [
12 {
13 "placeId": "synthetic-place",
14 "title": "Synthetic example venue",
15 "location": {
16 "lat": 59.9139,
17 "lng": 10.7522
18 }
19 }
20 ],
21 "sites": [
22 {
23 "id": "oslo-a",
24 "title": "Synthetic site A",
25 "lat": 59.91,
26 "lng": 10.75
27 },
28 {
29 "id": "oslo-b",
30 "title": "Synthetic site B",
31 "lat": 59.92,
32 "lng": 10.76
33 }
34 ]
35};
36
37
38const run = await client.actor("mrtronson/multi-site-proximity-matcher").call(input);
39
40
41console.log('Results from dataset');
42console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
43const { items } = await client.dataset(run.defaultDatasetId).listItems();
44items.forEach((item) => {
45 console.dir(item);
46});
47
48