1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "searchStringsArray": [
12 "coffee shop"
13 ],
14 "locationQuery": "Jersey City, New Jersey",
15 "maxCrawledPlacesPerSearch": 100,
16 "customGeolocation": {
17 "type": "Polygon",
18 "coordinates": [
19 [
20 [
21 -74.05,
22 40.7
23 ],
24 [
25 -73.95,
26 40.7
27 ],
28 [
29 -73.95,
30 40.78
31 ],
32 [
33 -74.05,
34 40.78
35 ],
36 [
37 -74.05,
38 40.7
39 ]
40 ]
41 ]
42 }
43};
44
45
46const run = await client.actor("calm_builder/google-maps-scraper").call(input);
47
48
49console.log('Results from dataset');
50console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
51const { items } = await client.dataset(run.defaultDatasetId).listItems();
52items.forEach((item) => {
53 console.dir(item);
54});
55
56