1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "current_csv": `SKU,Price,Quantity
120007,2.30,5
137,3.40,6`,
14 "profile": {
15 "profile_version": 1,
16 "profile_id": "synthetic-plain-sku-usd-each-v1",
17 "columns": {
18 "group": "SKU",
19 "sku": "SKU",
20 "options": [],
21 "price": "Price",
22 "quantity": "Quantity",
23 "currency": null,
24 "quantity_unit": null
25 },
26 "semantics": {
27 "currency": "USD",
28 "decimal_separator": ".",
29 "thousands_separator": null,
30 "price_scale": 2,
31 "quantity_unit": "each",
32 "quantity_must_be_integer": true,
33 "allow_negative_quantity": false,
34 "shared_sku_policy": "forbid"
35 },
36 "snapshots": {
37 "current": "complete",
38 "previous": "complete"
39 }
40 },
41 "previous_csv": `SKU,Price,Quantity
420007,2.30,5
437,3.40,6
448,4.50,1`
45};
46
47
48const run = await client.actor("ysoserious_h/catalog-snapshot-guard").call(input);
49
50
51console.log('Results from dataset');
52console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
53const { items } = await client.dataset(run.defaultDatasetId).listItems();
54items.forEach((item) => {
55 console.dir(item);
56});
57
58