<p>You have two options.</p>

<p><strong>Option 1:</strong><br>
The returned json includes a "pageTotal":'some number'.<br>
You can create a for-loop to loop through all the pages with API calls.</p>

<p>Let assume there are two pages aka "pageTotal":2</p>

<p>To fetch the first page, append parameter [&amp;pageNum=0] to the end<br>
<strong>Example usage:</strong>  </p>

<pre>
http://localhost:3001/insight-api/txs/?block=00000000000000004dff81aadf782cceb8a2d082f0f255472791c8bb2984e958&pageNum=0
</pre>  

<p>To fetch the second page, add param [&amp;pageNum=1]<br>
<strong>Example usage:</strong></p>

<pre>
http://localhost:3001/insight-api/txs/?block=00000000000000004dff81aadf782cceb8a2d082f0f255472791c8bb2984e958&pageNum=1
</pre>  

<p><br></p>

<p><strong>Option 2:</strong><br>
Modify <a href="https://github.com/bitpay/insight-api/blob/master/lib/transactions.js" rel="nofollow noreferrer">transactions.js</a> , 'var pageLength' on Line 253.<br>
The default is 'var pageLength = 10;'<br>
Unsure if there are consequences by doing this, but I assume it should be fine.</p>

CC BY-SA 3.0
2017-12-21T23:42:04.193Z
Thanks! I changed "var pageLength" to 50000. This should list 50.000 tx and should last a while. :) I think option two is the faster solution.
A.c
CC BY-SA 3.0
2017-12-21T23:18:34.590Z
2017-12-21T23:18:34.590Z
Chak
<p>I have an Insight API Server running, it's fully synced and working. I would like to get a json to receive every tx within a block.</p>

<p>On <a href="https://github.com/bitpay/insight-api" rel="nofollow noreferrer">https://github.com/bitpay/insight-api</a> it says I have to use:</p>

<pre><code>Transactions by Block
  /insight-api/txs/?block=HASH
  /insight-api/txs/?block=00000000fa6cf7367e50ad14eb0ca4737131f256fc4c5841fd3c3f140140e6b6
</code></pre>

<p>For example we take block #301453. This block has 725 transactions.</p>

<p><a href="https://insight.bitpay.com/block/00000000000000004dff81aadf782cceb8a2d082f0f255472791c8bb2984e958" rel="nofollow noreferrer">https://insight.bitpay.com/block/00000000000000004dff81aadf782cceb8a2d082f0f255472791c8bb2984e958</a></p>

<p>If I use the api to get the json file with this link:</p>

<pre><code>http://localhost:3001/insight-api/txs/?block=00000000000000004dff81aadf782cceb8a2d082f0f255472791c8bb2984e958
</code></pre>

<p>... then it shows the first 10 transactions only (numbers 0 - 9). <strong>But there are 725 tx in this block.</strong></p>

<p>It looks like the number 10 are those addresses are the first who are displayed. If i scroll further down, more transactions appear. But why does the json request only show 10 txs?</p>

<p>How can I get ALL transactions in this block - as the documentations mentions?</p>

<bitcoin-core><bitcore>
Insight API: txs json shows only 10 tx?
A.c
# Insight API: txs json shows only 10 tx?

(Asked by: username_0 on 2017-12-21)

I have an Insight API Server running, it's fully synced and working. I would like to get a json to receive every tx within a block.

On <https://github.com/bitpay/insight-api> it says I have to use:

```
Transactions by Block
  /insight-api/txs/?block=HASH
  /insight-api/txs/?block=00000000fa6cf7367e50ad14eb0ca4737131f256fc4c5841fd3c3f140140e6b6

```

For example we take block #301453. This block has 725 transactions.

<https://insight.bitpay.com/block/00000000000000004dff81aadf782cceb8a2d082f0f255472791c8bb2984e958>

If I use the api to get the json file with this link:

```
http://localhost:3001/insight-api/txs/?block=00000000000000004dff81aadf782cceb8a2d082f0f255472791c8bb2984e958

```

... then it shows the first 10 transactions only (numbers 0 - 9). **But there are 725 tx in this block.**

It looks like the number 10 are those addresses are the first who are displayed. If i scroll further down, more transactions appear. But why does the json request only show 10 txs?

How can I get ALL transactions in this block - as the documentations mentions?

**Tags:** bitcoin-core, bitcore


---

## 1 answers

### Answer by username_1 on 2017-12-21. Score: 1 | Accepted answer

You have two options.

**Option 1:**  
The returned json includes a "pageTotal":'some number'.  
You can create a for-loop to loop through all the pages with API calls.

Let assume there are two pages aka "pageTotal":2

To fetch the first page, append parameter [&pageNum=0] to the end  
**Example usage:**

```

http://localhost:3001/insight-api/txs/?block=00000000000000004dff81aadf782cceb8a2d082f0f255472791c8bb2984e958&pageNum=0

```

To fetch the second page, add param [&pageNum=1]  
**Example usage:**

```

http://localhost:3001/insight-api/txs/?block=00000000000000004dff81aadf782cceb8a2d082f0f255472791c8bb2984e958&pageNum=1

```

**Option 2:**  
Modify [transactions.js](https://github.com/bitpay/insight-api/blob/master/lib/transactions.js) , 'var pageLength' on Line 253.  
The default is 'var pageLength = 10;'  
Unsure if there are consequences by doing this, but I assume it should be fine.

> **Comments:**
> **username_0**: Thanks! I changed "var pageLength" to 50000. This should list 50.000 tx and should last a while. :) I think option two is the faster solution.  

---

