<p>The Cryptsy driver does not support this, or any kind of argument, actually.</p>

<p><a href="https://github.com/timmolter/XChange/blob/df9eb4e4d95c5bb3954b1527f585d9238514fa94/xchange-cryptsy/src/main/java/com/xeiam/xchange/cryptsy/service/polling/CryptsyPublicMarketDataService.java#L39" rel="nofollow">https://github.com/timmolter/XChange/blob/df9eb4e4d95c5bb3954b1527f585d9238514fa94/xchange-cryptsy/src/main/java/com/xeiam/xchange/cryptsy/service/polling/CryptsyPublicMarketDataService.java#L39</a></p>

<p>Neither does BTCE.</p>

<p><a href="https://github.com/timmolter/XChange/blob/df9eb4e4d95c5bb3954b1527f585d9238514fa94/xchange-btce/src/main/java/com/xeiam/xchange/btce/v2/service/polling/BTCEMarketDataService.java#L55" rel="nofollow">https://github.com/timmolter/XChange/blob/df9eb4e4d95c5bb3954b1527f585d9238514fa94/xchange-btce/src/main/java/com/xeiam/xchange/btce/v2/service/polling/BTCEMarketDataService.java#L55</a></p>

<p>However, the BTCE <code>getTrades</code> method does support a limit argument.</p>

<p><a href="https://github.com/timmolter/XChange/blob/df9eb4e4d95c5bb3954b1527f585d9238514fa94/xchange-btce/src/main/java/com/xeiam/xchange/btce/v2/service/polling/BTCEMarketDataService.java#L78" rel="nofollow">https://github.com/timmolter/XChange/blob/df9eb4e4d95c5bb3954b1527f585d9238514fa94/xchange-btce/src/main/java/com/xeiam/xchange/btce/v2/service/polling/BTCEMarketDataService.java#L78</a></p>

CC BY-SA 3.0
2015-04-26T18:18:10.853Z
2015-04-26T18:18:10.853Z
Nick ODell
<p>For sometime I am using this java API <a href="http://xeiam.com/xchange/" rel="nofollow">http://xeiam.com/xchange/</a> for building bitcoin trading robots. Today I got a bit stuck and I wanted to see if somebody had the same issue before.</p>

<p>I call the order books like this:</p>

<pre><code>OrderBook orderBook = exchangeMarket.getExchange().getPollingMarketDataService().
                                getOrderBook(CurrencyPair.LTC_BTC, new int[] {20});
</code></pre>

<p>My problem is that the orderBook object contains 100 asks and 100 bids. I just want 20. Does anybody know why this is not returning the amount I pass in the second parameter? BTW, if I try 150, it also returns 100. I don't know how to modify the amount of returned elements.</p>

CC BY-SA 3.0
2015-04-25T18:54:00.907Z
The [xchange docs](http://xeiam.com/javadocs/xchange/com/xeiam/xchange/service/polling/marketdata/PollingMarketDataService.html) say that the meaning of getOrderBook's second argument is exchange-specific. Does the exchange you're polling support limits? Do they support them in the manner that you're using them?
Nick ODell
CC BY-SA 3.0
2015-04-26T11:03:27.230Z
@Nick ODell I am interested in the exchanges Cryptsy and BTCE, but I am not sure how to find if they support limits. Also if they do support, how do I pass the parameter? I tried different things like new Integer[]{20,20}... but nothing worked, I would like to confirm that indeed there is no such support in those exchanges.
sfrj
<bitcoind><api><java><exchange-order>
Xemian Xchange Api for Java, returning a default of 100 market orders
sfrj
# Xemian Xchange Api for Java, returning a default of 100 market orders

(Asked by: username_0 on 2015-04-25)

For sometime I am using this java API <http://xeiam.com/xchange/> for building bitcoin trading robots. Today I got a bit stuck and I wanted to see if somebody had the same issue before.

I call the order books like this:

```
OrderBook orderBook = exchangeMarket.getExchange().getPollingMarketDataService().
                                getOrderBook(CurrencyPair.LTC_BTC, new int[] {20});

```

My problem is that the orderBook object contains 100 asks and 100 bids. I just want 20. Does anybody know why this is not returning the amount I pass in the second parameter? BTW, if I try 150, it also returns 100. I don't know how to modify the amount of returned elements.

**Tags:** bitcoind, api, java, exchange-order

> **Comments:**
> **username_1**: The [xchange docs](http://xeiam.com/javadocs/xchange/com/xeiam/xchange/service/polling/marketdata/PollingMarketDataService.html) say that the meaning of getOrderBook's second argument is exchange-specific. Does the exchange you're polling support limits? Do they support them in the manner that you're using them?  
> **username_0**: @username_1 I am interested in the exchanges Cryptsy and BTCE, but I am not sure how to find if they support limits. Also if they do support, how do I pass the parameter? I tried different things like new Integer[]{20,20}... but nothing worked, I would like to confirm that indeed there is no such support in those exchanges.  

---

## 1 answers

### Answer by username_1 on 2015-04-26. Score: 1 | Accepted answer

The Cryptsy driver does not support this, or any kind of argument, actually.

<https://github.com/timmolter/XChange/blob/df9eb4e4d95c5bb3954b1527f585d9238514fa94/xchange-cryptsy/src/main/java/com/xeiam/xchange/cryptsy/service/polling/CryptsyPublicMarketDataService.java#L39>

Neither does BTCE.

<https://github.com/timmolter/XChange/blob/df9eb4e4d95c5bb3954b1527f585d9238514fa94/xchange-btce/src/main/java/com/xeiam/xchange/btce/v2/service/polling/BTCEMarketDataService.java#L55>

However, the BTCE `getTrades` method does support a limit argument.

<https://github.com/timmolter/XChange/blob/df9eb4e4d95c5bb3954b1527f585d9238514fa94/xchange-btce/src/main/java/com/xeiam/xchange/btce/v2/service/polling/BTCEMarketDataService.java#L78>


---

