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 "restaurant"
13 ],
14 "locationQuery": "Lyon, France",
15 "maxCrawledPlacesPerSearch": 20,
16 "language": "en",
17 "customQuestions": [
18 {
19 "id": "terrace",
20 "question": "Does the listing suggest an outdoor terrace?"
21 },
22 {
23 "id": "cuisine",
24 "question": "What is the main cuisine?",
25 "options": [
26 "French",
27 "Italian",
28 "Asian",
29 "Other"
30 ]
31 }
32 ],
33 "proxyConfiguration": {
34 "useApifyProxy": true
35 }
36};
37
38
39const run = await client.actor("sherwood/google-maps-scraper").call(input);
40
41
42console.log('Results from dataset');
43console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
44const { items } = await client.dataset(run.defaultDatasetId).listItems();
45items.forEach((item) => {
46 console.dir(item);
47});
48
49