<p>I don't believe you can do this with just a single API call. I'd return all the transactions from one of the addresses, and cycle through all the inputs and outputs and if they match the other address then show the tx data.</p>

<p>Not sure which language you're using but the logic should be the same. </p>

<pre><code>&lt;?php
$addr1 = "1EipJdYVJbqsTSQhj1icK424AkMbyjvgBm";
$addr2 = "1LWwLvKWbcpiZYqCcwfuQ3gjjNJkxftmEJ";

$url = "https://blockchain.info/address/".$addr1."?format=json";
$fgc = json_decode(file_get_contents($url), true);

//num of txs
$txs = count($fgc["txs"]);

//loop through all txs
for($i=0;$i&lt;$txs;$i++){
    //check all inputs &amp; outputs for the other address
    //inputs
    $numinputs = count($fgc["txs"][$i]["inputs"]);
    for($ii=0;$ii&lt;$numinputs;$ii++){
        if($fgc["txs"][$i]["inputs"][$ii]["prev_out"]["addr"] == $addr2){
            //found a corresponding tx
            print_r($fgc["txs"][$i]);
        }
    }//end inputs loop

    $numoutputs = count($fgc["txs"][$i]["out"]);
    for($iii=0;$iii&lt;$numoutputs;$iii++){
        if($fgc["txs"][$i]["out"][$iii]["addr"] == $addr2){
            //found a corresponding tx
            print_r($fgc["txs"][$i]);
        }
    }//end outputs loop
}

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

<p><a href="http://phpfiddle.org/main/code/8imw-ardy" rel="nofollow noreferrer">http://phpfiddle.org/main/code/8imw-ardy</a></p>

CC BY-SA 3.0
2016-12-14T09:50:50.877Z
why is it so that this is not an easy thing to query?
smatthewenglish
CC BY-SA 3.0
2016-12-13T21:05:57.523Z
2016-12-13T21:05:57.523Z
m1xolyd1an
<p>I had trouble too. Documentation is unclear. This link works by way of browser:
<a href="https://blockchain.info/multiaddr?address=641ad5051edd97029a003fe9efb29359fcee409d&amp;address=1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq" rel="nofollow noreferrer">https://blockchain.info/multiaddr?address=641ad5051edd97029a003fe9efb29359fcee409d&amp;address=1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq</a></p>

CC BY-SA 4.0
2019-06-09T21:32:44.690Z
2019-06-09T21:32:44.690Z
Scott Lewis
<p>I've used this query to try to get all the transaction between two addresses: </p>

<p><code>https://blockchain.info/multiaddr?active=1EipJdYVJbqsTSQhj1icK424AkMbyjvgBm|1LWwLvKWbcpiZYqCcwfuQ3gjjNJkxftmEJ</code></p>

<p>but the thing is- according to my wallet there are many more transactions that aren't appearing in the json result <a href="https://blockchain.info/multiaddr?active=1EipJdYVJbqsTSQhj1icK424AkMbyjvgBm|1LWwLvKWbcpiZYqCcwfuQ3gjjNJkxftmEJ" rel="nofollow noreferrer">here</a>. </p>

<p>Why is that? </p>

<p>How can I see <em>actually</em> all of the transactions? </p>

<p>I though maybe blockexplorer would be better than blockchain.info, but actually- not so.  </p>

<p>They have it as this: </p>

<p><code>https://blockexplorer.com/api/addrs/1EipJdYVJbqsTSQhj1icK424AkMbyjvgBm,1LWwLvKWbcpiZYqCcwfuQ3gjjNJkxftmEJ/txs?from=0&amp;to=50</code></p>

<p>perhaps it would be better to just query by txid? </p>

CC BY-SA 3.0
2016-12-13T16:56:49.607Z
When you say "all the transactions between two addresses" do you mean you only want transactions where both addresses were involved, or do you just want all transactions from both addresses?
m1xolyd1an
CC BY-SA 3.0
2016-12-13T20:16:02.450Z
the ones between then, but- also those that are not just bi-directional, but that also include maybe like- 1 to many others as well- but- at least those two
smatthewenglish
<transactions><api><query>
retrieve all the transaction between two addresses
smatthewenglish
# retrieve all the transaction between two addresses

(Asked by: username_0 on 2016-12-13)

I've used this query to try to get all the transaction between two addresses:

`https://blockchain.info/multiaddr?active=1EipJdYVJbqsTSQhj1icK424AkMbyjvgBm|1LWwLvKWbcpiZYqCcwfuQ3gjjNJkxftmEJ`

but the thing is- according to my wallet there are many more transactions that aren't appearing in the json result [here](https://blockchain.info/multiaddr?active=1EipJdYVJbqsTSQhj1icK424AkMbyjvgBm|1LWwLvKWbcpiZYqCcwfuQ3gjjNJkxftmEJ).

Why is that?

How can I see *actually* all of the transactions?

I though maybe blockexplorer would be better than blockchain.info, but actually- not so.

They have it as this:

`https://blockexplorer.com/api/addrs/1EipJdYVJbqsTSQhj1icK424AkMbyjvgBm,1LWwLvKWbcpiZYqCcwfuQ3gjjNJkxftmEJ/txs?from=0&to=50`

perhaps it would be better to just query by txid?

**Tags:** transactions, api, query

> **Comments:**
> **username_1**: When you say "all the transactions between two addresses" do you mean you only want transactions where both addresses were involved, or do you just want all transactions from both addresses?  
> **username_0**: the ones between then, but- also those that are not just bi-directional, but that also include maybe like- 1 to many others as well- but- at least those two  

---

## 2 answers

### Answer by username_1 on 2016-12-13. Score: 1 | Accepted answer

I don't believe you can do this with just a single API call. I'd return all the transactions from one of the addresses, and cycle through all the inputs and outputs and if they match the other address then show the tx data.

Not sure which language you're using but the logic should be the same.

```
<?php
$addr1 = "1EipJdYVJbqsTSQhj1icK424AkMbyjvgBm";
$addr2 = "1LWwLvKWbcpiZYqCcwfuQ3gjjNJkxftmEJ";

$url = "https://blockchain.info/address/".$addr1."?format=json";
$fgc = json_decode(file_get_contents($url), true);

//num of txs
$txs = count($fgc["txs"]);

//loop through all txs
for($i=0;$i<$txs;$i++){
    //check all inputs & outputs for the other address
    //inputs
    $numinputs = count($fgc["txs"][$i]["inputs"]);
    for($ii=0;$ii<$numinputs;$ii++){
        if($fgc["txs"][$i]["inputs"][$ii]["prev_out"]["addr"] == $addr2){
            //found a corresponding tx
            print_r($fgc["txs"][$i]);
        }
    }//end inputs loop

    $numoutputs = count($fgc["txs"][$i]["out"]);
    for($iii=0;$iii<$numoutputs;$iii++){
        if($fgc["txs"][$i]["out"][$iii]["addr"] == $addr2){
            //found a corresponding tx
            print_r($fgc["txs"][$i]);
        }
    }//end outputs loop
}

?>

```

<http://phpfiddle.org/main/code/8imw-ardy>

> **Comments:**
> **username_0**: why is it so that this is not an easy thing to query?  

---

### Answer by username_2 on 2019-06-09. Score: 0

I had trouble too. Documentation is unclear. This link works by way of browser:
<https://blockchain.info/multiaddr?address=641ad5051edd97029a003fe9efb29359fcee409d&address=1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq>


---

