Exporting your API JSON data in a CSV file via a Google Spreadsheet

Guillaume Viguier-Just
2 min readNov 22, 2017

If you are an API developer working from time to time with data analysts, you might have already received a request along the lines of: “hey, would it be possible to export all of the data exposed in our API as a spreadsheet, so I could run some analysis on it” ?

Depending on how much time you had to work on this request, you could have done:

  1. a quick & dirty database export (which you would have then somehow converted to a csv file)
  2. a proper script to parse the JSON output of your API into a CSV file
  3. modified your API directly to provide a CSV output.

Whether you chose 1, 2 or 3, it’s still a task that takes some time and can be tricky: solution #1 will be hard to automate via a script, solution #2 has the risk of running into the rate limits of your API and solution #3 could run into performance issues when you’re trying to export in a single file the gazillions of records that your API contains. Also, besides #3, none of these solutions will allow your data analyst to export the data into CSV whenever they want, on the click of a button…

This is why I started api2sheet as a small proof-of-concept: it will allow you to parse pretty much any flat JSON output from an API into the google spreadsheet of your choice. Have a look at it and let me know: is it useful for you ? Is it missing something ? Would you like such a prototype to become a real service ?

Originally published at https://www.gvj-web.com on November 22, 2017.

--

--