Examples
Use your API key only in server-side or trusted environments. Never expose it in browser apps.
cURL
curl -X GET "https://faciotech.com/modules/addons/faciotech_monitor/api.php/status" \
-H "X-API-Key: YOUR_API_KEY"
JavaScript (fetch)
const res = await fetch('https://faciotech.com/modules/addons/faciotech_monitor/api.php/status', {
headers: { 'X-API-Key': process.env.MONITOR_API_KEY }
});
const data = await res.json();
if (data.success) console.log(data.data.status);
Run this in Node.js or a server-side context; do not use the key in browser code.
Node.js
const apiKey = process.env.MONITOR_API_KEY;
const base = 'https://faciotech.com/modules/addons/faciotech_monitor/api.php';
const { data } = await fetch(`${base}/status`, {
headers: { 'X-API-Key': apiKey }
}).then(r => r.json());
if (data) console.log('Overall:', data.status.overall_status);
Python (requests)
import os
import requests
api_key = os.environ.get('MONITOR_API_KEY')
base = 'https://faciotech.com/modules/addons/faciotech_monitor/api.php'
r = requests.get(f'{base}/status', headers={'X-API-Key': api_key})
data = r.json()
if data.get('success'):
print(data['data']['status']['overall_status'])
Build a status page from the API
Poll the API from your backend or a cron job; do not call it from the browser with a key.
- Call GET /status to get overall status and active incidents.
- Call GET /monitors to list components and their status.
- Optionally call GET /incidents for recent history.
- Render states (operational / degraded / partial outage / major outage / maintenance) and incident list. Cache responses (e.g. 60-120 seconds) to reduce load.
Add a status badge to your website
To show a "systems operational" (or current state) badge:
- Implement a small backend endpoint or serverless function that calls GET /status with your API key, then returns only the minimal data needed for the badge (e.g.
overall_statusand a label). - Your front end calls your own endpoint (no API key in the browser) and displays a cached result (e.g. 5-10 minutes) to limit traffic.