REST API Benchmarking

Measure and compare API endpoint performance

Get precise latency percentiles (p50, p95, p99) for every REST endpoint. Compare performance across deployments, identify slow queries, and establish SLA baselines.

What you get

  • Percentile-based latency metrics (p50, p95, p99)
  • Endpoint-by-endpoint comparison
  • Throughput measurement (requests/second)
  • Error rate tracking
  • Custom thresholds and SLA validation
  • Historical comparison across test runs
benchmark.js
import http from 'k6/http';
import { check } from 'k6';
import { Trend } from 'k6/metrics';

const getUsers = new Trend('get_users_duration');
const getOrders = new Trend('get_orders_duration');

export const options = {
  vus: 100,
  duration: '5m',
  thresholds: {
    get_users_duration: ['p(95)<300'],
    get_orders_duration: ['p(95)<500'],
  },
};

export default function () {
  const users = http.get('https://api.example.com/users');
  getUsers.add(users.timings.duration);

  const orders = http.get('https://api.example.com/orders');
  getOrders.add(orders.timings.duration);
}

Frequently Asked Questions

What metrics does the benchmark provide?

Response time percentiles (p50, p95, p99), throughput (requests/second), data transfer rates, and error rates. You can also define custom metrics for business-specific measurements.

Can I set pass/fail thresholds?

Yes. k6 thresholds let you define SLAs like "95th percentile must be under 300ms". Tests automatically fail if thresholds are breached, making it easy to integrate with CI/CD.

Ready to start rest api benchmarking?

Sign up free — no credit card required. Get 200 VUs and 5 minute tests instantly.

loadtest.dev

© 2026 loadtest.dev