2.5.0 • Published 4 years ago

ccxt-rest v2.5.0

Weekly downloads
38
License
MIT
Repository
github
Last release
4 years ago

Build Status npm NPM Downloads Docker Pulls Supported Exchanges

Gitter

Hire Us

Table of Contents

Introduction

CCXT-REST provides a Unified REST APIs to allow clients access to retrieve data (ticker, order book, trades, your order, your trades, balances, etc) and to create and cancel orders from over 100 cryptocurrency exhange sites. And it is built on top of the popular open source project CCXT

Installation

You can install either through docker or as a global node package

Docker

$ docker run -p 3000:3000 ccxtrest/ccxt-rest

NPM Package

$ npm install -g ccxt-rest
$ ccxt-rest

Getting Started

CCXT-REST supports over 100 crytpocurrency exchange sites. If you want to access public data, for most exchanges, you can access them directly without any API Keys or Secret.

  • GET:/exchanges/{exchangeName}/markets
  • GET:/exchanges/{exchangeName}/ticker
  • GET:/exchanges/{exchangeName}/tickers
  • GET:/exchanges/{exchangeName}/orderBook
  • GET:/exchanges/{exchangeName}/trades

In binance, it would look something like this

  • GET:/exchanges/binance/markets
  • GET:/exchanges/binance/ticker?symbol=BTC/USDT
  • GET:/exchanges/binance/tickers
  • GET:/exchanges/binance/orderBook?symbol=BTC/USDT
  • GET:/exchanges/binance/trades?symbol=BTC/USDT

However, some exchanges though require you to have an API Key and Secret even when accessing public data. For example, for cointiger, you would need to get an API Key and Secret first from cointiger see cointiger's official documentation for more info, and then you would need to provide those to ccxt-rest

  • POST:/exchanges/cointiger -d {"id":"myCoinTiger","apiKey":"myApiKey","secret":"$hcreT"}
  • GET:/exchanges/cointiger/markets -H 'Authorization: Bearer xxx.yyy.zzz'(where xxx.yyy.zzz was part of the response of POST:/exchanges/cointiger)
  • GET:/exchanges/cointiger/ticker?symbol=BTC/LTC -H 'Authorization: Bearer xxx.yyy.zzz'
  • GET:/exchanges/cointiger/tickers -H 'Authorization: Bearer xxx.yyy.zzz'
  • GET:/exchanges/cointiger/orderBook?symbol=BTC/LTC -H 'Authorization: Bearer xxx.yyy.zzz'
  • GET:/exchanges/cointiger/trades?symbol=BTC/LTC -H 'Authorization: Bearer xxx.yyy.zzz'

Lastly, for private data like your user orders, trades, balances and for actions like placing and cancelling orders, you would definitely need to provide the API Key and Secret for your exchange to ccxt-rest.

CCXT-REST Overview


Note: The API listing below is now comprehensive. For a full list of APIs supported, see https://ccxt-rest.io


Providing API Keys and Secret

$ curl -X POST http://localhost:3000/exchange/binance \
  -H 'Accept: application/json'
  -d {
    "id" : "myBinance",
    "apiKey" : "myApiKey",
    "secret" : "s3cr3t"
  }

This would then return something like this

{
  "token":"xxx.yyy.zzz"
}

List All Supported Currency Pairs

$ curl -X GET http://localhost:3000/exchange/binance/markets \
  -H 'Accept: application/json'

Get Ticker for a Currency Pair

$ curl -X GET http://localhost:3000/exchange/binance/ticker?symbol=BTC/USDT \
  -H 'Accept: application/json'

Get Order Book for a Currency Pair

$ curl -X GET http://localhost:3000/exchange/binance/orderBook?symbol=BTC/USDT \
  -H 'Accept: application/json'

Placing an Order

$ curl -X POST http://localhost:3000/exchange/binance/order \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer xxx.yyy.zzz'
  -d {
  "symbol": "string",
  "type": "market",
  "side": "buy",
  "amount": 0,
  "price": 0
}

Cancelling an Order

Note: 12345 is the id of the order you want to cancel

$ curl -X DELETE http://localhost:3000/exchange/binance/order/12345 \
  -H 'Accept: application/json'
  -H 'Authorization: Bearer xxx.yyy.zzz'

API

For a complete list of API, see https://ccxt-rest.io

CCXT-REST API Documentation

Exchange Summary

For a full list of supported exchanges and as to which of their APIs are public, private or even broken, checkout https://ccxt-rest.io/docs/exchange_api_status. The format there looks something like this

Note: The table below is just an example. This does NOT represent the current state of these API statuses

ExchangeConnectMarketTickerTickersOrder BookTrades
.....................
(sample only)(sample only)(sample only)(sample only)(sample only)(sample only)(sample only)
binancePublic APIPublic APIPublic APIPublic APIPublic APIPublic API
coinspotPublic APIPublic APIPrivate APINot SupportedPrivate APIPrivate API
geminiPublic APIPublic APIPublic APINot SupportedPublic APIPublic API
krakenPublic APIPublic APIPublic APIPublic APIPublic APIPublic API
poloniexPublic APIPublic APIPublic APIPublic APIPublic APIPublic API
quadrigacxPublic APIPublic APIError: UnexpectedError: UnexpectedError: UnexpectedError: Unexpected
(sample only)(sample only)(sample only)(sample only)(sample only)(sample only)(sample only)
.....................

Note: The table above is just an example. This does NOT represent the current state of these API statuses

For full list of the current statuses, see https://ccxt-rest.io/docs/exchange_api_status

Feature / Support Request

Need a feature or need support? Reach out and let us know what you need.

Hire Us

algorithmicalgotradingaltcoinaltcoinsapiarbitragereal-timerealtimebacktestbacktestingbitcoinbotbtccnycoincoinscryptocryptocurrencycrypto currencycrypto marketcurrencycurrenciesdarkcoindashdigital currencydogedogecoine-commerceetcethetherethereumexchangeexchangeseurframeworkinvestinvestinginvestorlibrarylightlitecoinltcmarketmarket datamarketsmerchandisemerchantminimalohlcvorderorderbookorder bookpriceprice datapricefeedprivatepublicripplestrategytickertickerstoolkittradetradertradingusdvolumewebsocketwebsocketsweb socketweb socketswsxbtxrpzeczerocoin1Broker1BTCXEACXacx.ioallcoinallcoin.comANXANXProbiboxbibox.comBinancebinance.combit2c.co.ilBit2CBitBayBitBaysbitcoincoidBitcoin.co.idBitfinexbitFLyerbitflyer.jpbithumbbithumb.combitlishBitMarketBitMEXBitsoBitstampBittrexBL3PBleutradebleutrade.comBlinkTradebraziliexbraziliex.comBtcBoxbtcbox.co.jpBTCCBTCChinaBTC-eBTCeBTCExchangebtcexchange.phBTC Marketsbtcmarketsbtcmarkets.netBTCTraderbtctrader.combtc-trade.com.uaBTC Trade UABTCTurkbtcturk.comBTCXbtc-xbterBter.comBX.in.thccexC-CEXcexCEX.IOCHBTCChileBitchilebit.netcoincheckCoinExchangecoinexchange.iocoingicoingi.comCoinMarketCapCoinMateCoinsecureCoinSpotcoinspot.com.auCrypto Capitalcryptocapital.coDSXdsx.ukEXMOflowBTCflowbtc.comFoxBitfoxbit.exchangeFYB-SEFYB-SGGatecoinGDAXGeminiHitBTCHuobiHuobiPROhuobi.proIndependent Reserveindependentreserve.comitBitjubi.comKrakenKucoinKunaLakeBTClakebtc.comLiveCoinLiquiliqui.iolunomercadoMercadoBitcoinmercadobitcoin.brmixcoinsmixcoins.comnovanovaexchangenovaexchange.comOKCoinOKCoin.comOKCoin.cnOKEXokex.comPaymiumPoloniexQuadrigaCXQryptosQUOINEXSouthxchangeSurBitcoinsurbitcoin.comTidextidex.comTheRockTradingUrduBiturdubit.comVaultoroVBTCvbtc.exchangevbtc.vnVirWoXWEXwex.nzxBTCexbtce.comYoBityobit.netYUNBIZaifZB1btcxe.comAllcoinanxpro.comanybits.comAnybitsbcex.topBCEXBiboxbig.oneBigONEbitbank.ccbitbankbitbay.netbitfinex.combitFlyerbitforex.comBitforexBithumbbitibu.comBitibubitkk.combitkkbitlish.comBitlishbitmarket.plbitmarket.netbitmex.combitsane.comBitsanebitso.combitstamp.netbittrex.combit-z.comBit-Zbl3p.eubitonic.nlBraziliexbtc-alpha.comBTC-Alphabtcchina.combtctrade.imBtcTrade.imbuda.comBudabx.in.thc-cex.comcex.iotrade.chbtc.comcobinhood.comCOBINHOODcoinbase.comCoinbaseprime.coinbase.comCoinbase Primepro.coinbase.comCoinbase Procoincheck.comcoinegg.comCoinEggcoinex.comCoinExcoinfalcon.comCoinFalconcoinfloor.co.ukcoinfloorCoingicoinmarketcap.comcoinmate.iocoinnest.co.krcoinnestcoinone.co.krCoinOnecointiger.proCoinTigercoolcoin.comCoolCoincoss.ioCOSScrex24.comCREX24cryptonbtc.comCryptonderibit.comDeribitethfinex.comEthfinexexmo.meexx.comEXXfcoin.comFCointrader.flowbtc.comfybse.sefybsg.comgatecoin.comgate.ioGate.iogdax.comgemini.comgetbtc.orgGetBTChadax.comHADAXhitbtc.comHuobi Prohuobi.com.ruHuobi Russiaice3x.comice3x.co.zaICE3Xindodax.comINDODAXitbit.comkkex.comKKEXkraken.comkucoin.comKuCoinkuna.iolbank.infoLBankliquid.comLiquidlivecoin.netluno.comlykke.comLykkemercadobitcoin.com.brMercado BitcoinMixCoinsnegociecoins.com.brNegocieCoinsNovaexchangeokcoin.cnOKCoin CNYokcoin.comOKCoin USDpaymium.compoloniex.comquadrigacx.comrightbtc.comRightBTCsouthxchange.comSouthXchangestronghold.coStrongholdtheocean.tradeThe Oceantherocktrading.comtidebit.comTideBituex.comUEXupbit.comUpbitvaultoro.comvirwox.comyunbi.comzaif.jpzb.comfcoinjp.comFCoinJPbinance.jeBinance Jerseybequant.ioBequantdx.exchangeDX.Exchangeoceanex.pro.comOceanExflowbtc.com.brfoxbit.com.brlatoken.comLatokenbitmart.comBitMartdigifinex.vipDigiFinexidex.marketIDEXadara.ioAdarabinance.usBinance USwhitebit.comWhiteBitbitmax.ioBitMaxbytetrade.comByteTradeftx.comFTX{hostname}bw.comstex.comSTEXBWtimex.ioTimeXbitz.comtopliq.comTOP.Qhollaex.comHollaExbybit.comBybitaofex.comAOFEXbyte-trade.comhbtc.comHBTCprobit.comProBiteterbase.comETERBASEEterbaseqtrade.ioqTradedsxglobal.combitvavo.comBitvavocurrency.comCurrency.com
2.5.0

4 years ago

2.4.0

5 years ago

2.3.0

5 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.1.0

5 years ago

1.0.7

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago

0.0.0

6 years ago