Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification; json or not json? #135

Open
Kryptoid opened this issue Aug 7, 2023 · 0 comments
Open

Clarification; json or not json? #135

Kryptoid opened this issue Aug 7, 2023 · 0 comments

Comments

@Kryptoid
Copy link

Kryptoid commented Aug 7, 2023

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..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant