F8Coin_ Global Digital Currency Asset Trading Platform_ Trans-Fee Mining

Home page  >   API documentation

F8 provides a simple and powerful API for users to quickly and efficiently integrate F8 transaction functions into their applications. If you have any questions during use, please contact us and we will give you the most authoritative answer.

API Request Description


request URL prefix:   http://www.f8coin.com/api/rest/v1
request parameter
name type description
code string 0-error
msg string wrong information
data array interface return data
Whether the interface requires a signature
interface name interface URL Signature required(Y-yes N-no)
get all trading pairs /common/symbols N
get certain pair latest market /ticker/ticker N
get account information /getAccountInfo/getAccountInfo Y
order /order/order Y
cancel order /cancelOrder/cancelOrder Y
Query order details /getOrder/getOrderDetail Y
parameter sign description All request parameters of the interface to be signed participate in the signature (sign itself does not participate in the signature); all parameters are sorted according to the parameter name ASCII code order, and encrypted by APISercret using HmacSHA256 protocol to obtain the signature parameter sign
// Java版本签名方法
public static String sha256_HMAC(SortedMap< String, String > paramMap, String secret) {
    String params = "";
    String firstKey = paramMap.firstKey();
    for (Map.Entry< String, String > entry : paramMap.entrySet()) {
        // 如果是第一个不加&
        String key = entry.getKey();
        String value = entry.getValue();
        if (!firstKey.equals(key)) {
            params += "&";
        }
        params += key + "=" + value;
    }
    return sha256_HMAC(params, secret); }
/**
  * sha256_HMAC 加密
  */
private static String byteArrayToHexString(byte[] b) {
    StringBuilder hs = new StringBuilder();
    String stmp;
    for (int n = 0; b != null && n < b.length; n++) {
        stmp = Integer.toHexString(b[n] & 0XFF);
        if (stmp.length() == 1)
            hs.append('0');
        hs.append(stmp);
    }
    return hs.toString().toLowerCase();
}

order


request URL   /order/order
request type   GET
parameter
parameter name required type description
accesskey Yes string APIKey
amount Yes string trade amount
market Yes string pair name
method Yes string Direct assignment order
price Yes string price
tradeType Yes string trade type0/1[buy/sell]
reqTime Yes string Current time in milliseconds
sign Yes string Request encrypted signature string
example
{     "code": "0",     "msg": "下单成功",      "data": {         "orderId": 232051     } }
return parameter description
parameter name type description
orderId long orderID

cancel order


request URL   /cancelOrder/cancelOrder
request type   GET
parameter
parameter name required type description
accesskey Yes string APIKey
currency Yes string 交易对名称
id Yes string orderID
method Yes string Direct assignment cancelOrder
reqTime Yes string Current time in milliseconds
sign Yes string Request encrypted signature string
example
{
    "code": "0",
    "msg": "取消订单成功"
}

get Account Information


request URL   /getAccountInfo/getAccountInfo
request type   GET
parameter
parameter name required type description
accesskey Yes string APIKey
method Yes string sendgetAccountInfo
reqTime Yes string Current time in milliseconds
sign Yes string Request encrypted signature string
example
{
    "code": "0",
    "msg": "成功",
    "data": {
        "bases": {
            "auth_google_enabled": false,
            "auth_mobile_enabled": false,
            "trade_password_enabled": true,
            "username": "1428819869@qq.com"
        },
        "coins": [
            {
                "cnName": "BTC",
                "enName": "BTC",
                "available": "427.04702476",
                "freez": "4.21450500",
                "unitTag": "BTC",
                "unitDecimal": 8,
                "key": "btc"
            },
            {
                "cnName": "ETH",
                "enName": "ETH",
                "available": "1001.93312079",
                "freez": "0.00000000",
                "unitTag": "ETH",
                "unitDecimal": 8,
                "key": "eth"
            }
        ]
    }
}
return parameter description
parameter name type description
auth_google_enabled boolean enabled google authentication or not
auth_mobile_enabled boolean enabled SMS authentication or not
trade_password_enabled boolean enabled payment password or not
username string account name
cnName int coin Chinese name
enName int coin English name
available int available asset
freez int frozen asset
unitTag int coin symbol
unitDecimal int Keep decimal places
key int coin

Get Order Detail


request URL   /getOrder/getOrderDetail
request type   GET
parameter
parameter name required type description
accesskey Yes string APIKey
market Yes string pair name
method Yes string Direct assignment getOrderDetail
reqTime Yes string Current time in milliseconds
id Yes string order id ID
sign Yes string Request encrypted signature string
example
{
    "code": "0",
    "msg": "ok",
    "data": {
        "market": "F8USDT",
        "total_amount": "1.00000000",
        "trade_amount": "0.00000000",
        "price": "8888.00000000",
        "id": "232051",
        "trade_money": "0.00000000",
        "type": 1,
        "trade_date": 1535425760000,
        "status": -1
    }
}
return parameter description
parameter name type description
market string pair name
total_amount string total amount
trade_amount string filled amount
price int price
id int order id
trade_money string total filled fee
type int order type 0/1【buy/sell】
trade_date long order type
status int filled )

get all pairs list


request URL   /common/symbols
request type   GET
parameter   无
example
{
    "code": "0",
    "msg": "成功",
    "data": [
        {
            "currencyPair": "BTC_USDT",
            "priceDisplayDp": 4,
            "minSize": 0.0001,
            "maxSize": 100000,
            "maxPrice": 100000,
            "MinPrice": 0.0001,
            "sizeDisplayDp": 4
        },
        {
            "currencyPair": "ETH_USDT",
            "priceDisplayDp": 4,
            "minSize": 0.0001,
            "maxSize": 100000,
            "maxPrice": 100000,
            "MinPrice": 0.0001,
            "sizeDisplayDp": 4
        },
        {
            "currencyPair": "ETH_BTC",
            "priceDisplayDp": 4,
            "minSize": 0.0001,
            "maxSize": 100000,
            "maxPrice": 100000,
            "MinPrice": 0.0001,
            "sizeDisplayDp": 4
        }
    ]
}
return parameter description
parameter name type description
pricePrecision string price accuracy
currencyPair string pair name
symbolPartition string Trading area
amountPredision string amount accuracy

get single pair depth


request URL   /depth/depth
request type   GET
parameter
parameter name required type description
market Yes string pair name such as :BTCUSDT
example
{
    "code": "0",
    "msg": "成功",
    "data": {
        "pairId": 2,
        "bids": [
            [
                198.43,
                6.0243
            ],
            [
                198.4,
                4.8
            ],
            [
                198.39,
                0.2434
            ]
        ],
        "asks": [
            [
                199.15,
                2.99
            ],
            [
                199.23,
                0.01
            ],
            [
                199.25,
                0.02
            ],
            [
                199.31,
                12.0641
            ],
        ],
    }
}
parameter name type description
pairId int pair nameID
bids array Buy orders
asks array Sell orders

get single pair trade record


request URL   /trades/trades
request type   GET
parameter
parameter name required type description
market Yes string pair name such as :BTCUSDT
example
{
    "code": "0",
    "msg": "成功",
    "data": {
        "pairId": 2,
        "execs": [
            {
                "price": 199.15,
                "size": 0.01,
                "takerSide": "B",
                "time": 1539413674000
            },
            {
                "price": 198.45,
                "size": 0.1964,
                "takerSide": "S",
                "time": 1539413629000
            },
            {
                "price": 199.15,
                "size": 0.9705,
                "takerSide": "B",
                "time": 1539402529000
            }
        ]
    }
}
parameter name type description
pairId int pair nameID
price decimal Order price
size decimal Order quantity
takerSide string Order type B-Buy S-Sell
time long Order time

Query the latest market for a single trade pair


request URL   /ticker/ticker
request type   GET
parameter
parameter name required type description
market Yes string pair name such as :BTCUSDT
example
{
    "code": "0",
    "data": {
        "quote": {
            "pairId": 23,
            "fromTime": 1535529721000,
            "toTime": 1535616120000,
            "open": 1,
            "high": 105.6,
            "low": 1,
            "close": 12,
            "volume": 5532.896023,
            "quoteVolume": 59507.47802722,
            "tradeNum": 265
        },
        "depth": {
            "asks": [
                12,
                929.2624
            ],
            "bids": [
                10,
                89.5692
            ]
        }
    }
}
return parameter description
parameter name type description
pairId int pair nameID
fromTime long start time
toTime long end time
open bigDecimal Open price
high bigDecimal highest price
low bigDecimal lowest price
close bigDecimal Closing price
volume bigDecimal volume
quoteVolume bigDecimal quote Volume
tradeNum long Trade Amount
asks array Sell orders[amount,price]
bids array Buy orders[amount,price]