ABOUT HitBTC API
HitBTC REST & Streaming API version provides programmatic access to HitBTC’s next generation trading engine.
We strongly recommend that our new customers use API version to get the best trading experience. We also recommend that our current traders switch to the newest version
By using the HitBTC API you confirm that you have read and accepted the API License Agreement.
API Explorer
You can explore the API using SwaggerUI including methods requiring authorization.
API URLs
REST | Streaming Market Data | Streaming Trading |
---|---|---|
conwaytransport.com.au | wss://conwaytransport.com.au | wss://conwaytransport.com.au |
Demo environment (sandbox):
REST | Streaming Market Data | Streaming Trading |
---|---|---|
conwaytransport.com.au | wss://conwaytransport.com.au | wss://conwaytransport.com.au |
DateTime Format
All timestamps are returned in ISO format (UTC).
Example: "TZ"
Number Format
All finance data, e.g. price, quantity, fee, etc., should be arbitrary precision numbers and have a string representation.
Example: ""
Pagination
Parameters:
Parameter | Description |
---|---|
limit | Number of results per call Accepted range: 0 - Default value: |
offset | Number of results offset Default value: 0 |
sort | Sort direction Accepted values: (ascending order), (descending order) Default value: |
by | Defines filter type Accepted values: , |
from | Interval initial value (optional parameter) If filter by is used, then parameter type is , otherwise |
till | Interval end value (optional parameter) If filter by is used, then parameter type is , otherwise |
The following Rate Limits are applied:
- For the Market data, the limit is requests per second for one IP;
- For Trading, the limit is requests per second for one user;
- For other requests, including Trading history, the limit is 10 requests per second for one user.
Significantly exceeding the Rate Limits can lead to suspension.
- Margin trading feature available over REST and socket API
- New market data only streaming endpoint
- New trading only streaming endpoint
- Single streaming location /api/2/ws is deprecated
The HitBTC API development team strives to bring the best trading experience to API users. This manual contains a set of best practices for using the API as efficiently as possible.
HTTP Persistent Connection
The underlying TCP connection is kept active for multiple requests/responses. Subsequent requests will result in reduced latency as the TCP handshaking process is no longer required.
If you use the HTTP client, please ensure it supports the Keep-Alive directive and submit the ''Connection: Keep-Alive'' header with your request.
Keep-Alive is a part of the HTTP protocol and enabled by default on compliant clients. However, you will have to ensure your implementation does not set other values as the connection header.
Retrieving and updating account state
Use the Streaming API for real-time updates of your orders, trades and any transaction changes.
HTTP Status codes
- OK. Successful request
- Bad Request. Returns JSON with the error message
- Unauthorized. Authorization is required or has been failed
- Forbidden. Action is forbidden for API key
- Too Many Requests. Your connection has been rate limited
- Internal Server. Internal Server Error
- Service Unavailable. Service is down for maintenance
- Gateway Timeout. Request timeout expired
Error response
All error responses have error and human readable fields. Some errors contain an additional field.
Example of error response:
Currencies
Get a list of all currencies or specified currencies
The above command returns JSON structured like this:
Return the actual list of available currencies, tokens, etc.
You can optionally use comma-separated list of currencies. If it is not provided, null or empty, the request returns all currencies.
Requires no API key Access Rights.
Parameter:
Name | Type | Description |
---|---|---|
currencies | String | Comma-separated list of currency codes. Optional parameter |
Responses:
Name | Type | Description |
---|---|---|
id | String | Currency identifier (code), for example, ''BTC'' Note: description will simply use in the future. |
fullName | String | Currency full name, for example, ''Bitcoin'' |
crypto | Boolean | Determines whether currency belongs to blockchain |
payinEnabled | Boolean | Determines whether it is allowed to generate addresses for a deposit |
payinPaymentId | Boolean | Determines whether it is required to provide additional information other than the address for deposit |
payinConfirmations | Number | Count of blocks confirmations, which are needed for deposit |
payoutEnabled | Boolean | Determines whether withdraw is allowed |
payoutIsPaymentId | Boolean | Determines whether providing of additional information for withdraw is allowed |
transferEnabled | Boolean | Determines whether transfer between trading account and bank account is allowed (may be disabled on maintenance) |
delisted | Boolean | if currency is delisted (deposit and trading are stopped) |
payoutFee | Number | Default withdraw fee |
payoutMinimalAmount | String | Minimum withdraw amount |
precisionPayout | Number | Currency precision for payout (number of digits after the decimal point) |
precisionTransfer | Number | Currency precision for transfer (number of digits after the decimal point) |
Get a certain currency
The above command returns JSON structured like this:
Returns the data for a certain currency.
Requires no API key Access Rights.
Responses:
Name | Type | Description |
---|---|---|
id | String | Currency identifier (code), for example, ''BTC'' Note: description will simply use in the future. |
fullName | String | Currency full name, for example, ''Bitcoin'' |
crypto | Boolean | Determines whether currency belongs to blockchain |
payinEnabled | Boolean | Determines whether it is allowed to generate addresses for a deposit |
payinPaymentId | Boolean | Determines whether it is required to provide additional information other than the address for deposit |
payinConfirmations | Number | Count of blocks confirmations, which are needed for deposit |
payoutEnabled | Boolean | Determines whether withdraw is allowed |
payoutIsPaymentId | Boolean | Determines whether providing of additional information for withdraw is allowed |
transferEnabled | Boolean | Determines whether transfer between trading account and bank account is allowed (may be disabled on maintenance) |
delisted | Boolean | if currency is delisted (deposit and trading are stopped) |
payoutFee | Number | Default withdraw fee |
payoutMinimalAmount | String | Minimum withdraw amount |
precisionPayout | Number | Currency precision for payout (number of digits after the decimal point) |
precisionTransfer | Number | Currency precision for transfer (number of digits after the decimal point) |
Symbols
Get a list of all symbols or specified symbols
The above command returns JSON structured like this:
Return the actual list of currency symbols (currency pairs) traded on exchange. The first listed currency of a symbol is called the base currency, and the second currency is called the quote currency. The currency pair indicates how much of the quote currency is needed to purchase one unit of the base currency. Read more
You can optionally use comma-separated list of symbols. If it is not provided, null or empty, the request returns all symbols.
Requires no API key Access Rights.
Parameter:
Name | Type | Description |
---|---|---|
symbols | String | Comma-separated list of symbol codes. Optional parameter |
Responses:
Name | Type | Description |
---|---|---|
id | String | Symbol (currency pair) identifier, for example, ''ETHBTC'' Note: description will simply use in the future. |
baseCurrency | String | Name (code) of base currency, for example, ''ETH'' |
quoteCurrency | String | Name of quote currency |
quantityIncrement | Number | Symbol quantity should be divided by this value with no remainder |
tickSize | Number | Symbol price should be divided by this value with no remainder |
takeLiquidityRate | Number | Default fee rate |
provideLiquidityRate | Number | Default fee rate for market making trades |
feeCurrency | String | Value of charged fee |
Get a certain symbol
The above command returns JSON structured like this:
Returns the data for a certain symbol.
Requires no API key Access Rights.
Responses:
Name | Type | Description |
---|---|---|
id | String | Symbol (currency pair) identifier, for example, ''ETHBTC'' Note: description will simply use in the future. |
baseCurrency | String | Name (code) of base currency, for example, ''ETH'' |
quoteCurrency | String | Name of quote currency |
quantityIncrement | Number | Symbol quantity should be divided by this value with no remainder |
tickSize | Number | Symbol price should be divided by this value with no remainder |
takeLiquidityRate | Number | Default fee rate |
provideLiquidityRate | Number | Default fee rate for market making trades |
feeCurrency | String | Value of charged fee |
Tickers
Get tickers for all symbols or for specified symbols
The above command returns JSON structured like this:
Returns ticker information.
You can optionally use comma-separated list of symbols. If it is not provided, null or empty, the request returns tickers for all symbols.
Requires no API key Access Rights.
Parameter:
Name | Type | Description |
---|---|---|
symbols | String | Comma-separated list of symbol codes. Optional parameter |
Responses:
Name | Type | Description |
---|---|---|
ask | Number or null | Best ask price. Can return 'null' if no data |
bid | Number or null | Best bid price. Can return 'null' if no data |
last | Number or null | Last trade price. Can return 'null' if no data |
open | Number or null | Last trade price 24 hours ago. Can return 'null' if no data |
low | Number | Lowest trade price within 24 hours |
high | Number | Highest trade price within 24 hours |
volume | Number | Total trading amount within 24 hours in base currency |
volumeQuote | Number | Total trading amount within 24 hours in quote currency |
timestamp | Datetime | Last update or refresh ticker timestamp |
symbol | String | Symbol name |
Get ticker for a certain symbol
The above command returns JSON structured like this:
Returns the ticker for a certain symbol.
Requires no API key Access Rights.
Responses:
Name | Type | Description |
---|---|---|
ask | Number or null | Best ask price. Can return 'null' if no data |
bid | Number or null | Best bid price. Can return 'null' if no data |
last | Number or null | Last trade price. Can return 'null' if no data |
open | Number or null | Last trade price 24 hours ago. Can return 'null' if no data |
low | Number | Lowest trade price within 24 hours |
high | Number | Highest trade price within 24 hours |
volume | Number | Total trading amount within 24 hours in base currency |
volumeQuote | Number | Total trading amount within 24 hours in quote currency |
timestamp | Datetime | Last update or refresh ticker timestamp |
symbol | String | Symbol name |
Trades
Get trades for all symbols or for specified symbols
The above command returns JSON structured like this:
Returns trades information for a symbol with a symbol Id.
You can optionally use comma-separated list of symbols. If it is not provided, null or empty, the request returns trades for all symbols.
Requires no API key Access Rights.
Parameters:
Name | Type | Description |
---|---|---|
sort | String | Sort direction Accepted values: , Default value: |
from | Datetime or Number | Interval initial value (optional parameter) If sorting by is used, then , otherwise of index value |
till | Datetime or Number | Interval end value (optional parameter) If sorting by is used, then , otherwise of index value |
limit | Number | Default value: Max value: |
offset | Number | Default value: 0 Max value: |
symbols | String | Comma-separated list of symbol codes. Optional parameter |
Responses:
Name | Type | Description |
---|---|---|
id | Number | Trade identifier |
price | Number | Trade price |
quantity | Number | Trade quantity |
side | String | Trade side Accepted values: or |
timestamp | Datetime | Trade timestamp |
Get trades for a certain symbol
The above command returns JSON structured like this:
Returns trades information for a symbol with a symbol Id.
Requires no API key Access Rights.
Parameters:
Name | Type | Description |
---|---|---|
sort | String | Sort direction Accepted values: , Default value: |
by | String | Defines filter type Accepted values: , Default value: |
from | Datetime or Number | Interval initial value (optional parameter) If sorting by is used, then , otherwise of index value |
till | Datetime or Number | Interval end value (optional parameter) If sorting by is used, then , otherwise of index value |
limit | Number | Default value: Max value: |
offset | Number | Default value: 0 Max value: |
Responses:
Name | Type | Description |
---|---|---|
id | Number | Trade identifier |
price | Number | Trade price |
quantity | Number | Trade quantity |
side | String | Trade side Accepted values: or |
timestamp | Datetime | Trade timestamp |
Order Book
Get Order Book for all symbols or for specified symbols
The above command returns JSON structured like this:
An Order Book is an electronic list of buy and sell orders for a specific symbol, structured by price level.
You can optionally use comma-separated list of symbols. If it is not provided, null or empty, the request returns an Order Book for all symbols.
Requires no API key Access Rights.
Parameters:
Name | Type | Description |
---|---|---|
limit | Number | Limit of Order Book levels Default value: Set 0 to view full list of Order Book levels. |
symbols | String | Comma-separated list of symbol codes. Optional parameter |
Responses:
Name | Type | Description |
---|---|---|
ask | Array | Ask side array of levels |
bid | Array | Bid side array of levels |
size | Number | Total volume of orders with the specified price |
price | Number | Price level |
Get Order Book for a certain symbol
The above command returns JSON structured like this:
The request returns an Order Book for a certain symbol.
Requires no API key Access Rights.
Parameters:
Name | Type | Description |
---|---|---|
limit | Number | Limit of Order Book levels Default value: Set 0 to view full list of Order Book levels. |
volume | Number | Desired volume for market depth search |
Please note that if the is specified, the will be ignored, and are returned in response.
Responses:
Name | Type | Description |
---|---|---|
ask | Array | Ask side array of levels |
bid | Array | Bid side array of levels |
size | Number | Total volume of orders with the specified price |
price | Number | Price level |
askAveragePrice | Number | Average aggregated price for the ask side orders |
bidAveragePrice | Number | Average aggregated price for the bid side orders |
Candles
Get candles for all symbols or for specified symbols
The above command returns JSON structured like this:
Candles are used for the representation of a specific symbol as an OHLC chart.
You can optionally use comma-separated list of symbols. If it is not provided, null or empty, the request returns candles for all symbols.
Requires no API key Access Rights.
Parameters:
Name | Type | Description |
---|---|---|
period | String | Accepted values: (one minute), , , , , (one hour), , (one day), , (one month) Default value: (30 minutes) |
sort | String | Sort direction Accepted values: , Default value: |
from | Datetime | Interval initial value (optional parameter) |
till | Datetime | Interval end value (optional parameter) |
limit | Number | Limit of candles Default value: Max value: |
offset | Number | Default value: 0 Max value: |
symbols | String | Comma-separated list of symbol codes. Optional parameter |
Responses:
Name | Type | Description |
---|---|---|
timestamp | Datetime | Candle timestamp |
open | Number | Open price |
close | Number | Closing price |
min | Number | Lowest price for the period |
max | Number | Highest price for the period |
volume | Number | Volume in base currency |
volumeQuote | Number | Volume in quote currency |
Get candles for a certain symbol
The above command returns JSON structured like this:
The request returns candles for a certain symbol.
Requires no API key Access Rights.
Parameters:
Name | Type | Description |
---|---|---|
period | String | Accepted values: (one minute), , , , , (one hour), , (one day), , (one month) Default value: (30 minutes) |
sort | String | Sort direction Accepted values: , Default value: |
from | Datetime | Interval initial value (optional parameter) |
till | Datetime | Interval end value (optional parameter) |
limit | Number | Limit of candles Default value: Max value: |
offset | Number | Default value: 0 Max value: |
Responses:
Name | Type | Description |
---|---|---|
timestamp | Datetime | Candle timestamp |
open | Number | Open price |
close | Number | Closing price |
min | Number | Lowest price for the period |
max | Number | Highest price for the period |
volume | Number | Volume in base currency |
volumeQuote | Number | Volume in quote currency |
Public market data are available without authentication. Authentication is required for other requests.
You should create API keys on the API Setting page. You can create multiple API keys with different access rights for your applications.
Use Basic Authentication to access the REST API.
-
-