PerfLoad / API load testing
API Load Testing Without Writing a Test Script
Most API load tests start with a chore: write a script, wire up headers and a payload, then work out how to read the output. PerfLoad starts from the request you already have. Point it at a REST or HTTP endpoint, set how many concurrent users you want, and it reports latency, throughput, and error rate.
Load Test Your API →Runs in Docker on your machine or in your own environment — installation guide.
How it works
- Describe the request. Paste a curl command (Chrome DevTools and Postman can both export one), or fill in the Dashboard's quick form: method, target URL, headers, and a JSON body.
- Send it once. Run Single fires one request through the runner and shows the full response, so you know the request is valid before you generate load.
- Add concurrency. Set virtual users, duration, and the pause between requests. Ramp-up is available in the Workbench.
- Run and read. The runner executes the test with k6 and you watch latency and success counts live, then keep the run in history.
What you can configure
| You want to test | In PerfLoad |
|---|---|
| GET, POST, and other methods | The method comes from your curl command, or from the Dashboard's method picker. |
| Custom headers | Any header you put in the curl command, or JSON headers in the Dashboard form. |
| Authentication | Send an Authorization header yourself, or use the Workbench's Bearer and Basic auth fields. The runner API also accepts a client certificate and key for mTLS. |
| JSON request bodies | Paste the body as part of the curl command, or attach a JSON body in the Dashboard. |
| Realistic, varying data | ${variable} placeholders in the URL, headers, or body, resolved per virtual user and per iteration. |
| Correct responses, not just fast ones | Response validation by content type, using a JSON path, XPath, or text expression. |
A varying-payload example
Hitting one cart item a thousand times tells you about one cache entry. This request uses a variable so each call adds a different product:
curl -X POST 'https://api.example.com/cart' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"productId": "${productId}", "qty": 1}'
Define productId as a Sequential variable (101, 102, 103) and
each request takes the next value, looping back to the start. Use a Random variable when order shouldn't
matter, or the built-ins (${user}, ${iteration}, ${random}) when you just
need something unique per request.
Reading the results
- Latency: look at p95 and p99, not just the average. An average of 120 ms can hide a slow tail that real users feel; the percentiles show it. The live chart shows latency across the run.
- Throughput: requests per second the API sustained at that many concurrent users. If it plateaus while latency climbs, you've found a limit.
- Error rate: success and failure counts. Each response is checked for a 2xx status and, if you've set one, your validation expression. A fast API returning the wrong thing isn't a pass.
The same test through the runner API
Everything the UI does goes through the runner's REST API, which is what makes tests scriptable. A run is a single JSON document:
curl -X POST http://localhost:3000/runs \
-H 'Content-Type: application/json' \
-d '{
"url": "https://api.example.com/cart",
"method": "POST",
"headers": { "Authorization": "Bearer YOUR_TOKEN" },
"body": { "productId": "${productId}", "qty": 1 },
"users": 10,
"duration": "30s",
"pause": 1,
"variables": {
"productId": { "type": "sequential", "values": ["101", "102", "103"] }
}
}'
The response includes the run's id, which you can poll for status and summary. When you want that
on every deploy, see CI/CD load testing.
When this approach fits
It suits teams that need answers about HTTP endpoints without a scripting detour: QA and QE engineers who would rather not maintain a test codebase, developers checking a new endpoint, and DevOps engineers who want the same test to run from a pipeline. It targets HTTP request tests, so protocols like gRPC or WebSockets aren't what it's for, and elaborate scripted flows are better served by k6 itself — see how the two compare.
FAQ
Do I need an OpenAPI spec or a Postman collection?
No. PerfLoad starts from a curl command or a form. If your request lives in Postman or the browser's network tab, copy it out as curl and paste it in.
Can I load test a GraphQL API?
GraphQL over HTTP is a POST with a JSON body, so it's the same workflow as any other JSON request.
Is it safe to point this at production?
That's your call, but start small: a few users for a short time, confirm the request with Run Single, and increase gradually. Load tests generate real traffic against whatever you point them at.
Related guides
Find out what your API does under concurrency
Start from the request you already have.
Load Test Your API →