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 "placeId": "sample-place-001",
14 "title": "Blue Door Bakery",
15 "address": "12 Market Street, Springfield",
16 "location": {
17 "lat": 40.7128,
18 "lng": -74.006
19 },
20 "phone": "+1 555 0100 111",
21 "website": "https://bluedoorbakery.example",
22 "categoryName": "Bakery",
23 "reviewsCount": 120
24 },
25 {
26 "placeId": "sample-place-001",
27 "title": "Blue Door Bakery & Cafe",
28 "address": "12 Market St, Springfield",
29 "location": {
30 "lat": 40.7128,
31 "lng": -74.006
32 }
33 },
34 {
35 "title": "The Blue Door Bakery",
36 "location": {
37 "lat": 40.71283,
38 "lng": -74.00601
39 },
40 "phone": "(555) 010-0111"
41 },
42 {
43 "placeId": "sample-place-002",
44 "title": "Harbor Dental Clinic",
45 "address": "400 Pier Road, Springfield",
46 "location": {
47 "lat": 40.72,
48 "lng": -74.01
49 },
50 "phone": "+1 555 0100 222"
51 },
52 {
53 "title": "Harbor Dental Clinic LLC",
54 "phone": "555-010-0222"
55 },
56 {
57 "placeId": "sample-place-003",
58 "title": "Greenleaf Market",
59 "location": {
60 "lat": 40.7,
61 "lng": -74
62 },
63 "website": "https://greenleafmarket.example"
64 },
65 {
66 "placeId": "sample-place-004",
67 "title": "Greenleaf Market",
68 "location": {
69 "lat": 40.76,
70 "lng": -73.95
71 },
72 "website": "https://greenleafmarket.example"
73 }
74 ]
75};
76
77
78const run = await client.actor("practical_ai_lab_jp/pal-maps-duplicate-places-audit").call(input);
79
80
81console.log('Results from dataset');
82console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
83const { items } = await client.dataset(run.defaultDatasetId).listItems();
84items.forEach((item) => {
85 console.dir(item);
86});
87
88