1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "records": [
12 {
13 "placeId": "demo-001",
14 "title": "Example Riverside Cafe",
15 "categoryName": "Cafe",
16 "address": "101 Sample Avenue",
17 "city": "Demo City",
18 "countryCode": "US",
19 "website": "https://riverside.example",
20 "location": {
21 "lat": 40.7128,
22 "lng": -74.006
23 },
24 "totalScore": 4.4,
25 "reviewsCount": 88
26 },
27 {
28 "placeId": "demo-001",
29 "title": "Example Riverside Cafe (duplicate)",
30 "categoryName": "Cafe",
31 "address": "101 Sample Avenue",
32 "city": "Demo City",
33 "countryCode": "US",
34 "location": {
35 "lat": 40.7128,
36 "lng": -74.006
37 },
38 "totalScore": 4.4,
39 "reviewsCount": 88
40 },
41 {
42 "placeId": "demo-002",
43 "title": "Example Northside Bakery",
44 "categoryName": "Bakery",
45 "address": "20 Sample Street",
46 "city": "Demo City",
47 "countryCode": "US",
48 "website": "",
49 "location": {
50 "lat": 40.713,
51 "lng": -74.0065
52 },
53 "totalScore": 4.1,
54 "reviewsCount": 31
55 },
56 {
57 "placeId": "demo-003",
58 "title": "Example Garden Florist",
59 "categoryName": "Florist",
60 "address": "8 Example Road",
61 "city": "Demo City",
62 "countryCode": "US",
63 "website": "https://garden.example",
64 "location": {
65 "lat": 40.714,
66 "lng": -74.0045
67 },
68 "totalScore": 4.7,
69 "reviewsCount": 52
70 }
71 ]
72};
73
74
75const run = await client.actor("practical_ai_lab_jp/pal-maps-business-dataset-quality").call(input);
76
77
78console.log('Results from dataset');
79console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
80const { items } = await client.dataset(run.defaultDatasetId).listItems();
81items.forEach((item) => {
82 console.dir(item);
83});
84
85