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 "place_id": "ChIJN1t_tDeuEmsRUsoyG83frY4",
14 "cid": "10281019595535971924",
15 "title": "Example Restaurant Ltd.",
16 "category": "Italian restaurant",
17 "categories": [
18 "Italian restaurant",
19 "Pizza restaurant"
20 ],
21 "website": "https://example-restaurant.example",
22 "phone": "+49 89 12345678",
23 "description": "Sample Italian restaurant in Munich, family-owned since 1985.",
24 "open_hours": {
25 "Monday": "11:00-22:00",
26 "Tuesday": "11:00-22:00"
27 },
28 "review_count": 320,
29 "review_rating": 4.5,
30 "images": [
31 {
32 "title": "Interior",
33 "image": "https://lh5.googleusercontent.com/p/1.jpg"
34 },
35 {
36 "title": "Dish",
37 "image": "https://lh5.googleusercontent.com/p/2.jpg"
38 },
39 {
40 "title": "Menu",
41 "image": "https://lh5.googleusercontent.com/p/3.jpg"
42 },
43 {
44 "title": "Storefront",
45 "image": "https://lh5.googleusercontent.com/p/4.jpg"
46 },
47 {
48 "title": "Terrace",
49 "image": "https://lh5.googleusercontent.com/p/5.jpg"
50 }
51 ],
52 "owner": {
53 "id": "123",
54 "name": "Example Restaurant Ltd.",
55 "link": "https://maps.google.com/owner"
56 }
57 }
58 ],
59 "proxyConfiguration": {
60 "useApifyProxy": true
61 }
62};
63
64
65const run = await client.actor("santamaria-automations/gbp-completeness-audit").call(input);
66
67
68console.log('Results from dataset');
69console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
70const { items } = await client.dataset(run.defaultDatasetId).listItems();
71items.forEach((item) => {
72 console.dir(item);
73});
74
75