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": "Demo Peachtree Plumbing",
14 "categoryName": "Plumber",
15 "phone": "(404) 555-0142",
16 "website": "https://example.com/peachtree-plumbing",
17 "address": "100 Demo St, Sandy Springs, GA 30328",
18 "city": "Sandy Springs",
19 "state": "Georgia",
20 "reviewsCount": 212,
21 "totalScore": 4.8,
22 "placeId": "demo-place-01",
23 "url": "https://www.google.com/maps/place/?q=place_id:demo-place-01"
24 },
25 {
26 "title": "Demo Peachtree Plumbing LLC",
27 "categoryName": "Plumber",
28 "phone": "+1 404-555-0142",
29 "website": "https://example.com/peachtree-plumbing",
30 "address": "100 Demo Street, Sandy Springs, GA 30328",
31 "city": "Sandy Springs",
32 "state": "Georgia",
33 "reviewsCount": 9,
34 "totalScore": 4.6,
35 "placeId": "demo-place-02",
36 "url": "https://www.google.com/maps/place/?q=place_id:demo-place-02"
37 },
38 {
39 "title": "Demo Riverside Drain & Sewer",
40 "categoryName": "Plumber",
41 "phone": "(770) 555-0188",
42 "website": "https://example.com/riverside-drain",
43 "address": "200 Sample Ave, Sandy Springs, GA 30350",
44 "city": "Sandy Springs",
45 "state": "Georgia",
46 "reviewsCount": 87,
47 "totalScore": 4.7,
48 "placeId": "demo-place-03",
49 "url": "https://www.google.com/maps/place/?q=place_id:demo-place-03"
50 },
51 {
52 "title": "Demo Old Town Plumbers",
53 "categoryName": "Plumber",
54 "phone": "(404) 555-0170",
55 "address": "300 Example Rd, Sandy Springs, GA 30328",
56 "city": "Sandy Springs",
57 "state": "Georgia",
58 "reviewsCount": 41,
59 "totalScore": 4.1,
60 "permanentlyClosed": true,
61 "placeId": "demo-place-04",
62 "url": "https://www.google.com/maps/place/?q=place_id:demo-place-04"
63 },
64 {
65 "title": "Demo Quick Lube Auto Repair",
66 "categoryName": "Auto repair shop",
67 "phone": "(404) 555-0123",
68 "website": "https://example.com/quick-lube",
69 "address": "400 Test Blvd, Sandy Springs, GA 30328",
70 "city": "Sandy Springs",
71 "state": "Georgia",
72 "reviewsCount": 150,
73 "totalScore": 4.4,
74 "placeId": "demo-place-05",
75 "url": "https://www.google.com/maps/place/?q=place_id:demo-place-05"
76 },
77 {
78 "title": "Halcy Plumbing Repair Sandy Springs",
79 "categoryName": "Plumber",
80 "phone": "(470) 555-0101",
81 "address": "Sandy Springs, GA",
82 "city": "Sandy Springs",
83 "state": "Georgia",
84 "reviewsCount": 1,
85 "totalScore": 5,
86 "placeId": "demo-place-06",
87 "url": "https://www.google.com/maps/place/?q=place_id:demo-place-06"
88 },
89 {
90 "title": "Gravix Plumbing Repair Sandy Springs",
91 "categoryName": "Plumber",
92 "phone": "(470) 555-0102",
93 "address": "Sandy Springs, GA",
94 "city": "Sandy Springs",
95 "state": "Georgia",
96 "reviewsCount": 0,
97 "placeId": "demo-place-07",
98 "url": "https://www.google.com/maps/place/?q=place_id:demo-place-07"
99 },
100 {
101 "title": "Metric Plumbing Repair Sandy Springs",
102 "categoryName": "Plumber",
103 "phone": "(470) 555-0103",
104 "address": "Sandy Springs, GA",
105 "city": "Sandy Springs",
106 "state": "Georgia",
107 "reviewsCount": 2,
108 "totalScore": 5,
109 "placeId": "demo-place-08",
110 "url": "https://www.google.com/maps/place/?q=place_id:demo-place-08"
111 }
112 ]
113};
114
115
116const run = await client.actor("callbacklocal/google-maps-lead-cleaner").call(input);
117
118
119console.log('Results from dataset');
120console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
121const { items } = await client.dataset(run.defaultDatasetId).listItems();
122items.forEach((item) => {
123 console.dir(item);
124});
125
126