https://docs.kraken.com/rest/#operation/...nformation
It must be a POST Request and the data must be sent as url-form encoded and the use of the
param
-Keyword does the proper thing. You must concatenate the Symbols with commas. The
str.join
method does this. The response is json. The response object has the method
json
to get the answer back as a python dict.
import requests
api_version = 0
method = "Ticker"
url = f"https://api.kraken.com/{api_version}/public/{method}"
symbols = ",".join(["ADAUSD", "DOGEUSD", "LTCUSD"])
response = requests.post(url, params={"pair": symbols})
result = response.json().get("result", {})
for symbol, payload in result.items():
print(symbol, payload.get("o", "MISSING"))
I've no clue what the data means. You've to look in the docs to understand the different keys from the payload.
Each symbol has different keys where each key has a list of values. One value of them is not a list.
You can investigate the data, which is saved in
result
.