API Health Monitor — Uptime Checker with Webhook Alerts avatar

API Health Monitor — Uptime Checker with Webhook Alerts

Pricing

from $0.05 / actor start

Go to Apify Store
API Health Monitor — Uptime Checker with Webhook Alerts

API Health Monitor — Uptime Checker with Webhook Alerts

Monitor API endpoints for HTTP status, response time, and SSL certificate expiry. Configurable check intervals, webhook alerts (Slack, Discord, generic), response time stats, and custom headers.

Pricing

from $0.05 / actor start

Rating

0.0

(0)

Developer

Perry AY

Perry AY

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a day ago

Last modified

Share

API Health Monitor

Check your API endpoints for uptime, response time, and SSL expiry. Get webhook alerts in Slack or Discord when something breaks. Batch up to 50 URLs per run.


What does it do?

The API Health Monitor fetches endpoints you care about and tells you whether they're up, how fast they responded, and if their SSL certificate is about to expire. When a check fails — wrong status code, connection timeout, expiring cert — it fires a webhook alert to Slack, Discord, or any HTTP endpoint you point it at.

Each check records the HTTP status code, response time in milliseconds, and SSL certificate metadata (issuer, expiry date, days remaining). After all checks complete, you get a summary with response-time percentiles (p50, p95, p99, average) so you can track latency trends.

Features

HTTP Status Validation. Fetches each URL with a configurable timeout and compares the returned status code against what you expect (defaults to 200). Anything that doesn't match gets flagged as unhealthy and triggers a webhook if you've configured one.

Response Time Tracking. Measures end-to-end response time per check in milliseconds. The run summary includes p50 (median), p95, p99, and average across all URLs so you can spot tail-latency problems.

SSL Certificate Inspection. For every HTTPS URL, opens a TLS connection and reads the certificate chain. Extracts issuer, expiry date, and days remaining. Certificates within 7 days of expiry are marked unhealthy regardless of HTTP status.

Webhook Alerts. When a check fails, the actor POSTs a formatted alert to Slack (Block Kit format), Discord (Embed format), or any generic HTTP endpoint (flat JSON payload).

Custom Headers. Pass key-value pairs of HTTP headers to include with every request. Handy for Authorization headers, API keys, or custom Accept types.

Batch Monitoring. Check up to 50 URLs in one run. URLs are processed sequentially with your chosen interval between each one. Runs with more than 5 URLs use batch mode internally.

Configurable Intervals. Set the delay between checks starting at 60 seconds. Short intervals work for smoke tests after deploys; longer intervals make sense for ongoing monitoring via the Apify scheduler.

Who is it for?

PersonaWhat they use it for
DevOps / SRE EngineerAdding lightweight uptime monitoring to internal APIs and microservices without deploying Prometheus or Datadog. Checking that staging and production endpoints return 200 after every deployment.
Backend DeveloperVerifying that new API endpoints are reachable, respond within SLA, and have valid SSL certificates before handing off to QA. Running one-off health checks during development.
QA EngineerSmoke-testing a set of API endpoints after every release to confirm nothing is broken. Using batch mode to check 20+ endpoints in one run and reviewing the output for failures.
Security EngineerTracking SSL certificate expiry across all internal and customer-facing APIs. The actor flags certificates expiring within 7 days so renewals never get missed.
Platform EngineerMonitoring third-party API dependencies that the platform relies on. If Stripe, SendGrid, or any external service goes down, the webhook alert fires immediately.
Technical Support LeadRunning a health check against customer-reported broken endpoints to quickly confirm whether the issue is server-side (5xx, timeout) or client-side.

Input Parameters

FieldTypeRequiredDefaultDescription
urlsarray of stringsYesList of endpoint URLs to monitor. Each must start with http:// or https://. Maximum 50 URLs per run.
intervalintegerNo60Seconds between successive health checks. Minimum 60 to avoid rate limiting target servers.
webhookUrlstringNoURL to send alert notifications. Supports Slack incoming webhooks, Discord webhooks, and any HTTP POST endpoint.
webhookTypestringNo"generic"Payload format for webhook alerts. One of: "slack" (Slack Block Kit), "discord" (Discord Embed), "generic" (JSON event).
timeoutintegerNo30HTTP request timeout per URL in seconds. Must be between 5 and 120. A URL that doesn't respond within this window is marked as failed.
customHeadersobjectNo{}Key-value pairs of HTTP headers to include with every health check request.
expectedStatusintegerNo200Expected HTTP status code for a healthy response. Any other status code triggers an alert if a webhook is configured.

Example Input

Minimal: Check two endpoints with defaults

{
"urls": ["https://example.com", "https://example.org/api/health"]
}

Full: Batch mode with webhook alerts and custom headers

{
"urls": [
"https://api.example.com/v1/status",
"https://api.example.com/v1/users",
"https://auth.example.com/health",
"https://cdn.example.com/ping",
"https://webhook.example.com/health",
"https://internal.example.com/metrics"
],
"interval": 120,
"webhookUrl": "https://hooks.slack.com/services/T00000000/B00000000/xxxxxxxxxxxxxxxxxxxxxxxx",
"webhookType": "slack",
"timeout": 30,
"expectedStatus": 200,
"customHeaders": {
"Authorization": "Bearer your-api-token",
"X-Service-Name": "health-monitor"
}
}

Output Format

Each URL produces one dataset item with these fields:

FieldTypeDescription
urlstringThe URL that was checked.
status_codeinteger or nullHTTP status code returned by the endpoint. Null if the connection failed before receiving a response.
response_time_msnumberRound-trip response time in milliseconds. Measured from request start to response completion.
ssl_days_remaininginteger or nullDays until the SSL certificate expires. Null for non-HTTPS URLs or if the TLS handshake failed.
ssl_issuerstring or nullOrganization name from the SSL certificate issuer field.
ssl_expirystring or nullISO 8601 timestamp of certificate expiry in UTC.
healthybooleantrue if the status code matches expectedStatus and SSL is valid. false otherwise.
errorstring or nullError description if the check failed. Includes timeout messages, connection errors, status mismatches, and SSL warnings.
webhook_sentbooleanPresent and true only when an alert webhook was successfully dispatched for this URL.
checked_atstringISO 8601 timestamp of when the check was performed (UTC).
final_urlstring or nullThe final URL after following redirects.

Example Output (healthy check)

{
"url": "https://example.com",
"status_code": 200,
"response_time_ms": 187.43,
"ssl_days_remaining": 82,
"ssl_issuer": "Let's Encrypt",
"ssl_expiry": "2026-10-16T12:00:00+00:00",
"healthy": true,
"checked_at": "2026-07-26T14:30:00.123456+00:00",
"final_url": "https://example.com/"
}

Example Output (failed check with webhook alert)

{
"url": "https://api.example.com/status",
"status_code": 503,
"response_time_ms": 412.18,
"ssl_days_remaining": 82,
"ssl_issuer": "Let's Encrypt",
"ssl_expiry": "2026-10-16T12:00:00+00:00",
"healthy": false,
"error": "Expected HTTP 200, got 503",
"webhook_sent": true,
"checked_at": "2026-07-26T14:30:02.456789+00:00",
"final_url": "https://api.example.com/status"
}

Example Summary

The last dataset item is a summary object with _summary: true:

{
"_summary": true,
"total_urls": 6,
"healthy": 5,
"unhealthy": 1,
"batch_mode": true,
"checked_at": "2026-07-26T14:30:00.000000+00:00",
"response_time_stats": {
"p50_ms": 187.43,
"p95_ms": 412.18,
"p99_ms": 412.18,
"avg_ms": 224.81
}
}

FAQ

What happens if a URL is unreachable? The check is marked healthy: false with an error field describing the failure (e.g., "Connection failed" or "Request timed out"). If a webhook is configured, an alert is dispatched. The actor continues to the next URL — one failed check never blocks the rest of the batch.

How does SSL certificate checking work? For every HTTPS URL, the actor opens a TLS connection to the hostname on port 443 and reads the server certificate. It extracts the notAfter date and the issuer's organization name. If the certificate expires within 7 days, the check is marked unhealthy regardless of the HTTP status code.

What webhook services are supported? The actor supports Slack (via incoming webhooks), Discord (via webhook URLs), and generic HTTP POST endpoints. The webhookType field selects the payload format: Slack gets Block Kit messages, Discord gets Embeds, and generic endpoints get a flat JSON event object.

Can I use this with authenticated APIs? Yes. Set the customHeaders field to include authorization headers. For Bearer tokens: {"Authorization": "Bearer eyJ..."}. For API keys: {"X-API-Key": "your-key"}. Headers are sent with every health check request.

What's the minimum interval between checks? 60 seconds. This prevents rate-limiting the target servers. For production monitoring, consider longer intervals (5-15 minutes) and use the Apify scheduler to trigger runs. The interval only applies within a single run — scheduled runs start fresh each time.

How many URLs can I check in one run? Up to 50 URLs per run. The actor processes URLs sequentially with the configured interval between each one.

What status code counts as healthy? By default, HTTP 200. You can override this with the expectedStatus field — for example, set it to 204 if your health endpoint returns No Content on success, or 301 if you expect a redirect and want to follow it.

Does the actor follow redirects? Yes. HTTP redirects (301, 302, 307, 308) are followed automatically. The final_url field in the output shows the URL after all redirects, so you can see where the request ultimately landed.

Can I use this for non-HTTPS endpoints? Yes. HTTP URLs are checked for status code and response time only — SSL checks are skipped since there's no TLS connection to inspect. The ssl_days_remaining and related fields will be null.

What happens if my webhook endpoint is down? The webhook delivery is attempted once with a 15-second timeout. If it fails (non-2xx response, timeout, or connection error), the failure is logged but the health check continues. The actor does not retry webhook deliveries.

API Usage

cURL

curl -X POST "https://api.apify.com/v2/acts/perryay~api-health-monitor/runs?token=YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"urls": ["https://example.com", "https://example.org/api/health"],
"interval": 60,
"timeout": 30
}'

Python

from apify_client import ApifyClient
client = ApifyClient("YOUR_API_TOKEN")
result = client.actor("perryay~api-health-monitor").call(
run_input={
"urls": ["https://example.com", "https://example.org/api/health"],
"interval": 60,
"webhookUrl": "https://hooks.slack.com/services/T00/B00/xxx",
"webhookType": "slack",
"expectedStatus": 200,
}
)
dataset_items = client.dataset(result["defaultDatasetId"]).list_items()
for item in dataset_items.items:
print(f"{item['url']}: {item['status_code']} ({item['response_time_ms']}ms) - {'✅' if item['healthy'] else '❌'}")

Node.js

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const result = await client.actor('perryay~api-health-monitor').call({
urls: ['https://example.com', 'https://example.org/api/health'],
interval: 60,
webhookUrl: 'https://hooks.slack.com/services/T00/B00/xxx',
webhookType: 'slack',
});
const { items } = await client.dataset(result.defaultDatasetId).listItems();
items.forEach(item => {
const icon = item.healthy ? '✅' : '❌';
console.log(`${icon} ${item.url}: ${item.status_code} (${item.response_time_ms}ms)`);
});

Use Cases

  • Post-deployment smoke test. Run the actor against your API's health endpoints right after every deployment. If any endpoint returns a non-200 or times out, the run summary tells you which service failed before you close the deployment ticket.
  • 24/7 uptime monitoring via scheduler. Point the Apify scheduler at the actor every 5 minutes against your production endpoints with a Slack webhook. Failed checks hit your on-call channel. No external monitoring service required.
  • SSL certificate renewal calendar. Run the actor monthly against all your HTTPS endpoints. Sort the dataset by ssl_days_remaining ascending. Anything under 30 days goes on the renewal calendar. Under 7 days, the check is marked unhealthy and alerts fire.
  • Third-party dependency monitoring. Add the health endpoints of every external service your platform depends on — payment processors, email APIs, auth providers, CDNs. If Stripe or SendGrid goes down, your Slack channel gets an alert.
  • API contract validation during QA. Before a release, run the actor with expectedStatus set to the documented response code for each endpoint. Any deviation is a regression caught before customers see it.
  • Latency trend tracking. Run the actor hourly and dump the summary's response_time_stats into a spreadsheet or database. Plot p95 and p99 over time to catch performance regressions before they turn into timeouts.
  • Multi-region health checks. Schedule runs from different Apify datacenters to check if your CDN or geo-routed endpoints are reachable from key regions.
  • Pre-launch checklist item. Include a health monitor run in your go-live checklist. One command checks every public endpoint and confirms all certs are valid before you announce.