Monitoring Runner avatar

Monitoring Runner

Try for free

No credit card required

View all Actors
Monitoring Runner

Monitoring Runner

apify/monitoring-runner
Try for free

No credit card required

The monitoring runner is a part of the Apify Monitoring Suite (apify/monitoring). See its readme for more information and how to use this.

Do you want to learn more about this Actor?

Get a demo

You can access the Monitoring Runner programmatically from your own JavaScript applications by using the Apify API. You can also choose the language preference from below. To use the Apify API, you’ll need an Apify account and your API token, found in Integrations settings in Apify Console.

1import { ApifyClient } from 'apify-client';
2
3// Initialize the ApifyClient with your Apify API token
4// Replace the '<YOUR_API_TOKEN>' with your token
5const client = new ApifyClient({
6    token: '<YOUR_API_TOKEN>',
7});
8
9// Prepare Actor input
10const input = {
11    "limit": 1000,
12    "checkersInput": {
13        "RESOURCE_STATS_CHECKER": {},
14        "DEDUPLICATION_CHECKER": {
15            "uniqueKey": "email"
16        },
17        "SCHEMA_VALIDATOR_CHECKER": {
18            "options": [
19                {
20                    "resourceList": [
21                        "id",
22                        "id"
23                    ],
24                    "resourceRegex": "",
25                    "minItemCount": 100,
26                    "maxItemCount": 5000,
27                    "validationSchema": "{ address: String, open: Boolean }"
28                }
29            ]
30        }
31    },
32    "reportersInput": {
33        "EMAIL_REPORTER": {
34            "sendMailInput": {
35                "to": "info@apify.com",
36                "subject": "My monitoring task report"
37            }
38        },
39        "SLACK_REPORTER": {
40            "slackInput": {
41                "token": "Your token",
42                "message": "Hey, look what I have done!",
43                "channel": "#monitoring"
44            }
45        },
46        "DASHBOARD_REPORTER": {
47            "notifyOnUpdate": true
48        }
49    }
50};
51
52// Run the Actor and wait for it to finish
53const run = await client.actor("apify/monitoring-runner").call(input);
54
55// Fetch and print Actor results from the run's dataset (if any)
56console.log('Results from dataset');
57console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
58const { items } = await client.dataset(run.defaultDatasetId).listItems();
59items.forEach((item) => {
60    console.dir(item);
61});
62
63// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

Monitoring Runner API in JavaScript

The Apify API client for JavaScript is the official library that allows you to use Monitoring Runner API in JavaScript or TypeScript, providing convenience functions and automatic retries on errors.

Install the apify-client

npm install apify-client

Other API clients include:

Developer
Maintained by Apify
Actor metrics
  • 37 monthly users
  • 14 stars
  • 97.5% runs succeeded
  • Created in Aug 2020
  • Modified 4 months ago
Categories