Cryptocurrency Rest API - Bitcoin Rest API for Crypto Prices & Other Market Data

Learn how to use our cryptocurrency rest API. Get crypto & bitcoin rest api to manage your trades and access all market data types.

Content

Tag: Public API calls

Tag: Private API calls

Definitions

Public API calls

Public API calls

Currency limits

GET https://cex.io/api/currency_limits

Request

Responses

Code 200: Data on limits for all pairs.

Schema:

Name Type Description
extends APIResponse Base response schema
data
pairs CurrencyLimit ]
Examples

application/json

{
  "e": "currency_limits",
  "ok": "ok",
  "data": {
    "pairs": [
      {
        "symbol1": "BTC",
        "symbol2": "USD",
        "pricePrecision": 1,
        "minLotSize": 0.01,
        "minLotSizeS2": 2.5,
        "maxLotSize": 30,
        "minPrice": "100",
        "maxPrice": "35000"
      },
      {
        "symbol1": "ETH",
        "symbol2": "USD",
        "pricePrecision": 2,
        "minLotSize": 0.1,
        "minLotSizeS2": 2.5,
        "maxLotSize": 1000,
        "minPrice": "2.5",
        "maxPrice": "4096"
      },
      {
        "symbol1": "BCH",
        "symbol2": "USD",
        "pricePrecision": 2,
        "minLotSize": 0.01,
        "minLotSizeS2": 2.5,
        "maxLotSize": 30,
        "minPrice": "50",
        "maxPrice": "5128"
      }
    ]
  }
}

Ticker

GET https://cex.io/api/ticker/{symbol1}/{symbol2}

Request

Parameters
Position Name Type Description
path symbol1 string The first currency code
path symbol2 string The second currency code

Responses

Code 200: OK

Schema: Ticker

Examples

application/json

{
  "timestamp": "1513166480",
  "low": "17200",
  "high": "17920",
  "last": "17420",
  "volume": "2042.59581123",
  "volume30d": "81150.14153359",
  "bid": 17400.04,
  "ask": 17418.2
}

Tickers for all pairs by markets

GET https://cex.io/api/tickers/{marketSymbol1}/{marketSymbol2}/.../{marketSymbolN}

Request

Parameters
Position Name Type Description
path marketSymbol1 string The first currency code (mandatory)
path marketSymbol2 string The second currency code (optional)
path marketSymbolN string N-th currency code (optional)

Responses

Code 200: OK

Schema:

Name Type Description
extends APIResponse Base response schema
data Ticker ]
Examples

application/json

{
  "ok": "ok",
  "e": "tickers",
  "data": [
    {
      "volume": "526.41732435",
      "last": "3867.1349",
      "timestamp": "1506345965",
      "bid": 3870.0315,
      "high": "3900",
      "ask": 3874.6483,
      "low": "3775.0519",
      "pair": "BTC:USD",
      "volume30d": "40276.65481187"
    },
    {
      "volume": "4146.55696100",
      "last": "296.3",
      "timestamp": "1506345965",
      "bid": 296.3001,
      "high": "300",
      "ask": 296.88829983,
      "low": "290.7499",
      "pair": "ETH:USD",
      "volume30d": "387349.74846600"
    },
    {
      "volume": "195.78393984",
      "last": "454",
      "timestamp": "1506345965",
      "bid": 448.0264,
      "high": "454",
      "ask": 453.9054,
      "low": "430",
      "pair": "BCH:USD",
      "volume30d": "29682.51951238"
    }
  ]
}

Last price

GET https://cex.io/api/last_price/{symbol1}/{symbol2}

Request

Parameters
Position Name Type Description
path symbol1 string The first currency code
path symbol2 string The second currency code

Responses

Code 200: OK

Schema: PairPrice

Examples

application/json

{
  "lprice": "17663",
  "curr1": "BTC",
  "curr2": "USD"
}

Last prices for given markets

GET https://cex.io/api/last_prices/{marketSymbol1}/{marketSymbol2}/.../{marketSymbolN}

Request

Parameters
Position Name Type Description
path marketSymbol1 string The first currency code (mandatory)
path marketSymbol2 string The second currency code (optional)
path marketSymbolN string N-th currency code (optional)

Responses

Code 200: OK

Schema:

Name Type Description
extends APIResponse Base response schema
data PairPrice ]
Examples

application/json

{
  "e": "last_prices",
  "ok": "ok",
  "data": [
    {
      "symbol1": "BTC",
      "symbol2": "USD",
      "lprice": "17656.2"
    },
    {
      "symbol1": "ETH",
      "symbol2": "USD",
      "lprice": "701"
    },
    {
      "symbol1": "BCH",
      "symbol2": "USD",
      "lprice": "1640"
    }
  ]
}

Converter

POST https://cex.io/api/convert/{symbol1}/{symbol2}

Request

Parameters
Position Name Type Description
path symbol1 string The first currency code
path symbol2 string The second currency code
body body ConvertRequest
Example
{
  "amnt": "2.5"
}

Responses

Code 200: OK

Schema:

Name Type Description
amnt string convertible amount
Examples

application/json

{
  "amnt": "1000.00"
}

Chart

POST https://cex.io/api/price_stats/{symbol1}/{symbol2}

Request

Parameters
Position Name Type Description
path symbol1 string The first currency code
path symbol2 string The second currency code
body body PriceStatsRequest
Example
{
  "lastHours": 24,
  "maxRespArrSize": 100
}

Responses

Code 200: OK

Schema: array

Items:

Name Type Description
tmsp number UNIX timestamp
price string price value
Examples

application/json

[
  {
    "tmsp": 1513063800,
    "price": "17288.9"
  },
  {
    "tmsp": 1513064700,
    "price": "17374"
  },
  {
    "tmsp": 1513065600,
    "price": "17393.57"
  }
]

Historical 1m OHLCV Chart

GET https://cex.io/api/ohlcv/hd/{date}/{symbol1}/{symbol2}

Request

Parameters
Position Name Type Description
path date string date in format "YYYYMMDD"
path symbol1 string The first currency code
path symbol2 string The second currency code

Responses

Code 200: OK

Schema: array

Items:

Name Type Description
time number Date in format "YYYYMMDD"
data1m string Stringified array of candle data by minutes
data1h string Stringified array of candle data by hours
data1d string Stringified array of candle data by days
Examples

application/json

{
  "time": 20171011,
  "data1m": "[[1507680000,4793.9996,4793.9996,4787.3213,4787.3229,1.03986482],[1507680060,4793.9809,4793.9993,4793.9809,4793.9932,0.81958763]]",
  "data1h": "[[1507334400,4378.1725,4395,4372.7588,4387.9062,14.244019],[1507338000,4387.8018,4400,4372.911,4385,12.50705421],[1507341600,4385,4385.46,4368.9999,4374,9.03757199]]",
  "data1d": "[[1499126400,2649.6085,2710,2632.2142,2668.9757,500.1209406],[1499212800,2669.2497,2690,2617.1779,2679.2315,383.08839447],[1499299200,2679.2305,2689.7435,2638.457,2675.0076,248.49638678]]"
}

Orderbook

GET https://cex.io/api/order_book/{symbol1}/{symbol2}/

Request

Parameters
Position Name Type Description
path symbol1 string The first currency code
path symbol2 string The second currency code
query depth integer limit the number of bid/ask records returned (optional parameter, all existing elements are returned if omitted)

Responses

Code 200: OK

Schema: array

Items:

Name Type Description
timestamp number UNIX timestamp
bids [ number ]
asks [ number ]
pair string Pair name ${symbol1}:${symbol2}
id integer Incremental version id of order-book snapshot, may be used to check if order-book changed
sell_total string Total available in symbol1 (e.g. BTC)
buy_total string Total available in symbol2 (e.g. USD)
Examples

application/json

{
  "timestamp": 1513173506,
  "bids": [
    [
      17670.3,
      0.00250037
    ]
  ],
  "asks": [
    [
      17689.66,
      0.01
    ]
  ],
  "pair": "BTC:USD",
  "id": 158217212,
  "sell_total": "1299.73578729",
  "buy_total": "10006393.37"
}

Trade history

GET https://cex.io/api/trade_history/{symbol1}/{symbol2}/

Request

Parameters
Position Name Type Description
path symbol1 string The first currency code
path symbol2 string The second currency code
query since integer return trades with tid >= since (optional parameter, 1000 or all existing (if less than 1000), elements are returned if omitted)

Responses

Code 200: OK

Schema: array

Items:

Name Type Description
tid string trade id
type string Order type
amount string trade amount
price string price
date string UNIX timestamp
Examples

application/json

[
  {
    "type": "buy",
    "date": "1513174106",
    "amount": "0.05634990",
    "price": "17698.7",
    "tid": "4765364"
  },
  {
    "type": "buy",
    "date": "1513174106",
    "amount": "0.02587643",
    "price": "17695",
    "tid": "4765363"
  },
  {
    "type": "sell",
    "date": "1513174102",
    "amount": "0.03112472",
    "price": "17695",
    "tid": "4765362"
  }
]

Private API calls

Requires API key. Each private call should contain API key, signature and nonce in request body (see. EmptyPrivateRequest)

Account balance

POST https://cex.io/api/balance/

Request

Parameters
Position Name Type Description
body body EmptyPrivateRequest
Example
{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715"
}

Responses

Code 200: OK

Schema:

Name Type Description
timestamp string UNIX timestamp
username string User ID
BTC Balance
BCH Balance
ETH Balance
LTC Balance
DASH Balance
ZEC Balance
USD Balance
EUR Balance
GBP Balance
RUB Balance
GHS Balance
Examples

application/json

{
  "timestamp": "1513177918",
  "username": "ud000000000",
  "BTC": {
    "available": "1.38000000",
    "orders": "0.00000000"
  },
  "BCH": {
    "available": "1.00000000",
    "orders": "0.00000000"
  },
  "ETH": {
    "available": "100.00000000",
    "orders": "0.00000000"
  },
  "LTC": {
    "available": "1.00000000"
  },
  "DASH": {
    "available": "1.00000000",
    "orders": "0.00000000"
  },
  "ZEC": {
    "available": "1.00000000",
    "orders": "0.00000000"
  },
  "USD": {
    "available": "998087.07",
    "orders": "0.00"
  },
  "EUR": {
    "available": "999562.56",
    "orders": "0.00"
  },
  "GBP": {
    "available": "1000000.00",
    "orders": "0.00"
  },
  "RUB": {
    "available": "1000000.00",
    "orders": "0.00"
  },
  "GHS": {
    "available": "0.00000000",
    "orders": "0.00000000"
  }
}

Open orders

POST https://cex.io/api/open_orders/

Request

Parameters
Position Name Type Description
body body EmptyPrivateRequest
Example
{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715"
}

Responses

Code 200: OK

Schema: [ ShortOrder ]

Examples

application/json

[
  {
    "id": "13837040",
    "time": "1460020144872",
    "type": "sell",
    "price": "411.626",
    "amount": "1.00000000",
    "pending": "1.00000000",
    "symbol1": "BTC",
    "symbol2": "EUR"
  },
  {
    "id": "16452929",
    "time": "1462355019816",
    "type": "buy",
    "price": "400",
    "amount": "1.00000000",
    "pending": "1.00000000",
    "symbol1": "BTC",
    "symbol2": "USD"
  }
]

Open orders by pair

POST https://cex.io/api/open_orders/{symbol1}/{symbol2}

Request

Parameters
Position Name Type Description
path symbol1 string The first currency code
path symbol2 string The second currency code
body body EmptyPrivateRequest
Example
{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715"
}

Responses

Code 200: OK

Schema: [ ShortOrder ]

Examples

application/json

[
  {
    "id": "13837040",
    "time": "1460020144872",
    "type": "sell",
    "price": "411.626",
    "amount": "1.00000000",
    "pending": "1.00000000",
    "symbol1": "BTC",
    "symbol2": "EUR"
  },
  {
    "id": "16452929",
    "time": "1462355019816",
    "type": "buy",
    "price": "400",
    "amount": "1.00000000",
    "pending": "1.00000000",
    "symbol1": "BTC",
    "symbol2": "USD"
  }
]

Active order status

POST https://cex.io/api/active_orders_status

Request

Parameters
Position Name Type Description
body body ActiveOrdersRequest
Example
{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "orders_list": [
    "8550492",
    "8550495",
    "8550497"
  ]
}

Responses

Code 200: OK

Schema:

Name Type Description
extends APIResponse Base response schema
data [ string ] list of [order_id, amount, remains]. remains is shown in case if order executed partially, it is less than amount, equal otherwise
Examples

application/json

{
  "e": "active_orders_status",
  "ok": "ok",
  "data": [
    [
      "8550408",
      "0",
      "0"
    ],
    [
      "8550495",
      "0.02000000",
      "0.02000000"
    ],
    [
      "8550497",
      "0.04000000",
      "0.02700000"
    ]
  ]
}

Archived orders

POST https://cex.io/api/archived_orders/{symbol1}/{symbol2}

Request

Parameters
Position Name Type Description
path symbol1 string The first currency code
path symbol2 string The second currency code
body body ArchivedOrdersRequest
Example
{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "dateTo": 1506943193,
  "dateFrom": 1506943193,
  "lastTxDateTo": 1506943193,
  "lastTxDateFrom": 1506943193
}

Responses

Code 200: OK

Schema: [ FullOrder ]

Examples

application/json

[
  {
    "id": "22348164",
    "type": "buy",
    "time": "2016-08-04T09:28:24.669Z",
    "lastTxTime": "2016-08-04T09:28:58.762Z",
    "lastTx": "22348407",
    "status": "d",
    "symbol1": "BTC",
    "symbol2": "USD",
    "amount": "1.00000000",
    "price": "564",
    "fa:USD": "0.00",
    "ta:USD": "563.98",
    "remains": "0.00000000",
    "a:BTC:cds": "1.00000000",
    "a:USD:cds": "565.13",
    "f:USD:cds": "0.00",
    "tradingFeeMaker": "0",
    "tradingFeeTaker": "0.2",
    "orderId": "22348164"
  },
  {
    "id": "22347874",
    "type": "buy",
    "time": "2016-08-04T09:27:40.316Z",
    "lastTxTime": "2016-08-04T09:27:47.527Z",
    "lastTx": "22347950",
    "status": "cd",
    "symbol1": "BTC",
    "symbol2": "USD",
    "amount": "1.00000000",
    "price": "564",
    "fa:USD": "0.00",
    "ta:USD": "359.72",
    "remains": "0.36219371",
    "a:BTC:cds": "0.63780629",
    "a:USD:cds": "565.13",
    "f:USD:cds": "0.00",
    "tradingFeeMaker": "0",
    "tradingFeeTaker": "0.2",
    "orderId": "22347874"
  }
]

Cancel order

POST https://cex.io/api/cancel_order/

Request

Parameters
Position Name Type Description
body body OrderRequest
Example
{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "id": 89067468
}

Responses

Code 200: OK

Examples

application/json

true

Cancel all orders for given pair

POST https://cex.io/api/cancel_orders/{symbol1}/{symbol2}

Request

Parameters
Position Name Type Description
path symbol1 string The first currency code
path symbol2 string The second currency code
body body EmptyPrivateRequest
Example
{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715"
}

Responses

Code 200: OK

Schema:

Name Type Description
extends APIResponse Base response schema
data [ string ] Ids of cancelled orders
Examples

application/json

{
  "e": "cancel_orders",
  "ok": "ok",
  "data": [
    "2407314",
    "2407317",
    "2407320",
    "2407323"
  ]
}

Place order

POST https://cex.io/api/place_order/{symbol1}/{symbol2}

Request

Parameters
Position Name Type Description
path symbol1 string The first currency code
path symbol2 string The second currency code
body body PlaceOrderRequest
Example
{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "type": "buy",
  "amount": 12,
  "price": 1155.67
}

Responses

Code 200: OK

Schema: ShortOrder

Examples

application/json

{
  "complete": false,
  "id": "89067468",
  "time": 1512054972480,
  "pending": "12.00000000",
  "amount": "12.00000000",
  "type": "buy",
  "price": "1155.67"
}

application/json, market order

{
  "symbol2Amount": "10000",
  "symbol1Amount": "19970000",
  "time": 1506615736816,
  "message": "Your order has been completed. Bought 0.19970000 BTC for 100.00 USD",
  "type": "buy",
  "id": "88640269"
}

Get order details

POST https://cex.io/api/get_order/

Request

Parameters
Position Name Type Description
body body OrderRequest
Example
{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "id": 89067468
}

Responses

Code 200: OK

Schema: FullOrder

Examples

application/json

{
  "id": "22347874",
  "type": "buy",
  "time": 1470302860316,
  "lastTxTime": "2016-08-04T09:27:47.527Z",
  "lastTx": "22347950",
  "pos": null,
  "user": "userId",
  "status": "cd",
  "symbol1": "BTC",
  "symbol2": "USD",
  "amount": "1.00000000",
  "price": "564",
  "fa:USD": "0.00",
  "ta:USD": "359.72",
  "remains": "0.36219371",
  "a:BTC:cds": "0.63780629",
  "a:USD:cds": "565.13",
  "f:USD:cds": "0.00",
  "tradingFeeMaker": "0",
  "tradingFeeTaker": "0.2",
  "tradingFeeStrategy": "Promo000Maker",
  "orderId": "22347874"
}

Get order transactions

POST https://cex.io/api/get_order_tx/

Request

Parameters
Position Name Type Description
body body OrderRequest
Example
{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "id": 89067468
}

Responses

Code 200: OK

Schema:

Name Type Description
extends APIResponse Base response schema
data
id string order id
time string timestamp
type string Order type
price string price
amount string amount
pending string pending amount (if partially executed)
symbol1 string Currency code
symbol2 string Currency code
symbol1Amount string
symbol2Amount string
lastTxTime string Time in unix time OR in ISO format
tradingFeeUserVolumeAmount string
ta:{symbol2} string total amount in current currency (Maker)
tta:{symbol2} string total amount in current currency (Taker)
fa:{symbol2} string fee amount in current currency (Maker)
tfa:{symbol2} string fee amount in current currency (Taker)
a:{symbol1}:cds string credit, debit and saldo merged amount in current currency
tradingFeeMaker string fee % value of Maker transactions
tradingFeeTaker string fee % value of Taker transactions
tradingFeeStrategy string
remains string
orderId string order id
pos string
status string Order status ('d' = done, fully executed OR 'c' = canceled, not executed OR 'cd' = cancel-done, partially executed OR 'a' = active, created)
next boolean
prev boolean
vtx Transaction ]
Examples

application/json

{
  "e": "get_order_tx",
  "ok": "ok",
  "data": {
    "id": "22347874",
    "type": "buy",
    "time": 1470302860316,
    "lastTxTime": "2016-08-04T09:27:47.527Z",
    "lastTx": "22347950",
    "user": "userId",
    "status": "cd",
    "symbol1": "BTC",
    "symbol2": "USD",
    "amount": "1.00000000",
    "price": "564",
    "fa:USD": "0.00",
    "ta:USD": "359.72",
    "remains": "0.36219371",
    "a:BTC:cds": "0.63780629",
    "a:USD:cds": "565.13",
    "f:USD:cds": "0.00",
    "tradingFeeMaker": "0",
    "tradingFeeTaker": "0.2",
    "tradingFeeStrategy": "Promo000Maker",
    "orderId": "22347874",
    "vtx": [
      {
        "id": "22347950",
        "type": "cancel",
        "time": "2016-08-04T09:27:47.527Z",
        "user": "userId",
        "c": "user:userId:a:USD",
        "d": "order:22347874:a:USD",
        "a": "204.28000000",
        "amount": "204.28000000",
        "balance": "1391212.24000000",
        "symbol": "USD",
        "order": "22347874",
        "buy": null,
        "sell": null,
        "pair": null,
        "pos": null,
        "cs": "1391212.24",
        "ds": 0
      },
      {
        "id": "22347949",
        "type": "buy",
        "time": "2016-08-04T09:27:40.972Z",
        "user": "userId",
        "c": "user:userId:a:BTC",
        "d": "order:22347874:a:BTC",
        "a": "0.63780629",
        "amount": "0.63780629",
        "balance": "7633.93075975",
        "symbol": "BTC",
        "order": "22347874",
        "buy": "22347874",
        "sell": "22347877",
        "pair": null,
        "pos": null,
        "cs": "7633.93075975",
        "ds": 0,
        "price": 564,
        "symbol2": "USD",
        "fee_amount": 0
      },
      {
        "id": "22347876",
        "type": "buy",
        "time": "2016-08-04T09:27:40.316Z",
        "user": "userId",
        "c": "user:userId:a:USD",
        "d": "order:22347874:a:USD",
        "a": "1.13000000",
        "amount": "-564.00000000",
        "balance": "1391007.96000000",
        "symbol": "USD",
        "order": "22347874",
        "buy": null,
        "sell": null,
        "pair": null,
        "pos": null,
        "cs": "1391007.96",
        "ds": "564.00"
      }
    ],
    "next": false,
    "prev": false
  }
}

Get crypto address

POST https://cex.io/api/get_address/

Request

Parameters
Position Name Type Description
body body AddressRequest
Example
{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "currency": "BTC"
}

Responses

Code 200: OK

Schema:

Name Type Description
extends APIResponse Base response schema
data string Crypto Address
Examples

application/json

{
  "ok": "ok",
  "e": "get_address",
  "data": "3JjMEw3b2wcRuUQL7rA5JMzKXwEgiArSrb"
}

Get all crypto addresses

POST https://cex.io/api/get_crypto_address

Request

Parameters
Position Name Type Description
body body AddressRequest
Example
{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "currency": "BTC"
}

Responses

Code 200: OK

Schema:

Name Type Description
extends APIResponse Base response schema
data
name string Currency code
addresses [ object ]
Examples

application/json

{
  "e": "get_crypto_address",
  "ok": "ok",
  "data": {
    "name": "BTC",
    "addresses": [
      {
        "blockchain": "crypto",
        "address": "2N349Xx1dbQfstRy8Q4jrDGQJgvoERkgHu2"
      }
    ]
  }
}

Get my fee

POST https://cex.io/api/get_myfee/

Request

Parameters
Position Name Type Description
body body EmptyPrivateRequest
Example
{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715"
}

Responses

Code 200: OK

Schema:

Name Type Description
extends APIResponse Base response schema
data
ETH:USD object Fee description
Examples

application/json

{
  "ok": "ok",
  "e": "get_myfee",
  "data": {
    "ETH:USD": {
      "sell": "0.15",
      "buyMaker": "0",
      "buy": "0.15",
      "sellMaker": "0"
    },
    "BCH:GBP": {
      "sell": "0.15",
      "buyMaker": "0",
      "buy": "0.15",
      "sellMaker": "0"
    },
    "ZEC:BTC": {
      "sell": "0.15",
      "buyMaker": "0",
      "buy": "0.15",
      "sellMaker": "0"
    },
    "ZEC:GBP": {
      "sell": "0.15",
      "buyMaker": "0",
      "buy": "0.15",
      "sellMaker": "0"
    }
  }
}

Cancel replace order

POST https://cex.io/api/cancel_replace_order/{symbol1}/{symbol2}

Request

Parameters
Position Name Type Description
path symbol1 string The first currency code
path symbol2 string The second currency code
body body CancelReplaceOrderRequest
Example
{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "type": "buy"
}

Responses

Code 200: OK

Schema: ShortOrder

Examples

application/json

{
  "complete": false,
  "price": "150",
  "amount": "0.02000000",
  "time": 1506952374430,
  "type": "buy",
  "id": "88646680",
  "pending": "0.02000000"
}

Definitions

PriceStatsRequest

PriceStatsRequest

Name Type Description
lastHours integer past tense period till the current date in hours;
maxRespArrSize number maximal amount of price values in return.

ConvertRequest

ConvertRequest

Name Type Description
amnt string convertible amount. should be a positive number string.

CurrencyLimit

CurrencyLimit

Name Type Description
symbol1 string Currency code
symbol2 string Currency code
pricePrecision number
minLotSize number
minLotSizeS2 number
maxLotSize number
minPrice string
maxPrice string

Fee

Fee description

Name Type Description
buy string
buyMaker string
sell string
sellMaker string

OrderStatus

Order status ('d' = done, fully executed OR 'c' = canceled, not executed OR 'cd' = cancel-done, partially executed OR 'a' = active, created)

Type: string

ResponseStatus

Response status

Type: string

OrderType

Order type

Type: string

ShortOrder

Order object (some fields omitted)

Name Type Description
id string order id
time string timestamp
type string Order type
price string price
amount string amount
pending string pending amount (if partially executed)
symbol1 string Currency code
symbol2 string Currency code
symbol1Amount string
symbol2Amount string

FullOrder

FullOrder

Name Type Description
id string order id
time string timestamp
type string Order type
price string price
amount string amount
pending string pending amount (if partially executed)
symbol1 string Currency code
symbol2 string Currency code
symbol1Amount string
symbol2Amount string
lastTxTime string Time in unix time OR in ISO format
tradingFeeUserVolumeAmount string
ta:{symbol2} string total amount in current currency (Maker)
tta:{symbol2} string total amount in current currency (Taker)
fa:{symbol2} string fee amount in current currency (Maker)
tfa:{symbol2} string fee amount in current currency (Taker)
a:{symbol1}:cds string credit, debit and saldo merged amount in current currency
tradingFeeMaker string fee % value of Maker transactions
tradingFeeTaker string fee % value of Taker transactions
tradingFeeStrategy string
remains string
orderId string
pos string
status string Order status ('d' = done, fully executed OR 'c' = canceled, not executed OR 'cd' = cancel-done, partially executed OR 'a' = active, created)

OrderWithTransactions

OrderWithTransactions

Name Type Description
id string order id
time string timestamp
type string Order type
price string price
amount string amount
pending string pending amount (if partially executed)
symbol1 string Currency code
symbol2 string Currency code
symbol1Amount string
symbol2Amount string
lastTxTime string Time in unix time OR in ISO format
tradingFeeUserVolumeAmount string
ta:{symbol2} string total amount in current currency (Maker)
tta:{symbol2} string total amount in current currency (Taker)
fa:{symbol2} string fee amount in current currency (Maker)
tfa:{symbol2} string fee amount in current currency (Taker)
a:{symbol1}:cds string credit, debit and saldo merged amount in current currency
tradingFeeMaker string fee % value of Maker transactions
tradingFeeTaker string fee % value of Taker transactions
tradingFeeStrategy string
remains string
orderId string order id
pos string
status string Order status ('d' = done, fully executed OR 'c' = canceled, not executed OR 'cd' = cancel-done, partially executed OR 'a' = active, created)
next boolean
prev boolean
vtx Transaction ]

Transaction

Transaction

Name Type Description
id string
type string Order type
time string
user string User id
c string
d string
a string
amount string
balance string
symbol string Currency code
symbol1 string Currency code
symbol2 string Currency code
order string order id
buy string order id
sell string order id
pair string
pos string
cs string
ds number
fee_amount number
price number

Symbol

Currency code

Type: string

Balance

Balance

Name Type Description
available string available balance
orders string balance in pending orders
bonus string referral program bonus

API key

Your own API key. To get an API key, go to Account -> API Access Tab. Set permissions and click "Generate key".

Type: string

nonce

The nonce is a regular integer number. It must be increasing with every request you make. Read more about it here. Example - if you set nonce to 1 in your first request, you must set it to at least 2 in your second request. You are not required to start with 1. A common practice is to use unix time for that parameter.

Type: string

signature

An HMAC-SHA256 encoded message containing - a nonce, user ID and API key. The HMAC-SHA256 code must be generated using a secret key that was generated with your API key. This code must be converted to its hexadecimal representation (64 uppercase characters).

Type: string

EmptyPrivateRequest

EmptyPrivateRequest

Name Type Description
key string Your own API key. To get an API key, go to Account -> API Access Tab. Set permissions and click "Generate key".
signature string An HMAC-SHA256 encoded message containing - a nonce, user ID and API key. The HMAC-SHA256 code must be generated using a secret key that was generated with your API key. This code must be converted to its hexadecimal representation (64 uppercase characters).
nonce string The nonce is a regular integer number. It must be increasing with every request you make. Read more about it here. Example - if you set nonce to 1 in your first request, you must set it to at least 2 in your second request. You are not required to start with 1. A common practice is to use unix time for that parameter.

IDRequest

Private request that contains some entity's ID

Name Type Description
key string Your own API key. To get an API key, go to Account -> API Access Tab. Set permissions and click "Generate key".
signature string An HMAC-SHA256 encoded message containing - a nonce, user ID and API key. The HMAC-SHA256 code must be generated using a secret key that was generated with your API key. This code must be converted to its hexadecimal representation (64 uppercase characters).
nonce string The nonce is a regular integer number. It must be increasing with every request you make. Read more about it here. Example - if you set nonce to 1 in your first request, you must set it to at least 2 in your second request. You are not required to start with 1. A common practice is to use unix time for that parameter.
id number

ArchivedOrdersRequest

ArchivedOrdersRequest

Name Type Description
key string Your own API key. To get an API key, go to Account -> API Access Tab. Set permissions and click "Generate key".
signature string An HMAC-SHA256 encoded message containing - a nonce, user ID and API key. The HMAC-SHA256 code must be generated using a secret key that was generated with your API key. This code must be converted to its hexadecimal representation (64 uppercase characters).
nonce string The nonce is a regular integer number. It must be increasing with every request you make. Read more about it here. Example - if you set nonce to 1 in your first request, you must set it to at least 2 in your second request. You are not required to start with 1. A common practice is to use unix time for that parameter.
limit integer limit the number of entries in response
dateTo integer end date for open orders filtering (unix timestamp in seconds, 10 digits), inclusive
dateFrom integer start date for open order filtering (unix timestamp in seconds, 10 digits), inclusive
lastTxDateTo integer end date for last change orders filtering (unix timestamp in seconds, 10 digits), inclusive
lastTxDateFrom integer start date for last change order filtering (unix timestamp in seconds, 10 digits), inclusive
status string Order status ('d' = done, fully executed OR 'c' = canceled, not executed OR 'cd' = cancel-done, partially executed OR 'a' = active, created)

ActiveOrdersRequest

ActiveOrdersRequest

Name Type Description
key string Your own API key. To get an API key, go to Account -> API Access Tab. Set permissions and click "Generate key".
signature string An HMAC-SHA256 encoded message containing - a nonce, user ID and API key. The HMAC-SHA256 code must be generated using a secret key that was generated with your API key. This code must be converted to its hexadecimal representation (64 uppercase characters).
nonce string The nonce is a regular integer number. It must be increasing with every request you make. Read more about it here. Example - if you set nonce to 1 in your first request, you must set it to at least 2 in your second request. You are not required to start with 1. A common practice is to use unix time for that parameter.
orders_list [ string ]

PlaceOrderRequest

PlaceOrderRequest

Name Type Description
key string Your own API key. To get an API key, go to Account -> API Access Tab. Set permissions and click "Generate key".
signature string An HMAC-SHA256 encoded message containing - a nonce, user ID and API key. The HMAC-SHA256 code must be generated using a secret key that was generated with your API key. This code must be converted to its hexadecimal representation (64 uppercase characters).
nonce string The nonce is a regular integer number. It must be increasing with every request you make. Read more about it here. Example - if you set nonce to 1 in your first request, you must set it to at least 2 in your second request. You are not required to start with 1. A common practice is to use unix time for that parameter.
order_type string
type string Order type
amount number amount
price string price

OrderRequest

OrderRequest

Name Type Description
key string Your own API key. To get an API key, go to Account -> API Access Tab. Set permissions and click "Generate key".
signature string An HMAC-SHA256 encoded message containing - a nonce, user ID and API key. The HMAC-SHA256 code must be generated using a secret key that was generated with your API key. This code must be converted to its hexadecimal representation (64 uppercase characters).
nonce string The nonce is a regular integer number. It must be increasing with every request you make. Read more about it here. Example - if you set nonce to 1 in your first request, you must set it to at least 2 in your second request. You are not required to start with 1. A common practice is to use unix time for that parameter.
id number Order ID

AddressRequest

AddressRequest

Name Type Description
key string Your own API key. To get an API key, go to Account -> API Access Tab. Set permissions and click "Generate key".
signature string An HMAC-SHA256 encoded message containing - a nonce, user ID and API key. The HMAC-SHA256 code must be generated using a secret key that was generated with your API key. This code must be converted to its hexadecimal representation (64 uppercase characters).
nonce string The nonce is a regular integer number. It must be increasing with every request you make. Read more about it here. Example - if you set nonce to 1 in your first request, you must set it to at least 2 in your second request. You are not required to start with 1. A common practice is to use unix time for that parameter.
currency string Currency code

CancelReplaceOrderRequest

CancelReplaceOrderRequest

Name Type Description
key string Your own API key. To get an API key, go to Account -> API Access Tab. Set permissions and click "Generate key".
signature string An HMAC-SHA256 encoded message containing - a nonce, user ID and API key. The HMAC-SHA256 code must be generated using a secret key that was generated with your API key. This code must be converted to its hexadecimal representation (64 uppercase characters).
nonce string The nonce is a regular integer number. It must be increasing with every request you make. Read more about it here. Example - if you set nonce to 1 in your first request, you must set it to at least 2 in your second request. You are not required to start with 1. A common practice is to use unix time for that parameter.
type string Order type
amount number amount
price number price
order_id string order id

PairPrice

PairPrice

Name Type Description
curr1 string Currency code
curr2 string Currency code
lprice string last price of selling/buying the first currency relative to the second one. If there are no such executed orders, then lprice will equal to 0.

Ticker

Ticker

Name Type Description
bid number Highest buy order
ask number Lowest sell order
low string Last 24 hours price low
high string Last 24 hours price high
last string Last price
volume string Last 24 hours volume
volume30d string Last 30 days volume
timestamp string Unix timestamp

APIResponse

APIResponse

Name Type Description
e string Event type
data object Operation result
ok string Response status
error string Error message