1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6    token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11    "dashboardStatisticsFrequency": "Every day at noon",
12    "validationCheckOptions": `/* global ow */
13        // The `ow` variable represents the ow validation variable. More at https://sindresorhus.com/ow/index.html
14         [
15            {
16                filter: "us", // matches all targets with "us" pattern
17                minItemCount: 5000,
18                schema: {
19                    url: ow.string.url,
20                    description: ow.string,
21                },
22            },
23            {
24                Ids: ["A1b2C3d4", "B1A2d45"], // matches 2 targets with specific IDs
25                schema: {
26                    itemId: ow.number,
27                    region: ow.string,
28                },
29            },
30        ]`,
31    "validationCheckFrequency": "Per run",
32    "duplicationCheckFrequency": "Per run"
33};
34
35
36const run = await client.actor("apify/monitoring").call(input);
37
38
39console.log('Results from dataset');
40console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
41const { items } = await client.dataset(run.defaultDatasetId).listItems();
42items.forEach((item) => {
43    console.dir(item);
44});
45
46