1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "currentItems": [
12 {
13 "placeId": "a1",
14 "name": "Cafe One",
15 "searchQuery": "coffee Austin",
16 "rating": 4.7,
17 "reviews": 920,
18 "rank": 1,
19 "category": "coffee"
20 },
21 {
22 "placeId": "a2",
23 "name": "Cafe Two",
24 "searchQuery": "coffee Austin",
25 "rating": 4.2,
26 "reviews": 310,
27 "rank": 2,
28 "category": "coffee"
29 },
30 {
31 "placeId": "a3",
32 "name": "Cafe Three",
33 "searchQuery": "coffee Austin",
34 "rating": 3.9,
35 "reviews": 80,
36 "rank": 3,
37 "category": "coffee"
38 }
39 ],
40 "previousItems": [
41 {
42 "placeId": "a1",
43 "name": "Cafe One",
44 "searchQuery": "coffee Austin",
45 "rating": 4.6,
46 "reviews": 850,
47 "rank": 1,
48 "category": "coffee"
49 },
50 {
51 "placeId": "a2",
52 "name": "Cafe Two",
53 "searchQuery": "coffee Austin",
54 "rating": 4.1,
55 "reviews": 270,
56 "rank": 4,
57 "category": "coffee"
58 }
59 ]
60};
61
62
63const run = await client.actor("quanmatrix/google-maps-market-whitespace-expansion-intelligence").call(input);
64
65
66console.log('Results from dataset');
67console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
68const { items } = await client.dataset(run.defaultDatasetId).listItems();
69items.forEach((item) => {
70 console.dir(item);
71});
72
73