<p>You could achieve this by getting the transactions an address has been involved in and filtering on the outputs with that address hash.</p>
<p>We've just released our own free API called <a href="https://www.blocktrail.com/" rel="nofollow noreferrer">Blocktrail</a> and provide SDKs for PHP, Python and NodeJS which make getting blockchain data trivial.</p>
<p>Assuming PHP you could do the following:</p>
<blockquote>
<p>Initialise the Blocktrail SDK</p>
<pre><code>use \Blocktrail\SDK\BlocktrailSDK;
$client = new BlocktrailSDK(&quot;MY_APIKEY&quot;, &quot;MY_APISECRET&quot;, &quot;BTC&quot;, false);
</code></pre>
<p>Get the address' transactions</p>
<pre><code>$address = &quot;1A4NfSJDzxzKgRrgfjxSAQ8hCPJJWKcmzX&quot;;
$page = 1;
$limit = 500;
$sortDir = &quot;desc&quot;;
$transactions = $client-&gt;addressTransactions($address, $page, $limit, $sortDir);
</code></pre>
<p>For each transaction get the amount sent to this address from the outputs</p>
<pre><code>$deposits = array();
foreach($transactions as $tx) {
    foreach($tx['outputs'] as $txout) {
      if($txout['address'] == $address) {
        $deposits[] = $txout['value'];
      }
    }
}
</code></pre>
</blockquote>
<h1>Tutorials and Examples</h1>
<p>We'll be creating in-depth tutorials really soon, but for now you can check the <a href="https://www.blocktrail.com/api/docs" rel="nofollow noreferrer">API documentation</a> for code examples and descriptions of the data returned.</p>
<p>There is also an example project on github: <a href="https://github.com/blocktrail/simple-block-explorer" rel="nofollow noreferrer">A Simple Block Explorer</a></p>

CC BY-SA 3.0
2015-01-06T16:26:38.477Z
Good answer! Does the Blocktrail API sort the transactions by date? The API docs are sorta unclear about this.
Nick ODell
CC BY-SA 3.0
2015-01-06T20:36:06.930Z
Ah, thanks for pointing that out. Yes they are sorted by time, with 'desc' giving you the most recent transactions first.
OACDesigns
CC BY-SA 3.0
2017-03-17T19:09:15.647Z
@OACDesigns I just want a simple CSV that I can import into Google Sheets, so I'm trying to use your "CSV_EXPORT" option, like so:
    `https://api.blocktrail.com/v1/BTC/address/16LzffMx6TqbMX4za7LEUkrLrWifhLfu9w/transactions.csv?limit=200&api_key=CSV_EXPORT`

Unfortunately if the limit is set to anything more than about 100, it times out.  Is there a way to get the whole transaction history of an address reliably?
JVC
CC BY-SA 3.0
2017-03-20T16:52:11.603Z
@JonathanvanClute Hi Jonathan, unfortunately I am no longer involved in the project so I can't really help with this.
I would suggest reaching out to the Blocktrail devs by email or on twitter
OACDesigns
CC BY-SA 3.0
2017-03-20T16:53:11.627Z
Ah ok, I really appreciate the tip!
JVC
CC BY-SA 3.0
2017-03-22T15:21:18.703Z
no problem, I hope you find a solution!
OACDesigns
CC BY-SA 3.0
2015-01-06T09:45:30.160Z
2015-01-06T09:45:30.160Z
2020-06-16T11:10:03.350Z
OACDesigns
<p>How to get the list of transactions that has deposited funds in an address, including information about the amount that has been deposited (sent towards my address not sent away from it), and the date when the transaction occurred.</p>

<p>For example here is address A (my address) :</p>

<pre><code>TX 1)  from address B , 2   bitcoins , 2014 1 january 12:12 pm 
TX 2)  from address C , 1   bitcoins , 2014 2 january 7:51 am 
TX 3)  from address D , 4   bitcoins , 2014 5 january 3:22 am 
TX 4)  from address E , 0.5 bitcoins , 2014 6 january 1:42 pm
</code></pre>

<p>Also, I want it to use an API that is online, so that I don't need to download the whole block chain.</p>

<p>Preferably blockchain.info API or blockexporer.com API would be nice.</p>

<p>A link to a tutorial would also be helpful. I have an specific application in mind that needs this info for an address. </p>

<transactions><api><blockchain.info><blockexplorer>
How to get the list of transactions that has gone into an address with the amount and date?
Mr. Curious
# How to get the list of transactions that has gone into an address with the amount and date?

(Asked by: username_0 on 2015-01-06)

How to get the list of transactions that has deposited funds in an address, including information about the amount that has been deposited (sent towards my address not sent away from it), and the date when the transaction occurred.

For example here is address A (my address) :

```
TX 1)  from address B , 2   bitcoins , 2014 1 january 12:12 pm 
TX 2)  from address C , 1   bitcoins , 2014 2 january 7:51 am 
TX 3)  from address D , 4   bitcoins , 2014 5 january 3:22 am 
TX 4)  from address E , 0.5 bitcoins , 2014 6 january 1:42 pm

```

Also, I want it to use an API that is online, so that I don't need to download the whole block chain.

Preferably blockchain.info API or blockexporer.com API would be nice.

A link to a tutorial would also be helpful. I have an specific application in mind that needs this info for an address.

**Tags:** transactions, api, blockchain.info, blockexplorer


---

## 1 answers

### Answer by username_1 on 2015-01-06. Score: 1

You could achieve this by getting the transactions an address has been involved in and filtering on the outputs with that address hash.

We've just released our own free API called [Blocktrail](https://www.blocktrail.com/) and provide SDKs for PHP, Python and NodeJS which make getting blockchain data trivial.

Assuming PHP you could do the following:

> Initialise the Blocktrail SDK
>
> ```
> use \Blocktrail\SDK\BlocktrailSDK;
> $client = new BlocktrailSDK("MY_APIKEY", "MY_APISECRET", "BTC", false);
>
> ```
>
> Get the address' transactions
>
> ```
> $address = "1A4NfSJDzxzKgRrgfjxSAQ8hCPJJWKcmzX";
> $page = 1;
> $limit = 500;
> $sortDir = "desc";
> $transactions = $client->addressTransactions($address, $page, $limit, $sortDir);
>
> ```
>
> For each transaction get the amount sent to this address from the outputs
>
> ```
> $deposits = array();
> foreach($transactions as $tx) {
>     foreach($tx['outputs'] as $txout) {
>       if($txout['address'] == $address) {
>         $deposits[] = $txout['value'];
>       }
>     }
> }
>
> ```

# Tutorials and Examples

We'll be creating in-depth tutorials really soon, but for now you can check the [API documentation](https://www.blocktrail.com/api/docs) for code examples and descriptions of the data returned.

There is also an example project on github: [A Simple Block Explorer](https://github.com/blocktrail/simple-block-explorer)

> **Comments:**
> **username_2**: Good answer! Does the Blocktrail API sort the transactions by date? The API docs are sorta unclear about this.  
> **username_1**: Ah, thanks for pointing that out. Yes they are sorted by time, with 'desc' giving you the most recent transactions first.  
> **username_3**: @username_1 I just want a simple CSV that I can import into Google Sheets, so I'm trying to use your "CSV_EXPORT" option, like so:     `https://api.blocktrail.com/v1/BTC/address/16LzffMx6TqbMX4za7LEUkrLrWifhLfu9w/transactions.csv?limit=200&api_key=CSV_EXPORT`  Unfortunately if the limit is set to anything more than about 100, it times out.  Is there a way to get the whole transaction history of an address reliably?  
> **username_1**: @JonathanvanClute Hi Jonathan, unfortunately I am no longer involved in the project so I can't really help with this. I would suggest reaching out to the Blocktrail devs by email or on twitter  
> **username_3**: Ah ok, I really appreciate the tip!  
> **username_1**: no problem, I hope you find a solution!  

---

