1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "items": [
12 {
13 "title": "Sunrise Hair Studio",
14 "categoryName": "Hair salon",
15 "address": "12 Park Street",
16 "city": "Austin",
17 "countryCode": "US",
18 "website": null,
19 "phone": "(512) 555-0142",
20 "phoneUnformatted": "+15125550142",
21 "totalScore": 4.6,
22 "reviewsCount": 640,
23 "claimThisBusiness": false,
24 "permanentlyClosed": false,
25 "temporarilyClosed": false,
26 "placeId": "example1",
27 "url": "https://maps.example/1"
28 },
29 {
30 "title": "Blue Door Dental",
31 "categoryName": "Dentist",
32 "address": "40 Elm Avenue",
33 "city": "Austin",
34 "countryCode": "US",
35 "website": "https://www.facebook.com/bluedoordental",
36 "phone": "(512) 555-0177",
37 "phoneUnformatted": "+15125550177",
38 "totalScore": 4.8,
39 "reviewsCount": 64,
40 "claimThisBusiness": false,
41 "permanentlyClosed": false,
42 "temporarilyClosed": false,
43 "placeId": "example2",
44 "url": "https://maps.example/2"
45 },
46 {
47 "title": "Green Leaf Cafe",
48 "categoryName": "Cafe",
49 "address": "9 Oak Road",
50 "city": "Austin",
51 "countryCode": "US",
52 "website": "https://greenleafcafe.com",
53 "phone": "(512) 555-0190",
54 "phoneUnformatted": "+15125550190",
55 "totalScore": 4.4,
56 "reviewsCount": 300,
57 "claimThisBusiness": false,
58 "permanentlyClosed": false,
59 "temporarilyClosed": false,
60 "placeId": "example3",
61 "url": "https://maps.example/3"
62 },
63 {
64 "title": "Old Mill Pizza",
65 "categoryName": "Pizza restaurant",
66 "address": "5 Mill Lane",
67 "city": "Austin",
68 "countryCode": "US",
69 "website": null,
70 "phone": "(512) 555-0111",
71 "phoneUnformatted": "+15125550111",
72 "totalScore": 4.1,
73 "reviewsCount": 80,
74 "claimThisBusiness": false,
75 "permanentlyClosed": true,
76 "temporarilyClosed": false,
77 "placeId": "example4",
78 "url": "https://maps.example/4"
79 }
80 ]
81};
82
83
84const run = await client.actor("asmalek/google-maps-leads-cleaner").call(input);
85
86
87console.log('Results from dataset');
88console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
89const { items } = await client.dataset(run.defaultDatasetId).listItems();
90items.forEach((item) => {
91 console.dir(item);
92});
93
94