【发布时间】:2022-01-13 02:01:52
【问题描述】:
我正在尝试使用 Gemini 公共 API 编写程序,但是当我使用请求来获取 JSON 页面时,我得到一个列表而不是带有可搜索密钥对的字典。我在代码中做错了什么/遗漏了什么?我希望能够提取 1 个密钥对,例如 ETHUSD 密钥对。
import requests
raw_prices = requests.get("https://api.gemini.com/v1/pricefeed")
format_prices = raw_prices.json()
print(format_prices)
print(type(format_prices))```
【问题讨论】:
标签: python json python-requests