<p>As the <a href="https://www.blockchain.com/api/blockchain_api" rel="nofollow noreferrer">API documentation</a> specifies, the response of <code>/rawaddr/$address</code> will only return up to 50 transactions. There is an optional parameter <code>&amp;offset=n</code> which let's you skip the first <code>n</code> transactions. The first call, you get fifty transactions. Then you add the parameter <code>offset=50</code> to skip the first fifty transactions in the response to the second call. This will result in you retrieving the second fifty transactions (51-100). Increment the offset each time by 50, until you have collected all transactions for the address. Quoting from the documentation:</p>
<blockquote>
<p><strong>Single Address</strong></p>
<ul>
<li><a href="https://blockchain.info/rawaddr/$bitcoin_address" rel="nofollow noreferrer">https://blockchain.info/rawaddr/$bitcoin_address</a></li>
<li>Address can be base58 or hash160</li>
<li>Optional limit parameter to show <code>n</code> transactions e.g. <code>&amp;limit=50</code> (Default: 50, Max: 50)</li>
<li>Optional offset parameter to skip the first <code>n</code> transactions e.g. <code>&amp;offset=100</code> (Page 2 for limit 50)</li>
</ul>
</blockquote>
<p>After you have collected all txids, you look up the details of each transaction with <code>rawtx/$txid</code>:</p>
<blockquote>
<p><strong>Single Transaction</strong></p>
<ul>
<li><a href="https://blockchain.info/rawtx/$tx_hash" rel="nofollow noreferrer">https://blockchain.info/rawtx/$tx_hash</a></li>
<li>You can also request the transaction to return in binary form (Hex encoded) using ?format=hex</li>
</ul>
</blockquote>

CC BY-SA 4.0
2021-08-23T18:50:47.693Z
2021-08-24T17:59:53.003Z
2021-08-24T17:59:53.003Z
Murch
<p>Tell me how to interact with <a href="https://www.blockchain.com/" rel="nofollow noreferrer">https://www.blockchain.com/</a>.
1). I need to withdraw all transactions from the address, my code outputs transactions only for the last day?
2). How do I add additional transaction information (Sigscript, Witness)?</p>
<pre><code>#!/usr/bin/env python
import bitcoin, sys

if len(sys.argv) &lt; 2:
    ADDRESS = &quot;1NDyJtNTjmwk5xPNhjgAMu4HDHigtobu1s&quot;
elif len(sys.argv) &lt; 3:
    ADDRESS = sys.argv[1]
else:
    print('Wallet address must be provided.')

def main():
    #bitcoin.allTransactions(ADDRESS)
    bitcoin.simpleTransactions(ADDRESS)
    
if __name__ == '__main__':
    main()
</code></pre>

<blockchain.info><api><python>
How can I retrieve all transactions for an address using the blockchain API?
MDR
# How can I retrieve all transactions for an address using the blockchain API?

(Asked by: username_0 on 2021-08-23)

Tell me how to interact with <https://www.blockchain.com/>.
1). I need to withdraw all transactions from the address, my code outputs transactions only for the last day?
2). How do I add additional transaction information (Sigscript, Witness)?

```
#!/usr/bin/env python
import bitcoin, sys

if len(sys.argv) < 2:
    ADDRESS = "1NDyJtNTjmwk5xPNhjgAMu4HDHigtobu1s"
elif len(sys.argv) < 3:
    ADDRESS = sys.argv[1]
else:
    print('Wallet address must be provided.')

def main():
    #bitcoin.allTransactions(ADDRESS)
    bitcoin.simpleTransactions(ADDRESS)
    
if __name__ == '__main__':
    main()

```

**Tags:** blockchain.info, api, python


---

## 1 answers

### Answer by username_1 on 2021-08-23. Score: 3 | Accepted answer

As the [API documentation](https://www.blockchain.com/api/blockchain_api) specifies, the response of `/rawaddr/$address` will only return up to 50 transactions. There is an optional parameter `&offset=n` which let's you skip the first `n` transactions. The first call, you get fifty transactions. Then you add the parameter `offset=50` to skip the first fifty transactions in the response to the second call. This will result in you retrieving the second fifty transactions (51-100). Increment the offset each time by 50, until you have collected all transactions for the address. Quoting from the documentation:

> **Single Address**
>
> * <https://blockchain.info/rawaddr/$bitcoin_address>
> * Address can be base58 or hash160
> * Optional limit parameter to show `n` transactions e.g. `&limit=50` (Default: 50, Max: 50)
> * Optional offset parameter to skip the first `n` transactions e.g. `&offset=100` (Page 2 for limit 50)

After you have collected all txids, you look up the details of each transaction with `rawtx/$txid`:

> **Single Transaction**
>
> * <https://blockchain.info/rawtx/$tx_hash>
> * You can also request the transaction to return in binary form (Hex encoded) using ?format=hex


---

