🔀Spot
Spot Trading API Documentation
Terminology
base asset
refers to the asset that is thequantity
of a symbol.quote asset
refers to the asset that is theprice
of a symbol.
Symbol status
TRADING
HALT
BREAK
Order status
NEW
PARTIALLY_FILLED
FILLED
CANCELED
PENDING_CANCEL
REJECTED
Order types
LIMIT
MARKET
Order side
BUY
SELL
Time in Force
GTC
IOC
FOK
Kline/Candlestick Interval
m -> minutes; h -> hours; d -> days; w -> weeks; M -> months
1m
3m
5m
15m
30m
1h
2h
4h
6h
8h
12h
1d
3d
1w
1M
For detailed request limit information, see brokerInfo.
Rate limiters (rateLimitType)
REQUESTS_WEIGHT
ORDERS
Rate limit intervals
SECOND
MINUTE
DAY
For example:
Public
Security Type: None
Endpoints under Public section can be accessed freely without requiring any API-key or signatures.
Test Connectivity
GET
https://api.coinflare.com/openapi/v1/ping
This endpoint checks connectivity to the host
Path Parameters
string
Weight: 0
Get Server Time
GET
https://api.coinflare.com/openapi/v1/time
Path Parameters
string
Weight: 0
Get Trading Pairs
GET
https://api.coinflare.com/openapi/v1/pairs
Market
Security Type: None
Endpoints under the Market section can be accessed freely without requiring any API-key or signatures.
Broker Token Information
GET
https://api.coinflare.com/openapi/v1/brokerInfo
Current broker trading rules and symbol information
Query Parameters
type
string
Trade section information. Possible values include token
, options
, and contracts
, If the parameter is not sent, all trading information will be returned.
Response:
timezone
string
UTC
Timezone of timestamp
serverTime
long
1554887652929
Retrieves the current time on server (in ms).
In the symbols
field, All actively trading symbols will be displayed.
symbol
string
ETHBTC
Name of the symbol
status
string
TRADING
Status of the symbol
baseAsset
string
ETH
Underlying asset for the symbol
baseAssetPrecision
float
0.001
Precision of the symbol quantity
quoteAsset
string
BTC
Quote asset for the symbol
quoteAssetPrecision
float
0.01
Precision of the symbol price
icebergAllowed
string
false
Whether iceberg orders are allowed.
For filters
in symbols
field:
filterType
string
PRICE_FILTER
Type of the filter.
minPrice
float
0.001
Minimum of the symbol price
maxPrice
float
100000.00000000
Maximum of the symbol price
tickSize
float
0.001
Precision of the symbol price.
minQty
float
0.01
Minimal trading quantity of the symbol
maxQty
float
100000.00000000
Maximum trading quantity of the symbol
stepSize
float
0.001
Precision of the symbol quantity
minNotional
float
1
Precision of the symbol order size (quantity * price)
Depth
GET
https://api.coinflare.com/openapi/quote/v1/depth
This endpoint retrieve market depth data. This endpoint updates every 300ms.
Query Parameters
symbol
string
Symbol Name. E.g. BTCUSDT
limit
integer
Default 100; Max 100.
Response:
time
long
1550829103981
Current timestamp (ms)
bids
list
(see below)
List of all bids, best bids first. See below for entry details.
asks
list
(see below)
List of all asks, best asks first. See below for entry details.
The fields bids
and asks
are lists of order book price level entries, sorted from best to worst.
''
float
123.10
price level
''
float
300
The total quantity of orders for this price level
Merged Depth (Recommended)
GET
https://api.coinflare.com/openapi/quote/v1/depth/merged
This endpoint retrieve market depth data (not full depth). This endpoint updates every 300ms.
Query Parameters
symbol
string
Symbol Name. E.g. BTCUSDT
limit
integer
Default 40; Max 40.
Response:
time
long
1550829103981
Current timestamp (ms)
bids
list
(see below)
List of all bids, best bids first. See below for entry details.
asks
list
(see below)
List of all asks, best asks first. See below for entry details.
The fields bids
and asks
are lists of order book price level entries, sorted from best to worst.
''
float
123.10
price level
''
float
300
The total quantity of orders for this price level
Recent Trades List
GET
https://api.coinflare.com/openapi/quote/v1/trades
This endpoint retrieves latest trades
Query Parameters
symbol
string
Symbol Name. E.g. BTCUSDT
limit
integer
Default 500; Max 1000
Response:
price
float
0.055
The price of the trade
time
long
1537797044116
Current timestamp (ms)
qty
float
5
The quantity traded
isBuyerMaker
string
true
true
= Order is a buy order when created, false
= Order is a sell order when created
Kline/candlestick data
GET
https://api.coinflare.com/openapi/quote/v1/klines
This endpoint retrieves kline data
Query Parameters
symbol
string
Symbol Name
interval
string
Interval of the Kline. Possible values include: 1m
,5m
,15m
,30m
,1h
,1d
,1w
,1M
startTime
number
Starting timestamp (ms)
endTime
number
Ending timestamp (ms)
limit
integer
Default 500; Max 1000
Response:
''
long
1538728740000
Open Time
''
float
36.00000
Open
''
float
36.00000
High
''
float
36.00000
Low
''
float
36.00000
Close
''
float
148976.11427815
Trade volume amount
''
long
1538728740000
Close time
''
float
2434.19055334
Quote asset volume
''
integer
308
Number of trades
''
float
1756.87402397
Taker buy base asset volume
''
float
28.46694368
Taker buy quote asset volume
If startTime and endTime are not sent, the most recent klines are returned.
24hrs ticker price change statistics
GET
https://api.coinflare.com/openapi/quote/v1/ticker/24hr
24 hour price change statistics. Careful when accessing this no symbol.
Path Parameters
symbol
string
Symbol Name. E.g. BTCUSDT
Response:
time
long
1538728740000
Open Time
symbol
string
ETHBTC
Symbol Name
bestBidPrice
float
4.000002000
Best Bid Price
bestAskPrice
float
4.000002000
Best Ask Price
lastPrice
float
4.000002000
Last Price
openPrice
float
99.0000000
Open Price
highPrice
float
100.0000000
High Price
lowPrice
float
0.10000000
Low Price
volume
float
8913.300000
Trade Volume
If the symbol is not sent, tickers for all symbols will be returned in an array.
Symbol price ticker
GET
https://api.coinflare.com/openapi/quote/v1/ticker/price
Latest price for a symbol or symbols
Query Parameters
symbol
string
Symbol Name. E.g. BTCUSDT
Response:
symbol
string
ETHBTC
Symbol Name
price
float
4.0000200
Symbol Price
If the symbol is not sent, prices for all symbols will be returned in an array.
Symbol Orderbook Ticker
GET
https://api.coinflare.com/openapi/quote/v1/ticker/bookTicker
Best price/quantity on the orderbook for a symbol or symbols
Path Parameters
symbol
string
Symbol Name. E.g. BTCUSDT
Response:
symbol
string
ETHBTC
Symbol Name
bidPrice
float
4.0000000
Bid Price
bidQty
float
431
Bid Quantity
askPrice
float
4.0000200
Ask Price
askQty
float
9
Ask Quantity
If the symbol is not sent, prices for all symbols will be returned in an array.
Trade
Security Type: USER_DATA/TRADE
Endpoints under Trade require an API-key and a signature.
New Order
POST
https://api.coinflare.com/openapi/v1/order
This endpoint allows you to send in a new order
Query Parameters
symbol
string
Symbol Name. E.g. BTCUSDT
quantity
number
Order quantity. For MARKET BUY orders, quantity
=amount
.
side
string
Side of the order, BUY/SELL
type
string
Type of the order, LIMIT/MARKET/LIMIT_MAKER
timeInForce
string
Time in force. Possible values include GTC
(Default),FOK
,IOC
price
number
Order price, REQUIRED for LIMIT
orders
newClientOrderId
string
Unique order ID generated by users to mark their orders
Headers
X-BH-APIKEY
string
Your API key.
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp(ms)
recvWindow
integer
RecvWindow for this request.
Weight: 1
Response:
orderId
integer
891
ID of the order.
clientOrderId
integer
213443
A unique ID of the order.
symbol
string
LXTUSDT
Symbol Name
transactTime
integer
1573713225668
Time the order is placed
price
float
4765.29
Price of the order.
origQty
float
1.01
Quantity ordered
executedQty
float
1.01
Quantity of orders that has been executed
type
string
LIMIT
The order type, possible types: LIMIT
, MARKET
side
string
BUY
Direction of the order. Possible values include BUY
or SELL
status
string
NEW
The state of the order.Possible values include NEW
, PARTIALLY_FILLED
, FILLED
, CANCELED
, and REJECTED
.
timeInForce
string
GTC
Time in force. Possible values include GTC
,FOK
,IOC
Weight: 1
Test New Order
POST
https://api.coinflare.com/openapi/v1/order/test
Test new order creation and signature/recvWindow length. Creates and validates a new order but does not send the order into the matching engine.
Query Parameters
symbol
string
Symbol Names. E.g. BTCUSDT
quantity
number
Order Quantity
side
string
Side of the order, BUY/SELL
type
string
Type of the order, LIMIT/MARKET/LIMIT_MAKER
timeInForce
string
Time in force. Possible values include GTC
(Default),FOK
,IOC
price
number
Order Price, REQUIRED for LIMIT orders
newClientOrderId
string
Unique order ID generated by users to mark their orders.
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp(ms)
recvWindow
integer
RecvWindow for this request.
Weight: 1
Query Order
GET
https://api.coinflare.com/openapi/v1/order
Check an order's
Query Parameters
orderId
string
Order Id. E.g. 507904211109878016
clientOrderId
string
Client Order Id, Unique order ID generated by users to mark their orders. E.g. 12094ahsihsiad
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp(ms)
recvWindow
integer
RecvWindow for this request.
Response:
orderId
integer
713637304
ID of the order
clientOrderId
string
213443
Unique ID of the order.
symbol
string
BHTUSDT
name of the symbol
price
float
12.34
Price of the order.
origQty
float
1.01
Quantity ordered
executedQty
float
1.01
Quantity of orders that has been executed
avgPrice
float
4754.24
Average price of filled orders.
type
string
LIMIT
The order type, possible types: LIMIT
, MARKET
side
string
BUY
Direction of the order. Possible values include BUY
or SELL
status
string
NEW
The state of the order.Possible values include NEW
, PARTIALLY_FILLED
, FILLED
, CANCELED
, and REJECTED
.
timeInForce
string
GTC
Time in force. Possible values include GTC
,FOK
,IOC
.
Weight: 1
Either
orderId
orclientOrderId
must be sent.For some historical orders
cummulativeQuoteQty
will be < 0, meaning the data is not available at this time.
Cancel Order
DELETE
https://api.coinflare.com/openapi/v1/order
Cancel an active order
Query Parameters
orderId
string
Order Id. E.g. 507904211109878016
clientOrderId
string
Client Order Id, Unique order ID generated by users to mark their orders. E.g. 12094ahsihsiad
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp(ms)
recvWindow
integer
RecvWindow for this request.
orderId
integer
713637304
ID of the order
clientOrderId
string
213443
Unique ID of the order.
symbol
string
BHTUSDT
Name of the symbol
status
string
NEW
The state of the order.Possible values include NEW
, PARTIALLY_FILLED
, FILLED
, CANCELED
, and REJECTED
.
Weight: 1
Either
orderId
orclientOrderId
must be sent.
Current Open Orders
GET
https://api.coinflare.com/openapi/v1/openOrders
Get all open orders on a symbol. Careful when accessing this with no symbol
Query Parameters
symbol
string
Symbol Name. E.g. BTCUSDT
orderId
string
Order Id. E.g. 507904211109878016
limit
integer
Default 500; Max 1000
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp(ms)
recvWindow
integer
RecvWindow for this request.
Response:
orderId
integer
713637304
ID of the order
clientOrderId
string
213443
Unique ID of the order.
symbol
string
BHTUSDT
name of the symbol
price
float
12.34
Price of the order.
origQty
float
1.01
Quantity ordered
executedQty
float
1.01
Quantity of orders that has been executed
avgPrice
float
4754.24
Average price of filled orders.
type
string
LIMIT
The order type, possible types: LIMIT
, MARKET
side
string
BUY
Direction of the order. Possible values include BUY
or SELL
status
string
NEW
The state of the order.Possible values include NEW
, PARTIALLY_FILLED
, FILLED
, CANCELED
, and REJECTED
.
timeInForce
string
GTC
Time in force. Possible values include GTC
,FOK
,IOC
.
Weight: 1
If
orderId
is set, it will get orders < thatorderId
. Otherwise most recent orders are returned.Weight: 1
If
orderId
is set, it will get orders < thatorderId
. Otherwise most recent orders are returned.
History Orders
GET
https://api.coinflare.com/openapi/v1/historyOrders
Get all history orders. Careful when accessing this with no symbol.
Query Parameters
symbol
string
Symbol Name. E.g. BTCUSDT
orderId
string
Order Id. E.g. 507904211109878016
startTime
integer
Start time (ms)
endTime
integer
End Time (ms)
limit
integer
Default 500; Max 1000
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp(ms)
recvWindow
integer
RecvWindow for this request.
Response:
orderId
integer
713637304
ID of the order
clientOrderId
string
213443
Unique ID of the order.
symbol
string
BHTUSDT
name of the symbol
price
float
12.34
Price of the order.
origQty
float
1.01
Quantity ordered
executedQty
float
1.01
Quantity of orders that has been executed
avgPrice
float
4754.24
Average price of filled orders.
type
string
LIMIT
The order type, possible types: LIMIT
, MARKET
side
string
BUY
Direction of the order. Possible values include BUY
or SELL
status
string
NEW
The state of the order.Possible values include FILLED
, CANCELED
, and REJECTED
.
timeInForce
string
GTC
Time in force. Possible values include GTC
,FOK
,IOC
.
Weight: 5
If
orderId
is set, it will get orders < thatorderId
. Otherwise most recent orders are returned.
Trades
GET
https://api.coinflare.com/openapi/v1/myTrades
Get historical trades.
Query Parameters
symbol
string
Symbol Name. E.g. BTCUSDT
startTime
integer
Start time (ms)
endTime
integer
End time (ms)
fromId
integer
Trade Id to fetch from
toId
integer
Trade Id to fetch to
limit
integer
Default 500; Max 1000
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp(ms)
recvWindow
integer
RecvWindow for this request.
Response:
symbol
string
ETHBTC
Symbol Name (trading pair)
id
integer
28457
Trade ID
orderId
integer
100234
Order ID
price
integer
4.001
Timestamp of the trade
qty
float
12
Trade quantity
commission
float
10.10000
Trading fee
commissionAsset
string
ETH
Trading fee token name
time
number
1499865549590
Timestamp of the trade
isBuyer
bool
true
true
= Buyer false
= Seller
isMaker
bool
false
true
=Maker false
=Taker
Weight: 5
If only
fromId
is set,it will get orders < thatfromId
in descending order.If only
toId
is set, it will get orders > thattoId
in ascending order.If
fromId
is set andtoId
is set, it will get orders < thatfromId
and > thattoId
in descending order.If
fromId
is not set andtoId
it not set, most recent order are returned in descending order.
Account
Security Type: USER_DATA/TRADE
Endpoints under Account require an API-key and a signature.
Account Information
GET
https://api.coinflare.com/openapi/v1/account
Get current account information (balances)
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp(ms)
recvWindow
integer
RecvWindow for this request.
Response:
balances
float
Show balance details.
In the balances
field:
asset
string
USDT
Name of the asset
free
float
600.0
Amount available for use
locked
float
100.0
Amount locked (for open orders)
Weight: 5
Account Deposit Information
GET
https://api.coinflare.com/openapi/v1/depositOrders
Get deposit orders for a specific account
Query Parameters
startTime
integer
Start time (ms)
endTime
integer
End time (ms)
fromId
string
Deposit orderId to fetch from. Default gets the most recent deposit orders.
limit
integer
Default 500; Max 1000
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp(ms)
RecvWindow
integer
RecvWindow for this request.
Response:
time
float
1565769575929
Deposit timestamp.
orderId
integer
428100569859739648
Order ID
token
string
USDT
Token Name
address
string
Your token address
addressTag
string
Your token address tag
fromAddress
string
From which token address
fromAddressTag
string
From which token address tag
quantity
float
1100
Transferred quantity
Weight: 5
If
fromId
is set, it will get orders > thatfromId
. Otherwise most recent orders are returned.
Account withdrawal information
GET
https://api.coinflare.com/openapi/v1/withdrawalOrders
Query Parameters
token
string
Token name. Default: All tokens.
startTime
number
Starting timestamp(ms)
endTime
number
Ending timestamp(ms)
fromId
number
Query from this OrderId. Defaults to latest records.
limit
integer
Default 500; Max 1000
Headers
X-BH-APIKEY
string
Your API Key
Request Body
signature
string
Authentication is needed for this endpoint.
timestamp
integer
Current unix timestamp(ms).
recvWindow
integer
RecvWindow for this request.
1
BROKER_AUDITING_STATUS
Processing by broker
2
BROKER_REJECT_STATUS
Rejected by broker
3
AUDITING_STATUS
Processing by platform
4
AUDIT_REJECT_STATUS
Reject by platform
5
PROCESSING_STATUS
Processing by wallet
6
WITHDRAWAL_SUCCESS_STATUS
Withdrawal success
7
WITHDRAWAL_FAILURE_STATUS
Withdrawal failed
8
BLOCK_MINING_STATUS
Blockchain mining
Withdrawal Detail
GET
https://api.coinflare.com/openapi/v1/withdraw/detail
Get withdrawal info
Query Parameters
orderId
number
Either orderId or clientOrderId must be sent
clientOrderId
string
Either orderId or clientOrderId must be sent
Headers
X-BH-APIKEY
string
Your API Key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current Unix Timestamp (ms)
recvWindow
integer
RecvWindow for this request.
Get Sub-account list
POST
https://api.coinflare.com/openapi/v1/subAccount/query
Get your main-account and sub-accounts
Headers
X-BH-APIKEY
string
Your API Key
Request Body
signature
string
Authentication is needed for this request
timestamp
integer
Current unix timestamp (ms)
RecvWindow
integer
Recv Window for this request
Response:
accountId
integer
YES
Your accountId for main-account or sub-account
accountName
string
YES
Name of your account.
accountType
integer
YES
Account type: 1. token trading account 2. Options account 3. Contracts account
accountIndex
integer
YES
0: main account; >0 (1 or larger): sub-account
Weight: 5
Internal Account Transfer
POST
https://api.coinflare.com/openapi/v1/transfer
Internal transfer are permitted using this endpoint
Query Parameters
fromAccountType
string
Source account type: 1. token trading account 2.Options account 3. Contracts account
fromAccountIndex
string
Sub-account index(valid when using main-account api, get sub-account indices from /subAccount/query
endpoint)
toAccountType
integer
Source account type: 1. token trading account 2.Options account 3. Contracts account
toAccountIndex
integer
Sub-account index(valid when using main-account api, get sub-account indices from /subAccount/query
endpoint)
tokenId
string
Token Id. E.g. BTC
, ETH
, XRP
amount
integer
Amount of token(s) to be transferred
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint
timestamp
integer
Current unix timestamp (ms)
RecvWindow
integer
Recv window for this request
Explanation
Either transferring or receiving account must be the main account (Token trading account)
Main-account API can support transferring to other account(including sub-accounts) and receiving from other accounts
Sub-account API only supports transferring from current account to the main-account. Therefore
fromAccountType\fromAccountIndex\toAccountType\toAccountIndex
should be left empty.Weight: 1
Withdraw
POST
https://api.coinflare.com/openapi/v1/withdraw
Withdraw to external address
Query Parameters
tokenId
string
TokenId. E.g. BTC、ETH...
clientOrderId
string
Id generated from broker side, to prevent double withdrawal
address
string
提 Withdrawal address (Note: the withdrawal address must be in current tag list in your PC/APP client)
addressExt
string
EOS tag
withdrawQuantity
string
WIthdrawal Amount
chainType
string
chain type, USDT chain types areOMNI
ERC20
TRC20
default is OMNI
Headers
X-BH-APIKEY
string
Your API Key
Request Body
signature
string
Authentication is needed for this endpoint.
timestamp
integer
Current Unix Timestamp(ms)
recvWindow
integer
RecvWindow for this request
Check Balance Flow
GET
https://api.coinflare.com/openapi/v1/balance_flow
Check balance flow for a specified account
Query Parameters
accountType
integer
Account type: 1. token trading account 2.Options account 3. Contracts account
accountIndex
integer
Sub-account index(valid when using main-account api, get sub-account indices from /subAccount/query
endpoint)
tokenId
string
Token Id. E.g. BTC, ETH, XRP
fromFlowId
integer
FlowId to start from
endFlowId
integer
FlowId to end with
startTime
integer
Time to start from
endTime
integer
Time to end with
limit
integer
Number of entries returned. Default 500, max 500.
Headers
X-BH-APIKEY
string
Your API key
Request Body
signature
string
Authentication is needed for this endpoint.
timestamp
integer
Current Unix timestamp (ms)
RecvWindow
integer
Recv window for this request
Explanation
Main-account API can query balance flow for token account and other accounts(including sub-accounts, or designated
accountType
andaccountIndex
accounts)Sub-account API can only query current sub-account, therefore
accountType
andaccountIndex
is not required.
Response:
id
integer
539870570957903104
Flow id
accountId
integer
122216245228131
Your accountId
tokenId
string
USDT
Token ID
tokenId
string
USDT
Token name, same as token id in most cases
flowTypeValue
integer
51
Flow type value
flowType
string
AIRDROP
Flow type
flowName
string
Airdrop
Flow type name
change
float
-12.5
Amount affected for this action
total
float
782.235
Account balance after the action
created
string
1579093587214
Timestamp of the action
Balance Flow Types:
General Balance Flow
TRADE
1
trades
General Balance Flow
FEE
2
trading fees
General Balance Flow
TRANSFER
3
transfer
General Balance Flow
DEPOSIT
4
deposit
Derivatives
MAKER_REWARD
27
maker reward
Derivatives
PNL
28
PnL from contracts
Derivatives
SETTLEMENT
30
Settlement
Derivatives
LIQUIDATION
31
Liquidation
Derivatives
FUNDING_SETTLEMENT
32
Funding fee settlement
Internal Transfer
USER_ACCOUNT_TRANSFER
51
userAccountTransfer Exclusive
OTC
OTC_BUY_COIN
65
OTC buy coin
OTC
OTC_SELL_COIN
66
OTC sell coin
OTC
OTC_FEE
73
OTC fees
OTC
OTC_TRADE
200
Old OTC balance flow
Campaign
ACTIVITY_AWARD
67
Campaign reward
Campaign
INVITATION_REFERRAL_BONUS
68
User rebates
Campaign
REGISTER_BONUS
69
Registration reward
Campaign
AIRDROP
70
Airdrop
Campaign
MINE_REWARD
71
Mining reward
Weight: 5
Last updated