Bitcoin Forum
May 02, 2024, 09:59:54 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Blockchain.info api. How to read transactions data.  (Read 1897 times)
karan_736 (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
October 10, 2014, 06:46:38 AM
Last edit: October 10, 2014, 11:27:14 AM by karan_736
 #1

I am trying to list all the transactions of a given wallet address using https://blockchain.info/address/. My requirement is to list receive and sent btc separately.  But somehow I am not able to understand which values to read. "result" key in json seems consistent as it gives + or - integers but the first result is always 0. Values in "outs" "value" key are correct but no way of knowing whether amount is received or sent.

Any Help is appreciated.
1714687194
Hero Member
*
Offline Offline

Posts: 1714687194

View Profile Personal Message (Offline)

Ignore
1714687194
Reply with quote  #2

1714687194
Report to moderator
1714687194
Hero Member
*
Offline Offline

Posts: 1714687194

View Profile Personal Message (Offline)

Ignore
1714687194
Reply with quote  #2

1714687194
Report to moderator
The network tries to produce one block per 10 minutes. It does this by automatically adjusting how difficult it is to produce blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714687194
Hero Member
*
Offline Offline

Posts: 1714687194

View Profile Personal Message (Offline)

Ignore
1714687194
Reply with quote  #2

1714687194
Report to moderator
1714687194
Hero Member
*
Offline Offline

Posts: 1714687194

View Profile Personal Message (Offline)

Ignore
1714687194
Reply with quote  #2

1714687194
Report to moderator
1714687194
Hero Member
*
Offline Offline

Posts: 1714687194

View Profile Personal Message (Offline)

Ignore
1714687194
Reply with quote  #2

1714687194
Report to moderator
Redwan
Full Member
***
Offline Offline

Activity: 126
Merit: 100


View Profile
October 10, 2014, 08:58:38 AM
 #2

i need to know that also.....Smiley

< MONEY IS NOT EVERYTHING BUT EVERYTHING NEEDS MONEY > donate 14V9xuWy2fRzchkpK44ZeDbjdJprXLP2qC
amacar
Hero Member
*****
Offline Offline

Activity: 546
Merit: 500


View Profile
October 10, 2014, 06:31:14 PM
 #3

Don't know about API, but you can change filter parameter and you will get received or sent transactions.

Sent:
Code:
https://blockchain.info/address/1PdHRDrRxBsohPRJMxTa5cVLNriEbJUhdP?filter=1

Recieved:
Code:
https://blockchain.info/address/1PdHRDrRxBsohPRJMxTa5cVLNriEbJUhdP?filter=2
RocketSingh
Legendary
*
Offline Offline

Activity: 1662
Merit: 1050


View Profile
October 10, 2014, 09:46:04 PM
 #4

I am trying to list all the transactions of a given wallet address using https://blockchain.info/address/. My requirement is to list receive and sent btc separately.  But somehow I am not able to understand which values to read. "result" key in json seems consistent as it gives + or - integers but the first result is always 0. Values in "outs" "value" key are correct but no way of knowing whether amount is received or sent.

Any Help is appreciated.

There is no received or sent btc against a certain address. Within a Tx, an address may be in both input & output.

Consider https://blockchain.info/rawaddr/1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj

Code:
"out":[{"spent":true,"tx_index":45037626,"type":0,"addr":"1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj","value":2000000,"n":0,"script":"76a914998f169318eb1d8d2a4e53dce2712f5678c6f06e88ac"}

Says 2000000 is input of 1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj

Code:
"prev_out":{"tx_index":17584482,"type":0,"addr":"1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj","value":10097213,"n":1,"script":"76a914998f169318eb1d8d2a4e53dce2712f5678c6f06e88ac"}


Says 10097213 Satoshi is output of 1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj

Now u need to properly read the JS to format it against Tx ids and then find out the respective input and output against the given address.

karan_736 (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
October 14, 2014, 07:18:44 AM
 #5

Thanks a lot RocketSingh. Got it working in the end.
Appreciated.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!