Author

Topic: how to read blockexplorer (Read 303 times)

legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
January 21, 2020, 08:05:53 AM
#8
You also could try https://blockchair.com/api, but they no longer offer free API, only free demo API.
HCP
legendary
Activity: 2086
Merit: 4363
January 21, 2020, 03:02:29 AM
#7
Depending on what you require in terms of requests/sec... I have always had fairly reliable service from Blockcypher: https://www.blockcypher.com/dev/

The free tier is 3 requests/sec and up to 200 requests/hr... Limits reset on the hour. You can read more here: https://www.blockcypher.com/dev/bitcoin/#rate-limits-and-tokens

Haven't used it for a while tho, as I have my own full node and just use bitcoin-cli for what I need/want.
newbie
Activity: 17
Merit: 6
January 21, 2020, 01:07:16 AM
#6
If the fee is not explicitly stated by the API, you can calculate it yourself very easily as it is simply the difference between the total of vIn amouts and vOut amounts for a transaction.

In the example above:

vIn = 0.03602039
VOut = 0.01 + 0.02601813 = 0.03601813

Fee = vIn - vOut = 0.03602039 - 0.03601813 = 0.00000226

great! thank you for your help!

which block explorer api would you recommend? I have found that https://blockexplorer.com/ has been down lately... so not very reliable...

Thank you so much!
HCP
legendary
Activity: 2086
Merit: 4363
January 20, 2020, 02:56:00 PM
#5
If the fee is not explicitly stated by the API, you can calculate it yourself very easily as it is simply the difference between the total of vIn amouts and vOut amounts for a transaction.

In the example above:

vIn = 0.03602039
VOut = 0.01 + 0.02601813 = 0.03601813

Fee = vIn - vOut = 0.03602039 - 0.03601813 = 0.00000226
staff
Activity: 3500
Merit: 6152
January 20, 2020, 11:49:55 AM
#4
Thank you so much for this! this make much more sense to me now!


just a note,   the transaction fees are for the overall block, right? is there a transaction fee for each one of the transactions? how do I know how much each transaction costed me?


while doing some research and testing, I have found that blockchain.info have a different way to represent the same transactions.... see below...

https://blockchain.info/rawaddr/1GB2CgZ9a4yXFaaN2YfmTKuhZbomkpUfbH

would anybody know why I cannot frn the transaction fees on blockchain.info?

if you would choose a reliable service, which one would you choose? (to read balance, transactions and transactions fee)

thank you all


No, the fees are for a single transaction.

I've only shown you the fees for #0 (the last transactions). If you check the JSON of transaction #0, you'll notice a fees field at the very bottom as I showed in the first post:



As you can see, it says 0.0000026 BTC.

Now if you check your address at any block explorer, you'll see that the same fees are being shown:



But since Blockexplorer API appears to be down at the moment:

Code:
Backend Error. Bitcoin JSON-RPC: Request Error: getaddrinfo ENOTFOUND tasks.bitcoind tasks.bitcoind:8332

And Blockchain.com API doesn't show the fees either, I would suggest you take a look at BTC.com API.
newbie
Activity: 17
Merit: 6
January 20, 2020, 11:05:59 AM
#3
Here is how the JSON looks like:

https://i.imgur.com/KB087Rr.png

The picture above represents the three transactions you received. They are ordered by date (descending), meaning, that #0 is the last one you received.

As an example, I selected the last transaction. Here is the JSON and the equivalent in the explorer:

https://i.imgur.com/ACEuZEY.png https://i.imgur.com/8PHt2nS.png

I've used the same colors to highlight the addresses and amount in both screenshots, so it's easier to read and understand.

The fees can be found on the bottom as you can see on the first screenshot.

vIn represent the address(es) the funds are coming out from:

  • 1GB2CgZ9a4yXFaaN2YfmTKuhZbomkpUfbH

While the vOut is where the BTCs are being sent to:

  • 15eeUWLYneRUr5KQYRgcTG4WRRQ1DJMSTc
  • 1ASKLKCZ3SKV2Ky5A2ncFxMxdGLRE9Y3Vv

And based on that, if 1GB2CgZ9a4yXFaaN2YfmTKuhZbomkpUfbH is on the vIn field, it's an outgoing transaction, otherwise it's incoming.



Thank you so much for this! this make much more sense to me now!


just a note,   the transaction fees are for the overall block, right? is there a transaction fee for each one of the transactions? how do I know how much each transaction costed me?


while doing some research and testing, I have found that blockchain.info have a different way to represent the same transactions.... see below...

https://blockchain.info/rawaddr/1GB2CgZ9a4yXFaaN2YfmTKuhZbomkpUfbH

would anybody know why I cannot frn the transaction fees on blockchain.info?

if you would choose a reliable service, which one would you choose? (to read balance, transactions and transactions fee)

thank you all
staff
Activity: 3500
Merit: 6152
December 31, 2019, 02:08:20 PM
#2
Here is how the JSON looks like:



The picture above represents the three transactions you received. They are ordered by date (descending), meaning, that #0 is the last one you received.

As an example, I selected the last transaction. Here is the JSON and the equivalent in the explorer:



I've used the same colors to highlight the addresses and amount in both screenshots, so it's easier to read and understand.

The fees can be found on the bottom as you can see on the first screenshot.

vIn represent the address(es) the funds are coming out from:

  • 1GB2CgZ9a4yXFaaN2YfmTKuhZbomkpUfbH

While the vOut is where the BTCs are being sent to:

  • 15eeUWLYneRUr5KQYRgcTG4WRRQ1DJMSTc
  • 1ASKLKCZ3SKV2Ky5A2ncFxMxdGLRE9Y3Vv

And based on that, if 1GB2CgZ9a4yXFaaN2YfmTKuhZbomkpUfbH is on the vIn field, it's an outgoing transaction, otherwise it's incoming.

newbie
Activity: 17
Merit: 6
December 31, 2019, 07:41:34 AM
#1
hello all,

first of all sorry for the silly request... I am trying to understand the outcome of blockexplores api

for example if I check the followign address: 1GB2CgZ9a4yXFaaN2YfmTKuhZbomkpUfbH https://blockexplorer.com/address/1GB2CgZ9a4yXFaaN2YfmTKuhZbomkpUfbH I get three transaction:

two deposit: 0.03086609 and 0.03602039

and one withdraw: 0.03602039

if instead I use the API, I get the overall block data https://blockexplorer.com/api/txs/?address=1GB2CgZ9a4yXFaaN2YfmTKuhZbomkpUfbH

I am unsure how to read the JSON I get back from the API... how do I know what is the incoming and outgunning transaction? how do I know what was paid in fees?

can anyone illuminate me Smiley  (below extract of JSON)

Code:
{
                    "txid": "4c26a643aa025a2320eee133cf553949d71bd9cb180071c152d753903645d221",
                    "vout": 24,
                    "sequence": 4294967293,
                    "n": 0,
                    "scriptSig": {
                        "hex": "47304402203ec5248f97b98b7e860c0b46ffd44f7f5ccd04c2f97f78c5a960e1abc5b705c702201251677c5adab0ad032b049408df02f8e91225c6cc6594a901540e09baf6d94a012102d79ba705aac9f43d8f1d629a9f12838a1ee04c5398c3ed89054694fd7bbd6f9a",
                        "asm": "304402203ec5248f97b98b7e860c0b46ffd44f7f5ccd04c2f97f78c5a960e1abc5b705c702201251677c5adab0ad032b049408df02f8e91225c6cc6594a901540e09baf6d94a[ALL] 02d79ba705aac9f43d8f1d629a9f12838a1ee04c5398c3ed89054694fd7bbd6f9a"
                    },
                    "addr": "1GB2CgZ9a4yXFaaN2YfmTKuhZbomkpUfbH",
                    "valueSat": 3602039,
                    "value": 0.03602039,
                    "doubleSpentTxID": null
                }


Code:
{
                    "value": "0.03086609",
                    "n": 0,
                    "scriptPubKey": {
                        "hex": "76a914a66f0c9c8e60898f4b7b8a25d21437a223e0cab988ac",
                        "asm": "OP_DUP OP_HASH160 a66f0c9c8e60898f4b7b8a25d21437a223e0cab9 OP_EQUALVERIFY OP_CHECKSIG",
                        "addresses": [
                            "1GB2CgZ9a4yXFaaN2YfmTKuhZbomkpUfbH"
                        ],
                        "type": "pubkeyhash"
                    },
                    "spentTxId": null,
                    "spentIndex": null,
                    "spentHeight": null
                }


Code:
{
                    "value": "0.03602039",
                    "n": 24,
                    "scriptPubKey": {
                        "hex": "76a914a66f0c9c8e60898f4b7b8a25d21437a223e0cab988ac",
                        "asm": "OP_DUP OP_HASH160 a66f0c9c8e60898f4b7b8a25d21437a223e0cab9 OP_EQUALVERIFY OP_CHECKSIG",
                        "addresses": [
                            "1GB2CgZ9a4yXFaaN2YfmTKuhZbomkpUfbH"
                        ],
                        "type": "pubkeyhash"
                    },
                    "spentTxId": "75ccef7cfd58cb9b3cd24d3d31a4405b423efbffd21dcf46e0b0b63419236e05",
                    "spentIndex": 0,
                    "spentHeight": 609868
                }
Jump to: