import requests
url = "https://api.itick.org/indices/klines?region=GB&codes=SPX,DJI&kType=2&limit=5"
headers = {
"accept": "application/json"
"token": "Your Token"
}
response = requests.get(url, headers=headers)
print(response.text)
{
"code": 0,
"msg": null,
"data": {
"DJI": [
{
"tu": 0,
"c": 43006.58,
"t": 1741209540000,
"v": 0,
"h": 43006.6,
"l": 43006.58,
"o": 43006.6
}
],
"SPX": [
{
"tu": 385612920000,
"c": 5842.62,
"t": 1741208580000,
"v": 66000000,
"h": 5842.62,
"l": 5842.62,
"o": 5842.62
}
]
}
}