Writing Results to Google Sheets

Archived topic — this may be out of date.
Newman has been replaced by the Postman CLI, Postman’s official, signed command-line tool. It runs collections as Newman did, and also lints API specs, runs mocks and monitors, and syncs local files with Postman from your terminal, CI/CD pipeline or coding agent.
Working with an AI coding agent? The Postman plugin lets agents in Claude Code, Cursor, Codex and others design, mock, test and ship APIs with Postman.
For current help, see the Postman docs, try the free Postman tools (no account needed), or join us on Discord.

I have a script that gathers data on API response times. In order to report results to the business I’m copying and pasting results from the Newman command line into a Google Sheet. Is there a way I can get my script to write directly to Google Sheets so I don’t have to manually copy and paste?

Thanks.

Hi @david.goldstein!

You sure can! Here’s a link to the Google Sheet API reference page – https://developers.google.com/sheets/api/.

From a workflow perspective, you should be able to store all of the different response times in a variable, and then parse/pass those value(s) into the API call to Google Sheets.

I was hoping for a code sample. Someone must have tried this before and can provide something to work from.

Hey David,

Can you please provide the script that captures API response times? Also were able to resolve the issue with writing in Google sheets?

Thanks
Satej C Mirpagar

@SatejMirpagar Doesn’t this line of code in the Tests script of each request, help you?

console.log(`${responseTime}ms`);

Thanks @singhsivcan, I need to redirect to a file to measure API response time.