Script your API test results with JSON output and jq
JUnit XML is for CI test views. HTML is for humans. When you want to do something with test results (post the slowest endpoints to a dashboard, fail on a specific test, diff two runs), you want JSON. The Requestarium CLI writes a JSON report with a versioned schema, and jq turns it into whatever you need.
Get a report
requestarium run-collection "Users API" --env Staging --out report.json--out keeps the readable summary in the terminal and writes the JSON to a file. --json prints it to stdout instead, for piping.
The shape
{
"schemaVersion": 1,
"kind": "collection",
"generatedAt": "2026-11-22T09:14:03Z",
"target": "Users API",
"environment": "Staging",
"total": 24, "passed": 22, "failed": 1, "errors": 1,
"tests": { "passed": 51, "failed": 2 },
"durationMs": 4210,
"results": [
{
"path": "Users API/Auth/Login",
"status": "passed",
"method": "POST",
"url": "https://staging.example.com/login",
"statusCode": 200,
"durationMs": 112,
"tests": [{ "name": "logged in", "passed": true }],
"missingVariables": [],
"iteration": 1
}
]
}status is passed, failed (a test failed, or no tests and status 400 or more) or error (couldn't be sent: bad URL, timeout, unresolved variable, script error).
Recipes
Every failure, one per line:
jq -r '.results[] | select(.status != "passed") | "\(.path): \(.error.message // .statusCode)"' report.jsonThe five slowest requests:
jq -r '.results | sort_by(-.durationMs) | .[:5][] | "\(.durationMs) ms \(.path)"' report.jsonFailed test names, with the reason:
jq -r '.results[] | .path as $p | .tests[] | select(.passed | not) | "\($p) › \(.name): \(.detail)"' report.jsonRequests that didn't run because a variable was missing:
jq -r '.results[] | select(.missingVariables | length > 0) | "\(.path): \(.missingVariables | join(", "))"' report.jsonPass rate as a number, for a dashboard:
jq '(.passed / .total * 100 | floor)' report.jsonUse it in a pipeline step
Fail a job only when a specific folder breaks, while the rest of the collection may be flaky:
requestarium run-collection "Checkout API" --env Staging --out report.json || true
jq -e '[.results[] | select(.path | startswith("Checkout API/Payments/")) | select(.status != "passed")] | length == 0' report.jsonjq -e exits non-zero when the expression is false, so the step fails exactly when a Payments request failed.
What's masked, and what isn't
URLs and headers in the report have secret environment values, --env-var and --env-file values, and Authorization, Cookie and API key headers masked. Response bodies are included as received. If a response contains personal data, be careful where you upload the report.