Skip to content

Latest commit

Β 

History

History
116 lines (98 loc) Β· 14.2 KB

File metadata and controls

116 lines (98 loc) Β· 14.2 KB

bitso-bert-api

Getting started

The first step will be to get your API Keys (for private endpoints). In order to get your API Keys, please refer to their documentation

You will need the following environment variables in your project

BITSO_API_KEY=""
BITSO_API_SECRET=""
BITSO_API_URL="https://api.bitso.com"

When working on integrations, bitso recommends that you use their dev server before running your code against production. The URL for this server is https://api-dev.bitso.com/v3/

npm install bitso-bert-api

usage

try {
  const ticker = await BitsoApi.public.getTicker('btc_mxn')
  const { book, last, volume, low, high } = ticker
} catch (err) {
  const { code, message } = err
}

Rate Limits

Rate limits are based on one minute windows. For public API requests, the limit is by IP address and allows 60 requests per minute. For private API requests, the limit is by user and allows 300 requests per minute. If you exceed these limits, you will get locked out for one minute. Continuous one minute lockouts may result in a 24-hour block. Order cancellations aren’t subject to API rate limiting.

Implemented REST API

The API is divided in two sections: public, private and undocumented

Public API
Available Books βœ… getAvailableBooks()
Ticker βœ… getTicker('btc_mxn')
Order Book βœ… getOrderBook('btc_mxn', params?) { aggregate?: boolean }
Trades βœ… getTrades('btc_mxn', params?) { marker?: string, sort?: 'asc'|'desc', limit?: number }
Private API
πŸ”’ Account Status βœ… getAccountStatus()
πŸ”’ Document Upload β˜‘οΈ
πŸ”’ Mobile Phone Number Registration βœ… mobilePhone.register(phoneNumber)
πŸ”’ Mobile Phone Number Verification βœ… mobilePhone.verify(verificationCode)
πŸ”’ Account Balance βœ… getBalance()
πŸ”’ Fees βœ… getFees()
πŸ”’ Ledger
πŸ”’ - all βœ… ledger.getLedger(params?) { marker?: string, sort?: 'asc'|'desc', limit?: number }
πŸ”’ - trades βœ… ledger.getTrades(params?) { marker?: string, sort?: 'asc'|'desc', limit?: number }
πŸ”’ - fees βœ… ledger.getFees(params?) { marker?: string, sort?: 'asc'|'desc', limit?: number }
πŸ”’ - fundings βœ… ledger.getFundings(params?) { marker?: string, sort?: 'asc'|'desc', limit?: number }
πŸ”’ - withdrawals βœ… ledger.getWithdrawals(params?) { marker?: string, sort?: 'asc'|'desc', limit?: number }
πŸ”’ Withdrawals
πŸ”’ - all βœ… withdrawals.getAll(params?) { marker?: string, limit?: number, status?: string, method?: string }
πŸ”’ - by wid βœ… withdrawals.getByWid(wid)
πŸ”’ - by wids βœ… withdrawals.getByWids([wid1, wid2])
πŸ”’ - by origin_ids βœ… withdrawals.getByOriginIds([originId1, originId2])
πŸ”’ Fundings
πŸ”’ - all βœ… fundings.getAll(params?) { marker?: string, limit?: number, status?: string, method?: string, txids?: string }
πŸ”’ - by fid βœ… fundings.getByFid(fid)
πŸ”’ - by fids βœ… fundings.getByFids([fid1, fid2])
πŸ”’ User Trades
πŸ”’ - by book βœ… userTrades.getByBook('btc_mxn', params?) { marker?: string, sort?: 'asc'|'desc', limit?: number }
πŸ”’ - by id βœ… userTrades.getByTid(tid)
πŸ”’ - by ids βœ… userTrades.getByTids([tid1, tid2])
πŸ”’ Order Trades
πŸ”’ - by oid βœ… orderTrades.getByOid(oid)
πŸ”’ - by origin id βœ… orderTrades.getByOriginId(originId)
πŸ”’ Open Orders βœ… getOpenOrders(params?) { marker?: string, sort?: 'asc'|'desc', limit?: number, book?: Book }
πŸ”’ Lookup Orders
πŸ”’ - by oid βœ… lookupOrders.getByOid(oid)
πŸ”’ - by list of oids βœ… lookupOrders.getByOids([oid1, oid2])
πŸ”’ - by list of origin_ids βœ… lookupOrders.getByOriginIds([originId1, originId2])
πŸ”’ Cancel Order
πŸ”’ - all βœ… cancelOrder.cancelAll()
πŸ”’ - by oid βœ… cancelOrder.cancelByOid(oid)
πŸ”’ - by list of oids βœ… cancelOrder.cancelByOids([oid1, oid2])
πŸ”’ - by list of origin_ids βœ… cancelOrder.cancelByOrderIds([originId1, originId2])
πŸ”’ Place an Order (buy, sell)
πŸ”’ - market βœ… market(book, amount, currency)
πŸ”’ - limit βœ… limit(book, amount, currency, price, executionType?) executionType = 'goodtillcancelled' | 'fillorkill' | 'immediateorcancel' | 'postonly'
πŸ”’ - stopLoss βœ… stopLoss(book, amount, stopPrice)
πŸ”’ - stopLimit βœ… stopLimit(book, amount, currency, price, stopPrice, executionType?) executionType = 'goodtillcancelled' | 'fillorkill' | 'immediateorcancel' | 'postonly'
πŸ”’ Funding Destination βœ… getFundingDestination(currency)
πŸ”’ Crypto Withdrawals β˜‘οΈ
πŸ”’ SPEI Withdrawal β˜‘οΈ
πŸ”’ Bank Codes βœ… getBankCodes()
πŸ”’ Debit Card Withdrawal β˜‘οΈ
πŸ”’ Phone Number Withdrawal β˜‘οΈ
Undocumented API
Charts
- Charting Information βœ… charts.getChartInfo(book, timeBucket, startDate, endDate)
- Charting Trades βœ… charts.getChartTrades(book, timeframe)
Catalogues
- Available Currency Conversions βœ… catalogues.availableCurrencyConversions.public()
πŸ”’ - Available Currency Conversions βœ… catalogues.availableCurrencyConversions.private()
- Countries βœ… catalogues.getCountries()
- Currencies βœ… catalogues.getCurrencies()
πŸ”’ Tickers βœ… getTickers()
πŸ”’ Settings βœ… getSettings()