1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "vendors": [
12 {
13 "name": "GitHub",
14 "status_json_url": "https://www.githubstatus.com/api/v2/status.json",
15 "probe_url": "https://github.com/robots.txt",
16 "probe_method": "GET",
17 "expect_status": [
18 200
19 ]
20 },
21 {
22 "name": "Cloudflare",
23 "status_json_url": "https://www.cloudflarestatus.com/api/v2/status.json",
24 "probe_url": "https://www.cloudflare.com/cdn-cgi/trace",
25 "probe_method": "GET",
26 "expect_status": [
27 200
28 ]
29 },
30 {
31 "name": "npm",
32 "status_json_url": "https://status.npmjs.org/api/v2/status.json",
33 "probe_url": "https://registry.npmjs.org/-/ping",
34 "probe_method": "GET",
35 "expect_status": [
36 200
37 ]
38 }
39 ],
40 "checkIntervalMinutes": 15,
41 "maxProbeAttempts": 3,
42 "requestTimeoutSeconds": 20,
43 "concurrency": 5,
44 "maxRedirects": 5,
45 "maxResponseBytes": 2000000,
46 "stateStoreName": "shadow-outage-ledger-state",
47 "stateRetentionHours": 720
48};
49
50
51const run = await client.actor("kingii98/shadow-outage-ledger-vendor-claimed-status").call(input);
52
53
54console.log('Results from dataset');
55console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
56const { items } = await client.dataset(run.defaultDatasetId).listItems();
57items.forEach((item) => {
58 console.dir(item);
59});
60
61