1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "input_mode": "file_upload",
12 "current_snapshot": {
13 "observed_at": "2026-09-10T09:00:00+08:00",
14 "records": [
15 {
16 "product_id": "SYNTHETIC-P100",
17 "skus": [
18 {
19 "sku_id": "A",
20 "attributes": {
21 "颜色": "黑色",
22 "容量": "128GB"
23 },
24 "price": "126.00",
25 "currency": "CNY",
26 "price_basis": "sku_listed",
27 "stock_status": "in_stock"
28 }
29 ]
30 }
31 ]
32 },
33 "previous_snapshot": {
34 "observed_at": "2026-09-03T09:00:00+08:00",
35 "records": [
36 {
37 "product_id": "SYNTHETIC-P100",
38 "skus": [
39 {
40 "sku_id": "A",
41 "attributes": {
42 "容量": "128GB",
43 "颜色": "黑色"
44 },
45 "price": "120.00",
46 "currency": "CNY",
47 "price_basis": "sku_listed",
48 "stock_status": "in_stock"
49 }
50 ]
51 }
52 ]
53 }
54};
55
56
57const run = await client.actor("crocheted_pipa/catalogdelta-1688-sku-normalizer").call(input);
58
59
60console.log('Results from dataset');
61console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
62const { items } = await client.dataset(run.defaultDatasetId).listItems();
63items.forEach((item) => {
64 console.dir(item);
65});
66
67