API uptime ≠ landing-page uptime. Check a health endpoint (not /), expect 200 OK + json {"status":"ok"}, 10 s timeout, 60 s interval (no rarer — you will miss 5-min incidents). Multi-region checks rule out "your ISP is down, not our API". Alert after 3 consecutive fails, not the first.
Below: details, example, related terms, FAQ.
Free online tool — HTTP header checker: instant results, no signup.
# A good /health endpoint (PHP)
<?php
header('Content-Type: application/json');
$checks = [
'db' => @$pdo->query('SELECT 1') !== false,
'redis' => @$redis->ping() === '+PONG',
'disk' => disk_free_space('/') > 1024 * 1024 * 1024, // 1 GB free
];
$ok = !in_array(false, $checks, true);
http_response_code($ok ? 200 : 503);
echo json_encode(['status' => $ok ? 'ok' : 'degraded', 'checks' => $checks]);
# In enterno.io: monitor type=http, URL=https://api.example.com/health,
# expected_code=200, interval=60s, regions=ru-msk+eu-de, fail_threshold=3To monitor API uptime effectively, implement an HTTP check that regularly pings the API endpoint, checks HTTP status codes, and manages timeouts. Tools like curl or monitoring services such as Pingdom can automate these checks. Aim for a response time under 500ms and configure alerts for any non-200 status codes to maintain optimal uptime.
Monitoring API uptime begins with setting up HTTP checks to continuously evaluate the API's availability. This involves sending periodic requests to the API endpoint to verify that it responds as expected. The following steps outline how to set up these checks:
https://api.example.com/v1/status.For a practical implementation using curl, you can use the following command to check the status code:
curl -o /dev/null -s -w "%{http_code}" https://api.example.com/v1/statusThis command retrieves the HTTP status code from the specified API endpoint without displaying the response body. A response code of 200 indicates that the API is functioning correctly.
When monitoring API uptime, understanding HTTP status codes and managing timeouts is crucial for effective monitoring. Here's a breakdown of the most relevant status codes and timeout configurations:
Timeout settings are essential for ensuring that your monitoring tools do not wait indefinitely for a response. A commonly recommended timeout setting is 5 seconds. This can be configured in most monitoring tools and can also be set in curl commands as follows:
curl --max-time 5 -o /dev/null -s -w "%{http_code}" https://api.example.com/v1/statusThis command sets the maximum time allowed for the API call to 5 seconds. If the API does not respond within this time, it will return an error. By monitoring these status codes and configuring appropriate timeouts, you can maintain a high level of API uptime and quickly react to any issues that arise.
API uptime means "works on average", not "works right now". A 5-sec check × millions = perf hit on the API + your monitor plan limits. 60 s with a 3-fail threshold = ~3-min incident detection — usually enough.
Useless — only verifies PHP-FPM is alive. A real health endpoint pings DB, Redis, S3, queues. Cost: ~10-50 ms per check. Benefit: catches partial degradations.
No, but recommended for production. Single-region = one ISP network glitch kills your on-call at night. Multi-region + 2-of-3 rule = >95% accuracy.
Free plan — 10 monitors, checks every 5 min, no card required. Upgrade for 1-minute interval and multi-region monitoring.