بلاگ
Ethereum: How to get the list of transactions of input/outputs for a bitcoin address in JSON format?
obtaining bitcoin transaction data for a specific address
In this article, we will explore how to take the list of transactions for a specific bitcoin address using different methods and tools.
Method 1: using Blockchain.info
Blockchain.info is one of the most popular blockchains explorers and provides access to many transaction data. You can search for a bitcoin address on their site and you can view the chronology of its Json format transactions.
Here’s how:
- Access [Blockchair.com] ( (Non Blockchain.info).
- Enter the bitcoin address for which you want to recover the transactions.
- Click “Get the transactions chronology” on the “Transactions” tab.
- Select the “Json” output format.
- Click “Get data”.
- Transactions data will be displayed in Json format.
Method 2: Using Blockchain Explorer (ETH)
Ethereum BlockchaChacha explorer, [Blockchair.com] ( also offers access to bitcoin transactions. You can search for a bitcoin address and view the chronology of its Json format transactions.
Here’s how:
- Access [Blockchair.com] (
- Enter the bitcoin address for which you want to recover the transactions.
- Click “Get the transactions chronology” on the “Transactions” tab.
- Select the “Json” output format.
- Click “Get data”.
- Transactions data will be displayed in Json format.
Method 3: Using a Python script
You can also use a Python script to detect Bitcoin transaction data for a specific JSO address. Here is an example:
`Python
Import requests
Def get_transactions (address, output_format):
URL = F " #dresins/transscs"
Params = {"format": output_formed}
Answer = Requests.get (URL, Params = Params)
Data = Answer.json ()
return data
Get transactions for a particular address
Address = "BC1 ... Your-Bc1-ADDR-HERE"
Output_format = "Json"
Transactions = Get_Transactions (address, output_formed)
For transactions in transactions:
Print ("TXID" Transaction, Transaction ["Index"], Transaction ["Blockhash"])
This script sends a request Geta to the API Blockchain Ethereum with the specified address and output format. Then return a list of Json format transactions.
Method 4: using web3.js
Alternatively, you can use the web3.js bookshop (available on Github) to interact with the Ethereum blockchain and take the Bitcoin transaction data.
`Javascript
Const Web3 = requires (“web3”);
Const Web3 = New Web3 (New Web3.Priders.httpprovider (‘http: // localhost: 8545’));
Consulting address = “BC1 … Your-Bc1-ADDR-HERE”;
The asynching function Gettranshations () {
Const Txs = Wait Web3.etth.gettransazionhistory (address, {includes blockheaders: true});
for (Cont TX of TXS) {
Console.log (TX);
}
}
Gettranshations ();
`
This script uses the web3.js library to interact with the Ethereum blockchain and to detect Bitcoin transaction data. Then record each transaction in Json format.
Example example
Regardless of the method you choose, here is an example of exit:
`Json
[
{
"TXID": "00012345",
"Index": 1,
"Blockhash": "0c56f5d6 ..."
},
{
"TXID": "00067890",
"Index": 2,
"Blockhash": "0B345df8 ..."
}
"
This output shows the transaction ID, the index and the hash block for each Json transaction.