比特儿API

1. 所有交易对 API

返回所有系统支持的交易对

URL: http://data.bter.com/api/1/pairs


2. 交易市场订单参数 API

返回所有系统支持的交易市场的参数信息,包括交易费,最小下单量,价格精度等。

URL: http://data.bter.com/api/1/marketinfo


3. 交易市场详细行情 API

返回所有系统支持的交易市场的详细行情和币种信息,包括币种名,市值,供应量,最新价格,涨跌趋势,价格曲线等。

URL: http://data.bter.com/api/1/marketlist


4. 所有交易行情 API

返回系统支持的所有交易对的 最新,最高,最低 交易行情和交易量,每10秒钟更新:

URL: http://data.bter.com/api/1/tickers


5. 单项交易行情 API

返回最新,最高,最低 交易行情和交易量,每10秒钟更新:

URL: http://data.bter.com/api/1/ticker/[CURR_A]_[CURR_B]

请替换 [CURR_A] and [CURR_B] 为您需要查看的币种.

支持的兑换类型:

http://data.bter.com/api/1/ticker/btc_cny
http://data.bter.com/api/1/ticker/ltc_cny
http://data.bter.com/api/1/ticker/blk_cny
http://data.bter.com/api/1/ticker/bitcny_cny
http://data.bter.com/api/1/ticker/bqc_cny
http://data.bter.com/api/1/ticker/btb_cny
http://data.bter.com/api/1/ticker/qtum_btc
http://data.bter.com/api/1/ticker/qtum_cny
http://data.bter.com/api/1/ticker/etp_btc
http://data.bter.com/api/1/ticker/etp_cny
http://data.bter.com/api/1/ticker/btrx_cny
http://data.bter.com/api/1/ticker/btrx_btc
http://data.bter.com/api/1/ticker/btq_cny
http://data.bter.com/api/1/ticker/bts_cny
http://data.bter.com/api/1/ticker/cent_cny
http://data.bter.com/api/1/ticker/cmc_cny
http://data.bter.com/api/1/ticker/cnc_cny
http://data.bter.com/api/1/ticker/rep_cny
http://data.bter.com/api/1/ticker/dgc_cny
http://data.bter.com/api/1/ticker/doge_cny
http://data.bter.com/api/1/ticker/dash_cny
http://data.bter.com/api/1/ticker/dtc_cny
http://data.bter.com/api/1/ticker/dvc_cny
http://data.bter.com/api/1/ticker/eth_cny
http://data.bter.com/api/1/ticker/etc_cny
http://data.bter.com/api/1/ticker/exc_cny
http://data.bter.com/api/1/ticker/ftc_cny
http://data.bter.com/api/1/ticker/frc_cny
http://data.bter.com/api/1/ticker/ifc_cny
http://data.bter.com/api/1/ticker/max_cny
http://data.bter.com/api/1/ticker/mec_cny
http://data.bter.com/api/1/ticker/mint_cny
http://data.bter.com/api/1/ticker/mmc_cny
http://data.bter.com/api/1/ticker/nbt_cny
http://data.bter.com/api/1/ticker/net_cny
http://data.bter.com/api/1/ticker/nmc_cny
http://data.bter.com/api/1/ticker/nxt_cny
http://data.bter.com/api/1/ticker/ppc_cny
http://data.bter.com/api/1/ticker/pts_cny
http://data.bter.com/api/1/ticker/qrk_cny
http://data.bter.com/api/1/ticker/red_cny
http://data.bter.com/api/1/ticker/shell_cny
http://data.bter.com/api/1/ticker/src_cny
http://data.bter.com/api/1/ticker/tag_cny
http://data.bter.com/api/1/ticker/tbc_cny
http://data.bter.com/api/1/ticker/tips_cny
http://data.bter.com/api/1/ticker/tix_cny
http://data.bter.com/api/1/ticker/vrc_cny
http://data.bter.com/api/1/ticker/vtc_cny
http://data.bter.com/api/1/ticker/wdc_cny
http://data.bter.com/api/1/ticker/xcp_cny
http://data.bter.com/api/1/ticker/xmr_cny
http://data.bter.com/api/1/ticker/xpm_cny
http://data.bter.com/api/1/ticker/xtc_cny
http://data.bter.com/api/1/ticker/yac_cny
http://data.bter.com/api/1/ticker/zcc_cny
http://data.bter.com/api/1/ticker/zet_cny
http://data.bter.com/api/1/ticker/ltc_btc
http://data.bter.com/api/1/ticker/ac_btc
http://data.bter.com/api/1/ticker/arch_btc
http://data.bter.com/api/1/ticker/aur_btc
http://data.bter.com/api/1/ticker/bay_btc
http://data.bter.com/api/1/ticker/bbr_btc
http://data.bter.com/api/1/ticker/blk_btc
http://data.bter.com/api/1/ticker/bitgld_btc
http://data.bter.com/api/1/ticker/block_btc
http://data.bter.com/api/1/ticker/bqc_btc
http://data.bter.com/api/1/ticker/btb_btc
http://data.bter.com/api/1/ticker/btcd_btc
http://data.bter.com/api/1/ticker/bts_btc
http://data.bter.com/api/1/ticker/buk_btc
http://data.bter.com/api/1/ticker/c2_btc
http://data.bter.com/api/1/ticker/cdc_btc
http://data.bter.com/api/1/ticker/ckc_btc
http://data.bter.com/api/1/ticker/comm_btc
http://data.bter.com/api/1/ticker/cmc_btc
http://data.bter.com/api/1/ticker/cnc_btc
http://data.bter.com/api/1/ticker/rep_btc
http://data.bter.com/api/1/ticker/hkg_btc
http://data.bter.com/api/1/ticker/dgc_btc
http://data.bter.com/api/1/ticker/doge_btc
http://data.bter.com/api/1/ticker/dns_btc
http://data.bter.com/api/1/ticker/dash_btc
http://data.bter.com/api/1/ticker/drkc_btc
http://data.bter.com/api/1/ticker/dtc_btc
http://data.bter.com/api/1/ticker/eth_btc
http://data.bter.com/api/1/ticker/etc_btc
http://data.bter.com/api/1/ticker/exc_btc
http://data.bter.com/api/1/ticker/flt_btc
http://data.bter.com/api/1/ticker/frc_btc
http://data.bter.com/api/1/ticker/frsh_btc
http://data.bter.com/api/1/ticker/ftc_btc
http://data.bter.com/api/1/ticker/ftp_btc
http://data.bter.com/api/1/ticker/gemz_btc
http://data.bter.com/api/1/ticker/ghost_btc
http://data.bter.com/api/1/ticker/gml_btc
http://data.bter.com/api/1/ticker/kdc_btc
http://data.bter.com/api/1/ticker/lts_btc
http://data.bter.com/api/1/ticker/max_btc
http://data.bter.com/api/1/ticker/mec_btc
http://data.bter.com/api/1/ticker/mint_btc
http://data.bter.com/api/1/ticker/mmc_btc
http://data.bter.com/api/1/ticker/msc_btc
http://data.bter.com/api/1/ticker/nav_btc
http://data.bter.com/api/1/ticker/nbt_btc
http://data.bter.com/api/1/ticker/nsr_btc
http://data.bter.com/api/1/ticker/nec_btc
http://data.bter.com/api/1/ticker/nmc_btc
http://data.bter.com/api/1/ticker/node_btc
http://data.bter.com/api/1/ticker/nas_btc
http://data.bter.com/api/1/ticker/net_btc
http://data.bter.com/api/1/ticker/nfd_btc
http://data.bter.com/api/1/ticker/nxt_btc
http://data.bter.com/api/1/ticker/ntx_btc
http://data.bter.com/api/1/ticker/ppc_btc
http://data.bter.com/api/1/ticker/prt_btc
http://data.bter.com/api/1/ticker/pts_btc
http://data.bter.com/api/1/ticker/qrk_btc
http://data.bter.com/api/1/ticker/rox_btc
http://data.bter.com/api/1/ticker/sfr_btc
http://data.bter.com/api/1/ticker/slm_btc
http://data.bter.com/api/1/ticker/spark_btc
http://data.bter.com/api/1/ticker/src_btc
http://data.bter.com/api/1/ticker/swift_btc
http://data.bter.com/api/1/ticker/tag_btc
http://data.bter.com/api/1/ticker/tbc_btc
http://data.bter.com/api/1/ticker/xtc_btc
http://data.bter.com/api/1/ticker/yac_btc
http://data.bter.com/api/1/ticker/via_btc
http://data.bter.com/api/1/ticker/vrc_btc
http://data.bter.com/api/1/ticker/vtc_btc
http://data.bter.com/api/1/ticker/wdc_btc
http://data.bter.com/api/1/ticker/xc_btc
http://data.bter.com/api/1/ticker/xch_btc
http://data.bter.com/api/1/ticker/xcn_btc
http://data.bter.com/api/1/ticker/xcr_btc
http://data.bter.com/api/1/ticker/xcp_btc
http://data.bter.com/api/1/ticker/xem_btc
http://data.bter.com/api/1/ticker/xem_cny
http://data.bter.com/api/1/ticker/xpm_btc
http://data.bter.com/api/1/ticker/xmr_btc
http://data.bter.com/api/1/ticker/qora_btc
http://data.bter.com/api/1/ticker/zcc_btc
http://data.bter.com/api/1/ticker/zet_btc
http://data.bter.com/api/1/ticker/ctc_btc
http://data.bter.com/api/1/ticker/mg_btc
http://data.bter.com/api/1/ticker/cent_ltc
http://data.bter.com/api/1/ticker/dvc_ltc
http://data.bter.com/api/1/ticker/ifc_ltc
http://data.bter.com/api/1/ticker/net_ltc
http://data.bter.com/api/1/ticker/nfd_ltc
http://data.bter.com/api/1/ticker/red_ltc
http://data.bter.com/api/1/ticker/tips_ltc
http://data.bter.com/api/1/ticker/tix_ltc
http://data.bter.com/api/1/ticker/etc_eth
http://data.bter.com/api/1/ticker/zec_btc
http://data.bter.com/api/1/ticker/zec_cny
http://data.bter.com/api/1/ticker/mgw_btc
http://data.bter.com/api/1/ticker/nxtty_btc
http://data.bter.com/api/1/ticker/atomic_btc
http://data.bter.com/api/1/ticker/mrkt_btc
http://data.bter.com/api/1/ticker/nxtty_cny
http://data.bter.com/api/1/ticker/token_btc
http://data.bter.com/api/1/ticker/token_cny
http://data.bter.com/api/1/ticker/unity_btc
http://data.bter.com/api/1/ticker/unity_cny
http://data.bter.com/api/1/ticker/dice_btc

6. 市场深度 API

返回当前市场深度(委托挂单),其中 asks 是委卖单, bids 是委买单。

URL: http://data.bter.com/api/1/depth/[CURR_A]_[CURR_B]

请替换 [CURR_A] and [CURR_B] 为您需要查看的币种.

支持的兑换类型:

http://data.bter.com/api/1/depth/btc_cny
http://data.bter.com/api/1/depth/ltc_cny
http://data.bter.com/api/1/depth/blk_cny
http://data.bter.com/api/1/depth/bitcny_cny
http://data.bter.com/api/1/depth/bqc_cny
http://data.bter.com/api/1/depth/btb_cny
http://data.bter.com/api/1/depth/qtum_btc
http://data.bter.com/api/1/depth/qtum_cny
http://data.bter.com/api/1/depth/etp_btc
http://data.bter.com/api/1/depth/etp_cny
http://data.bter.com/api/1/depth/btrx_cny
http://data.bter.com/api/1/depth/btrx_btc
http://data.bter.com/api/1/depth/btq_cny
http://data.bter.com/api/1/depth/bts_cny
http://data.bter.com/api/1/depth/cent_cny
http://data.bter.com/api/1/depth/cmc_cny
http://data.bter.com/api/1/depth/cnc_cny
http://data.bter.com/api/1/depth/rep_cny
http://data.bter.com/api/1/depth/dgc_cny
http://data.bter.com/api/1/depth/doge_cny
http://data.bter.com/api/1/depth/dash_cny
http://data.bter.com/api/1/depth/dtc_cny
http://data.bter.com/api/1/depth/dvc_cny
http://data.bter.com/api/1/depth/eth_cny
http://data.bter.com/api/1/depth/etc_cny
http://data.bter.com/api/1/depth/exc_cny
http://data.bter.com/api/1/depth/ftc_cny
http://data.bter.com/api/1/depth/frc_cny
http://data.bter.com/api/1/depth/ifc_cny
http://data.bter.com/api/1/depth/max_cny
http://data.bter.com/api/1/depth/mec_cny
http://data.bter.com/api/1/depth/mint_cny
http://data.bter.com/api/1/depth/mmc_cny
http://data.bter.com/api/1/depth/nbt_cny
http://data.bter.com/api/1/depth/net_cny
http://data.bter.com/api/1/depth/nmc_cny
http://data.bter.com/api/1/depth/nxt_cny
http://data.bter.com/api/1/depth/ppc_cny
http://data.bter.com/api/1/depth/pts_cny
http://data.bter.com/api/1/depth/qrk_cny
http://data.bter.com/api/1/depth/red_cny
http://data.bter.com/api/1/depth/shell_cny
http://data.bter.com/api/1/depth/src_cny
http://data.bter.com/api/1/depth/tag_cny
http://data.bter.com/api/1/depth/tbc_cny
http://data.bter.com/api/1/depth/tips_cny
http://data.bter.com/api/1/depth/tix_cny
http://data.bter.com/api/1/depth/vrc_cny
http://data.bter.com/api/1/depth/vtc_cny
http://data.bter.com/api/1/depth/wdc_cny
http://data.bter.com/api/1/depth/xcp_cny
http://data.bter.com/api/1/depth/xmr_cny
http://data.bter.com/api/1/depth/xpm_cny
http://data.bter.com/api/1/depth/xtc_cny
http://data.bter.com/api/1/depth/yac_cny
http://data.bter.com/api/1/depth/zcc_cny
http://data.bter.com/api/1/depth/zet_cny
http://data.bter.com/api/1/depth/ltc_btc
http://data.bter.com/api/1/depth/ac_btc
http://data.bter.com/api/1/depth/arch_btc
http://data.bter.com/api/1/depth/aur_btc
http://data.bter.com/api/1/depth/bay_btc
http://data.bter.com/api/1/depth/bbr_btc
http://data.bter.com/api/1/depth/blk_btc
http://data.bter.com/api/1/depth/bitgld_btc
http://data.bter.com/api/1/depth/block_btc
http://data.bter.com/api/1/depth/bqc_btc
http://data.bter.com/api/1/depth/btb_btc
http://data.bter.com/api/1/depth/btcd_btc
http://data.bter.com/api/1/depth/bts_btc
http://data.bter.com/api/1/depth/buk_btc
http://data.bter.com/api/1/depth/c2_btc
http://data.bter.com/api/1/depth/cdc_btc
http://data.bter.com/api/1/depth/ckc_btc
http://data.bter.com/api/1/depth/comm_btc
http://data.bter.com/api/1/depth/cmc_btc
http://data.bter.com/api/1/depth/cnc_btc
http://data.bter.com/api/1/depth/rep_btc
http://data.bter.com/api/1/depth/hkg_btc
http://data.bter.com/api/1/depth/dgc_btc
http://data.bter.com/api/1/depth/doge_btc
http://data.bter.com/api/1/depth/dns_btc
http://data.bter.com/api/1/depth/dash_btc
http://data.bter.com/api/1/depth/drkc_btc
http://data.bter.com/api/1/depth/dtc_btc
http://data.bter.com/api/1/depth/eth_btc
http://data.bter.com/api/1/depth/etc_btc
http://data.bter.com/api/1/depth/exc_btc
http://data.bter.com/api/1/depth/flt_btc
http://data.bter.com/api/1/depth/frc_btc
http://data.bter.com/api/1/depth/frsh_btc
http://data.bter.com/api/1/depth/ftc_btc
http://data.bter.com/api/1/depth/ftp_btc
http://data.bter.com/api/1/depth/gemz_btc
http://data.bter.com/api/1/depth/ghost_btc
http://data.bter.com/api/1/depth/gml_btc
http://data.bter.com/api/1/depth/kdc_btc
http://data.bter.com/api/1/depth/lts_btc
http://data.bter.com/api/1/depth/max_btc
http://data.bter.com/api/1/depth/mec_btc
http://data.bter.com/api/1/depth/mint_btc
http://data.bter.com/api/1/depth/mmc_btc
http://data.bter.com/api/1/depth/msc_btc
http://data.bter.com/api/1/depth/nav_btc
http://data.bter.com/api/1/depth/nbt_btc
http://data.bter.com/api/1/depth/nsr_btc
http://data.bter.com/api/1/depth/nec_btc
http://data.bter.com/api/1/depth/nmc_btc
http://data.bter.com/api/1/depth/node_btc
http://data.bter.com/api/1/depth/nas_btc
http://data.bter.com/api/1/depth/net_btc
http://data.bter.com/api/1/depth/nfd_btc
http://data.bter.com/api/1/depth/nxt_btc
http://data.bter.com/api/1/depth/ntx_btc
http://data.bter.com/api/1/depth/ppc_btc
http://data.bter.com/api/1/depth/prt_btc
http://data.bter.com/api/1/depth/pts_btc
http://data.bter.com/api/1/depth/qrk_btc
http://data.bter.com/api/1/depth/rox_btc
http://data.bter.com/api/1/depth/sfr_btc
http://data.bter.com/api/1/depth/slm_btc
http://data.bter.com/api/1/depth/spark_btc
http://data.bter.com/api/1/depth/src_btc
http://data.bter.com/api/1/depth/swift_btc
http://data.bter.com/api/1/depth/tag_btc
http://data.bter.com/api/1/depth/tbc_btc
http://data.bter.com/api/1/depth/xtc_btc
http://data.bter.com/api/1/depth/yac_btc
http://data.bter.com/api/1/depth/via_btc
http://data.bter.com/api/1/depth/vrc_btc
http://data.bter.com/api/1/depth/vtc_btc
http://data.bter.com/api/1/depth/wdc_btc
http://data.bter.com/api/1/depth/xc_btc
http://data.bter.com/api/1/depth/xch_btc
http://data.bter.com/api/1/depth/xcn_btc
http://data.bter.com/api/1/depth/xcr_btc
http://data.bter.com/api/1/depth/xcp_btc
http://data.bter.com/api/1/depth/xem_btc
http://data.bter.com/api/1/depth/xem_cny
http://data.bter.com/api/1/depth/xpm_btc
http://data.bter.com/api/1/depth/xmr_btc
http://data.bter.com/api/1/depth/qora_btc
http://data.bter.com/api/1/depth/zcc_btc
http://data.bter.com/api/1/depth/zet_btc
http://data.bter.com/api/1/depth/ctc_btc
http://data.bter.com/api/1/depth/mg_btc
http://data.bter.com/api/1/depth/cent_ltc
http://data.bter.com/api/1/depth/dvc_ltc
http://data.bter.com/api/1/depth/ifc_ltc
http://data.bter.com/api/1/depth/net_ltc
http://data.bter.com/api/1/depth/nfd_ltc
http://data.bter.com/api/1/depth/red_ltc
http://data.bter.com/api/1/depth/tips_ltc
http://data.bter.com/api/1/depth/tix_ltc
http://data.bter.com/api/1/depth/etc_eth
http://data.bter.com/api/1/depth/zec_btc
http://data.bter.com/api/1/depth/zec_cny
http://data.bter.com/api/1/depth/mgw_btc
http://data.bter.com/api/1/depth/nxtty_btc
http://data.bter.com/api/1/depth/atomic_btc
http://data.bter.com/api/1/depth/mrkt_btc
http://data.bter.com/api/1/depth/nxtty_cny
http://data.bter.com/api/1/depth/token_btc
http://data.bter.com/api/1/depth/token_cny
http://data.bter.com/api/1/depth/unity_btc
http://data.bter.com/api/1/depth/unity_cny
http://data.bter.com/api/1/depth/dice_btc

7. 历史成交记录 API

返回最新80条历史成交记录:

URL: http://data.bter.com/api/1/trade/[CURR_A]_[CURR_B]

返回从[TID]往后的最多1000历史成交记录:

URL: http://data.bter.com/api/1/trade/[CURR_A]_[CURR_B]/[TID]

请替换 [CURR_A] and [CURR_B] 为您需要查看的币种.

支持的兑换类型:

http://data.bter.com/api/1/trade/btc_cny
http://data.bter.com/api/1/trade/ltc_cny
http://data.bter.com/api/1/trade/blk_cny
http://data.bter.com/api/1/trade/bitcny_cny
http://data.bter.com/api/1/trade/bqc_cny
http://data.bter.com/api/1/trade/btb_cny
http://data.bter.com/api/1/trade/qtum_btc
http://data.bter.com/api/1/trade/qtum_cny
http://data.bter.com/api/1/trade/etp_btc
http://data.bter.com/api/1/trade/etp_cny
http://data.bter.com/api/1/trade/btrx_cny
http://data.bter.com/api/1/trade/btrx_btc
http://data.bter.com/api/1/trade/btq_cny
http://data.bter.com/api/1/trade/bts_cny
http://data.bter.com/api/1/trade/cent_cny
http://data.bter.com/api/1/trade/cmc_cny
http://data.bter.com/api/1/trade/cnc_cny
http://data.bter.com/api/1/trade/rep_cny
http://data.bter.com/api/1/trade/dgc_cny
http://data.bter.com/api/1/trade/doge_cny
http://data.bter.com/api/1/trade/dash_cny
http://data.bter.com/api/1/trade/dtc_cny
http://data.bter.com/api/1/trade/dvc_cny
http://data.bter.com/api/1/trade/eth_cny
http://data.bter.com/api/1/trade/etc_cny
http://data.bter.com/api/1/trade/exc_cny
http://data.bter.com/api/1/trade/ftc_cny
http://data.bter.com/api/1/trade/frc_cny
http://data.bter.com/api/1/trade/ifc_cny
http://data.bter.com/api/1/trade/max_cny
http://data.bter.com/api/1/trade/mec_cny
http://data.bter.com/api/1/trade/mint_cny
http://data.bter.com/api/1/trade/mmc_cny
http://data.bter.com/api/1/trade/nbt_cny
http://data.bter.com/api/1/trade/net_cny
http://data.bter.com/api/1/trade/nmc_cny
http://data.bter.com/api/1/trade/nxt_cny
http://data.bter.com/api/1/trade/ppc_cny
http://data.bter.com/api/1/trade/pts_cny
http://data.bter.com/api/1/trade/qrk_cny
http://data.bter.com/api/1/trade/red_cny
http://data.bter.com/api/1/trade/shell_cny
http://data.bter.com/api/1/trade/src_cny
http://data.bter.com/api/1/trade/tag_cny
http://data.bter.com/api/1/trade/tbc_cny
http://data.bter.com/api/1/trade/tips_cny
http://data.bter.com/api/1/trade/tix_cny
http://data.bter.com/api/1/trade/vrc_cny
http://data.bter.com/api/1/trade/vtc_cny
http://data.bter.com/api/1/trade/wdc_cny
http://data.bter.com/api/1/trade/xcp_cny
http://data.bter.com/api/1/trade/xmr_cny
http://data.bter.com/api/1/trade/xpm_cny
http://data.bter.com/api/1/trade/xtc_cny
http://data.bter.com/api/1/trade/yac_cny
http://data.bter.com/api/1/trade/zcc_cny
http://data.bter.com/api/1/trade/zet_cny
http://data.bter.com/api/1/trade/ltc_btc
http://data.bter.com/api/1/trade/ac_btc
http://data.bter.com/api/1/trade/arch_btc
http://data.bter.com/api/1/trade/aur_btc
http://data.bter.com/api/1/trade/bay_btc
http://data.bter.com/api/1/trade/bbr_btc
http://data.bter.com/api/1/trade/blk_btc
http://data.bter.com/api/1/trade/bitgld_btc
http://data.bter.com/api/1/trade/block_btc
http://data.bter.com/api/1/trade/bqc_btc
http://data.bter.com/api/1/trade/btb_btc
http://data.bter.com/api/1/trade/btcd_btc
http://data.bter.com/api/1/trade/bts_btc
http://data.bter.com/api/1/trade/buk_btc
http://data.bter.com/api/1/trade/c2_btc
http://data.bter.com/api/1/trade/cdc_btc
http://data.bter.com/api/1/trade/ckc_btc
http://data.bter.com/api/1/trade/comm_btc
http://data.bter.com/api/1/trade/cmc_btc
http://data.bter.com/api/1/trade/cnc_btc
http://data.bter.com/api/1/trade/rep_btc
http://data.bter.com/api/1/trade/hkg_btc
http://data.bter.com/api/1/trade/dgc_btc
http://data.bter.com/api/1/trade/doge_btc
http://data.bter.com/api/1/trade/dns_btc
http://data.bter.com/api/1/trade/dash_btc
http://data.bter.com/api/1/trade/drkc_btc
http://data.bter.com/api/1/trade/dtc_btc
http://data.bter.com/api/1/trade/eth_btc
http://data.bter.com/api/1/trade/etc_btc
http://data.bter.com/api/1/trade/exc_btc
http://data.bter.com/api/1/trade/flt_btc
http://data.bter.com/api/1/trade/frc_btc
http://data.bter.com/api/1/trade/frsh_btc
http://data.bter.com/api/1/trade/ftc_btc
http://data.bter.com/api/1/trade/ftp_btc
http://data.bter.com/api/1/trade/gemz_btc
http://data.bter.com/api/1/trade/ghost_btc
http://data.bter.com/api/1/trade/gml_btc
http://data.bter.com/api/1/trade/kdc_btc
http://data.bter.com/api/1/trade/lts_btc
http://data.bter.com/api/1/trade/max_btc
http://data.bter.com/api/1/trade/mec_btc
http://data.bter.com/api/1/trade/mint_btc
http://data.bter.com/api/1/trade/mmc_btc
http://data.bter.com/api/1/trade/msc_btc
http://data.bter.com/api/1/trade/nav_btc
http://data.bter.com/api/1/trade/nbt_btc
http://data.bter.com/api/1/trade/nsr_btc
http://data.bter.com/api/1/trade/nec_btc
http://data.bter.com/api/1/trade/nmc_btc
http://data.bter.com/api/1/trade/node_btc
http://data.bter.com/api/1/trade/nas_btc
http://data.bter.com/api/1/trade/net_btc
http://data.bter.com/api/1/trade/nfd_btc
http://data.bter.com/api/1/trade/nxt_btc
http://data.bter.com/api/1/trade/ntx_btc
http://data.bter.com/api/1/trade/ppc_btc
http://data.bter.com/api/1/trade/prt_btc
http://data.bter.com/api/1/trade/pts_btc
http://data.bter.com/api/1/trade/qrk_btc
http://data.bter.com/api/1/trade/rox_btc
http://data.bter.com/api/1/trade/sfr_btc
http://data.bter.com/api/1/trade/slm_btc
http://data.bter.com/api/1/trade/spark_btc
http://data.bter.com/api/1/trade/src_btc
http://data.bter.com/api/1/trade/swift_btc
http://data.bter.com/api/1/trade/tag_btc
http://data.bter.com/api/1/trade/tbc_btc
http://data.bter.com/api/1/trade/xtc_btc
http://data.bter.com/api/1/trade/yac_btc
http://data.bter.com/api/1/trade/via_btc
http://data.bter.com/api/1/trade/vrc_btc
http://data.bter.com/api/1/trade/vtc_btc
http://data.bter.com/api/1/trade/wdc_btc
http://data.bter.com/api/1/trade/xc_btc
http://data.bter.com/api/1/trade/xch_btc
http://data.bter.com/api/1/trade/xcn_btc
http://data.bter.com/api/1/trade/xcr_btc
http://data.bter.com/api/1/trade/xcp_btc
http://data.bter.com/api/1/trade/xem_btc
http://data.bter.com/api/1/trade/xem_cny
http://data.bter.com/api/1/trade/xpm_btc
http://data.bter.com/api/1/trade/xmr_btc
http://data.bter.com/api/1/trade/qora_btc
http://data.bter.com/api/1/trade/zcc_btc
http://data.bter.com/api/1/trade/zet_btc
http://data.bter.com/api/1/trade/ctc_btc
http://data.bter.com/api/1/trade/mg_btc
http://data.bter.com/api/1/trade/cent_ltc
http://data.bter.com/api/1/trade/dvc_ltc
http://data.bter.com/api/1/trade/ifc_ltc
http://data.bter.com/api/1/trade/net_ltc
http://data.bter.com/api/1/trade/nfd_ltc
http://data.bter.com/api/1/trade/red_ltc
http://data.bter.com/api/1/trade/tips_ltc
http://data.bter.com/api/1/trade/tix_ltc
http://data.bter.com/api/1/trade/etc_eth
http://data.bter.com/api/1/trade/zec_btc
http://data.bter.com/api/1/trade/zec_cny
http://data.bter.com/api/1/trade/mgw_btc
http://data.bter.com/api/1/trade/nxtty_btc
http://data.bter.com/api/1/trade/atomic_btc
http://data.bter.com/api/1/trade/mrkt_btc
http://data.bter.com/api/1/trade/nxtty_cny
http://data.bter.com/api/1/trade/token_btc
http://data.bter.com/api/1/trade/token_cny
http://data.bter.com/api/1/trade/unity_btc
http://data.bter.com/api/1/trade/unity_cny
http://data.bter.com/api/1/trade/dice_btc

8. 自动交易 API

通过以下API,用户可以使用程序控制自动进行账号资金查询,下单交易,取消挂单。
请注意:请在您的程序中设置的HTTP请求头参数 Content-Type 为 application/x-www-form-urlencoded

用户首先要通过这个链接获取API接口身份认证用到的Key和Secret。 然后在程序中用Secret作为密码,通过SHA512加密方式签名需要POST给服务器的数据得到Sign,并在HTTPS请求的Header部分传回Key和Sign。请参考以下接口说明和例子程序进行设置。

获取帐号资金余额API

API URL: https://api.bter.com/api/1/private/getfunds

参数数据提交方式:POST

参数:无

返回数据格式:JSON

返回数据例子:

	{
		"result":"true",
		"available_funds":{
			"CNY":"1122.16",
			"BTC":"0.83337671",
			"LTC":"94.364",
			"YAC":"0.07161",
			"WDC":"82.35029899"
		},
		"locked_funds":{
			"BTC":"0.0002",
			"YAC":"10.01"
		}
	}
				


下单交易API

API URL: https://api.bter.com/api/1/private/placeorder

参数数据提交方式:POST

参数:

参数 说明 示例
pair 交易币种对 ltc_btc
type 交易类型,卖出为 SELL, 买入为 BUY SELL 或者 BUY
rate 价格 0.023
amount 交易量 100

返回数据格式:JSON

返回数据例子:

	{
		"result":"true",
		"order_id":"123456",
		"msg":"Success"
	}
				

注:返回的order_id可用于查询,取消订单。


取消下单API

API URL: https://api.bter.com/api/1/private/cancelorder

参数数据提交方式:POST

参数:

参数 说明 示例
order_id 下单单号 123456
pair 交易币种对 ltc_btc

返回数据格式:JSON

返回数据例子:

	{
		"result":"true",
		"msg":"Success"
	}
				


注:返回的order_id可用于查询,取消订单。


取消多个下单API

API URL: https://api.bter.com/api/1/private/cancelorders

参数数据提交方式:POST

参数:

参数 说明 示例
orders_json 下单单号和pair的json数据 [ { "id":"7942422" "pair":"ltc_btc" } { "id":"7942422" "pair":"ltc_btc" } ]

返回数据格式:JSON

返回数据例子:

	{
		"result":"true",
		"msg":"queued"
	}
				


获取下单状态API

API URL: https://api.bter.com/api/1/private/getorder

参数数据提交方式:POST

参数:

参数 说明 示例
order_id 下单单号 123456
pair 交易币种对 ltc_btc

返回数据格式:JSON

返回数据例子:


	{
		"result":true,
		"order":{
			"id":"15088",
			"status":"cancelled",
			"pair":"btc_cny",
			"type":"sell",
			"rate":811,
			"amount":"0.39901357",
			"initial_rate":811,
			"initial_amount":"1"
		},
		"msg":"Success"
	}

				


获取我的当前挂单列表API

API URL: https://api.bter.com/api/1/private/orderlist

参数数据提交方式:POST

参数:无

返回数据格式:JSON

返回数据例子:


	{
		"result":true,
		"orders":[
			{
				"id":"15088",				
				"sell_type":"BTC",
				"buy_type":"LTC",				
				"sell_amount":"0.39901357",
				"buy_amount":"12.0",		
				"pair":"ltc_btc",
				"type":"buy",
				"rate":0.033251,
				"amount":"0.39901357",
				"initial_rate":0.033251,
				"initial_amount":"1"
				"status":"open"
			},
			{
				"id":"15092",				
				"sell_type":"LTC",
				"buy_type":"BTC",				
				"sell_amount":"13.0",
				"buy_amount":"0.4210",
				"pair":"ltc_btc",
				"type":"buy",
				"rate":0.0323846,
				"amount":"0.4210",
				"initial_rate":0.0323846,
				"initial_amount":"1"
				"status":"open"
			}
			]
		"msg":"Success"
	}

				


获取我的24小时内成交记录API

API URL: https://api.bter.com/api/1/private/mytrades

参数数据提交方式:POST

参数:

参数 说明 示例
pair 交易币种对 ltc_btc
order_id 下单单号(可选项) 626150

返回数据格式:JSON

返回数据例子:


	{
		"result":true,
		"trades":[
		    {
		      "id":"7942422"
		      "orderid":"38100777"
		      "pair":"ltc_btc"
		      "type":"sell"
		      "rate":"0.01719"
		      "amount":"0.0588"
		      "time":"06-12 02:49:11"
		      "time_unix":"1402512551"
		    }
		    {
		      "id":"7942422"
		      "orderid":"38100491"
		      "pair":"ltc_btc"
		      "type":"buy"
		      "rate":"0.01719"
		      "amount":"0.0588"
		      "time":"06-12 02:49:11"
		      "time_unix":"1402512551"
		    }
	  	]
	  	"msg":"Success"
	}



				


PHP示例程序

				

<?php

	function bter_query($path, array $req = array()) {
		// API settings, add your Key and Secret at here
		$key = '';
		$secret = '';
	 
		// generate a nonce to avoid problems with 32bits systems
		$mt = explode(' ', microtime());
		$req['nonce'] = $mt[1].substr($mt[0], 2, 6);
	 
		// generate the POST data string
		$post_data = http_build_query($req, '', '&');
		$sign = hash_hmac('sha512', $post_data, $secret);
	 
		// generate the extra headers
		$headers = array(
			'KEY: '.$key,
			'SIGN: '.$sign,
		);

		//!!! please set Content-Type to application/x-www-form-urlencoded if it's not the default value

		// curl handle (initialize if required)
		static $ch = null;
		if (is_null($ch)) {
			$ch = curl_init();
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
			curl_setopt($ch, CURLOPT_USERAGENT, 
				'Mozilla/4.0 (compatible; Bter PHP bot; '.php_uname('a').'; PHP/'.phpversion().')'
				);
		}
		curl_setopt($ch, CURLOPT_URL, 'https://api.bter.com/api/'.$path);
		curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
		curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

		// run the query
		$res = curl_exec($ch);

		if ($res === false) throw new Exception('Curl error: '.curl_error($ch));
		//echo $res;
		$dec = json_decode($res, true);
		if (!$dec) throw new Exception('Invalid data: '.$res);
		return $dec;
	}
	 
	 function get_top_rate($pair, $type='BUY') {
		$rate = 0;

		// our curl handle (initialize if required)
		static $ch = null;
		if (is_null($ch)) {
			$ch = curl_init();
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
			curl_setopt($ch, CURLOPT_USERAGENT, 
				'Mozilla/4.0 (compatible; Bter PHP bot; '.php_uname('a').'; PHP/'.phpversion().')'
				);
		}
		curl_setopt($ch, CURLOPT_URL, 'https://api.bter.com/api/1/depth/'.$pair);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

		// run the query
		$res = curl_exec($ch);
		if ($res === false) throw new Exception('Could not get reply: '.curl_error($ch));
		//echo $res;
		$dec = json_decode($res, true);
		if (!$dec) throw new Exception('Invalid data: '.$res);
		
		if (strtoupper($type) == 'BUY') {
			$r =  $dec['bids'][0];
			$rate = $r[0];
		} else  {
			$r = end($dec['asks']);
			$rate = $r[0];
		}

		return $rate;
	}


	try {
		// example 1: get funds
		var_dump(bter_query('1/private/getfunds'));
		
		// example 2: place a buy order
		$pair = 'ltc_btc';
		$type = 'buy';
		$rate = get_top_rate($pair, $type) * 1.01;
		var_dump(bter_query('1/private/placeorder', 
			array(
				'pair' => "$pair",
				'type' => "$type",
				'rate' => "$rate",
				'amount' => '0.01',
				)
			  )
			);
		
		// example 3: cancel an order
		var_dump(bter_query('1/private/cancelorder', array('order_id' => 125811)));
		
		// example 4: get order status
		var_dump(bter_query('1/private/getorder', array('order_id' => 15088)));
		
		//example 5: list all open orders
		var_dump(bter_query('1/private/orderlist'));

	} catch (Exception $e) {
		echo "Error:".$e->getMessage();
		
	} 
?>