import requests
import json
URL = "https://wildboar.space:8001/api/defi_index"
response = requests.get(URL, timeout=5, verify=False)
if response.status_code == 200:
data = response.json()
print(json.dumps(data, indent=4, ensure_ascii=False))
else:
print("Error:", response.status_code, response.text)
[
{
"time": "2020-08-28",
"open": 1012.0,
"high": 1189.0,
"low": 964.1,
"close": 1018.8
},
{
"time": "2020-08-29",
"open": 1017.5,
"high": 1096.5,
"low": 1015.0,
"close": 1056.0
},
...
]