# Export Test Results to CSV

**URL:** <https://community.postman.com/t/export-test-results-to-csv/1215>\
**Category:** Help Hub\
**Created:** [March 14, 2018, 4:06pm UTC](https://community.postman.com/t/export-test-results-to-csv/1215 "2018-03-14T16:06:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmantripragada](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@rmantripragada](https://community.postman.com/u/rmantripragada)\
**Post date:** [March 14, 2018, 4:06pm UTC](https://community.postman.com/t/export-test-results-to-csv/1215/1 "2018-03-14T16:06:18Z")

</div>

Hi,

I am new to Postman and API testing world. I was able to create some basic tests and my team is looking for how long each api takes to respond. They want me to export the results to csv file so they can sort it by the response time to see which ones are taking the longest to respond. How can I easily fulfill that requirement using Postman? Question 1: Is there any way to automatically write the test results at the end of the test run to a csv file using Javascript in the Collection Test?  
Question 2: We are planning to integrate the tests with the builds. That means when somebody pushes a build, these tests will be run first using Newman. Not sure if the test results (in JSon format) will be automatically saved somewhere. If so can we do the conversion Json to CSV using New man after the test?  
Following information is needed in the csv file - Test name, request URL, pass/fail with the response time.

I greatly appreciate your help.  
Thanks,  
MJP

---

<div class="post-metadata">

**Author:** ![kunagpal](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kunagpal/32/9_2.png) [@kunagpal](https://community.postman.com/u/kunagpal)\
**Post date:** [July 5, 2018, 8:26pm UTC](https://community.postman.com/t/export-test-results-to-csv/1215/2 "2018-07-05T20:26:06Z")

</div>

@rmantripragada While there is no inbuilt export to CSV option, what you’ve described can be accomplished using [Newman](https://github.com/postmanlabs/newman) as a library: [https://github.com/postmanlabs/newman#newmanrunevents](https://github.com/postmanlabs/newman#newmanrunevents)

The idea here is that Newman provides an event emitter interface, which allows users to write highly complex handlers to account for virtually any use case. In this case, you can use the `test` event (see the links above for more context), which will let you handle test data in real time as the collection runs.

---

<div class="post-metadata">

**Author:** ![Nguyen\_Quoc\_Dung](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/nguyen_quoc_dung/32/805_2.png) [@Nguyen\_Quoc\_Dung](https://community.postman.com/u/Nguyen_Quoc_Dung)\
**Post date:** [August 3, 2018, 10:55am UTC](https://community.postman.com/t/export-test-results-to-csv/1215/3 "2018-08-03T10:55:41Z")

</div>

Thanks @kunagpal ,  
It’s help me a lot. Right now, I can export results with some types such as HTML, XML. I also can customer HTML template to render as format I want. Here are some notes of mine:

**+ Syntax:**  
newman run [FileNameJSon] -e [Environment] --reporters cli,[Support\_Type] --reporter-[Support\_Type]-export [Output\_File].[Support\_Type]  
**Example:**  
newman run 1\_Automated\_APIs.postman\_collection.json -e SIT.postman\_environment.json --reporters cli,html --reporter-html–export outputfileHTML.xml  
**+ Customize template HTML**  
newman run [FileNameJSon] -e [Environment] --reporters cli,html --reporter-html-template template-default.hbs --reporter-html-export [Output\_File].html  
**Example:**  
newman run 1\_Automated\_APIs.postman\_collection.json -e SIT.postman\_environment.json --reporters cli,html --reporter-html-template template-default.hbs --reporter-html-export outputfilehtml1.html

Note: You can download **template-default.hbs** by the following path https://github.com/postmanlabs/newman/tree/develop/lib/reporters/html

---

<div class="post-metadata">

**Author:** ![matt](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/matt/32/2562_2.png) [@matt](https://community.postman.com/u/matt)\
**Post date:** [January 23, 2019, 7:16pm UTC](https://community.postman.com/t/export-test-results-to-csv/1215/4 "2019-01-23T19:16:16Z")

</div>

A little late to the party but you can try out the `newman-reporter-csv` package:

> **[newman-reporter-csv](https://www.npmjs.com/package/newman-reporter-csv)**
>
> A CSV reporter for Newman.. Latest version: 1.3.0, last published: a year ago. Start using newman-reporter-csv in your project by running \`npm i newman-reporter-csv\`. There are 3 other projects in the npm registry using newman-reporter-csv.

---

<div class="post-metadata">

**Author:** ![lokesh.vamsi](https://avatars.discourse-cdn.com/v4/letter/l/e480ec/32.png) [@lokesh.vamsi](https://community.postman.com/u/lokesh.vamsi)\
**Post date:** [October 25, 2019, 4:50pm UTC](https://community.postman.com/t/export-test-results-to-csv/1215/5 "2019-10-25T16:50:44Z")

</div>

I mean

Question 1:  
My GET API is fetching data in to POSTMAN in JSON format.Can I download that fetched data through a CSV file?

Question 2: The GET API fetches a maximum of 150k records from a table.Is there a way that I can increase this?

Apologies for the confusion.

Please let me know if you want to discuss more on this.

Thanks,  
Lokesh.

---

<div class="post-metadata">

**Author:** ![vdespa](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/vdespa/32/2770_2.png) [@vdespa](https://community.postman.com/u/vdespa)\
**Post date:** [October 26, 2019, 1:46pm UTC](https://community.postman.com/t/export-test-results-to-csv/1215/6 "2019-10-26T13:46:10Z")

</div>

Your questions are very interesting but hard to answer and you did not give very much context. I would advise that you create two separate questions, in case they don’t directly relate to the question being asked here.

---

<div class="post-metadata">

**Author:** ![lokesh.vamsi](https://avatars.discourse-cdn.com/v4/letter/l/e480ec/32.png) [@lokesh.vamsi](https://community.postman.com/u/lokesh.vamsi)\
**Post date:** [October 28, 2019, 1:42pm UTC](https://community.postman.com/t/export-test-results-to-csv/1215/7 "2019-10-28T13:42:09Z")

</div>

Thank you!

I will give a try and let’s see how it works.
