我有這個API回應,我想獲取一些值并將它們存盤為python BOT的變數,例如'floor_price'(我想要它后面的整數)但是由于某種原因,它不起作用它一直給我錯誤但是當我用'stats'嘗試它,它可以作業并提供一切。
API https://api.opensea.io/api/v1/collection/ogcats-harvest-galaxy/stats
url = "https://api.opensea.io/api/v1/collection/ogcats-harvest-galaxy/stats"
headers = {"Accept": "application/json"}
response = requests.request("GET", url)
json_response = response.json()
floor= json_response['floor_price']
請幫助:)
uj5u.com熱心網友回復:
url = "https://api.opensea.io/api/v1/collection/ogcats-harvest-galaxy/stats"
headers = {"Accept": "application/json"}
response = requests.request("GET", url)
json_response = response.json()
floor= json_response['stats']['floor_price']
學分:@kindall
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/412339.html
標籤:
