BitaVita API Documentation

Please follow the api documentation instructions properly.

Introduction

Welcome to Bitavita API documents.

The full description of the APIs are in the middle and how to request them is provided in the right part along with the expected result of each one. We have tried to explain as clearly as possible. However, if you encounter problems requesting APIs or the result was not what you expected, you can contact our support.

Changelogs

  • 2022-03-05 - Add version 1.0.0 of API documents.

General Information

API Information

  • The base endpoint is: https://bitavita.dev/V1/
  • All endpoints return a JSON object in the result key.
  • All time and timestamp related fields are in unix timebased (milliseconds).
  • Your signed request is only available for 20 seconds. read Signing Data section for more information.

Authentication

                    curl 
                        "https://bitavita.dev/V1/"
                        /
                        {Timestamp}/
                        ""
                    
                

Bitavita APIs uses Key and Secret pair to allow access to the APIs.

Creating API Key

Your API Key is created while your registration.

In order to reveal your API Key:

  • Go to your DASHBOARD on bitavita.com and navigate to PROFILE
  • Click on PREVIEW API KEYS to reveal your Key.
  • You have the option to set your API Key Offline or Online.

For any request call you must first sign your prepared data with your Secret. Then, pass your Key and Signature to that HTTP request body. Check out following table for correct header names.

HTTP Header Names

Header Mandatory Description
apikey True Your public api Key.
timestamp True A timestamp for your request (milliseconds).
data_signature True The Signature created by your secret key.

Signing Data

Encode HMAC-SHA256

"API KEY" + "SECRET KEY + "TIMESTAMP" + "BODY"

As you know already, you must sign your request data. You must sign data based on endpoint's HTTP verb, for GET endpoints sign request's query and for POST, PUT, DELETE sign request's body.

Remember to add timestamp parameter to your body or query in milliseconds (based on your endpoint as explained) as well.

Rate Limits

Please do not send more than 60 request in a minute. Otherwise you will get a rate limit error (429).

Public Endpoints

Get Exchange Overview

                    
curl -XGET -H "Content-type: application/json" -d '{
  "market_code": "btc_try"
}' 'https://bitavita.dev/V1/Market/ExchangeOverview'
                    
                    

Example Response Data:

{ "status":true, "status_code":200, "status_message":"Your code is executed successfully", "data":{  "markets":[{ {   "market_code":"btc_try",   "base_currency":"btc",   "counter_currency":"try",   "last_price":"0.00010000",   "lowest_ask":"0.00010000",   "highest_bid":0.00010000,   "base_volume":0.00010000,   "quote_volume":0.00010000,   "price_change_percent_24h":-4.54546,   "price_minimum_24h":0.00010000,   "price_maximum_24h":0.00010000, }], } }

This endpoint retrieves all available markets and their details on the exchange.

HTTP Request

POST https://bitavita.dev/V1/Market/ExchangeOverview

HTTP Body Names

Body Mandatory Description
market_code false Market Code (Example: "btc_try") if empty, all assets will return

Get Ticker Details

                    
curl -XGET -H "Content-type: application/json" -d '{
  "market_code": "btc_try"
}' 'https://bitavita.dev/V1/Market/TickerDetails'
                    
                        

Example Response Data:

{ "status":true, "status_code":200, "status_message":"Your code is executed successfully", "data":{  "ticker":[{ {   "market_code":"btc_try",   "base_currency":"btc",   "counter_currency":"try",    "last_price":"40683.54",    "base_volume":"40683.54",    "counter_volume":"40700.00", }] }

The ticker endpoint is to provide a 24-hour pricing and volume summary for each market pair available on the exchange.

HTTP Request

POST https://bitavita.dev/V1/Market/TickerDetails

HTTP Body Names

Body Mandatory Description
market_code false Market Number (Example: "btc_try") If empty, all tickers will return

Get Specific Order Book Details

                    
curl -XGET -H "Content-type: application/json" -d '{
  "market_code": "btc_try"
}' 'https://bitavita.dev/V1/Market/SpecificOrderBookDetails'
                    
                    

Example Response Data:

{ "status":true, "status_code":200, "status_message":"Your code is executed successfully", "timestamp":"1585177482652", "data":{  "bids":[ { [ "12462000", "0.04548320" ], [ "12457000", "3.00000000" ] }  "asks":[ { [ "12506000", "2.73042000" ], [ "12508000", "0.33660000" ] } }

The order book endpoint is to provide a complete order book (arranged by asks/bids) with full depth returned for a given market pair.

HTTP Request

POST https://bitavita.dev/V1/Market/SpecificOrderBookDetails

HTTP Body Names

Body Mandatory Description
market_code true Market Number (Example: "btc_try")

Get Closed Trade History

                    
curl -XGET -H "Content-type: application/json" -d '{
  "market_code": "btc_try"
}' 'https://bitavita.dev/V1/Market/TradeHistory'
                    
                    

Example Response Data:

{ "status":true, "status_code":200, "status_message":"Your code is executed successfully", "data":{  "trade_history":[{ {    "trade_id":"11283",    "market_code":"btc_usdt",    "base_coin":"btc",    "counter_coin":"usdt",    "base_volume":"2499.00000000",    "counter_volume":"0.89000000",    "price":"19988.54000000",    "timestamp":"1678455551",    "type":"buy", }] }

The trades endpoint is to return data on all recently completed trades for a given market pair.

HTTP Request

POST https://bitavita.dev/V1/Market/TradeHistory

HTTP Body Names

Body Mandatory Description
market_code true Market Number (Example: "btc_try")

Get Asset Details

                    
curl -XGET -H "Content-type: application/json" -d '{
}' 'https://bitavita.dev/V1/Market/AssetsDetails'
                    
                        

Example Response Data:

{ "status":true, "status_code":200, "status_message":"Your code is executed successfully", "data":{  "Assets":[{ {   "code":"btc",   "name":"Bitcoin",   "unified_cryptoasset_id":"347",   "withdraw":"ON",   "deposit":"ON",   "min_withdraw":"0.0001",   "max_withdraw":"10000",   "maker_fee":"0.01000000",   "taker_fee":"0.08000000", }] }

The assets endpoint is to provide a detailed summary for each currency available on the exchange.

HTTP Request

GET https://bitavita.dev/V1/Market/AssetsDetails

HTTP Body Names

Body Mandatory Description
market_code false Market Number (Example: "btc_try") If empty, all tickers will return

Private Endpoints

Private endpoints are used for order and account management. Every private request must be signed as described in authentication section.

Get Balance

                    
curl -XGET -H 'apikey: ' 
-H 'timestamp: {timestamp}' 
-H 'datasign: ' 
-H "Content-type: application/json" 
-d '{
  "market_code": ""
}' 'https://bitavita.dev/V1/Account/Balance'
                    
                    

Example Response Data:

{ "status":true, "status_code":200, "status_message":"Your code is executed successfully", "data":{ {    "currency_code":"btc",    "base_currency_balance": "0.04973910", }, {    "currency_code":"usdt",    "counter_currency_balance": "4970.16665728", }, }

This endpoint retrieves the balance of your account.

HTTP Request

POST https://bitavita.dev/V1/Account/Balance

HTTP Body Names

Body Mandatory Description
currency_code false Market Number (Example: "btc_try") If empty, all balance data will return

Get Orders

                    
curl -XGET 
-H 'apikey: ' 
-H 'timestamp: {timestamp}' 
-H 'datasign: ' 
-H "Content-type: application/json" 
-d '{
  "order_token": "XKMWTWMPORPMASDMDTBTVSCOLBOXYCAR",
  "status": "0"
}' 'https://bitavita.dev/V1/Orders/Orders'
                    
                    

Example Response Data:

{ "status":true, "status_code":200, "status_message":"Your code is executed successfully", "data":{  "orders":[ {   "order_id":"54259",   "user_id": "109",   "order_type": "limit",   "market_code":"btc_try",   "base_currency": "btc",   "counter_currency": "try",   "price": "40683.54",   "volume": "0.01000000",   "buy_sell": "buy",   "add_date": "2018-05-10 11:23:22.710724+00:00",   "status": "in progress",   "avg_price": "40683.54",, }] }

This endpoint retrieves the balance of your account.

HTTP Request

POST https://bitavita.dev/V1/Orders/Orders

HTTP Body Names

Body Mandatory Description
order_token false Order Number (Example: "54259") If empty, all orders will return

Response Properties

Body Description
status New: N, Partially Filled: P, Filled: F, Canceled: C, Rejected: R,
buy_sell "buy" or "sell"

Get Order Status

                    
curl -XGET 
-H 'apikey: ' 
-H 'timestamp: {timestamp}' 
-H 'datasign: ' 
-H "Content-type: application/json" 
-d '{
  "order_token": "XKMWTWMPORPMRASDDTBTVSCOLBOXYCAR"
}' 'https://bitavita.dev/V1/Orders/OrderStatus'
                    
                    

Example Response Data:

{ "status":true, "status_code":200, "status_message":"Your code is executed successfully", "data":{  "order":[ {   "order_id":"54259",   "user_id": "109",   "order_type": "limit",   "market_code":"btc_try",   "base_currency": "btc",   "counter_currency": "try",   "price": "40683.54",   "volume": "0.01000000",   "buy_sell": "0",   "add_date": "2018-05-10 11:23:22.710724+00:00",   "status": "in progress",   "avg_price": "40683.54",, }] }

This endpoint retrieves the status of a given order.

HTTP Request

POST https://bitavita.dev/V1/Orders/OrderStatus

HTTP Body Names

Body Mandatory Description
order_token true Order Number (Example: "54259")

Response Properties

Body Description
status In Progress: in progress, Rejected: rejected, Completed: completed
buy_sell "buy" or "sell"

Create Order

                    
curl -XGET -H 'apikey: ' 
-H 'timestamp: {timestamp}' 
-H 'datasign: ' 
-H "Content-type: application/json" 
-d '{
  "order_type": "limit",
  "market_code": "btc_try",
  "volume": "0.01",
  "buy_sell": "0",
  "price": "40775.44",
}' 'https://bitavita.dev/V1/Orders/CreateOrder'
                    
                    

Example Response Data:

{ "status":true, "status_code":200, "status_message":"Success, your order has been placed.", "token":"BQUBIZRDVWPWVVJASDIGMXDUUFHWRIKU", }

This endpoint allows you to create an order.

HTTP Request

POST https://bitavita.dev/V1/Orders/CreateOrder

HTTP Body Names

Body Mandatory Description
TradeType true Type Of The Order ("limit-m", "limit" or "stop")
Market true Market Code (Example: "btc_try")
Num true Volume (Example: "0.01")
Type true 1: "Buy", 2: "Sell"
Price true Price (Example: "40775.44", "0" for market orders)

Cancel Order

                    
curl -XGET -H 'apikey: ' 
-H 'timestamp: {timestamp}' 
-H 'datasign: ' 
-H "Content-type: application/json" 
-d '{
  "order_token": "XKMWTWMASDPMRQAMDTBTVSCOLBOXYCAR"
}' 'https://bitavita.dev/V1/Orders/CancelOrder'
                    
                    

Example Response Data:

{ "status":true, "status_code":200, "status_message":"Order cancel request has been submitted." }

This endpoint allows you to cancel an order.

HTTP Request

POST https://bitavita.dev/V1/Orders/CancelOrder

HTTP Body Names

Body Mandatory Description
order_token true Order Number (Example: "54259")

Errors

As you already find out, our APIs have a static response structure. when an error occurs the status parameter is set to false with an error code defined in your response. You can see error message as well in status_message parameter.

And also here are status_code's that we are providing:

HTTP Meaning
200 OK - Your request has been executed successfully.
201 Created - The request has succeeded and has led to the creation of a resource.
202 Accepted - The request has been accepted for processing
400 Bad Request - You did not correctly format your API request.
401 Unauthorized - You dont have access to the endpoint.
403 Forbidden - you don’t have permission to request that URL.
404 Not Found - No content, data or repository found for your request.
408 Request Timeout - The server would like to shut down this unused connection.
409 Conflict - The request data conflicts with the current state of the server.
429 Too Many Requests - You have hit the API rate limit.
500 Internal Server Error - An error occurs in our server side application.
502 Bad Gateway - The server you were calling wasn’t the actual API server, but a gateway or proxy.
503 Service Unavailable - Too many API requests were sent and now the API can’t handle any more of them.
504 Gateway Timed Out - the server you were calling is a proxy for the real API server, but the problem is the API server's slow response.