1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "barcodes": [
12 {
13 "data": "012345678901",
14 "format": "EAN13",
15 "outputFormat": "PNG",
16 "label": "example-ean13"
17 },
18 {
19 "data": "Hello, World!",
20 "format": "CODE128",
21 "outputFormat": "PNG",
22 "label": "example-code128"
23 },
24 {
25 "data": "https://apify.com",
26 "format": "QR",
27 "outputFormat": "PNG",
28 "label": "example-qr"
29 }
30 ],
31 "outputFormat": "PNG",
32 "width": 300,
33 "height": 150,
34 "lineColor": "#000000",
35 "background": "#ffffff",
36 "includeText": true,
37 "fontSize": 20,
38 "margin": 10,
39 "qrErrorCorrection": "M"
40};
41
42
43const run = await client.actor("automation-lab/barcode-generator").call(input);
44
45
46console.log('Results from dataset');
47console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
48const { items } = await client.dataset(run.defaultDatasetId).listItems();
49items.forEach((item) => {
50 console.dir(item);
51});
52
53