1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "csv": `id,title,description,link,image_link,availability,price,brand,gtin,mpn
12SKU-1001,Oak desk,Compact oak writing desk,https://example.com/desk,https://example.com/desk.jpg,in_stock,129.00 EUR,Example Studio,,OAK-1
13SKU-1002,Reading lamp,Adjustable metal reading lamp,https://example.com/lamp,https://example.com/lamp.jpg,in_stock,39.00 EUR,Example Studio,,LAMP-2
14SKU-1003,Linen cushion,Soft linen cushion cover,https://example.com/cushion,https://example.com/cushion.jpg,in_stock,29 euros,Example Studio,,LIN-3
15SKU-1004,Ceramic vase,Hand glazed ceramic vase,https://example.com/vase,https://example.com/vase.jpg,out_of_stock,24.00 EUR,Example Studio,,VAS-4
16SKU-1005,Wall shelf,Small wall mounted shelf,https://example.com/shelf,https://example.com/shelf.jpg,in_stock,49.00 EUR,Example Studio,,SH-5
17SKU-1006,Table mirror,Round standing mirror,https://example.com/mirror,https://example.com/mirror.jpg,in_stock,34.00 EUR,Example Studio,,MIR-6
18SKU-1007,Cotton throw,Woven cotton throw,https://example.com/throw,,in_stock,59.00 EUR,Example Studio,,THR-7
19SKU-1008,Storage basket,Natural woven basket,https://example.com/basket,https://example.com/basket.jpg,available,19.00 EUR,Example Studio,,BAS-8
20SKU-1009,Side table,Small solid wood side table,https://example.com/table,https://example.com/table.jpg,in_stock,89.00 EUR,Example Studio,,TB-9
21SKU-1010,Glass jug,Clear glass water jug,https://example.com/jug,https://example.com/jug.jpg,in_stock,18.00 EUR,Example Studio,1234567890123,JUG-10
22SKU-1011,Serving tray,Lightweight serving tray,https://example.com/tray,https://example.com/tray.jpg,in_stock,22.00 EUR,,,
23SKU-1012,Coaster set,Four cork coasters,https://example.com/coasters,https://example.com/coasters.jpg,in_stock,12.00 EUR,Example Studio,,CO-12`
24};
25
26
27const run = await client.actor("onixcatalogdesk/onix-catalog-audit").call(input);
28
29
30console.log('Results from dataset');
31console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
32const { items } = await client.dataset(run.defaultDatasetId).listItems();
33items.forEach((item) => {
34 console.dir(item);
35});
36
37