简体   繁体   English

"CoinGeckoAPI - 格式输出 - Python"

[英]CoinGeckoAPI - Format Output - Python

Hi guys i'm working with the Coingecko API to get values from the site.大家好,我正在使用 Coingecko API 从网站获取值。

This is the code这是代码

from pycoingecko import CoinGeckoAPI
cg = CoinGeckoAPI()
cg.get_price(ids=['bitcoin'], vs_currencies='brl')

Yep you can access it like that是的,你可以这样访问它

from pycoingecko import CoinGeckoAPI
cg = CoinGeckoAPI()
dict = cg.get_price(ids=['bitcoin'], vs_currencies='brl')
print(dict['bitcoin']['brl'])

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM