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