<p>You can't really "stream" them. Transactions get confirmed once included in a block. So for 10 minutes you would have nothing and then all of a sudden there would be a 1,000+ transactions with a confirmation. If that's what you're looking for you can just use something like <a href="https://blockchain.info/block-index/" rel="nofollow">https://blockchain.info/block-index/</a>$block_index?format=json and replace $block_index with the latest block. The json will respond with all transaction id's in an array that were included under "tx":</p>

<p><a href="https://blockchain.info/api/blockchain_api" rel="nofollow">https://blockchain.info/api/blockchain_api</a></p>

<p><strong>EDIT:</strong><br>
Blockchain.info has all the info you need. 
First get the current block height which you can get from <a href="https://blockchain.info/stats?format=json" rel="nofollow">https://blockchain.info/stats?format=json</a>     </p>

<pre><code>$bcinfo = json_decode(file_get_contents("https://blockchain.info/stats?format=json"), true);
$latestblock = $bcinfo["n_blocks_total"];
</code></pre>

<p>Then plug the current block into <a href="https://blockchain.info/block-height/" rel="nofollow">https://blockchain.info/block-height/</a>$latestblock?format=json    </p>

<pre><code>$getblock = json_decode(file_get_contents("https://blockchain.info/block-height/".$latestblock."?format=json"), true);    
</code></pre>

<p>Then just count the amount for each array and run a for loop to grab each input(from address) and each output(receiver) along with the time.   </p>

<p>Here's one I did quickly in PHP: <a href="http://phpfiddle.org/lite/code/k16m-r8fh" rel="nofollow">http://phpfiddle.org/lite/code/k16m-r8fh</a>    </p>

<pre><code>&lt;?php
$bcinfo = json_decode(file_get_contents("https://blockchain.info/stats?format=json"), true);
$latestblock = $bcinfo["n_blocks_total"];
$getblock = json_decode(file_get_contents("https://blockchain.info/block-height/".$latestblock."?format=json"), true);
$counttxs = count($getblock["blocks"][0]["tx"]);
for($i=0;$i&lt;$counttxs;$i++){
    //tx time
    $timetx = $getblock["blocks"][0]["tx"][$i]["time"];
    $date = date('Y-m-d, H:i:s', $timetx);
    echo $date."&lt;br&gt;";
    //count inputs
    $countinputs = count($getblock["blocks"][0]["tx"][$i]["inputs"]);
    for($ii=0;$ii&lt;$countinputs;$ii++){
        //get input address
        $addr = $getblock["blocks"][0]["tx"][$i]["inputs"][$ii]["prev_out"]["addr"];
        echo $addr ? "INPUT: ".$addr."&lt;br&gt;" : "";
    }
    //count outputs
    $countouts = count($getblock["blocks"][0]["tx"][$i]["out"]);
    for($iii=0;$iii&lt;$countouts;$iii++){
        //get output address
        $outaddr = $getblock["blocks"][0]["tx"][$i]["out"][$iii]["addr"];
        echo $outaddr ? "OUTPUT: ".$outaddr."&lt;br&gt;" : "";
    }
    echo "&lt;br&gt;&lt;br&gt;";
}

?&gt;
</code></pre>

CC BY-SA 3.0
2016-05-29T00:52:44.210Z
Is there any API out there that makes it easy to get at the send/receive addresses and original date/time a transaction appeared for transactions that have been verified in the blockchain?
geofurb
CC BY-SA 3.0
2016-05-29T05:36:40.243Z
Yes you can just use blockchain.info they have all the info.  I edited my answer to include some code examples.
m1xolyd1an
CC BY-SA 3.0
2016-05-28T13:58:51.383Z
2016-05-29T05:35:51.533Z
2016-05-29T05:35:51.533Z
m1xolyd1an
<p>Is there an API that makes streams transactions as they're confirmed? Everything I can find seems to just be putting out unconfirmed transactions in realtime, rather than waiting for confirmation.</p>

<p>To clarify, I'm looking to stream <em>all</em> transactions, not just one wallet.</p>

<transactions><api><confirmations>
Streaming API for confirmed transactions?
geofurb
# Streaming API for confirmed transactions?

(Asked by: username_0 on 2016-05-28)

Is there an API that makes streams transactions as they're confirmed? Everything I can find seems to just be putting out unconfirmed transactions in realtime, rather than waiting for confirmation.

To clarify, I'm looking to stream *all* transactions, not just one wallet.

**Tags:** transactions, api, confirmations


---

## 1 answers

### Answer by username_1 on 2016-05-28. Score: 1 | Accepted answer

You can't really "stream" them. Transactions get confirmed once included in a block. So for 10 minutes you would have nothing and then all of a sudden there would be a 1,000+ transactions with a confirmation. If that's what you're looking for you can just use something like <https://blockchain.info/block-index/>$block\_index?format=json and replace $block\_index with the latest block. The json will respond with all transaction id's in an array that were included under "tx":

<https://blockchain.info/api/blockchain_api>

**EDIT:**  
Blockchain.info has all the info you need.
First get the current block height which you can get from <https://blockchain.info/stats?format=json>

```
$bcinfo = json_decode(file_get_contents("https://blockchain.info/stats?format=json"), true);
$latestblock = $bcinfo["n_blocks_total"];

```

Then plug the current block into <https://blockchain.info/block-height/>$latestblock?format=json

```
$getblock = json_decode(file_get_contents("https://blockchain.info/block-height/".$latestblock."?format=json"), true);    

```

Then just count the amount for each array and run a for loop to grab each input(from address) and each output(receiver) along with the time.

Here's one I did quickly in PHP: <http://phpfiddle.org/lite/code/k16m-r8fh>

```
<?php
$bcinfo = json_decode(file_get_contents("https://blockchain.info/stats?format=json"), true);
$latestblock = $bcinfo["n_blocks_total"];
$getblock = json_decode(file_get_contents("https://blockchain.info/block-height/".$latestblock."?format=json"), true);
$counttxs = count($getblock["blocks"][0]["tx"]);
for($i=0;$i<$counttxs;$i++){
    //tx time
    $timetx = $getblock["blocks"][0]["tx"][$i]["time"];
    $date = date('Y-m-d, H:i:s', $timetx);
    echo $date."<br>";
    //count inputs
    $countinputs = count($getblock["blocks"][0]["tx"][$i]["inputs"]);
    for($ii=0;$ii<$countinputs;$ii++){
        //get input address
        $addr = $getblock["blocks"][0]["tx"][$i]["inputs"][$ii]["prev_out"]["addr"];
        echo $addr ? "INPUT: ".$addr."<br>" : "";
    }
    //count outputs
    $countouts = count($getblock["blocks"][0]["tx"][$i]["out"]);
    for($iii=0;$iii<$countouts;$iii++){
        //get output address
        $outaddr = $getblock["blocks"][0]["tx"][$i]["out"][$iii]["addr"];
        echo $outaddr ? "OUTPUT: ".$outaddr."<br>" : "";
    }
    echo "<br><br>";
}

?>

```

> **Comments:**
> **username_0**: Is there any API out there that makes it easy to get at the send/receive addresses and original date/time a transaction appeared for transactions that have been verified in the blockchain?  
> **username_1**: Yes you can just use blockchain.info they have all the info.  I edited my answer to include some code examples.  

---

