1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "snapshots": [
12 {
13 "date": "2026-01-01",
14 "label": "January export",
15 "items": [
16 {
17 "placeId": "a1",
18 "categoryName": "Coffee shop",
19 "city": "Springfield"
20 },
21 {
22 "placeId": "a2",
23 "categoryName": "Coffee shop",
24 "city": "Springfield"
25 },
26 {
27 "placeId": "a3",
28 "categoryName": "Bakery",
29 "city": "Springfield"
30 },
31 {
32 "placeId": "a4",
33 "categoryName": "Gym",
34 "city": "Rivertown"
35 },
36 {
37 "placeId": "a5",
38 "categoryName": "Coffee shop",
39 "city": "Rivertown"
40 }
41 ]
42 },
43 {
44 "date": "2026-04-01",
45 "label": "April export",
46 "items": [
47 {
48 "placeId": "a1",
49 "categoryName": "Coffee shop",
50 "city": "Springfield"
51 },
52 {
53 "placeId": "a3",
54 "categoryName": "Bakery",
55 "city": "Springfield"
56 },
57 {
58 "placeId": "b1",
59 "categoryName": "Bakery",
60 "city": "Springfield"
61 },
62 {
63 "placeId": "a4",
64 "categoryName": "Gym",
65 "city": "Rivertown"
66 },
67 {
68 "placeId": "b2",
69 "categoryName": "Gym",
70 "city": "Rivertown"
71 },
72 {
73 "placeId": "b3",
74 "categoryName": "Yoga studio",
75 "city": "Rivertown"
76 }
77 ]
78 }
79 ]
80};
81
82
83const run = await client.actor("practical_ai_lab_jp/pal-maps-local-category-trends").call(input);
84
85
86console.log('Results from dataset');
87console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
88const { items } = await client.dataset(run.defaultDatasetId).listItems();
89items.forEach((item) => {
90 console.dir(item);
91});
92
93