Dear member, you are now on the BitaVita Global site. Easily choose to switch to the BitaVita Turkey stock market.
Please follow the api documentation instructions properly.
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.
Signing Data
curl "https://bitavita.dev/V1/" / {Timestamp}/ ""
Bitavita APIs uses Key and Secret pair to allow access to the APIs.
Key
Secret
Your API Key is created while your registration.
In order to reveal your API Key:
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.
Signature
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.
GET
query
POST
PUT
DELETE
body
timestamp
Please do not send more than 60 request in a minute. Otherwise you will get a rate limit error (429).
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, }], } }
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.
POST https://bitavita.dev/V1/Market/ExchangeOverview
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", }] }
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.
POST https://bitavita.dev/V1/Market/TickerDetails
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" ] } }
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.
POST https://bitavita.dev/V1/Market/SpecificOrderBookDetails
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", }] }
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.
POST https://bitavita.dev/V1/Market/TradeHistory
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", }] }
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.
GET https://bitavita.dev/V1/Market/AssetsDetails
Private endpoints are used for order and account management. Every private request must be signed as described in authentication section.
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", }, }
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.
POST https://bitavita.dev/V1/Account/Balance
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",, }] }
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",, }] }
POST https://bitavita.dev/V1/Orders/Orders
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",, }] }
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.
POST https://bitavita.dev/V1/Orders/OrderStatus
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", }
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.
POST https://bitavita.dev/V1/Orders/CreateOrder
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." }
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.
POST https://bitavita.dev/V1/Orders/CancelOrder
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.
status
false
status_message
And also here are status_code's that we are providing:
status_code