📱 To better serve our customers, we are pleased to announce the addition of a new Call Center number, 1518.
For additional information, please find on New Bitkub Call Center Number, 1518

FAQ for API Users

Modified on Wed, 25 Sep at 11:31 AM


1. API

No.FAQAnswer
1What is the API rate limit?Rate limit is the limit of how frequently an API user can send the requests within a specific timeframe. For more information, please visit the following sites:
2Do users get the message alert when their API gets blocked?Yes. The error message is {“error”:30}.
3How does Bitkub calculate the amount of the API rate limits: by accounts, by IP address, or by API key?Currently, we calculate the rate limit by user.

Per IP includes whitelist API key and non-whitelist.
4Is the test market supported?No, we do not have the test market at the moment. However, we do have the bid and ask tests.

(https://github.com/bitkub/bitkub-official-api-docs/blob/master/restful-api.md#post-apimarketplace-bidtest, and https://github.com/bitkub/bitkub-official-api-docs/blob/master/restful-api.md#post-apimarketplace-asktest)
5Is "amend order" supported or do users have to cancel and place a new order?Currently, an amend order is not supported; users will have to cancel and place a new order by themselves.
6Is "cancel-on-disconnect" or "dead man's switch" supported in case of network disconnection?No, we do not support this function at the moment.
7Does Bitkub have any official sample code for documentation?We have our API documented herehttps://github.com/bitkub/bitkub-official-api-docs. In this API document, users can also find a sample code and other useful information.
8What is the fastest way to get market data information from Bitkub?We have bitkub-official-api-docs/websocket-api.md at master · bitkub/bitkub-official-api-docs. Users can also use the REST API.
9How can users get balance for high-frequency trading?We recommend using the REST API market wallet because it returns available + reserved balances (bitkub-official-api-docs/restful-api.md at master · bitkub/bitkub-official-api-docs).

We have 2 API endpoints that can be used for this case (users need to refresh or request API to check the balance):
1. /api/v3/market/wallet : To check THB and token balances at the moment of request.
2. /api/v3/market/balances : To check THB balance, token balance, and in-order/reserved tokens at the moment of request.
10Can fee credit be used via Public API?No
11What is the format of Bitkub's server time?You can check our server time at https://github.com/bitkub/bitkub-official-api-docs/blob/master/restful-api.md#get-apiservertime.

You can also use: GET/api/v3/servertime
https://github.com/bitkub/bitkub-official-api-docs/blob/master/restful-api.md#get-apiv3servertime.

The response is in Epoch time, and the number must be converted on this website: 
https://www.epochconverter.com/.
12What should users do if they see a misleading API balance?When users see a misleading API balance, they should request the CSV file.
13What network value do we assign for all withdrawals? (If not, users will get the “ERROR CODE 10”.)ERROR CODE 10” code appears when some required parameters are missing when using our endpoints. Users can check the details of required parameters for each endpoint at Github doc (Query or Body) e.g. https://github.com/bitkub/bitkub-official-api-docs/blob/master/restful-api.md#query-15.

More examples of required parameters are listed below.
  • For requests on ERC-20, please assign the ‘net’ value as ETH.
  • For requests on BEP-20, please assign the ‘net’ value as BSC.
  • For requests on KAP-20, please assign the ‘net’ value as BKC.
If you do not specify the network, you will see the “ERROR CODE 10” code.
14What causes the cancellation error?A cancellation error can happen when a user submits "request to cancel order" at the same time when our system is still processing the "place order request".

As a result, our system cannot cancel the order that does not yet exist in our order book. We could also say that the speed of user's trading system does not match the exchange's.
15Why is the user's buyer/user seller tag not working?This feature is temporarily disabled.
16Is there any other endpoint where users can specify the amount of tokens instead of the amount of THB?No, we do not have API for only token amount at the moment. However, we have 2 API endpoints that relate to the question as follows:
1. /api/v3/market/wallet
2. /api/v3/market/balances

(See additional information in question No. 9 or check our endpoints information at
 
https://github.com/bitkub/bitkub-official-api-docs.)
17Does Bitkub have a place-bid-by-crypto?No
18How can users track via API or another process if their orders became makers or taker historically?According to the reference, POST/api/market/my-order-history will show the result that orders became maker or taker:
  • is_maker = TRUE >> Maker
  • is_maker = FALSE >> Taker

19How long does it take to synchronize transactions for endpoint "my-order-history"?It should be immediately (no later than a second). In case of any delay, please share the time of occurrence, API key, and order hash with our team for further check.
20How are orders in an order book sorted/organized when using an API?The orders are sorted by price; the 'SELL' side will be ASC, and the 'BUY' side will be DESC.

If the prices are equal, the orders will be sorted per the creating timestamp (created_at) followed by super_id respectively.
21Does Bitkub have a test environment like a sandbox for users to test the connection and so on?No, we currently do not have a test market or sandbox. However, we do have the bid and ask tests.

(https://github.com/bitkub/bitkub-official-api-docs/blob/master/restful-api.md#post-apimarketplace-bidtest, and 
https://github.com/bitkub/bitkub-official-api-docs/blob/master/restful-api.md#post-apimarketplace-asktest)
22How does Bitkub calculate the THB amount in the statement (since it sometimes differs from the details received from API order-info (amount x rate))?Buy
THB paid (deduct fee * 0.25%) = Result, any decimal will be rounded up to 2 decimal places.
Amount of tokens received will be rounded off to 8 decimal places.
-----------------------------------
Sell
THB received (deduct fee * 0.25%) = Result, any decimal will be rounded off to 2 decimal places.
Amount of tokens paid will be rounded up to 8 decimal places.
—---------------------------------
Buy
THB paid *0.25% = rounded up to 2 decimal places
Tokens received = rounded off to 8 decimal places
-----------------------------------
Sell
THB received *0.25% = rounded off to 2 decimal places
Tokens paid = rounded up to 8 decimal places
23How can users lock the IP to only 1 IP for sending/receiving requests via API?Use the restrict IP (lock IP) feature.
1. Select the IP that needs locking for the public API secure endpoint (authentication required when using the POST API).

2. On 
https://www.bitkub.com/publicapi, the called access will show the IP > click Restrict IP to lock it.
24Are the order IDs in placing bid/ask orders and trades WebSocket stream the same?Same
25What are parent_order_id and super_order_id?If an order is partially filled, a new order is created with the remaining amount. The first order is both the parent order and the super order.

If the second order is partially filled again, a new order is created with the remaining amount. The first order is now the super order, while the second order is the parent order.

** Superorder is the very first order. Parent is the 1 level up order.
26What is the format of the field 'ts' for FTM?Millisecond (13 digits) for FTM, and second (10 digits) for other tokens.


Back to top

2. Error codes

For more information, please visit https://github.com/bitkub/bitkub-official-api-docs.
No.FAQAnswer
1What is error 429?"Too many requests"
2What is error code 21 and how can we fix it?If you try to cancel an order and it shows an "error", please try re-canceling after waiting for a few more seconds in order to cancel the order successfully.

Why does this happen?
The "request to cancel order" you send happens at the same time that our system is still processing the "place order request" Our system, therefore, cannot cancel an order that does not yet exist in our order book. Another possibility is that the speed of your trading system did not match the Exchange.
3When does '503 Service Temporarily Unavailable' occur?At that time, the latency performance was too high.
4How can we fix 'Error 90' [API]?It is a server error, please contact Support.
5What is the Error 3: Invalid API key when we use an API to get the “wallet balance”?When you use an API to get the wallet balance, you need to enter the API key for each UID as a signature to access the API. The said error code will appear if something is missing or incorrect.


Back to top


3. WebSocket
No.FAQAnswer
1WebSocket keeps disconnectingThere are 2 WebSockets:
(1) wss://websocket.bitkub.com/websocket-api/1
(2) wss://api.bitkub.com/websocket-api/1

If the first one has an issue, then users can use the second one instead (the first one has a proxy layer while the second one bypasses the proxy).

** Kindly note that it disconnects every hour (users may find error 1006).
2What is the interval for the websocket stream?The WebSocket provides real-time data.
3How can we get open orders (from WebSocket) with a hash for multiple orders of the same rate and volume?Unfortunately, this is currently unavailable.
4Is there a WebSocket for balances?No
5Why is there a lot of WebSocket streams that have lots of packets but show no change in the order book?Same data means there is no change; it is possible to get the same data.
6Is there an available WebSocket stream for account owner trades?Our WebSocket only displays a market trade stream instead of account owner trades


Back to top


4. Servers and connection
No.FAQAnswer
1Does Bitkub have a physical server or a cloud server?We are using the cloud server: AWS cloud.
2Where is the trade engine located?Singapore
3Does Bitkub have a colocation service or any URL that is not behind DDOS protection?No
4Does Bitkub offer any URLs that are not behind Cloudflare?No
5Trade engine logicMarket orders are always the first to match. Then, limit orders are matched based on price-time prioritization, then best price, and THB.
6What is the purpose of whitelisting? Do they get through the Cloudflare?The reason we whitelist the IPs is to help support tracking their traffic and reducing latency. For new MMs, when they have the issue, it will be easier to see their behavior for further check. It is getting through Cloudflare.

** It does not help with rate limits.
7How do we calculate the rate per second? Moving window?It is a moving window.

It is safe to say moving window because 1 second is too short and Cloudflare tells that rate limit per second is just an estimation.


Back to top


5. Orders, markets, trading, and transactions related
No.FAQAnswer
1Does Bitkub have any internal matching engine for orders, or is all the volume displayed and matched in the order books?All of our orders are currently displayed.
2What are the price and volume precisions/increments of a token and THB?At the moment, every token will trade with 2 decimal places for price in THB, and 8 decimal places for a token amount, except IOST, USDT, USDC.
3What is the expected delay on each create/cancel order request?Normally, there is no delay or a maximum of 2 seconds.
4What are the differences between taker and maker orders, and how does it work?Every trade has two sides, the Maker and the Taker.
  • The Maker is the one who sends the order to the market.- The Taker is the one who trades with the orders that already exist in the market.
For example:
  • Mr. A sends an order for 1 BTC for 300,000 baht.
  • After 1 minute, Mr. B sends an order to sell 1 BTC for 300,000 baht.
  • Thus, a trading match occurs between Mr. A and Mr. B. Here, Mr. A is Maker and Mr. B is Taker.
5What are the required withdrawal fees for each chain (e.g. Bitcoin, ERC20, KAP20, Wanchain, Cardano, BEP20, etc.)?You can find more details about fees at https://www.bitkub.com/fee/cryptocurrency.
6Can the order IDs be duplicated?If the order is on a different side (buy/sell) or a different symbol, the order IDs can be duplicated, not unique.

On the other hand, if it is an order from the same side or the same symbol, the order id will not be duplicated.


Back to top


6. Account and daily limit
No.FAQAnswer
1Why is my daily limit decreased?Due to the ongoing (KYC Update) round, the Tier and account limit can be changed (decreased or increased) based on the recent documents the customer submits for verification.


Back to top


7. Fee credits
No.FAQAnswer
1What are fee credits?Fee credits are used only for discounts on our trading fees in the THB market on Bitkub Exchange. These amounts cannot be used for withdrawing and transferring.

If your account has a fee credit balance of more than 0, it will be automatically applied whenever you buy or sell your tokens.


Back to top


8. Others

No.FAQAnswer
1Does Bitkub have a market surveillance team?
Yes.
2Is there a system to prevent self-fill?
Yes.


Back to top

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article