Skip to content
AlertPing

Guides

How to monitor an API for errors, not just uptime

| Guides | 8 min read

To monitor an API for errors and not just uptime, check three things on every request: the status code, specific fields inside the JSON response body, and the response time. An endpoint can return 200 OK and still be broken: an empty array where there should be orders, a null auth token, an error object wrapped in a success envelope, or a field that quietly changed from a number to a string. A monitor that only asks “did the endpoint answer?” passes all of those. You need it to read the payload.

This matters most for the APIs your product actually depends on, the payments endpoint, the auth service, the search backend, a partner's data feed. When one of those degrades without going fully down, the failure is invisible to status-only monitoring and very visible to your users. Here is how to check the things that catch a real API problem.

The three layers of an API check

Layer Assert on Catches
Status codeExactly 200 (or 201, 204), not just “under 400”Hard failures, 5xx, redirects to a login page
Response bodyA JSON path like $.status == "ok" or $.data[0].id existsEmpty results, error objects with a 200, schema changes, null fields
Response timeUnder a threshold you set, e.g. 800 msDegradation before it becomes a timeout, a slow dependency

Assert on the status code precisely

Start with the code, but be strict. “Any 2xx or 3xx is fine” is too loose, because a 302 redirect to a login page means your auth expired, and a 204 where you expected a body means something is wrong. Assert on the exact code the endpoint should return. If your API uses 200 for success and 401 for an expired key, a check that tolerates “anything under 400” will happily pass a 401 and never tell you the key died.

Read a field inside the JSON body

This is the layer most monitoring skips, and it is where the real value is. Have the monitor parse the response and assert on a JSON path. A few patterns that pay off:

  • A success flag: assert $.status equals "ok", so an error object returned with a 200 status still fails the check.
  • A non-empty collection: assert $.data[0].id exists, so an endpoint that suddenly returns an empty list, a common silent failure after a bad deploy, gets caught.
  • A required field with the right type: assert a token or a price field is present and non-null, so a schema change that drops or renames a field surfaces immediately.

That single body assertion is the difference between finding out about a broken payload from your monitor versus from a user whose order never went through.

Watch response time, not just availability

An API rarely fails all at once. It gets slow first, as a database query degrades or a downstream dependency starts timing out. Set a response-time threshold, say 800 milliseconds, and alert when checks cross it consistently. That gives you a head start: you are looking at the problem while it is still latency, before it becomes a wall of timeouts and a real outage. If you are deciding what promise to make about that endpoint in the first place, what counts as a good API uptime SLA sets out the numbers customers actually accept.

alertping

Catch the 200 that hides a broken payload

Assert on status code, a JSON body field and response time on every check. 30-second intervals, second-region confirmation, SMS included.

Send auth headers and a real request

Most useful endpoints need authentication, so your check has to send the right headers, a bearer token or an API key, and sometimes a specific request body for a POST. Store those on the monitor and hit a real, representative endpoint rather than a bare health-check URL that always returns “ok”. A health check that never touches the database will stay green through a database outage. Check something that exercises the actual path your users rely on. The same reasoning applies to the machine behind the endpoint, which is why a server monitoring tool watching ports and processes pairs well with request-level API checks.

Monitoring an API you do not control

Some of the endpoints your product depends on are not yours: a partner's data feed, a third-party pricing service, a public API you built a feature around. You cannot fix those, but you absolutely want to know the moment they break your integration, because your users will blame you, not the vendor. Point a monitor at the third-party endpoint with the same body and response-time assertions, so a change on their side shows up as your alert. If you are pulling structured data off pages that were never meant to be an API in the first place, a tool that turns any website into clean, structured data gives you a stable endpoint to monitor instead of a brittle scraper that breaks on every layout change.

Put it together

A properly monitored API has, for each critical endpoint: an exact status-code assertion, at least one JSON body assertion on a field that proves the response is real, a response-time threshold, the correct auth headers, and confirmation from more than one region before it pages you. Run that every 30 seconds and route it to SMS. The result is that a broken payload, an expired key or a slow dependency reaches you as an alert with enough detail to act on, long before it reaches your users. The dedicated setup lives on the API monitoring page, and it sits in the same account as your website monitoring, SSL and cron checks.

keep reading

More from the blog

· Comparisons

Dynatrace synthetic monitoring pricing and what HTTP and browser monitors cost per month

8 min read ▸

· Comparisons

CloudWatch Synthetics pricing and what a canary costs per URL, per interval and per Region

8 min read ▸

· Comparisons

OpManager vs WhatsUp Gold pricing for 50 to 1,000 devices, per edition and per add-on

8 min read ▸

· Comparisons

Site24x7 vs PRTG pricing for 50 to 1,000 network devices, with and without add-ons

8 min read ▸

· Comparisons

OpManager pricing 2026 and what ManageEngine OpManager costs per device, per edition and per add-on

9 min read ▸

· Comparisons

Splunk On-Call pricing and cost per user from the published $5 rate to a yearly bill

7 min read ▸

· Comparisons

Rootly pricing and Rootly cost per user for Incident Response and On-Call

7 min read ▸

· Comparisons

FireHydrant pricing and what FireHydrant costs per responder after Freshworks

8 min read ▸

· Comparisons

Zabbix pricing and Zabbix Cloud pricing by tier with the real Zabbix cost per year

8 min read ▸

· Comparisons

Checkmk pricing 2026 and Checkmk cost per host for Pro, Ultimate and Cloud

8 min read ▸

· Comparisons

Nagios XI pricing and Nagios license cost per node, renewal included

8 min read ▸

· Comparisons

incident.io pricing and incident.io cost per user for response and on-call seats

8 min read ▸

· Comparisons

Datadog On-Call pricing vs PagerDuty cost per seat for 4 to 30 person rotations

8 min read ▸

· Comparisons

Datadog On-Call pricing and what a paging seat costs next to PagerDuty and Splunk On-Call

7 min read ▸

· Comparisons

LogicMonitor vs PRTG pricing for a 100 device network, per device against per sensor

7 min read ▸

· Comparisons

SolarWinds alternatives and competitors priced on one estate, from PRTG and LogicMonitor to Datadog

8 min read ▸

· Comparisons

LogicMonitor competitors and alternatives with Datadog, Dynatrace, New Relic, SolarWinds and PRTG priced on one estate

8 min read ▸

· Comparisons

SolarWinds pricing 2026 and how much SolarWinds costs per node, per module and per year

8 min read ▸

· Comparisons

LogicMonitor pricing 2026 and how much LogicMonitor costs per Hybrid Unit, per package and per year

8 min read ▸

· Comparisons

WhatsUp Gold pricing 2026 and how much WhatsUp Gold costs per device, per edition and per year

8 min read ▸

· Comparisons

Cronitor pricing 2026 and how much Cronitor costs per monitor, per user and per year

8 min read ▸

· Comparisons

Hyperping pricing 2026 and how much Hyperping costs per plan, per seat and per monitor

8 min read ▸

· Comparisons

Uptime.com pricing 2026 and how much Uptime.com costs per tier, per check and per year

8 min read ▸

· Comparisons

StatusCake pricing 2026 and how much StatusCake costs per plan, per monitor and per year

8 min read ▸

· Comparisons

PRTG pricing 2026 and what PRTG Network Monitor costs per sensor, per device and hosted

9 min read ▸

· Comparisons

New Relic Synthetics pricing 2026 and what synthetic checks cost per check, per edition and per month

9 min read ▸

· Comparisons

Sentry pricing 2026 and what Sentry costs per plan, per event and per monitor

9 min read ▸

· Comparisons

Checkly pricing 2026 and how much Checkly costs per check run, module by module

9 min read ▸

· Comparisons

Grafana Cloud pricing 2026 and how much Grafana Cloud costs, meter by meter

10 min read ▸

· Comparisons

Statuspage pricing and Atlassian Statuspage costs per subscriber for public and private pages

9 min read ▸

· Comparisons

Opsgenie pricing 2026 and how much Opsgenie costs, plus what you pay to replace it

8 min read ▸

· Comparisons

PagerDuty pricing 2026 and how much PagerDuty costs per user, per plan and per year

8 min read ▸

· Comparisons

Pingdom pricing 2026 and how much Pingdom costs per check, per plan and per year

8 min read ▸

· Comparisons

Uptime monitoring software to pair with Datadog, New Relic or Dynatrace

8 min read ▸

· Comparisons

How much does Splunk Observability Cloud cost? Hosts, editions and synthetic monitoring

8 min read ▸

· Comparisons

AppDynamics pricing 2026 and how much AppDynamics costs, from license cost per vCPU to synthetics

8 min read ▸

· Comparisons

Dynatrace pricing 2026 and how much Dynatrace costs for hosts, synthetic monitoring and log ingest

8 min read ▸

· Comparisons

How much does New Relic cost? Users, data ingest and synthetic checks

9 min read ▸

· Comparisons

Datadog synthetic monitoring pricing and what synthetics really cost per test run

9 min read ▸

· Guides

Uptime guarantee vs uptime monitoring and why your host reports 99.9% when your site was down

9 min read ▸

· Guides

Cloudflare uptime monitoring with health checks, origin monitoring and the blind spots behind the proxy

11 min read ▸

· Comparisons

Status page pricing and what a hosted status page actually costs in 2026

8 min read ▸

· Guides

API monitoring best practices on what to check, how often and how to keep alerts worth answering

10 min read ▸

· Guides

SSL certificate 200 days as the new validity limit and the 47-day lifetime coming next

9 min read ▸

· Guides

SSL certificate expired? What happens and how to fix it

8 min read ▸

· Guides

How often should you check website uptime?

7 min read ▸

· SLAs

Error budget formula, burn rate alerts and the policy that makes it work

11 min read ▸

· Playbooks

Runbook template for incident response that gets used

8 min read ▸

· Guides

What causes website downtime, and how to catch each cause

8 min read ▸

· Playbooks

Incident postmortem template that teams actually use

8 min read ▸

· Playbooks

On-call rotation best practices that keep engineers sane

8 min read ▸

· SLAs

MTTR (mean time to recovery) explained and how to cut it

7 min read ▸

· Guides

Heartbeat monitoring explained and how it works

7 min read ▸

· Guides

Status page examples and what the good ones get right

7 min read ▸

· Guides

API uptime SLA service credit tiers, downtime limits and what a good one costs

8 min read ▸

· Guides

How to create a status page in 6 steps

7 min read ▸

· Guides

Uptime SLA report and what to include, with a worked example

9 min read ▸

· Guides

SLA service credits and how to claim what you get back

8 min read ▸

· Guides

Synthetic monitoring vs uptime monitoring with what each one costs and when you need it

8 min read ▸

· Guides

What is a status page?

6 min read ▸

· Guides

Status page vs uptime monitoring and what the difference is

6 min read ▸

· Guides

What does 99.9% uptime mean?

6 min read ▸

· Guides

What is five nines (99.999%) uptime?

8 min read ▸

· Guides

How to calculate uptime percentage

7 min read ▸

· Guides

SLA vs SLO vs SLI and what the difference is

7 min read ▸

· Guides

Downtime alerts and how to get notified by email, SMS or phone when your website goes down

7 min read ▸

· Guides

How to monitor an online store for downtime

9 min read ▸

· Guides

Why is my Shopify store unavailable?

8 min read ▸

· Comparisons

Better Stack pricing and how much Better Stack costs

8 min read ▸

· Comparisons

UptimeRobot pricing and how much UptimeRobot costs

7 min read ▸

· Comparisons

Site24x7 pricing and how much Site24x7 costs

8 min read ▸

· Guides

What is a dead man's switch in monitoring?

9 min read ▸

· Guides

Why is my WordPress site down?

9 min read ▸

· Guides

How to monitor WooCommerce uptime and checkout

8 min read ▸

· Economics

How much does website downtime cost?

8 min read ▸

· Guides

How to monitor a cron job

9 min read ▸

· Comparisons

Synthetic monitoring vs real user monitoring

8 min read ▸

· Benchmarks

What is a good uptime percentage?

7 min read ▸

· SLAs

99.99 uptime meaning for SLAs and the real cost of each nine

8 min read ▸

· Guides

How to monitor website uptime

8 min read ▸

· Playbooks

Incident communication examples, templates and outage communication best practices

9 min read ▸

Know the second your site goes down

Checks every 30 seconds, confirmed from a second region, alerts on every channel.

See pricing