Following is my json file input
{\"userID\": \"679d3bad-155e-4b39-9ff7-7d564f408942\", \"Is salary credited before 5th\": \"Yes\", \"Avg Salary of last 3 mon
GeekSambhu's solution worked for me with a minor modification. I modified it a little because like Vinsent, I saw a KeyError. People may be getting the KeyError if the JSON structure has a top level object holding the array of the rows of data (this is considered a JSON best practice). Assuming a top level object called 'data', you would change only two lines of code of GeekSambhu's solution.
writer.writerow(_json['data'][0].keys()) # header row
for row in _json['data']: