1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "currentRecords": [
12 {
13 "sku": "A-100",
14 "title": "Acme Mug",
15 "price": 15.99,
16 "stock": 0,
17 "tags": [
18 "new",
19 "sale"
20 ],
21 "scrapedAt": "2026-10-24T08:00:00Z"
22 },
23 {
24 "sku": "B-200",
25 "title": "Blue Pen",
26 "price": 2.5,
27 "stock": 40,
28 "tags": [],
29 "scrapedAt": "2026-10-24T08:00:00Z"
30 },
31 {
32 "sku": "D-400",
33 "title": "Desk Lamp",
34 "price": 30,
35 "stock": 7,
36 "tags": [
37 "eco"
38 ],
39 "scrapedAt": "2026-10-24T08:00:00Z"
40 }
41 ],
42 "baselineRecords": [
43 {
44 "sku": "A-100",
45 "title": "Acme Mug",
46 "price": 19.99,
47 "stock": 12,
48 "tags": [
49 "new"
50 ],
51 "scrapedAt": "2026-10-23T08:00:00Z"
52 },
53 {
54 "sku": "B-200",
55 "title": "Blue Pen",
56 "price": 2.5,
57 "stock": 40,
58 "tags": [],
59 "scrapedAt": "2026-10-23T08:00:00Z"
60 },
61 {
62 "sku": "C-300",
63 "title": "Cable",
64 "price": 5,
65 "stock": 9,
66 "tags": [],
67 "scrapedAt": "2026-10-23T08:00:00Z"
68 }
69 ]
70};
71
72
73const run = await client.actor("hiredhandai/dataset-diff-explainer").call(input);
74
75
76console.log('Results from dataset');
77console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
78const { items } = await client.dataset(run.defaultDatasetId).listItems();
79items.forEach((item) => {
80 console.dir(item);
81});
82
83