0

I have used the Twitter standard search API to search tweets and I used:

twurl /1.1/search/tweets.json?q=I%20have%20been%20diagnosed%20with%20depression

in the terminal.

The outcome is a json file. How can I store it in CSV file?

syltruong
  • 2,563
  • 20
  • 33
Shideh Hm
  • 69
  • 1
  • 5
  • Perhaps you can use http://www.convertcsv.com/json-to-csv.htm to convert into csv. But I'am not sure if convertcsv offers a web service you can call programmatically... – baumfreund May 15 '18 at 05:59

1 Answers1

0

If you just want to convert the json file you're getting as an output to a CSV file, you can use "json2csv"

You can use it as a module or directly from the command line, and it'll convert your json file into a csv file with column titles and the proper line endings.

To install globally:

$ npm install -g json2csv

To install as a project dependency:

$ npm install json2csv --save

You can find more information on using it at the npm website: https://www.npmjs.com/package/json2csv

Dalton
  • 25
  • 6