Monitoring Third-Party APIs: Know When Your Dependencies Fail

Your app is only as reliable as the APIs it depends on. Here's how to monitor external services and respond when they go down.

Published: March 20, 2026 • Reading time: 10 minutes

Modern applications depend on external APIs for everything: payments (Stripe), email (SendGrid), maps (Google Maps), authentication (Auth0), and dozens of other services. When these APIs fail, your application fails — even if your code is perfect.

Here's how to monitor third-party APIs so you know when they're the problem, not you.

Why Monitor Third-Party APIs?

Without external API monitoring, you're flying blind:

The uncomfortable truth: If your app depends on Stripe and Stripe is down, your users can't pay. That's still your problem, even if it's Stripe's fault.

What to Monitor for Each API

Core Metrics

Metric What It Tells You
Availability Is the API responding at all?
Response Time Is it slower than usual?
Error Rate Are requests failing (4xx, 5xx)?
Rate Limit Headers Are you approaching limits?

API-Specific Monitoring

Monitoring Strategies

1. Synthetic Checks

Make periodic test requests to critical APIs:

# Example: Check Stripe health
curl -s -o /dev/null -w "%{http_code}" \
  https://api.stripe.com/v1/charges \
  -H "Authorization: Bearer sk_test_xxx"

# Expected: 200 (or 401 if unauthorized, which means API is up)
# Alert if: timeout, 5xx, or unexpected response

2. Real Traffic Monitoring

Track actual requests and responses in your application:

// Log API calls with timing
const startTime = Date.now();
try {
  const result = await stripe.charges.create({...});
  logApiCall('stripe', 'charges.create', Date.now() - startTime, 'success');
} catch (error) {
  logApiCall('stripe', 'charges.create', Date.now() - startTime, 'error', error.code);
  throw error;
}

3. Webhook Monitoring

For APIs that send webhooks, verify they're arriving:

// Track webhook receipt
app.post('/webhooks/stripe', (req, res) => {
  const received = Date.now();
  const sent = req.body.created * 1000;
  const delay = received - sent;

  metrics.gauge('webhook.stripe.delay_ms', delay);
  metrics.increment('webhook.stripe.received');

  // Alert if delay > 5 minutes (webhooks backed up)
});

4. Status Page Monitoring

Monitor the vendor's status page for announcements:

Pro tip: Many status pages have RSS feeds or webhooks. Subscribe to get automatic notifications when vendors report issues.

Setting Up Alerts

What to Alert On

Alert Thresholds

# Example alerting rules
stripe_api:
  availability:
    warning: < 99% over 5 minutes
    critical: < 95% over 5 minutes
  latency_p99:
    warning: > 2000ms over 5 minutes
    critical: > 5000ms over 5 minutes
  error_rate:
    warning: > 1% over 5 minutes
    critical: > 5% over 5 minutes

Responding to Third-Party Outages

Immediate Response

  1. Verify it's them, not you: Check their status page, Twitter, DownDetector
  2. Check scope: Is it all requests or specific endpoints?
  3. Implement fallback: Switch to backup provider or cached data
  4. Communicate: Update your status page, notify users

Mitigation Strategies

Circuit Breaker Example

const circuitBreaker = {
  failures: 0,
  lastFailure: null,
  state: 'closed', // closed, open, half-open

  async call(apiCall) {
    if (this.state === 'open') {
      if (Date.now() - this.lastFailure > 30000) {
        this.state = 'half-open'; // Try again
      } else {
        throw new Error('Circuit breaker open');
      }
    }

    try {
      const result = await apiCall();
      this.failures = 0;
      this.state = 'closed';
      return result;
    } catch (error) {
      this.failures++;
      this.lastFailure = Date.now();
      if (this.failures >= 5) {
        this.state = 'open';
      }
      throw error;
    }
  }
};

Monitoring Your Critical Dependencies

Identify Critical APIs

Which APIs would cause user-facing issues if they went down?

Monitoring Checklist

Monitor Your External Dependencies

OpsPulse can monitor any HTTP endpoint, including third-party APIs. Know when your dependencies fail before your users tell you.

Start Free Monitoring →

Common Mistakes

Summary

Monitoring third-party APIs:

  1. Monitor availability and latency — Synthetic checks + real traffic
  2. Subscribe to status pages — Early warning from vendors
  3. Set up meaningful alerts — Sustained issues, not transient failures
  4. Have a fallback plan — Circuit breakers, failover, graceful degradation
  5. Track everything — You need data when diagnosing issues

Your application's reliability includes your dependencies. Monitor them like they're part of your system — because they are.

Related Resources