1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "searchQueries": [
12 "coffee shop"
13 ],
14 "matchPlaces": [
15 "The Miners Coffee, Železná 14, Praha",
16 {
17 "name": "La Pecora Bianca",
18 "address": "20 W 40th St",
19 "city": "New York",
20 "id": "crm-42"
21 }
22 ],
23 "centerLat": 50.0875,
24 "centerLng": 14.4213,
25 "radiusKm": 1,
26 "maxPlaces": 50,
27 "proxyConfiguration": {
28 "useApifyProxy": true,
29 "apifyProxyGroups": [
30 "RESIDENTIAL"
31 ]
32 }
33};
34
35
36const run = await client.actor("datarelay/google-maps-api").call(input);
37
38
39console.log('Results from dataset');
40console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
41const { items } = await client.dataset(run.defaultDatasetId).listItems();
42items.forEach((item) => {
43 console.dir(item);
44});
45
46