I'm using blockchain api to display transactions of credits and debits seperately, I'm using the below procedure for displaying credit and debit transactions. But credit transactions are showing in debit transactions... I mean the credited transaction which need to display in "inputs" index showing in "out".

Clear explanation :

Taking an address as an example: 12RpKRwx7AevwTDJYF94MVDx6vEduFBvHR. If you can the compare transaction list in blockchain.info url https://blockchain.info/address/12RpKRwx7AevwTDJYF94MVDx6vEduFBvHR and json format url https:// blockchain.info/address/12RpKRwx7AevwTDJYF94MVDx6vEduFBvHR?format=json&limit=5, first 2 transactions are showing fine in 'out' index json. But when you see the 3rd transaction in https:// blockchain.info/address/12RpKRwx7AevwTDJYF94MVDx6vEduFBvHR it is incoming transaction, This 3rd transaction is showing in "out" index.

My moto is to show my website users a clear transactions of their address.

Here I need to show list of Incoming and Outgoing transactions from blockchain api seperately, Procedure I'm following as suggested by the blockchain.info support team.


1st api call https:// blockchain.info/address/12RpKRwx7AevwTDJYF94MVDx6vEduFBvHR?format=json&limit=5 . From this api call I'm taking "hash" index value and passing the to 2nd api call --> https://blockchain.info/rawtx/$hash in the foreach loop . Showing "inputs" index as incoming transactions received to address 12RpKRwx7AevwTDJYF94MVDx6vEduF and "out" as outgoing transactions from 12RpKRwx7AevwTDJYF94MVDx6vEdu.

1 Answer 1


You can check if transaction is incoming or outcoming if you check "spent" boolean value:

  • but for even both input and output has both 1 and 0 for different transaction. How can i show the user a clear transaction picture of in and out? Commented Nov 5, 2014 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.