REST API · v2

API Reference

Trade programmatically on 1bit. Market data is public; trading and account endpoints require an API key. All responses are JSON.

Base URL
https://1bit.trade/api/v2
Format

All responses are JSON. Prices and amounts are returned as strings to preserve decimal precision.

Market id

Lowercase base+quote, concatenated — btcusdt, ethbtc, usdcusdt (no slash or underscore).

Errors

Non-2xx responses return { "errors": ["code.message"] } with the matching HTTP status.

Rate limit

240 requests/min per IP on authenticated routes.

Authentication

Create an API key under Account → API Keys. You receive a key id and a secret (shown once). Sign every authenticated request with three headers:

X-Auth-ApikeyYour API key id.
X-Auth-NonceCurrent time in milliseconds (must be within 30s of server time).
X-Auth-SignatureHMAC-SHA256(secret, nonce + apikey), hex-encoded.

Signing example (Node.js)

const crypto = require("crypto");
const apiKey = "YOUR_KEY_ID";
const secret = "YOUR_SECRET";
const nonce  = Date.now().toString();
const signature = crypto.createHmac("sha256", secret)
                        .update(nonce + apiKey)
                        .digest("hex");

await fetch("https://1bit.trade/api/v2/account/balances", {
  headers: {
    "X-Auth-Apikey": apiKey,
    "X-Auth-Nonce": nonce,
    "X-Auth-Signature": signature,
  },
});

Rate limit: 240 requests/min per IP on authenticated routes. Withdrawals require 2FA to be enabled on the account.

Public — Market data

No authentication required. Live markets, tickers, order book, trades and candles. CoinGecko-format endpoints are also provided for exchange-listing integrations.

GET/public/marketspublic

List all trading markets and their precision/fees.

GET/public/currenciespublic

List currencies with per-chain deposit/withdraw config.

GET/public/tickerspublic

24h ticker (last, high, low, volume, change) for every market.

GET/public/markets/{market}/tickerspublic

24h ticker for one market, e.g. btcusdt.

GET/public/markets/{market}/depthpublic

Order book — aggregated bids & asks.

ParamRequiredDescription
limitnoLevels per side (default 50).
GET/public/markets/{market}/tradespublic

Recent public trades for a market.

ParamRequiredDescription
limitnoMax trades to return.
GET/public/markets/{market}/k-linepublic

OHLCV candlesticks.

ParamRequiredDescription
periodyesCandle size in minutes (1, 5, 15, 60, 240, 1440…).
limitnoNumber of candles (default 300).
GET/public/coingecko/tickerspublic

CoinGecko-format tickers for exchange-listing integrations.

GET/public/coingecko/orderbookpublic

CoinGecko-format order book.

ParamRequiredDescription
ticker_idyesPair in BASE_QUOTE form, e.g. BTC_USDT.
depthnoLevels to return.
GET/public/coingecko/historical_tradespublic

CoinGecko-format historical trades (real trades only; trade_timestamp in Unix seconds).

ParamRequiredDescription
ticker_idyesPair in BASE_QUOTE form, e.g. BTC_USDT.
typenobuy or sell — restrict to one side (omit for both).
limitnoMax trades to return (default 200, max 1000).
GET/public/cmc/summarypublic

CoinMarketCap-format 24h summary of every pair (last, bid/ask, volumes, 24h change/high/low).

GET/public/cmc/assetspublic

CoinMarketCap-format asset map: name, deposit/withdraw status, min withdraw, fees, contract address.

GET/public/cmc/tickerpublic

CoinMarketCap-format ticker map: last price, base/quote volume and isFrozen per pair.

GET/public/cmc/orderbook/{market_pair}public

CoinMarketCap-format order book (level 2; timestamp in ms).

ParamRequiredDescription
market_pairyesPair in BASE_QUOTE form, e.g. BTC_USDT (dash also accepted).
depthnoTotal levels across both sides (0 = full book).
GET/public/cmc/trades/{market_pair}public

CoinMarketCap-format recent trades (real trades only; timestamp in ms).

ParamRequiredDescription
market_pairyesPair in BASE_QUOTE form, e.g. BTC_USDT (dash also accepted).
limitnoMax trades to return (default 200, max 1000).

Trading

Requires authentication. Place, list and cancel orders; view your fills.

POST/market/orders🔒 auth

Place a limit or market order.

ParamRequiredDescription
marketyesMarket id, e.g. btcusdt.
sideyesbuy or sell.
ordTypeyeslimit or market.
pricenoLimit price (required for limit orders).
volumeyesOrder amount in the base currency.
GET/market/orders🔒 auth

List your orders.

ParamRequiredDescription
marketnoFilter by market.
statenoFilter by state (wait, done, cancel).
GET/market/orders/{id}🔒 auth

Get a single order by id.

POST/market/orders/{id}/cancel🔒 auth

Cancel an open order.

GET/market/trades🔒 auth

Your executed trades.

ParamRequiredDescription
marketnoFilter by market.

Account & Wallet

Requires authentication. Balances, deposit addresses and withdrawals.

GET/account/balances🔒 auth

Your balances (available & locked) per currency.

GET/account/ledger🔒 auth

Your account ledger — every balance change (trades, deposits, withdrawals, fees).

GET/account/deposit_address/{currency}🔒 auth

Get your deposit address for a currency.

ParamRequiredDescription
chainnoNetwork key (e.g. bsc-mainnet).
POST/account/deposit_address/{currency}🔒 auth

Generate a deposit address if you don't have one.

GET/account/deposits🔒 auth

Your deposit history with confirmation status.

GET/account/withdraws🔒 auth

Your withdrawal history.

POST/account/withdraws🔒 auth

Request a withdrawal (2FA required).

ParamRequiredDescription
currencyyesCurrency to withdraw.
chainyesDestination network.
addressyesDestination address.
amountyesAmount to withdraw.
otpCodeyesCurrent 6-digit 2FA code.

WebSocket — live data

Stream the order book, trades and tickers in real time. Connect and subscribe by repeating the stream query parameter; messages arrive as JSON keyed by stream name.

Endpoint
wss://1bit.trade/api/v2/ranger
StreamAuthPushes
{market}.obpublicOrder book (bids & asks) for one market.
{market}.tradespublicNew public trades for one market.
tickerspublic24h tickers for every market.
order🔒 authYour order updates (created/filled/canceled).
balance🔒 authYour balance changes.

Subscribe example (browser)

const ws = new WebSocket(
  "wss://1bit.trade/api/v2/ranger?stream=btcusdt.ob&stream=btcusdt.trades&stream=tickers"
);
ws.onmessage = (e) => {
  const msg = JSON.parse(e.data);
  if (msg["btcusdt.ob"]) { /* order book snapshot/update */ }
  if (msg["btcusdt.trades"]) { /* array of trades */ }
  if (msg["tickers"]) { /* array of tickers */ }
};

For private streams (order, balance) authenticate the upgrade request with the same X-Auth-* headers as REST.