vfddd32fdf
vfddd32fdf

Reputation: 13

Get request API

I use API:

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

Trying to make a Get request:

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

But it returns the entire page.

And I only need the balance value.

Please help me.

Upvotes: 0

Views: 120

Answers (1)

Sebin Sunny
Sebin Sunny

Reputation: 1803

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()

enter image description here

The API link is not wrong. Please check with the blockchain addresss

Upvotes: 1

Related Questions