Public API --go to Trader API

  • Public API for the exchange market data.
  • Response Style: {"status":{"success":1},"result":null} success if success = 1 and result is the return data.
  • Base URL: https://rightbtc.com/api/public/

DATA

DATA - CANDLESTICK LATEST

Get the candlestick data for given trading pair and time intervals.

GET

/candlestick/latest/:trading_pair

Example Usage:

curl https://www.rightbtc.com/api/public/candlestick/latest/BTCCNY

Success 200

Parameter:

Field Type Description
result Object each key is a timeSymbol, and value is [time, volume, open, high, low, close], each price/quantity should divide by 1E8.

Success-Response

{
    "status": {
        "success": 1,
        "message": null
    },
    "result": {
        "hr4": [
            1497600000000,
            16223600000,
            1840473000000,
            1841676000000,
            1794081000000,
            1804602000000
        ],
        "min5": [
            1497603300000,
            167600000,
            1804782000000,
            1805684000000,
            1804000000000,
            1804602000000
        ],
        "hr1": [
            1497600000000,
            16223600000,
            1840473000000,
            1841676000000,
            1794081000000,
            1804602000000
        ],
        "hr2": [
            1497600000000,
            16223600000,
            1840473000000,
            1841676000000,
            1794081000000,
            1804602000000
        ],
        "min3": [
            1497603420000,
            75200000,
            1804281000000,
            1805002000000,
            1804281000000,
            1804602000000
        ],
        "hr6": [
            1497592800000,
            48484500000,
            1795239000000,
            1842678000000,
            1788690000000,
            1804602000000
        ],
        "hr12": [
            1497571200000,
            88001900000,
            1797087000000,
            1842678000000,
            1774141000000,
            1804602000000
        ],
        "day3": [
            1497398400000,
            595937100000,
            1923589000000,
            1953699000000,
            1679953000000,
            1804602000000
        ],
        "week": [
            1497484800000,
            318750300000,
            1826233000000,
            1842678000000,
            1679953000000,
            1804602000000
        ],
        "day1": [
            1497571200000,
            88001900000,
            1797087000000,
            1842678000000,
            1774141000000,
            1804602000000
        ],
        "min15": [
            1497602700000,
            1366700000,
            1807609000000,
            1817628000000,
            1804000000000,
            1804602000000
        ],
        "min1": [
            1497603480000,
            74700000,
            1805002000000,
            1805002000000,
            1804281000000,
            1804602000000
        ],
        "min30": [
            1497601800000,
            5635800000,
            1807307000000,
            1817628000000,
            1794081000000,
            1804602000000
        ]
    }
}

DATA - CANDLESTICKS

  • Get the candlestick data for given trading pair and time intervals.

GET

/candlestick/:timeSymbol/:trading_pair/[:count]

Example Usage:

curl https://www.rightbtc.com/api/public/candlestick/day1/BTCCNY/3

Success 200

Parameter:

Field Type Description
result Array candlestick, item is [time, volume, open, high, low, close], each price/quantity should divide by 1E8.

Success-Response

{
    "status": {
        "success": 1,
        "message": null
    },
    "result": [
        [
            1497312000000,
            257689500000,
            1892576000000,
            1958910000000,
            1874050000000,
            1923589000000
        ],
        [
            1497398400000,
            277186800000,
            1923589000000,
            1953699000000,
            1748488000000,
            1826233000000
        ],
        [
            1497484800000,
            230748400000,
            1826233000000,
            1829151000000,
            1679953000000,
            1797087000000
        ]
    ]
}

DATA - LIST TRADING PAIRS

Returns all trading pairs.

GET

/trading_pairs

Example Usage:

curl https://www.rightbtc.com/api/public/trading_pairs

Success 200

Parameter:

Field Type Description
name String trding pair
ask_asset_symbol String FIAT

Success-Response

{
    "status": {
        "success": 1,
        "message": {
              "ONIONETH": {
                  "name": "ONIONETH",
                  "bid_asset_symbol": "ONION",
                  "bid_asset_decimals": "8",
                  "bid_asset_type": "COIN",
                  "ask_asset_symbol": "ETH",
                  "ask_asset_decimals": "8",
                  "ask_asset_type": "FIAT"
                           },.....
                  }
              }
}

DATA - ORDERBOOK

  • Get the current orderbook for given trading pair.

GET

/depth/:trading_pair/[:count]

Example Usage:

curl https://www.rightbtc.com/api/public/depth/BTCCNY

Success 200

Parameter:

Field Type Description
market String trading pair
ask Array ask depth, fisrt item is best ask, item order is [price, quantity, total quantity], each price/quantity should divide by 1E8.
bid Array bid depth, fisrt item is best bid, item order is [price, quantity, total quantity], each price/quantity should divide by 1E8.

Success-Response

{
    "status": {
        "success": 1,
        "message": null
    },
    "result": {
        "market": "BTCCNY",
        "ask": [
            [
                2000000000000,
                100000000,
                100000000
            ],
            [
                2000100000000,
                100000000,
                200000000
            ],
            [
                2000200000000,
                100000000,
                300000000
            ]
        ],
        "bid": [
            [
                1999900000000,
                100000000,
                100000000
            ],
            [
                1999800000000,
                100000000,
                200000000
            ],
            [
                1999700000000,
                100000000,
                300000000
            ]
        ]
    }
}

DATA - TICKER

Get the ticker for given trading pair.

GET

/ticker/:trading_pair

Example Usage:

curl https://www.rightbtc.com/api/public/ticker/BTCCNY

Success 200

Parameter:

Field Type Description
market String trading pair
date Number time in milliseconds
sell Number best sell price, should divide by 1E8.
buy Number best buy price, should divide by 1E8.
high Number highest price, should divide by 1E8.
low Number lowest price, should divide by 1E8.
last Number latest price, should divide by 1E8.
last24h Number price at 24 hours ago, should divide by 1E8.
vol Number volume calculated by day, should divide by 1E8.

Success-Response

{
    "status": {
        "success": 1,
        "message": null
    },
    "result": {
        "market": "BTCCNY",
        "date": 1497602424876,
        "sell": 1801596000000,
        "buy": 1799141000000,
        "high": 1842678000000,
        "low": 1774141000000,
        "last": 1801349000000,
        "last24h": 1759121000000,
        "vol": 86300900000
    }
}

DATA - TICKERS

Get the tickers for all trading pair.

GET

/tickers

Example Usage:

curl https://www.rightbtc.com/api/public/tickers

Success 200

Parameter:

Field Type Description
market String trading pair
date Number time in milliseconds
sell Number best sell price, should divide by 1E8.
buy Number best buy price, should divide by 1E8.
high Number highest price, should divide by 1E8.
low Number lowest price, should divide by 1E8.
last Number latest price, should divide by 1E8.
last24h Number price at 24 hours ago, should divide by 1E8.
vol Number volume calculated by day, should divide by 1E8.

Success-Response

{
    "status": {
        "success": 1,
        "message": null
    },
    "result": [
        {
            "market": "OBSCNY",
            "date": 1497601212761,
            "sell": 2043000000,
            "buy": 1963010000,
            "high": 2097200000,
            "low": 1900000000,
            "last": 2043000000,
            "last24h": 2080000000,
            "vol": 427342840000
        },
        {
            "market": "ZECCNY",
            "date": 1497601217414,
            "sell": 270900000000,
            "buy": 270000000000,
            "high": 287158000000,
            "low": 254156000000,
            "last": 270094000000,
            "last24h": 256418000000,
            "vol": 934208800000
        },
        {
            "market": "ETCCNY",
            "date": 1497601216148,
            "sell": 12814000000,
            "buy": 12775000000,
            "high": 12968000000,
            "low": 12191000000,
            "last": 12803000000,
            "last24h": 12785000000,
            "vol": 2166115000000
        },
        {
            "market": "ETHCNY",
            "date": 1497601215973,
            "sell": 264131000000,
            "buy": 263898000000,
            "high": 267622000000,
            "low": 236690000000,
            "last": 264070000000,
            "last24h": 245682000000,
            "vol": 11648096800000
        },
        {
            "market": "BTSCNY",
            "date": 1497601214341,
            "sell": 231240000,
            "buy": 230960000,
            "high": 240150000,
            "low": 217930000,
            "last": 231060000,
            "last24h": 222780000,
            "vol": 563423920490000
        },
        {
            "market": "ETPCNY",
            "date": 1497601208510,
            "sell": 3350000000,
            "buy": 3349000000,
            "high": 3350000000,
            "low": 3156000000,
            "last": 3350000000,
            "last24h": 3165000000,
            "vol": 3067245000000
        },
        {
            "market": "BTCCNY",
            "date": 1497601209883,
            "sell": 1826644000000,
            "buy": 1826575000000,
            "high": 1842678000000,
            "low": 1774141000000,
            "last": 1826646000000,
            "last24h": 1775544000000,
            "vol": 76237000000
        }
    ]
}

DATA - TRADES

Get the latest trades for given trading pair.

GET

/trades/:trading_pair/[:count]

Example Usage:

curl https://www.rightbtc.com/api/public/trades/BTCCNY/3

Success 200

Parameter:

Field Type Description
date Number time in milliseconds.
price Number trade price, should divide by 1E8.
amount Number trade price, should divide by 1E8.
tid Number trade ID.
side Number BUY or SELL

Success-Response

{
    "status": {
        "success": 1,
        "message": null
    },
    "result": [
        {
            "date": 1497601992136,
            "price": 1795684000000,
            "amount": 4100000,
            "tid": 8004750,
            "side": "BUY"
        },
        {
            "date": 1497601992136,
            "price": 1795052000000,
            "amount": 18800000,
            "tid": 8004752,
            "side": "BUY"
        },
        {
            "date": 1497601999035,
            "price": 1794982000000,
            "amount": 22900000,
            "tid": 8004784,
            "side": "SELL"
        }
    ]
}

TRADING

  • TRADING - 根据语言返回相应国际化TRADING PAIR数据

  • Returns the available tradings pairs.

GET

/getAssetsTradingPairs/zh