Guides / API monitoring

How to monitor your API endpoints

PingBase does more than check if a URL is reachable — it can verify the response code, check that specific content appears in the response, and track response times. Here's how to use it for API monitoring.

Free plan: 5-min checks Pro plan: 1-min checks

What PingBase checks

Response code

A monitor is considered UP if the response is 2xx. Any other status — 4xx, 5xx, timeout, or connection refused — triggers an alert.

Response content

Optionally check that a specific string appears (or doesn't appear) in the response body. Useful for detecting degraded states that still return 200.

Response time

Every check records response time in milliseconds. View trends in the dashboard to spot slow endpoints before they become outages.

Basic API endpoint monitoring

The simplest setup: monitor a health check endpoint or any API URL that should return 200.

Via dashboard

  1. 1. Click Add Monitor.
  2. 2. Name it something descriptive: e.g. "API Health" or "Payments API".
  3. 3. Enter the full URL: e.g. https://api.yourapp.com/health
  4. 4. Click Save. PingBase starts checking immediately.

Via API

curl -X POST https://pingbase-worker.workers.dev/api/monitors \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Payments API",
    "url": "https://api.yourapp.com/health"
  }'

Content checking — detect degraded states

Some failures return HTTP 200 but with a degraded or error payload. PingBase can check for a keyword in the response body and alert you if it's missing (or present).

Example: health endpoint returns {"status":"ok"}

curl -X POST https://pingbase-worker.workers.dev/api/monitors \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "API Health Check",
    "url": "https://api.yourapp.com/health",
    "keyword": "\"status\":\"ok\"",
    "keyword_type": "contains"
  }'

Alert fires if the response body does NOT contain the keyword — i.e. the endpoint returned 200 but the expected content is absent.

Example: detect error messages in response

curl -X POST https://pingbase-worker.workers.dev/api/monitors \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Homepage",
    "url": "https://yourapp.com",
    "keyword": "Application Error",
    "keyword_type": "not_contains"
  }'

Alert fires if the response body CONTAINS "Application Error" — useful to catch error pages that still return 200.

keyword_type values

  • contains — alert if the keyword is NOT found (default)
  • not_contains — alert if the keyword IS found

What to monitor in your API

🏥

/health or /ping

Your primary liveness check. Every API should have one. Monitor it with a keyword: "ok" check so you catch both downtime and degraded states.

💳

Payment or checkout endpoint

If your payment flow breaks, revenue stops immediately. Monitor your Stripe webhook handler or checkout initiation endpoint so you know within 1 minute.

🔐

Auth endpoint

Monitor your login or token endpoint. An auth outage affects every user immediately but often doesn't trigger internal alerts since the server itself stays up.

📊

Third-party API proxies

If your app calls external APIs (OpenAI, Stripe, Twilio) through a proxy layer, monitor that proxy. Detect third-party outages before your users do.

Response time tracking

Every check records response time. In the dashboard, you can view a response time graph for each monitor showing trends over time. Use it to:

  • Detect slow endpoints before they time out completely
  • Correlate deployment times with performance changes
  • Spot gradual database degradation (slow queries → slow API)
# Get the last 100 checks for a monitor (includes response_time_ms)
curl https://pingbase-worker.workers.dev/api/monitors/MONITOR_ID/checks \
  -H "Authorization: Bearer YOUR_TOKEN"

# Returns array of:
# {"status": "up", "response_time_ms": 142, "checked_at": 1712345678, ...}

Start monitoring your API

Free plan: 5 monitors, 5-minute checks. Pro: 1-minute checks, Slack/Discord alerts.

Start free →