1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "inputJson": `{
12 "business": {
13 "name": "Northwind Dental",
14 "category": "Dentist",
15 "location": "Chicago, IL"
16 },
17 "dateRanges": {
18 "current": { "start": "2026-03-15", "end": "2026-04-13" },
19 "previous": { "start": "2026-02-14", "end": "2026-03-14" }
20 },
21 "timeline": [
22 {
23 "date": "2026-04-13",
24 "profileViews": 342,
25 "searchViews": 188,
26 "mapsViews": 154,
27 "websiteClicks": 20,
28 "calls": 15,
29 "directionRequests": 18,
30 "bookings": 5,
31 "messages": 7,
32 "menuClicks": 8,
33 "productViews": 21,
34 "photoViews": 96,
35 "postEngagement": 14,
36 "impressions": 371,
37 "brandedViews": 118,
38 "discoveryViews": 224
39 }
40 ],
41 "searchQueries": [
42 {
43 "query": "family dentist chicago",
44 "impressions": 380,
45 "clicks": 41,
46 "branded": false,
47 "avgRank": 3.4,
48 "category": "Dentist",
49 "location": "Chicago"
50 }
51 ],
52 "reviews": [
53 { "date": "2026-04-12", "rating": 4, "responded": false }
54 ],
55 "rankings": [
56 { "date": "2026-04-10", "keyword": "family dentist chicago", "location": "Chicago", "rank": 3 }
57 ]
58}`,
59 "useSampleData": false
60};
61
62
63const run = await client.actor("shahabuddin38/google-business-profile-kpi-analyzer").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