【问题标题】:Get request API获取请求接口
【发布时间】:2019-11-12 06:05:15
【问题描述】:

我使用 API:

https://www.blockchain.com/api/q

尝试发出 Get 请求:

url = 'https://www.blockchain.info/api/q/getreceivedbyaddress/' + strpod + '?confirmations=6'
zapros = requests.get(url)

但它会返回整个页面。

而我只需要余额值。

请帮帮我。

【问题讨论】:

    标签: python get request python-requests


    【解决方案1】:

    import requests 
    address = "17LREmmnmTxCoFZ59wfhg4S639GsPqjTRT"
    URL = "https://blockchain.info/q/getreceivedbyaddress/"+address+"?confirmations=6"
    r = requests.get(url = URL) 
      
    # extracting balance ((in satoshi))
    bt_balance = r.json()

    API 链接没有错。请检查区块链地址

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-12-04
    • 2012-08-10
    • 1970-01-01
    • 1970-01-01
    • 2019-07-20
    • 1970-01-01
    • 2019-08-10
    • 2018-01-09
    相关资源
    最近更新 更多