Generate CSV Reports with Newman
How to get CSV output from Newman runs with a CSV reporter or a JSON-to-CSV step, what the conversion keeps and drops, and when JSON, JUnit or plain CLI output is the better choice.
Newman, the command-line runner for Postman collections, does not write CSV on its own. To get a spreadsheet-friendly report you either install a community reporter such as newman-reporter-csv or export the built-in JSON report and convert it yourself. Both options turn a nested run summary into flat rows. That makes results easy to sort and filter, but some detail is lost. This review covers what changes in that conversion, where the result stays usable, and when another format is the better fit.
Is a CSV report the right output for your run?
CSV works well when you want to scan many requests at once. You can sort by response time, filter for failed assertions, compare iterations side by side, or hand results to someone who works in a spreadsheet rather than a terminal. The main tradeoff is structure. A Newman run is hierarchical: folders contain requests, requests contain assertions, and each part carries its own metadata. A CSV report has to collapse that hierarchy into rows and columns, so nested detail is either summarized into counts or left out.
Another format is usually the better choice in these cases:
- Quick human checks during development: the default cli reporter is readable as it runs and needs no extra package.
- CI test dashboards: the built-in junit reporter produces XML that most CI systems already parse.
- Full-fidelity archiving or later reprocessing: the built-in json reporter keeps the complete run summary, so you can derive CSV from it whenever needed.
- Sharing with people who just need pass/fail: a short plain-text summary is clearer than a wide spreadsheet.
In short, use CSV as a derived view for analysis and sharing, and keep JSON as the record of truth if you may need details later.
How Newman loads a CSV reporter
Newman's documented convention is that an external reporter named newman-reporter-<name> is selected with -r <name>. Reporter options use the form --reporter-<name>-<option>. Newman must be able to resolve the reporter package from the same install scope. In practice, a globally installed Newman needs a globally installed reporter, and a project-local Newman needs a project-local one. A mismatch here is the most common reason Newman reports that it cannot find a reporter.
npm install -g newman newman-reporter-csv
newman run collection.json -e environment.json -r cli,csv \
--reporter-csv-export reports/run.csv
Listing several reporters, as in cli,csv, keeps the live terminal output and writes the file in the same run. The export option above follows Newman's naming convention and matches how the package is commonly described. The package is community-maintained, though, and its options can change between versions. Check its README for the version you install to confirm the exact option names, including any option for adding response bodies to the output.
What the conversion actually changes
This is a format conversion, not a visual effect. The reporter reads Newman's run summary and writes new text in which each record is a line and fields are separated by commas. Nothing about how the data is displayed is being styled or mirrored. The characters themselves are rewritten into a different layout.
Typically each row represents one executed request in one iteration, with columns for things like the request name, method, URL, status code, response time and assertion results. The exact column set depends on the reporter version and is not confirmed here. Inspect a sample file before building formulas or scripts that depend on specific columns.
Three kinds of information are usually reduced or lost:
- Assertion detail: individual test names and failure messages may be collapsed into counts or a single text field.
- Hierarchy: folder nesting is flattened, so two requests with the same name in different folders can look identical.
- Payloads: request and response bodies are left out unless the reporter is told to include them, and multi-line bodies make the file harder to handle.
Building CSV from the built-in JSON reporter
If you need control over the columns, or would rather not depend on a third-party package, export JSON and convert it with a tool such as jq. In Newman's JSON export, the per-request results sit under run.executions. Each entry holds the item, the response and the assertions. Confirm the field paths against your own export, because the structure can differ across Newman versions.
newman run collection.json -r cli,json --reporter-json-export reports/run.json
jq -r '["request","code","time_ms","failed_assertions"],
(.run.executions[] | [
.item.name,
.response.code,
.response.responseTime,
([.assertions[]? | select(.error)] | length)
]) | @csv' reports/run.json > reports/run.csv
The @csv filter quotes text fields for you. Swapping it for @tsv produces tab-separated output, which is useful when request names or URLs often contain commas. This route also makes the conversion explicit: you choose which fields survive and can version the script alongside the collection.
Will the file stay readable after sharing?
CSV is plain text, so it copies, diffs and emails without special rendering. Problems tend to show up when the file is opened, not when it is moved.
- Quoting: fields containing commas, quotes or line breaks must be quoted. Check a sample with a request name that includes a comma to confirm your reporter handles this.
- Encoding: some spreadsheet applications may misread non-ASCII characters in UTF-8 files that lack a byte-order mark. Test with your actual destination rather than assuming.
- Locale: where the comma is the decimal separator, spreadsheets may expect semicolons as the field delimiter, so a comma-separated file can open as one column.
- Formula injection: a cell beginning with =, +, - or @ may be interpreted as a formula. This matters most if response bodies or user-supplied values end up in the file.
- Sensitive data: URLs, headers and bodies can contain tokens or personal data. Review what is included before sharing a report outside the team.
On accessibility, a properly structured CSV opened in a spreadsheet gives assistive technology real rows and columns to navigate. That is generally easier to follow than an aligned plain-text table. No specific screen reader or spreadsheet combination was tested for this review, so confirm with the tools your readers use. If the audience only needs the outcome, a one-line plain-text summary (requests run, assertions failed, slowest request) is often more usable than a full spreadsheet.
Gaps in this review
No hands-on test results, version numbers or output samples were available. The exact columns and option names of newman-reporter-csv, its quoting and encoding behavior, and how the output renders in particular spreadsheet applications should all be checked against the package documentation and a sample run in your own environment.