This is a multi-part question. I am looking to make a request and print the result in excel, with the headers at the top all across and the content data in the row below. When I run the following code, I only get the headers printed vertically and no data is shown. So my questions are: 1. How do I get the data to come in? and 2. How can I transform the output so the headers are horizontal in the excel sheet (along with the data to come underneath)?
import requests
import json
import pandas
import xlwt
r = requests.get("https://testapp.deribit.com/api/v2/public/get_trade_volumes?")
db=[]
resp = json.loads(r.text)
for data in resp['result'][0]:
db.append(data)
for data in resp['result'][1]:
db.append(data)
df1 = pandas.DataFrame(db)
df1.to_excel('C:/Test/daily_volume.xls')
