I've been trying to get the extract a JSON requests API result into a csv but I'm struggeling,
so far the below code return the value in the terminal
import requests
import csv
import json
from pprint import pprint
import urllib
import pandas as pd
url = "https://esi.evetech.net/latest/markets/10000002/orders/?datasource=tranquility&order_type=all&page=1"
payload={}
headers = {}
r = {}
response = urllib.request.urlopen(url)
text = response.read()
json_data = json.loads(text)
pprint(json_data)
df = pd.read_json(r)
df.to_csv("output.csv")
however Pandas return me with an error in regards of the Dictionary class? ( apologize I'm not really familiar when it come to coding )
Last question would be, what would be the logic to continue the url request beyond page=1 in the url variable? (order_type=all&page=1 ) I don't know how many page the system have
thanks
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…