blockcypher / blockcypher-python

Python library for the BlockCypher web services

Home Page:https://www.blockcypher.com/dev/bitcoin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clarification; json or not json?

Kryptoid opened this issue · comments

My code is running in error state.

on website, data is returned as json, see example as from https://www.blockcypher.com/dev/?python#address-endpoint:

`
from blockcypher import get_address_full

get_address_full(address='1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD', before_bh=300000)

{
"address": "1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD",
"balance": 4433416,
"final_balance": 4433416,
"final_n_tx": 7,
"n_tx": 7,
"total_received": 4433416,
"total_sent": 0,
"txs": [
{
"addresses": [
"18KXZzuC3xvz6upUMQpsZzXrBwNPWZjdSa",
"1AAuRETEcHDqL4VM3R97aZHP8DSUHxpkFV",
"1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD",
"1VxsEDjo6ZLMT99dpcLu4RQonMDVEQQTG"
],
`

That is, all in double quotes, hence this is json data format.

BUT my python 3.9.0 returns data in single quotes, which is not valid json data:

`
get_address_full(address=tgt_addr, inout_limit=50)

{'address': '1CXkBfvxjyHQ2wBHchWppi6M...', 'total_received': 23000000, 'total_sent': 23000000, 'balance': 0, 'unconfirmed_balance': 0, 'final_balance': 0, 'n_tx': 2, 'unconfirmed_n_tx': 0, 'final_n_tx': 2, 'txs': [{'block_hash': '0000000000000000003ce92fef0f2b48825bb5d6eb8d2acd3e9c3bba...', 'block_height': 481.., 'block_index': 1446, 'hash': 'ec23ce314eb526cbe19d2f8e110b1ade478eae1ca16fb9a25fde766f4b...', 'addresses': ['1
`

Any parameter to adjust for correct return of json data? or is it simple not intended to return json?

Thanks for clarification..