Measure and compare API endpoint performance
REST API Benchmarking
Get precise latency percentiles (p50, p95, p99) for every REST endpoint. Compare performance across deployments, identify slow queries, and establish SLA baselines.
Standalone k6 example
Adapt this script and run it with k6 against an approved target. loadtest.dev accepts declarative GET/HEAD plans; it does not execute these scripts.
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
Related guides
API Load Testing
Learn how to test HTTP APIs with standalone k6 scripts, measure latency and failed requests, and choose rates suited to your approved target.
Use an HTTP plan with loadtest.dev
For estate apps, declare GET/HEAD requests to a verified hostname and submit a plan through the authenticated API.