SwaggerPulse journal
What Is a Good Response Time for API Endpoints?
Key takeaways
- Judge API response time by percentile, not average, because the mean hides the slow tail users actually feel.
- Set targets per endpoint type: reads under 300ms at p95, writes under 800ms, auth slower because password hashing is deliberately expensive.
- Measure server-side against benchmarks but alert on the client-side number, since that is what your users' timeouts hit.
- A p95 needs a few hundred samples before it stabilises, so rarely-hit endpoints need longer monitoring windows.
- Once p99 crosses a consumer's timeout, slow becomes failed, and retries can multiply load during an incident.
A good response time for api endpoints is roughly 200ms at p95 for reads and writes, 300ms for auth, and whatever your third-party dependency allows, plus its overhead. Averages hide your worst requests, so percentiles are the real benchmark. This guide sets numbers per endpoint type and shows how to measure them where users actually feel them.
What is a good response time for an API?
Sub-100ms is excellent, 100-500ms is good, 500ms-1s is acceptable, and anything over 1s deserves investigation. Those bands map to how humans perceive latency: interactions under 100ms feel instant, and delays past 1s break the user's flow, per the thresholds documented in web.dev's guidance on latency and performance. But a single flat number is the wrong frame. A POST that triggers email sending has no business hitting the same target as a cached GET on a lookup table, and a third-party webhook relay will always be slower than your own reads. Judge each endpoint against its type, then measure at p95 rather than the mean, because the mean hides the slow tail your users actually feel. If your OpenAPI spec already lists every path, you can tag each one with its expected band and check it at SwaggerPulse.
What is the ideal response time for a REST API?
REST itself doesn't set a number; the operation does. A single GET on a small resource can reasonably sit under 200 ms at p95, while a paginated list returning 100 records might justifiably take 300-500 ms. A POST that writes to a database and enqueues a job will run slower than the read it sits next to, and that's fine.
Payload size is the other variable nobody budgets for. A paths object entry returning a 2 KB JSON body and one returning a 200 KB body have very different ceilings on the same hardware, so benchmark them separately rather than as "the API".
The practical move for a spec-literate team: tag each operation in your Swagger JSON by type (read, write, auth, third-party call), then judge each tag against its own target instead of one flat threshold. That's what the next section breaks down.
What is the typical API response time for different endpoint types?
There is no single "good response time for api" number. A token issuance endpoint doing a bcrypt check and a paginated list endpoint scanning an index have different floors. Targets below are illustrative p50/p95 figures for a small public API, not guarantees.
| Endpoint type | p50 target | p95 target | Why |
|---|---|---|---|
| Auth / token issuance | < 300 ms | < 800 ms | Password hashing is deliberately slow |
| Simple read (single resource) | < 100 ms | < 300 ms | One indexed query |
| List with pagination | < 200 ms | < 600 ms | Page size multiplies query cost |
| Write (POST/PUT) | < 250 ms | < 800 ms | Validation plus transaction commit |
| Proxied third-party call | < 500 ms | < 2 s | You inherit someone else's latency |
Auth and token endpoints
Hashing dominates here. If your p95 creeps past a second, check bcrypt cost factor before blaming the network. These endpoints are also the ones attackers probe, so rate limiting adds its own tail.
Reads, lists, and writes
Reads are where a regression is most visible. A list endpoint that was fast at 100 rows falls over at 10,000; benchmark with realistic page sizes. Writes can legitimately be slower if you return after commit rather than fire-and-forget.
Endpoints that proxy third-party calls
Your p95 is the sum of their p95 plus yours. Set a client timeout below your own SLO so a slow upstream fails fast instead of holding a connection open. You can measure the split yourself with curl's -w variables: time_starttransfer captures time to first byte while time_total captures the full exchange (curl documentation).
How do you measure API response time correctly (and why averages mislead)?
Percentiles vs averages, with a worked example
A mean hides tail latency, and tail latency is what users actually hit. Suppose 100 requests to a read endpoint return in 50 ms each, and 4 requests hit a cold cache and return in 2,000 ms. Your average is 128 ms, which looks healthy. But p95 is 2,000 ms, meaning 1 in 20 calls is slow, and if that endpoint is in a page-load path, 1 in 20 page loads stalls. p50 tells you the typical experience, p95 tells you the experience of the slowest 5% of calls, and p99 tells you the worst 1%. Track all three separately; if p99 is 10x p50, you have a tail problem no average will ever surface.
Sample size matters too. A p95 from 10 data points is just the second-slowest request, so it swings wildly. You want at least a few hundred samples in the measurement window before you trust a p95, which is why percentile data is usually bucketed per hour or per day rather than per minute.
Tools: curl, load testers, and monitors
For a single endpoint, curl's -w flag with %{time_total}, %{time_starttransfer}, and %{time_connect} breaks total time into connect, TTFB, and transfer. For load, a tool like k6 or Vegeta generates enough requests to make a p95 meaningful. For continuous tracking, uptime monitors need to record response time per check and expose percentiles, not just a daily average. SwaggerPulse runs endpoint checks driven by your OpenAPI spec and tracks response time per path, so a slow write endpoint doesn't get averaged away by fast reads. One honest gap: check frequency caps how many samples you accumulate, so on the Free tier's 10 monitors a rarely-hit endpoint may need days before its p95 stabilises.
Where should you measure response time: client, gateway, or server?
The same endpoint produces three different numbers depending on where you measure, and your benchmark only makes sense once you know which one you're looking at.
Client-side measurement captures DNS, TLS handshake, connection setup, and network transit on top of your server's work. A UK client hitting an API hosted in us-east-1 can add 80-100ms of round-trip latency before your code runs a single line, so a "slow" reading may be geography, not your handler.
Gateway or CDN measurement (Cloudflare, nginx, an ALB) strips out the client's network but still includes proxy overhead and TLS termination. Nginx's default proxy_read_timeout is 60 seconds, per the nginx documentation, which matters because a gateway will happily wait far longer than any browser or SDK would.
Application server measurement, from your middleware or APM, isolates your actual processing time. It's the right number for catching regressions in your code, but it will always look better than what users experience.
Practical rule: benchmark server-side numbers against endpoint-type targets, but alert on the client-side number, since that's what your users' timeouts actually hit.
How does API response time affect user experience and timeouts?
Latency bands map roughly to perception: under 100ms feels instant, 100-300ms feels fast, 300ms-1s is noticeable, and past 1s users start watching a spinner. The hard limits matter more than perception, though. A read endpoint with p50 of 120ms but p99 of 9s is a failure for every caller whose timeout is shorter than 9s, and most are. Browsers default to around 300s, but gateway and HTTP client timeouts are commonly set at 5-30s, and mobile clients often lower still. Once p99 crosses a consumer's timeout, "slow" becomes "failed": the caller drops the connection, marks your endpoint down, and may retry.
Retries amplify the damage. A 9s response that triggers a retry doubles load precisely when your API is already struggling, and three retries can turn one slow request into four. This is why monitoring p99 against your consumers' timeout values matters more than tracking an average.
How do you set response-time SLOs for your own API?
Start by measuring, not guessing. Run your monitors for a week, then read the p95 per endpoint rather than the average. Your /auth/login path will sit far above your /health path, and an average across both tells you nothing.
Then pick targets per endpoint type: auth under ~500ms, reads under ~300ms, writes under ~800ms, third-party calls whatever the upstream actually delivers today, plus 20% headroom. Those are illustrative starting points; adjust after your first week of data.
Turning benchmarks into per-endpoint alerts
Alert on p95 breach, not single spikes: one slow request is noise, ten in a row is an incident. Wire the alert to email or Telegram so it reaches you, and publish the result on a public status page so users see the same truth you do.
This is where a spec-driven approach pays off. Because your OpenAPI document already enumerates every path, each entry in the paths object becomes a check, and a spec change adds or retires checks automatically. SwaggerPulse works this way, and honest comparison applies: UptimeRobot's free tier (uptimerobot.com), Checkly, Hyperping, Cronitor and Assertible all cover uptime and response-time tracking, and several do browser-level checks SwaggerPulse does not. Check their pricing pages before committing.
Which tools can track response time for a small API estate?
Run every option through the same four criteria: percentile reporting, per-endpoint checks, setup effort, and price transparency.
Self-hosted Uptime Kuma is free and flexible, but you own the host, the memory, and the updates. UptimeRobot covers basic uptime cheaply but stays URL-level rather than spec-level. Checkly adds scripted browser and API checks with code-first config. Hyperping and Cronitor are lean uptime and cron monitors with straightforward pricing. Assertible validates API responses against assertions, which suits contract-style checks.
SwaggerPulse fits one niche: paste your Swagger JSON URL and it generates endpoint checks from the paths object, so every route you maintain gets monitored without hand-entering URLs. Response-time tracking and downtime email alerts come with it, and the Free £0 tier (10 monitors, 100 endpoints) covers a solo estate.
Where it falls short: no PagerDuty or Telegram integrations yet, no p99 breakdown per endpoint, and no self-hosted option. If you need deep status-page CSS customisation or alert routing, Uptime Kuma or Checkly will fit better today.
FAQ
What is a good API response time in ms?
Sub-100ms is excellent, 100-500ms is good, and 500ms-1s is acceptable. Past 1s, investigate. Judge by percentile, not average: a read endpoint at p95 under 300ms and a write under 800ms are reasonable starting targets, while auth endpoints run slower because password hashing is deliberately expensive.
Is 2 seconds a slow API response?
For most endpoints, yes. A 2s p95 on a simple read or write means something is wrong: a cold cache, a missing index, or a slow upstream. The exception is an endpoint proxying a third-party call, where 2s at p95 can be normal because you inherit the upstream's latency. Check the endpoint type before panicking.
What is the API response time on Discord?
Discord's REST and gateway endpoints generally respond well under a second from most regions, but exact figures vary by route, region, and load, and Discord publishes no per-endpoint latency guarantees. If your bot depends on it, measure the calls yourself with curl's timing variables and set client timeouts below your own SLO.
How often should I check API response time?
Every 1-5 minutes is typical for a small estate. The constraint is sample count: a p95 needs a few hundred samples before it stabilises, so a rarely-hit endpoint checked every 5 minutes may need days of data. Check critical paths more often than internal ones, and alert on sustained p95 breaches rather than single spikes.
Does response time include network latency?
It depends where you measure. Client-side timing includes DNS, TLS handshake, and round-trip transit, which can add 80-100ms before your code runs. Gateway measurement strips the client's network but keeps proxy overhead. Server-side measurement isolates your processing time alone. Benchmark server-side against targets, but alert on the client-side number.