NAV
JavaScript Python C# Java

Cryptocurrency Rest API

Introduction

Welcome to the CEX.IO Exchange V2 API reference documentation.

The CEX.IO Exchange provides developers with a REST and websocket API. The majority of API calls are available across both mediums in the same request and response formats, allowing smooth transition and a reduced learning curve between the two platforms. Where applicable, all API calls come with detailed information on both the request and response parameters, all in a simple JSON format, as well as sample requests and code snippets in JavaScript, Python, C#, and Java which can be viewed on the right.

Documentation for the old REST API V1 can be found here.

Change logs

04/28/22

REST API - added timestamp_ms to response in Orderbook

API Key

Authentication

To get access to CEX.IO data, you should be authorized.

To authorize your account with CEX.IO, please get required keys using the following instructions:

  1. Log in to CEX.IO account.
  2. Go to profile page.
  3. Select type of required permissions.
  4. Click Generate Key button and save your secret key, as it will become inaccessible after activation.
  5. Activate your key.

image

image

Rest API Authorisation

We have 2 type of methods Public (GET requests), which don't need authorisation at all, and Private (POST requests) which need additional fields inside the request for user authorisation.

To call private method you must add 3 fields (nonce, key, signature) into your request.

nonce - is integer field which must be bigger in each next request (good practice is using of timestamp)

key - is a string generated by CEX.IO to access to API

signature - is hash of strings nonce+username+key by sha256 algorithm encrypted with APISecret like salt

Encryption method example: sha256(string: "nonce"+"username"+"api_key", string: "api_secret")

Example of private request:

POST: https://api.cex.io/cancel_orders/BTC/USD { "nonce":1529420368, "key":"xcvxcv", "signature":"70758FC6ABB1CEA18ADD719D69564EBC9DA956CE091E40605188E0AD4B38A60A" }

Limits per requests

For HTTP Rest API we have strong limits 600 requests per 10 minutes, thats why we recomend to use hybrid way of 2 API`s - REST + WebSocket subscribtions where possible.

Base URLs:

Terms of service Email: Support

WS API

WebSocket API console available here.

Public API calls

Public API calls

Old fashion docs

Currency limits

Code samples


const headers = {
  'Accept':'application/json'
};

fetch('https://cex.io/api/currency_limits',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://cex.io/api/currency_limits', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }

    /// Make a dummy request
    public async Task MakeGetRequest()
    {
      string url = "https://cex.io/api/currency_limits";
      var result = await GetAsync(url);
    }

    /// Performs a GET Request
    public async Task GetAsync(string url)
    {
        //Start the request
        HttpResponseMessage response = await Client.GetAsync(url);

        //Validate result
        response.EnsureSuccessStatusCode();

    }




    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/currency_limits");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /currency_limits

Data about minimal & maximal limits per order for all pairs. Symbol1 & Symbol2 must be in range which specified in minLotSize/maxLotSize & minLotPrice2, plus price must be in range which specified in minPrice/maxPrice.

Example responses

successful operation

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

Responses

Status Meaning Description Schema
200 OK successful operation LimitsResponse

Ticker

Code samples


const headers = {
  'Accept':'*/*'
};

fetch('https://cex.io/api/ticker/{symbol1}/{symbol2}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': '*/*'
}

r = requests.get('https://cex.io/api/ticker/{symbol1}/{symbol2}', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }

    /// Make a dummy request
    public async Task MakeGetRequest()
    {
      string url = "https://cex.io/api/ticker/{symbol1}/{symbol2}";
      var result = await GetAsync(url);
    }

    /// Performs a GET Request
    public async Task GetAsync(string url)
    {
        //Start the request
        HttpResponseMessage response = await Client.GetAsync(url);

        //Validate result
        response.EnsureSuccessStatusCode();

    }




    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/ticker/{symbol1}/{symbol2}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /ticker/{symbol1}/{symbol2}

Basic trading information about currency pair for last 24 hours. Note - pair is case-sensitive, so BTC/USD is valid pair, but btc/usd is not.

Parameters

Name In Type Required Description
symbol1 path string true The first currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
symbol2 path string true The second currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)

Example responses

200 Response

successful operation

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

Responses

Status Meaning Description Schema
200 OK successful operation Ticker

Tickers for all pairs by markets

Code samples


const headers = {
  'Accept':'*/*'
};

fetch('https://cex.io/api/tickers/{symbol1}/{symbol2}/.../{marketSymbolN}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': '*/*'
}

r = requests.get('https://cex.io/api/tickers/{symbol1}/{symbol2}/.../{marketSymbolN}', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }

    /// Make a dummy request
    public async Task MakeGetRequest()
    {
      string url = "https://cex.io/api/tickers/{symbol1}/{symbol2}/.../{marketSymbolN}";
      var result = await GetAsync(url);
    }

    /// Performs a GET Request
    public async Task GetAsync(string url)
    {
        //Start the request
        HttpResponseMessage response = await Client.GetAsync(url);

        //Validate result
        response.EnsureSuccessStatusCode();

    }




    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/tickers/{symbol1}/{symbol2}/.../{marketSymbolN}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /tickers/{symbol1}/{symbol2}/.../{marketSymbolN}

Basic trading information about requested currency pairs. The result shows tickers for all currency pairs with requested symbols. Note - pair is case-sensitive, so BTC/USD is valid pair, hence btc/usd is not.

Parameters

Name In Type Required Description
symbol1 path string true The first currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
symbol2 path string true The second currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)

Example responses

200 Response

OK

{
  "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"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK Tickers

Last price

Code samples


const headers = {
  'Accept':'*/*'
};

fetch('https://cex.io/api/last_price/{symbol1}/{symbol2}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': '*/*'
}

r = requests.get('https://cex.io/api/last_price/{symbol1}/{symbol2}', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }

    /// Make a dummy request
    public async Task MakeGetRequest()
    {
      string url = "https://cex.io/api/last_price/{symbol1}/{symbol2}";
      var result = await GetAsync(url);
    }

    /// Performs a GET Request
    public async Task GetAsync(string url)
    {
        //Start the request
        HttpResponseMessage response = await Client.GetAsync(url);

        //Validate result
        response.EnsureSuccessStatusCode();

    }




    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/last_price/{symbol1}/{symbol2}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /last_price/{symbol1}/{symbol2}

Get last price for each trading pair will be defined as the price of the last executed order for this pair.

Parameters

Name In Type Required Description
symbol1 path string true The first currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
symbol2 path string true The second currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)

Example responses

200 Response

OK

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

Responses

Status Meaning Description Schema
200 OK OK PairPrice

Last prices for given markets

Code samples


const headers = {
  'Accept':'*/*'
};

fetch('https://cex.io/api/last_prices/{symbol1}/{symbol2}/{symbol3}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': '*/*'
}

r = requests.get('https://cex.io/api/last_prices/{symbol1}/{symbol2}/{symbol3}', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }

    /// Make a dummy request
    public async Task MakeGetRequest()
    {
      string url = "https://cex.io/api/last_prices/{symbol1}/{symbol2}/{symbol3}";
      var result = await GetAsync(url);
    }

    /// Performs a GET Request
    public async Task GetAsync(string url)
    {
        //Start the request
        HttpResponseMessage response = await Client.GetAsync(url);

        //Validate result
        response.EnsureSuccessStatusCode();

    }




    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/last_prices/{symbol1}/{symbol2}/{symbol3}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /last_prices/{symbol1}/{symbol2}/{symbol3}

Get last prices for given markets. The result shows last prices for all currency pairs with requested symbol1 or symbol2 or symbol3. The last price for each currency pair will be defined as the price of the last executed order for this pair.

Parameters

Name In Type Required Description
symbol1 path string true The first currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
symbol2 path string true The second currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
symbol3 path string true The third currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)

Example responses

200 Response

OK

{
  "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"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Enumerated Values
Property Value
symbol1 BTC
symbol1 ETH
symbol1 BCH
symbol1 BTG
symbol1 DASH
symbol1 XRP
symbol1 ZEC
symbol1 GHS
symbol1 USD
symbol1 EUR
symbol1 GBP
symbol1 LTC
symbol2 BTC
symbol2 ETH
symbol2 BCH
symbol2 BTG
symbol2 DASH
symbol2 XRP
symbol2 ZEC
symbol2 GHS
symbol2 USD
symbol2 EUR
symbol2 GBP
symbol2 LTC

Converter

Code samples

const inputBody = '{
  "amnt": "2.5"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'*/*'
};

fetch('https://cex.io/api/convert/{symbol1}/{symbol2}',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': '*/*'
}

r = requests.post('https://cex.io/api/convert/{symbol1}/{symbol2}', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }


    /// Make a dummy request
    public async Task MakePostRequest()
    {
      string url = "https://cex.io/api/convert/{symbol1}/{symbol2}";

      string json = @"{
  ""amnt"": ""2.5""
}";
      ConvertRequest content = JsonConvert.DeserializeObject(json);
      await PostAsync(content, url);


    }

    /// Performs a POST Request
    public async Task PostAsync(ConvertRequest content, string url)
    {
        //Serialize Object
        StringContent jsonContent = SerializeObject(content);

        //Execute POST request
        HttpResponseMessage response = await Client.PostAsync(url, jsonContent);
    }



    /// Serialize an object to Json
    private StringContent SerializeObject(ConvertRequest content)
    {
        //Serialize Object
        string jsonObject = JsonConvert.SerializeObject(content);

        //Create Json UTF8 String Content
        return new StringContent(jsonObject, Encoding.UTF8, "application/json");
    }

    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/convert/{symbol1}/{symbol2}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /convert/{symbol1}/{symbol2}

Converts amount of the symbol1 currency to any symbol2 currency by multiplying the amount by the last price of the chosen pair according to the current exchange rate.

Body parameter

{
  "amnt": "2.5"
}

Parameters

Name In Type Required Description
symbol1 path string true The first currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
symbol2 path string true The second currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
body body ConvertRequest false none

Example responses

200 Response

OK

{
  "amnt": 1000
}

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» amnt number false none convertible amount
» error string false none !OPTIONAL! if error occured

Chart

Code samples

const inputBody = '{
  "lastHours": 24,
  "maxRespArrSize": 100
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'*/*'
};

fetch('https://cex.io/api/price_stats/{symbol1}/{symbol2}',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': '*/*'
}

r = requests.post('https://cex.io/api/price_stats/{symbol1}/{symbol2}', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }


    /// Make a dummy request
    public async Task MakePostRequest()
    {
      string url = "https://cex.io/api/price_stats/{symbol1}/{symbol2}";

      string json = @"{
  ""lastHours"": 24,
  ""maxRespArrSize"": 100
}";
      PriceStatsRequest content = JsonConvert.DeserializeObject(json);
      await PostAsync(content, url);


    }

    /// Performs a POST Request
    public async Task PostAsync(PriceStatsRequest content, string url)
    {
        //Serialize Object
        StringContent jsonContent = SerializeObject(content);

        //Execute POST request
        HttpResponseMessage response = await Client.PostAsync(url, jsonContent);
    }



    /// Serialize an object to Json
    private StringContent SerializeObject(PriceStatsRequest content)
    {
        //Serialize Object
        string jsonObject = JsonConvert.SerializeObject(content);

        //Create Json UTF8 String Content
        return new StringContent(jsonObject, Encoding.UTF8, "application/json");
    }

    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/price_stats/{symbol1}/{symbol2}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /price_stats/{symbol1}/{symbol2}

DEPRECATED!
Allows building price change charts (daily, weekly, monthly) and showing historical point at any point of the chart

Body parameter

{
  "lastHours": 24,
  "maxRespArrSize": 100
}

Parameters

Name In Type Required Description
symbol1 path string true The first currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
symbol2 path string true The second currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
body body PriceStatsRequest false none

Example responses

200 Response

OK

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

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» tmsp number false none UNIX timestamp
» price string false none price value

Historical OHLCV Chart

Code samples


const headers = {
  'Accept':'*/*'
};

fetch('https://cex.io/api/ohlcv/hd/{date}/{symbol1}/{symbol2}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': '*/*'
}

r = requests.get('https://cex.io/api/ohlcv/hd/{date}/{symbol1}/{symbol2}', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }

    /// Make a dummy request
    public async Task MakeGetRequest()
    {
      string url = "https://cex.io/api/ohlcv/hd/{date}/{symbol1}/{symbol2}";
      var result = await GetAsync(url);
    }

    /// Performs a GET Request
    public async Task GetAsync(string url)
    {
        //Start the request
        HttpResponseMessage response = await Client.GetAsync(url);

        //Validate result
        response.EnsureSuccessStatusCode();

    }




    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/ohlcv/hd/{date}/{symbol1}/{symbol2}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /ohlcv/hd/{date}/{symbol1}/{symbol2}

Returns dataset to build 1m OHLCV chart for a given day. Relies on historical data, is not working for current day

Parameters

Name In Type Required Description
date path string true date in format "YYYYMMDD"
symbol1 path string true The first currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
symbol2 path string true The second currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)

Example responses

200 Response

OK

{
  "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]]"
}

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» time number false none Date in format "YYYYMMDD"
» data1m string false none Stringified array of candle data by minutes [timestamp, open, high, low, close, volume]
» data1h string false none Stringified array of candle data by hours [timestamp, open, high, low, close, volume]
» data1d string false none Stringified array of candle data by days [timestamp, open, high, low, close, volume]

Orderbook

Code samples


const headers = {
  'Accept':'*/*'
};

fetch('https://cex.io/api/order_book/{symbol1}/{symbol2}/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': '*/*'
}

r = requests.get('https://cex.io/api/order_book/{symbol1}/{symbol2}/', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }

    /// Make a dummy request
    public async Task MakeGetRequest()
    {
      string url = "https://cex.io/api/order_book/{symbol1}/{symbol2}/";
      var result = await GetAsync(url);
    }

    /// Performs a GET Request
    public async Task GetAsync(string url)
    {
        //Start the request
        HttpResponseMessage response = await Client.GetAsync(url);

        //Validate result
        response.EnsureSuccessStatusCode();

    }




    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/order_book/{symbol1}/{symbol2}/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /order_book/{symbol1}/{symbol2}/

Get top of the current order book

Parameters

Name In Type Required Description
symbol1 path string true The first currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
symbol2 path string true The second currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
depth query number false !OPTIONAL! limit the number of bid/ask records returned (optional parameter, all existing elements are returned if omitted)

Example responses

200 Response

OK

{
  "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"
}

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» timestamp number false none UNIX timestamp
» bids [number] false none lists of open orders, each order is represented as a list of [price, amount].
» asks [number] false none lists of open orders, each order is represented as a list of [price, amount].
» pair string false none Pair name ${symbol1}:${symbol2}
» id number false none Incremental version id of order-book snapshot, may be used to check if order-book changed
» sell_total string false none Total available in symbol1 (e.g. BTC)
» buy_total string false none Total available in symbol2 (e.g. USD)

Trade history

Code samples


const headers = {
  'Accept':'*/*'
};

fetch('https://cex.io/api/trade_history/{symbol1}/{symbol2}/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': '*/*'
}

r = requests.get('https://cex.io/api/trade_history/{symbol1}/{symbol2}/', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }

    /// Make a dummy request
    public async Task MakeGetRequest()
    {
      string url = "https://cex.io/api/trade_history/{symbol1}/{symbol2}/";
      var result = await GetAsync(url);
    }

    /// Performs a GET Request
    public async Task GetAsync(string url)
    {
        //Start the request
        HttpResponseMessage response = await Client.GetAsync(url);

        //Validate result
        response.EnsureSuccessStatusCode();

    }




    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/trade_history/{symbol1}/{symbol2}/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /trade_history/{symbol1}/{symbol2}/

Get trade history data

Parameters

Name In Type Required Description
symbol1 path string true The first currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
symbol2 path string true The second currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
since query number false This is optional parameter. Response contains trades with tid >= since, and response contains not more then 1000 elements.

Example responses

200 Response

OK

[
  {
    "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"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» type OrderType false none Type of order transaction (buy or sell only)
» date string false none UNIX timestamp
» amount string false none trade amount
» price string false none price
» tid string false none trade id
Enumerated Values
Property Value
type buy
type sell

Currency profile

Code samples


const headers = {
  'Accept':'application/json'
};

fetch('https://cex.io/api/currency_profile',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://cex.io/api/currency_profile', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }


    /// Make a dummy request
    public async Task MakeGetRequest()
    {
      string url = "https://cex.io/api/currency_profile";


      await GetAsync(null, url);

    }

    /// Performs a GET Request
    public async Task GetAsync(undefined content, string url)
    {
        //Serialize Object
        StringContent jsonContent = SerializeObject(content);

        //Execute GET request
        HttpResponseMessage response = await Client.GetAsync(url, jsonContent);
    }



    /// Serialize an object to Json
    private StringContent SerializeObject(undefined content)
    {
        //Serialize Object
        string jsonObject = JsonConvert.SerializeObject(content);

        //Create Json UTF8 String Content
        return new StringContent(jsonObject, Encoding.UTF8, "application/json");
    }

    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/currency_profile");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /currency_profile

Returns available symbols and pairs in the system

Example responses

success

{
  "e": "currency_profile",
  "ok": "ok",
  "data": {
    "symbols": [
      {
        "code": "GHS",
        "contract": true,
        "commodity": true,
        "fiat": false,
        "description": "CEX.IO doesn't provide cloud mining services anymore.",
        "precision": 8,
        "scale": 0,
        "minimumCurrencyAmount": "0.00000001",
        "minimalWithdrawalAmount": -1
      }
    ],
    "pairs": [
      {
        "symbol1": "BTC",
        "symbol2": "USD",
        "pricePrecision": 1,
        "priceScale": "/1000000",
        "minLotSize": 0.00014213,
        "minLotSizeS2": 20,
        "newLabelEndDate": 1613735901213,
        "tags": [
          "major"
        ]
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK success None

Response Schema

Private API calls

Private API calls requires API key. Each private call should contain API key, signature and nonce in request body

Account balance

Code samples

const inputBody = '{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'*/*'
};

fetch('https://cex.io/api/balance/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': '*/*'
}

r = requests.post('https://cex.io/api/balance/', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }


    /// Make a dummy request
    public async Task MakePostRequest()
    {
      string url = "https://cex.io/api/balance/";

      string json = @"{
  ""key"": ""HLixH1aYdOIWOoRyoHkFpHlawrM"",
  ""signature"": ""0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9"",
  ""nonce"": ""1513175715""
}";
      EmptyPrivateRequest content = JsonConvert.DeserializeObject(json);
      await PostAsync(content, url);


    }

    /// Performs a POST Request
    public async Task PostAsync(EmptyPrivateRequest content, string url)
    {
        //Serialize Object
        StringContent jsonContent = SerializeObject(content);

        //Execute POST request
        HttpResponseMessage response = await Client.PostAsync(url, jsonContent);
    }



    /// Serialize an object to Json
    private StringContent SerializeObject(EmptyPrivateRequest content)
    {
        //Serialize Object
        string jsonObject = JsonConvert.SerializeObject(content);

        //Create Json UTF8 String Content
        return new StringContent(jsonObject, Encoding.UTF8, "application/json");
    }

    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/balance/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /balance/

Obtain actual user's balance for all currencies

Body parameter

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715"
}

Parameters

Name In Type Required Description
body body EmptyPrivateRequest false none

Example responses

200 Response

OK

{
  "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"
  },
  "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"
  },
  "LTC": {
    "available": "1000000.00",
    "orders": "0.00"
  },
  "GHS": {
    "available": "0.00000000",
    "orders": "0.00000000"
  }
}

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» timestamp string false none UNIX timestamp
» username string false none User ID
» BTC Balance false none none
»» available string false none available balance
»» orders string false none balance in pending orders
» BCH Balance false none none
» ETH Balance false none none
» LTC Balance false none none
» DASH Balance false none none
» ZEC Balance false none none
» USD Balance false none none
» EUR Balance false none none
» GBP Balance false none none
» GHS Balance false none none

Open orders

Code samples

const inputBody = '{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'*/*'
};

fetch('https://cex.io/api/open_orders/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': '*/*'
}

r = requests.post('https://cex.io/api/open_orders/', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }


    /// Make a dummy request
    public async Task MakePostRequest()
    {
      string url = "https://cex.io/api/open_orders/";

      string json = @"{
  ""key"": ""HLixH1aYdOIWOoRyoHkFpHlawrM"",
  ""signature"": ""0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9"",
  ""nonce"": ""1513175715""
}";
      EmptyPrivateRequest content = JsonConvert.DeserializeObject(json);
      await PostAsync(content, url);


    }

    /// Performs a POST Request
    public async Task PostAsync(EmptyPrivateRequest content, string url)
    {
        //Serialize Object
        StringContent jsonContent = SerializeObject(content);

        //Execute POST request
        HttpResponseMessage response = await Client.PostAsync(url, jsonContent);
    }



    /// Serialize an object to Json
    private StringContent SerializeObject(EmptyPrivateRequest content)
    {
        //Serialize Object
        string jsonObject = JsonConvert.SerializeObject(content);

        //Create Json UTF8 String Content
        return new StringContent(jsonObject, Encoding.UTF8, "application/json");
    }

    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/open_orders/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /open_orders/

Obtain actual user's opened orders

Body parameter

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715"
}

Parameters

Name In Type Required Description
body body EmptyPrivateRequest false none

Example responses

200 Response

OK

[
  {
    "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"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [ShortOrder] false none [Order object (some fields omitted)]
» id ShortOrder/properties/id false none order id
» time string false none timestamp
» type OrderType false none Type of order transaction (buy or sell only)
» price string false none price
» amount string false none amount
» pending string false none pending amount (if partially executed)
» symbol1 Symbol false none Currency code
» symbol2 Symbol false none Currency code
» symbol1Amount string false none !OPTIONAL! amount (if market order)
» symbol2Amount string false none !OPTIONAL! amount (if market order)
Enumerated Values
Property Value
type buy
type sell
symbol1 BTC
symbol1 ETH
symbol1 BCH
symbol1 BTG
symbol1 DASH
symbol1 XRP
symbol1 ZEC
symbol1 GHS
symbol1 USD
symbol1 EUR
symbol1 GBP
symbol1 LTC
symbol2 BTC
symbol2 ETH
symbol2 BCH
symbol2 BTG
symbol2 DASH
symbol2 XRP
symbol2 ZEC
symbol2 GHS
symbol2 USD
symbol2 EUR
symbol2 GBP
symbol2 LTC

Open orders by pair

Code samples

const inputBody = '{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'*/*'
};

fetch('https://cex.io/api/open_orders/{symbol1}/{symbol2}',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': '*/*'
}

r = requests.post('https://cex.io/api/open_orders/{symbol1}/{symbol2}', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }


    /// Make a dummy request
    public async Task MakePostRequest()
    {
      string url = "https://cex.io/api/open_orders/{symbol1}/{symbol2}";

      string json = @"{
  ""key"": ""HLixH1aYdOIWOoRyoHkFpHlawrM"",
  ""signature"": ""0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9"",
  ""nonce"": ""1513175715""
}";
      EmptyPrivateRequest content = JsonConvert.DeserializeObject(json);
      await PostAsync(content, url);


    }

    /// Performs a POST Request
    public async Task PostAsync(EmptyPrivateRequest content, string url)
    {
        //Serialize Object
        StringContent jsonContent = SerializeObject(content);

        //Execute POST request
        HttpResponseMessage response = await Client.PostAsync(url, jsonContent);
    }



    /// Serialize an object to Json
    private StringContent SerializeObject(EmptyPrivateRequest content)
    {
        //Serialize Object
        string jsonObject = JsonConvert.SerializeObject(content);

        //Create Json UTF8 String Content
        return new StringContent(jsonObject, Encoding.UTF8, "application/json");
    }

    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/open_orders/{symbol1}/{symbol2}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /open_orders/{symbol1}/{symbol2}

Obtain actual user's opened orders for selected pair

Body parameter

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715"
}

Parameters

Name In Type Required Description
symbol1 path string true The first currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
symbol2 path string true The second currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
body body EmptyPrivateRequest false none

Example responses

200 Response

OK

[
  {
    "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"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [ShortOrder] false none [Order object (some fields omitted)]
» id ShortOrder/properties/id false none order id
» time string false none timestamp
» type OrderType false none Type of order transaction (buy or sell only)
» price string false none price
» amount string false none amount
» pending string false none pending amount (if partially executed)
» symbol1 Symbol false none Currency code
» symbol2 Symbol false none Currency code
» symbol1Amount string false none !OPTIONAL! amount (if market order)
» symbol2Amount string false none !OPTIONAL! amount (if market order)
Enumerated Values
Property Value
type buy
type sell
symbol1 BTC
symbol1 ETH
symbol1 BCH
symbol1 BTG
symbol1 DASH
symbol1 XRP
symbol1 ZEC
symbol1 GHS
symbol1 USD
symbol1 EUR
symbol1 GBP
symbol1 LTC
symbol2 BTC
symbol2 ETH
symbol2 BCH
symbol2 BTG
symbol2 DASH
symbol2 XRP
symbol2 ZEC
symbol2 GHS
symbol2 USD
symbol2 EUR
symbol2 GBP
symbol2 LTC

Open orders by symbol

Code samples

const inputBody = '{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'*/*'
};

fetch('https://cex.io/api/open_orders/{symbol1}',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': '*/*'
}

r = requests.post('https://cex.io/api/open_orders/{symbol1}', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }


    /// Make a dummy request
    public async Task MakePostRequest()
    {
      string url = "https://cex.io/api/open_orders/{symbol1}";

      string json = @"{
  ""key"": ""HLixH1aYdOIWOoRyoHkFpHlawrM"",
  ""signature"": ""0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9"",
  ""nonce"": ""1513175715""
}";
      EmptyPrivateRequest content = JsonConvert.DeserializeObject(json);
      await PostAsync(content, url);


    }

    /// Performs a POST Request
    public async Task PostAsync(EmptyPrivateRequest content, string url)
    {
        //Serialize Object
        StringContent jsonContent = SerializeObject(content);

        //Execute POST request
        HttpResponseMessage response = await Client.PostAsync(url, jsonContent);
    }



    /// Serialize an object to Json
    private StringContent SerializeObject(EmptyPrivateRequest content)
    {
        //Serialize Object
        string jsonObject = JsonConvert.SerializeObject(content);

        //Create Json UTF8 String Content
        return new StringContent(jsonObject, Encoding.UTF8, "application/json");
    }

    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/open_orders/{symbol1}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /open_orders/{symbol1}

Obtain actual user's opened orders for selected symbol

Body parameter

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715"
}

Parameters

Name In Type Required Description
symbol1 path string true The first currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
body body EmptyPrivateRequest false none

Example responses

200 Response

OK

[
  {
    "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"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [ShortOrder] false none [Order object (some fields omitted)]
» id ShortOrder/properties/id false none order id
» time string false none timestamp
» type OrderType false none Type of order transaction (buy or sell only)
» price string false none price
» amount string false none amount
» pending string false none pending amount (if partially executed)
» symbol1 Symbol false none Currency code
» symbol2 Symbol false none Currency code
» symbol1Amount string false none !OPTIONAL! amount (if market order)
» symbol2Amount string false none !OPTIONAL! amount (if market order)
Enumerated Values
Property Value
type buy
type sell
symbol1 BTC
symbol1 ETH
symbol1 BCH
symbol1 BTG
symbol1 DASH
symbol1 XRP
symbol1 ZEC
symbol1 GHS
symbol1 USD
symbol1 EUR
symbol1 GBP
symbol1 LTC
symbol2 BTC
symbol2 ETH
symbol2 BCH
symbol2 BTG
symbol2 DASH
symbol2 XRP
symbol2 ZEC
symbol2 GHS
symbol2 USD
symbol2 EUR
symbol2 GBP
symbol2 LTC

Mass cancel place orders

Code samples

const inputBody = '{
  "cancel-orders": [
    "1987",
    "1278"
  ],
  "place-orders": [
    {
      "pair": [
        "BTC",
        "USD"
      ],
      "amount": 0.02,
      "price": "4200",
      "order_type": "limit",
      "type": "buy"
    }
  ],
  "cancelPlacedOrdersIfPlaceFailed": false
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('https://cex.io/api/mass_cancel_place_orders',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('https://cex.io/api/mass_cancel_place_orders', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }


    /// Make a dummy request
    public async Task MakePostRequest()
    {
      string url = "https://cex.io/api/mass_cancel_place_orders";


      await PostAsync(null, url);

    }

    /// Performs a POST Request
    public async Task PostAsync(undefined content, string url)
    {
        //Serialize Object
        StringContent jsonContent = SerializeObject(content);

        //Execute POST request
        HttpResponseMessage response = await Client.PostAsync(url, jsonContent);
    }



    /// Serialize an object to Json
    private StringContent SerializeObject(undefined content)
    {
        //Serialize Object
        string jsonObject = JsonConvert.SerializeObject(content);

        //Create Json UTF8 String Content
        return new StringContent(jsonObject, Encoding.UTF8, "application/json");
    }

    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/mass_cancel_place_orders");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /mass_cancel_place_orders

Allows to cancel and place up to 50 limit orders. Only order_type=='limit' is supported

Body parameter

{
  "cancel-orders": [
    "1987",
    "1278"
  ],
  "place-orders": [
    {
      "pair": [
        "BTC",
        "USD"
      ],
      "amount": 0.02,
      "price": "4200",
      "order_type": "limit",
      "type": "buy"
    }
  ],
  "cancelPlacedOrdersIfPlaceFailed": false
}

Parameters

Name In Type Required Description
body body object false none
» cancel-orders body [any] false array of order IDs(string), max length 50
» place-orders body [any] false array of orders objects, max length 50
» cancelPlacedOrdersIfPlaceFailed body boolean false OPTIONAL, default = true

Example responses

success

{
  "e": "mass_cancel_place_orders",
  "ok": "ok",
  "data": {
    "cancel-orders": [
      "1987",
      "1278"
    ],
    "place-orders": [
      {
        "pair": [
          "BTC",
          "USD"
        ],
        "amount": 0.02,
        "price": "4200",
        "order_type": "limit",
        "type": "buy"
      }
    ],
    "placed-cancelled": [
      {
        "order_id": "136055974",
        "fremains": "11.00000000"
      }
    ]
  }
}

order was not found

{
  "e": "mass_cancel_place_orders",
  "ok": "ok",
  "data": {
    "cancel-orders": [
      {
        "error": "Order not found"
      }
    ],
    "place-orders": [],
    "placed-cancelled": []
  }
}

Responses

Status Meaning Description Schema
200 OK success None
500 Internal Server Error order was not found None

Response Schema

Active order status

Code samples

const inputBody = '{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "orders_list": [
    "8550492",
    "8550495",
    "8550497"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'*/*'
};

fetch('https://cex.io/api/active_orders_status',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': '*/*'
}

r = requests.post('https://cex.io/api/active_orders_status', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }


    /// Make a dummy request
    public async Task MakePostRequest()
    {
      string url = "https://cex.io/api/active_orders_status";

      string json = @"{
  ""key"": ""HLixH1aYdOIWOoRyoHkFpHlawrM"",
  ""signature"": ""0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9"",
  ""nonce"": ""1513175715"",
  ""orders_list"": [
    ""8550492"",
    ""8550495"",
    ""8550497""
  ]
}";
      ActiveOrdersRequest content = JsonConvert.DeserializeObject(json);
      await PostAsync(content, url);


    }

    /// Performs a POST Request
    public async Task PostAsync(ActiveOrdersRequest content, string url)
    {
        //Serialize Object
        StringContent jsonContent = SerializeObject(content);

        //Execute POST request
        HttpResponseMessage response = await Client.PostAsync(url, jsonContent);
    }



    /// Serialize an object to Json
    private StringContent SerializeObject(ActiveOrdersRequest content)
    {
        //Serialize Object
        string jsonObject = JsonConvert.SerializeObject(content);

        //Create Json UTF8 String Content
        return new StringContent(jsonObject, Encoding.UTF8, "application/json");
    }

    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/active_orders_status");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /active_orders_status

Obtain actual user's active order

Body parameter

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "orders_list": [
    "8550492",
    "8550495",
    "8550497"
  ]
}

Parameters

Name In Type Required Description
body body ActiveOrdersRequest false none

Example responses

200 Response

OK

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

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Archived orders

Code samples

const inputBody = '{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "limit": 10,
  "dateTo": 1506943193,
  "dateFrom": 1506943193,
  "lastTxDateTo": 1506943193,
  "lastTxDateFrom": 1506943193,
  "status": "c"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'*/*'
};

fetch('https://cex.io/api/archived_orders/{symbol1}/{symbol2}',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': '*/*'
}

r = requests.post('https://cex.io/api/archived_orders/{symbol1}/{symbol2}', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }


    /// Make a dummy request
    public async Task MakePostRequest()
    {
      string url = "https://cex.io/api/archived_orders/{symbol1}/{symbol2}";

      string json = @"{
  ""key"": ""HLixH1aYdOIWOoRyoHkFpHlawrM"",
  ""signature"": ""0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9"",
  ""nonce"": ""1513175715"",
  ""limit"": 10,
  ""dateTo"": 1506943193,
  ""dateFrom"": 1506943193,
  ""lastTxDateTo"": 1506943193,
  ""lastTxDateFrom"": 1506943193,
  ""status"": ""c""
}";
      ArchivedOrdersRequest content = JsonConvert.DeserializeObject(json);
      await PostAsync(content, url);


    }

    /// Performs a POST Request
    public async Task PostAsync(ArchivedOrdersRequest content, string url)
    {
        //Serialize Object
        StringContent jsonContent = SerializeObject(content);

        //Execute POST request
        HttpResponseMessage response = await Client.PostAsync(url, jsonContent);
    }



    /// Serialize an object to Json
    private StringContent SerializeObject(ArchivedOrdersRequest content)
    {
        //Serialize Object
        string jsonObject = JsonConvert.SerializeObject(content);

        //Create Json UTF8 String Content
        return new StringContent(jsonObject, Encoding.UTF8, "application/json");
    }

    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/archived_orders/{symbol1}/{symbol2}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /archived_orders/{symbol1}/{symbol2}

Obtain archived user's orders for selected pair

Body parameter

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "limit": 10,
  "dateTo": 1506943193,
  "dateFrom": 1506943193,
  "lastTxDateTo": 1506943193,
  "lastTxDateFrom": 1506943193,
  "status": "c"
}

Parameters

Name In Type Required Description
symbol1 path string true The first currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
symbol2 path string true The second currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
body body ArchivedOrdersRequest false none

Example responses

200 Response

OK

[
  {
    "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"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Enumerated Values
Property Value
type buy
type sell
symbol1 BTC
symbol1 ETH
symbol1 BCH
symbol1 BTG
symbol1 DASH
symbol1 XRP
symbol1 ZEC
symbol1 GHS
symbol1 USD
symbol1 EUR
symbol1 GBP
symbol1 LTC
symbol2 BTC
symbol2 ETH
symbol2 BCH
symbol2 BTG
symbol2 DASH
symbol2 XRP
symbol2 ZEC
symbol2 GHS
symbol2 USD
symbol2 EUR
symbol2 GBP
symbol2 LTC

Cancel order

Code samples

const inputBody = '{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "id": 1234
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'*/*'
};

fetch('https://cex.io/api/cancel_order/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': '*/*'
}

r = requests.post('https://cex.io/api/cancel_order/', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }


    /// Make a dummy request
    public async Task MakePostRequest()
    {
      string url = "https://cex.io/api/cancel_order/";

      string json = @"{
  ""key"": ""HLixH1aYdOIWOoRyoHkFpHlawrM"",
  ""signature"": ""0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9"",
  ""nonce"": ""1513175715"",
  ""id"": 1234
}";
      OrderRequest content = JsonConvert.DeserializeObject(json);
      await PostAsync(content, url);


    }

    /// Performs a POST Request
    public async Task PostAsync(OrderRequest content, string url)
    {
        //Serialize Object
        StringContent jsonContent = SerializeObject(content);

        //Execute POST request
        HttpResponseMessage response = await Client.PostAsync(url, jsonContent);
    }



    /// Serialize an object to Json
    private StringContent SerializeObject(OrderRequest content)
    {
        //Serialize Object
        string jsonObject = JsonConvert.SerializeObject(content);

        //Create Json UTF8 String Content
        return new StringContent(jsonObject, Encoding.UTF8, "application/json");
    }

    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/cancel_order/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /cancel_order/

Cancel order by provided id

Body parameter

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "id": 1234
}

Parameters

Name In Type Required Description
body body OrderRequest false none

Example responses

200 Response

OK

true

Responses

Status Meaning Description Schema
200 OK OK boolean

Cancel all orders for given pair

Code samples

const inputBody = '{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'*/*'
};

fetch('https://cex.io/api/cancel_orders/{symbol1}/{symbol2}',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': '*/*'
}

r = requests.post('https://cex.io/api/cancel_orders/{symbol1}/{symbol2}', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }


    /// Make a dummy request
    public async Task MakePostRequest()
    {
      string url = "https://cex.io/api/cancel_orders/{symbol1}/{symbol2}";

      string json = @"{
  ""key"": ""HLixH1aYdOIWOoRyoHkFpHlawrM"",
  ""signature"": ""0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9"",
  ""nonce"": ""1513175715""
}";
      EmptyPrivateRequest content = JsonConvert.DeserializeObject(json);
      await PostAsync(content, url);


    }

    /// Performs a POST Request
    public async Task PostAsync(EmptyPrivateRequest content, string url)
    {
        //Serialize Object
        StringContent jsonContent = SerializeObject(content);

        //Execute POST request
        HttpResponseMessage response = await Client.PostAsync(url, jsonContent);
    }



    /// Serialize an object to Json
    private StringContent SerializeObject(EmptyPrivateRequest content)
    {
        //Serialize Object
        string jsonObject = JsonConvert.SerializeObject(content);

        //Create Json UTF8 String Content
        return new StringContent(jsonObject, Encoding.UTF8, "application/json");
    }

    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/cancel_orders/{symbol1}/{symbol2}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /cancel_orders/{symbol1}/{symbol2}

Cancel user's opened orders for selected pair

Body parameter

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715"
}

Parameters

Name In Type Required Description
symbol1 path string true The first currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
symbol2 path string true The second currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
body body EmptyPrivateRequest false none

Example responses

200 Response

OK

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

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Place order

Code samples

const inputBody = '{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "order_type": "market",
  "type": "buy",
  "amount": 0.2,
  "price": 1155.6
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'*/*'
};

fetch('https://cex.io/api/place_order/{symbol1}/{symbol2}',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': '*/*'
}

r = requests.post('https://cex.io/api/place_order/{symbol1}/{symbol2}', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }


    /// Make a dummy request
    public async Task MakePostRequest()
    {
      string url = "https://cex.io/api/place_order/{symbol1}/{symbol2}";

      string json = @"{
  ""key"": ""HLixH1aYdOIWOoRyoHkFpHlawrM"",
  ""signature"": ""0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9"",
  ""nonce"": ""1513175715"",
  ""order_type"": ""market"",
  ""type"": ""buy"",
  ""amount"": 0.2,
  ""price"": 1155.6
}";
      PlaceOrderRequest content = JsonConvert.DeserializeObject(json);
      await PostAsync(content, url);


    }

    /// Performs a POST Request
    public async Task PostAsync(PlaceOrderRequest content, string url)
    {
        //Serialize Object
        StringContent jsonContent = SerializeObject(content);

        //Execute POST request
        HttpResponseMessage response = await Client.PostAsync(url, jsonContent);
    }



    /// Serialize an object to Json
    private StringContent SerializeObject(PlaceOrderRequest content)
    {
        //Serialize Object
        string jsonObject = JsonConvert.SerializeObject(content);

        //Create Json UTF8 String Content
        return new StringContent(jsonObject, Encoding.UTF8, "application/json");
    }

    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/place_order/{symbol1}/{symbol2}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /place_order/{symbol1}/{symbol2}

place a new order on selected pair

Body parameter

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "order_type": "market",
  "type": "buy",
  "amount": 0.2,
  "price": 1155.6
}

Parameters

Name In Type Required Description
symbol1 path string true The first currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
symbol2 path string true The second currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
body body PlaceOrderRequest false none

Example responses

200 Response

OK

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

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Enumerated Values
Property Value
type buy
type sell
symbol1 BTC
symbol1 ETH
symbol1 BCH
symbol1 BTG
symbol1 DASH
symbol1 XRP
symbol1 ZEC
symbol1 GHS
symbol1 USD
symbol1 EUR
symbol1 GBP
symbol1 LTC
symbol2 BTC
symbol2 ETH
symbol2 BCH
symbol2 BTG
symbol2 DASH
symbol2 XRP
symbol2 ZEC
symbol2 GHS
symbol2 USD
symbol2 EUR
symbol2 GBP
symbol2 LTC

Get order details

Code samples

const inputBody = '{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "id": 1234
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'*/*'
};

fetch('https://cex.io/api/get_order/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': '*/*'
}

r = requests.post('https://cex.io/api/get_order/', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }


    /// Make a dummy request
    public async Task MakePostRequest()
    {
      string url = "https://cex.io/api/get_order/";

      string json = @"{
  ""key"": ""HLixH1aYdOIWOoRyoHkFpHlawrM"",
  ""signature"": ""0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9"",
  ""nonce"": ""1513175715"",
  ""id"": 1234
}";
      OrderRequest content = JsonConvert.DeserializeObject(json);
      await PostAsync(content, url);


    }

    /// Performs a POST Request
    public async Task PostAsync(OrderRequest content, string url)
    {
        //Serialize Object
        StringContent jsonContent = SerializeObject(content);

        //Execute POST request
        HttpResponseMessage response = await Client.PostAsync(url, jsonContent);
    }



    /// Serialize an object to Json
    private StringContent SerializeObject(OrderRequest content)
    {
        //Serialize Object
        string jsonObject = JsonConvert.SerializeObject(content);

        //Create Json UTF8 String Content
        return new StringContent(jsonObject, Encoding.UTF8, "application/json");
    }

    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/get_order/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /get_order/

Get full inforamtion about order.

Body parameter

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "id": 1234
}

Parameters

Name In Type Required Description
body body OrderRequest false none

Example responses

200 Response

OK

{
  "id": "22347874",
  "type": "buy",
  "time": 1470302860316,
  "lastTxTime": "2016-08-04T09:27:47.527Z",
  "lastTx": "22347950",
  "pos": null,
  "user": "up12345678",
  "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"
}

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Enumerated Values
Property Value
type buy
type sell
symbol1 BTC
symbol1 ETH
symbol1 BCH
symbol1 BTG
symbol1 DASH
symbol1 XRP
symbol1 ZEC
symbol1 GHS
symbol1 USD
symbol1 EUR
symbol1 GBP
symbol1 LTC
symbol2 BTC
symbol2 ETH
symbol2 BCH
symbol2 BTG
symbol2 DASH
symbol2 XRP
symbol2 ZEC
symbol2 GHS
symbol2 USD
symbol2 EUR
symbol2 GBP
symbol2 LTC

Get order transactions

Code samples

const inputBody = '{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "id": 1234
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'*/*'
};

fetch('https://cex.io/api/get_order_tx/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': '*/*'
}

r = requests.post('https://cex.io/api/get_order_tx/', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }


    /// Make a dummy request
    public async Task MakePostRequest()
    {
      string url = "https://cex.io/api/get_order_tx/";

      string json = @"{
  ""key"": ""HLixH1aYdOIWOoRyoHkFpHlawrM"",
  ""signature"": ""0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9"",
  ""nonce"": ""1513175715"",
  ""id"": 1234
}";
      OrderRequest content = JsonConvert.DeserializeObject(json);
      await PostAsync(content, url);


    }

    /// Performs a POST Request
    public async Task PostAsync(OrderRequest content, string url)
    {
        //Serialize Object
        StringContent jsonContent = SerializeObject(content);

        //Execute POST request
        HttpResponseMessage response = await Client.PostAsync(url, jsonContent);
    }



    /// Serialize an object to Json
    private StringContent SerializeObject(OrderRequest content)
    {
        //Serialize Object
        string jsonObject = JsonConvert.SerializeObject(content);

        //Create Json UTF8 String Content
        return new StringContent(jsonObject, Encoding.UTF8, "application/json");
    }

    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/get_order_tx/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /get_order_tx/

Get information about all order transactions.

Body parameter

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "id": 1234
}

Parameters

Name In Type Required Description
body body OrderRequest false none

Example responses

200 Response

OK

{
  "e": "get_order_tx",
  "ok": "ok",
  "data": {
    "id": "22347874",
    "type": "buy",
    "time": 1470302860316,
    "lastTxTime": "2016-08-04T09:27:47.527Z",
    "lastTx": "22347950",
    "user": "up12345678",
    "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": "up12345678",
        "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": "up12345678",
        "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": "up12345678",
        "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
  }
}

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Enumerated Values
Property Value
type buy
type sell
status d
status c
status cd
symbol1 BTC
symbol1 ETH
symbol1 BCH
symbol1 BTG
symbol1 DASH
symbol1 XRP
symbol1 ZEC
symbol1 GHS
symbol1 USD
symbol1 EUR
symbol1 GBP
symbol1 LTC
symbol2 BTC
symbol2 ETH
symbol2 BCH
symbol2 BTG
symbol2 DASH
symbol2 XRP
symbol2 ZEC
symbol2 GHS
symbol2 USD
symbol2 EUR
symbol2 GBP
symbol2 LTC
type buy
type sell
symbol BTC
symbol ETH
symbol BCH
symbol BTG
symbol DASH
symbol XRP
symbol ZEC
symbol GHS
symbol USD
symbol EUR
symbol GBP
symbol LTC
symbol2 BTC
symbol2 ETH
symbol2 BCH
symbol2 BTG
symbol2 DASH
symbol2 XRP
symbol2 ZEC
symbol2 GHS
symbol2 USD
symbol2 EUR
symbol2 GBP
symbol2 LTC

Get crypto address

Code samples

const inputBody = '{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "currency": "BTC"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'*/*'
};

fetch('https://cex.io/api/get_address/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': '*/*'
}

r = requests.post('https://cex.io/api/get_address/', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }


    /// Make a dummy request
    public async Task MakePostRequest()
    {
      string url = "https://cex.io/api/get_address/";

      string json = @"{
  ""key"": ""HLixH1aYdOIWOoRyoHkFpHlawrM"",
  ""signature"": ""0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9"",
  ""nonce"": ""1513175715"",
  ""currency"": ""BTC""
}";
      AddressRequest content = JsonConvert.DeserializeObject(json);
      await PostAsync(content, url);


    }

    /// Performs a POST Request
    public async Task PostAsync(AddressRequest content, string url)
    {
        //Serialize Object
        StringContent jsonContent = SerializeObject(content);

        //Execute POST request
        HttpResponseMessage response = await Client.PostAsync(url, jsonContent);
    }



    /// Serialize an object to Json
    private StringContent SerializeObject(AddressRequest content)
    {
        //Serialize Object
        string jsonObject = JsonConvert.SerializeObject(content);

        //Create Json UTF8 String Content
        return new StringContent(jsonObject, Encoding.UTF8, "application/json");
    }

    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/get_address/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /get_address/

Get crypto address

Body parameter

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "currency": "BTC"
}

Parameters

Name In Type Required Description
body body AddressRequest false none

Example responses

200 Response

OK

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

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Get all crypto addresses

Code samples

const inputBody = '{
  "currency": "BTC"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('https://cex.io/api/get_crypto_address',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('https://cex.io/api/get_crypto_address', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }


    /// Make a dummy request
    public async Task MakePostRequest()
    {
      string url = "https://cex.io/api/get_crypto_address";


      await PostAsync(null, url);

    }

    /// Performs a POST Request
    public async Task PostAsync(undefined content, string url)
    {
        //Serialize Object
        StringContent jsonContent = SerializeObject(content);

        //Execute POST request
        HttpResponseMessage response = await Client.PostAsync(url, jsonContent);
    }



    /// Serialize an object to Json
    private StringContent SerializeObject(undefined content)
    {
        //Serialize Object
        string jsonObject = JsonConvert.SerializeObject(content);

        //Create Json UTF8 String Content
        return new StringContent(jsonObject, Encoding.UTF8, "application/json");
    }

    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/get_crypto_address");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /get_crypto_address

Get user's crypto addresses with blockchains for given currency

Body parameter

{
  "currency": "BTC"
}

Parameters

Name In Type Required Description
body body object false none
» currency body string false currency

Example responses

success

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

Responses

Status Meaning Description Schema
200 OK success None

Response Schema

Get my fee

Code samples

const inputBody = '{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'*/*'
};

fetch('https://cex.io/api/get_myfee/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': '*/*'
}

r = requests.post('https://cex.io/api/get_myfee/', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }


    /// Make a dummy request
    public async Task MakePostRequest()
    {
      string url = "https://cex.io/api/get_myfee/";

      string json = @"{
  ""key"": ""HLixH1aYdOIWOoRyoHkFpHlawrM"",
  ""signature"": ""0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9"",
  ""nonce"": ""1513175715""
}";
      EmptyPrivateRequest content = JsonConvert.DeserializeObject(json);
      await PostAsync(content, url);


    }

    /// Performs a POST Request
    public async Task PostAsync(EmptyPrivateRequest content, string url)
    {
        //Serialize Object
        StringContent jsonContent = SerializeObject(content);

        //Execute POST request
        HttpResponseMessage response = await Client.PostAsync(url, jsonContent);
    }



    /// Serialize an object to Json
    private StringContent SerializeObject(EmptyPrivateRequest content)
    {
        //Serialize Object
        string jsonObject = JsonConvert.SerializeObject(content);

        //Create Json UTF8 String Content
        return new StringContent(jsonObject, Encoding.UTF8, "application/json");
    }

    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/get_myfee/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /get_myfee/

Get account fees for availible pairs

Body parameter

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715"
}

Parameters

Name In Type Required Description
body body EmptyPrivateRequest false none

Example responses

200 Response

OK

{
  "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"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» e string false none event name
» ok string false none status of request
» data object false none Map of fees
»» {Symbol1}:{Symbol2} Fee false none Fee description
»»» buy string false none percents of fee
»»» buyMaker string false none percents of fee
»»» sell string false none percents of fee
»»» sellMaker string false none percents of fee

Cancel replace order

Code samples

const inputBody = '{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "type": "buy",
  "amount": 1000,
  "price": 24.15,
  "order_id": "\"22348164\""
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'*/*'
};

fetch('https://cex.io/api/cancel_replace_order/{symbol1}/{symbol2}',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': '*/*'
}

r = requests.post('https://cex.io/api/cancel_replace_order/{symbol1}/{symbol2}', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }


    /// Make a dummy request
    public async Task MakePostRequest()
    {
      string url = "https://cex.io/api/cancel_replace_order/{symbol1}/{symbol2}";

      string json = @"{
  ""key"": ""HLixH1aYdOIWOoRyoHkFpHlawrM"",
  ""signature"": ""0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9"",
  ""nonce"": ""1513175715"",
  ""type"": ""buy"",
  ""amount"": 1000,
  ""price"": 24.15,
  ""order_id"": ""\""22348164\""""
}";
      CancelReplaceOrderRequest content = JsonConvert.DeserializeObject(json);
      await PostAsync(content, url);


    }

    /// Performs a POST Request
    public async Task PostAsync(CancelReplaceOrderRequest content, string url)
    {
        //Serialize Object
        StringContent jsonContent = SerializeObject(content);

        //Execute POST request
        HttpResponseMessage response = await Client.PostAsync(url, jsonContent);
    }



    /// Serialize an object to Json
    private StringContent SerializeObject(CancelReplaceOrderRequest content)
    {
        //Serialize Object
        string jsonObject = JsonConvert.SerializeObject(content);

        //Create Json UTF8 String Content
        return new StringContent(jsonObject, Encoding.UTF8, "application/json");
    }

    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/cancel_replace_order/{symbol1}/{symbol2}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /cancel_replace_order/{symbol1}/{symbol2}

Replace an order on selected pair

Body parameter

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "type": "buy",
  "amount": 1000,
  "price": 24.15,
  "order_id": "\"22348164\""
}

Parameters

Name In Type Required Description
symbol1 path string true The first currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
symbol2 path string true The second currency code (BTC, ETH, BCH, BTG, DASH, XRP, ZEC, GHS, USD, EUR, GBP, LTC)
body body CancelReplaceOrderRequest false none

Example responses

200 Response

OK

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

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Enumerated Values
Property Value
type buy
type sell

Currency profile

Code samples


const headers = {
  'Accept':'application/json'
};

fetch('https://cex.io/api/currency_profile',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.post('https://cex.io/api/currency_profile', headers = headers)

print(r.json())

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }


    /// Make a dummy request
    public async Task MakePostRequest()
    {
      string url = "https://cex.io/api/currency_profile";


      await PostAsync(null, url);

    }

    /// Performs a POST Request
    public async Task PostAsync(undefined content, string url)
    {
        //Serialize Object
        StringContent jsonContent = SerializeObject(content);

        //Execute POST request
        HttpResponseMessage response = await Client.PostAsync(url, jsonContent);
    }



    /// Serialize an object to Json
    private StringContent SerializeObject(undefined content)
    {
        //Serialize Object
        string jsonObject = JsonConvert.SerializeObject(content);

        //Create Json UTF8 String Content
        return new StringContent(jsonObject, Encoding.UTF8, "application/json");
    }

    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("https://cex.io/api/currency_profile");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /currency_profile

Returns available symbols and pairs for user according to his/her trading group

Example responses

success

{
  "e": "currency_profile",
  "ok": "ok",
  "data": {
    "symbols": [
      {
        "code": "GHS",
        "contract": true,
        "commodity": true,
        "fiat": false,
        "description": "CEX.IO doesn't provide cloud mining services anymore.",
        "precision": 8,
        "scale": 0,
        "minimumCurrencyAmount": "0.00000001",
        "minimalWithdrawalAmount": -1
      }
    ],
    "pairs": [
      {
        "symbol1": "BTC",
        "symbol2": "USD",
        "pricePrecision": 1,
        "priceScale": "/1000000",
        "minLotSize": 0.00014213,
        "minLotSizeS2": 20,
        "newLabelEndDate": 1613735901213,
        "tags": [
          "major"
        ]
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK success None

Response Schema

Definitions

PriceStatsRequest

{
  "lastHours": 24,
  "maxRespArrSize": 100
}

Properties

Name Type Required Restrictions Description
lastHours number false none period till the current date in hours
maxRespArrSize number false none maximal array size in response

ConvertRequest

{
  "amnt": "2.5"
}

Properties

Name Type Required Restrictions Description
amnt string false none convertible amount. should be a positive number string.

CurrencyLimit

{
  "symbol1": "BTC",
  "symbol2": "BTC",
  "minLotSize": 0.002,
  "minLotSizeS2": 20,
  "maxLotSize": 30,
  "minPrice": "\"1500\"",
  "maxPrice": "\"35000\""
}

Properties

Name Type Required Restrictions Description
symbol1 Symbol false none Currency code
symbol2 Symbol false none Currency code
minLotSize number false none minimal order amount in first currency
minLotSizeS2 number false none minimal order ammount in second currency
maxLotSize number false none maximal order ammount in first currency (can be null if order didnt have maximal amount size)
minPrice string false none minimal order price
maxPrice string false none maximal order price

Fee

{
  "buy": "0.15",
  "buyMaker": "0",
  "sell": "0.15",
  "sellMaker": "0"
}

Fee description

Properties

Name Type Required Restrictions Description
buy string false none percents of fee
buyMaker string false none percents of fee
sell string false none percents of fee
sellMaker string false none percents of fee

OrderStatus

"c"

Order status (d = done, c = canceled, cd = partially executed)

Properties

Name Type Required Restrictions Description
anonymous string false none Order status (d = done, c = canceled, cd = partially executed)
Enumerated Values
Property Value
anonymous d
anonymous c
anonymous cd

ResponseStatus

"ok"

Response status

Properties

Name Type Required Restrictions Description
anonymous string false none Response status
Enumerated Values
Property Value
anonymous ok
anonymous error

OrderType

"buy"

Type of order transaction (buy or sell only)

Properties

Name Type Required Restrictions Description
anonymous string false none Type of order transaction (buy or sell only)
Enumerated Values
Property Value
anonymous buy
anonymous sell

ShortOrder

{
  "id": "\"22348164\"",
  "time": "\"1460020144872\"",
  "type": "buy",
  "price": "\"564\"",
  "amount": "\"1.00000000\"",
  "pending": "\"0.50000000\"",
  "symbol1": "BTC",
  "symbol2": "BTC",
  "symbol1Amount": "\"1.00000000\"",
  "symbol2Amount": "\"1.00000000\""
}

Order object (some fields omitted)

Properties

Name Type Required Restrictions Description
id string false none order id
time string false none timestamp
type OrderType false none Type of order transaction (buy or sell only)
price string false none price
amount string false none amount
pending string false none pending amount (if partially executed)
symbol1 Symbol false none Currency code
symbol2 Symbol false none Currency code
symbol1Amount string false none !OPTIONAL! amount (if market order)
symbol2Amount string false none !OPTIONAL! amount (if market order)

FullOrder

{
  "id": "\"22348164\"",
  "time": "\"1460020144872\"",
  "type": "buy",
  "price": "\"564\"",
  "amount": "\"1.00000000\"",
  "pending": "\"0.50000000\"",
  "symbol1": "BTC",
  "symbol2": "BTC",
  "symbol1Amount": "\"1.00000000\"",
  "symbol2Amount": "\"1.00000000\"",
  "lastTx": "\"12345678\"",
  "lastTxTime": "\"2016-08-04T09:28:24.669Z\"",
  "tradingFeeUserVolumeAmount": "\"1223.00\"",
  "ta:{symbol2}": "\"1223.00\"",
  "tta:{symbol2}": "\"1223.00\"",
  "fa:{symbol2}": "\"1223.00\"",
  "tfa:{symbol2}": "\"1223.00\"",
  "a:{symbol1}:cds": "\"1223.00\"",
  "tradingFeeMaker": "\"0.0\"",
  "tradingFeeTaker": "\"0.2\"",
  "tradingFeeStrategy": "Promo000Maker",
  "remains": "\"0.232111\"",
  "orderId": "\"12232344\"",
  "pos": "null"
}

Properties

allOf

Name Type Required Restrictions Description
anonymous any false none Order object

and

Name Type Required Restrictions Description
anonymous ShortOrder false none Order object (some fields omitted)

and

Name Type Required Restrictions Description
anonymous object false none none
» lastTx string false none Last transaction id (last order number)
» lastTxTime string false none Time of last transaction (last order) in unix time OR in ISO format
» tradingFeeUserVolumeAmount string false none none
» ta:{symbol2} string false none total amount in current currency (Maker)
» tta:{symbol2} string false none total amount in current currency (Taker)
» fa:{symbol2} string false none fee amount in current currency (Maker)
» tfa:{symbol2} string false none fee amount in current currency (Taker)
» a:{symbol1}:cds string false none credit, debit and saldo merged amount in current currency
» tradingFeeMaker string false none fee % value of Maker transactions
» tradingFeeTaker string false none fee % value of Taker transactions
» tradingFeeStrategy string false none name of trading fee strategy
» remains string false none amount ramains
» orderId string false none order number into system
» pos string false none none

OrderWithTransactions

{
  "data": {
    "id": "\"22348164\"",
    "time": "\"2016-08-04T09:28:24.669Z\"",
    "type": "buy",
    "lastTx": "\"22347950\"",
    "lastTxTime": "\"2016-08-04T09:28:24.669Z\"",
    "user": "\"11111111\"",
    "status": "c",
    "symbol1": "BTC",
    "symbol2": "BTC",
    "amount": "\"1.00000000\"",
    "price": "\"564\"",
    "pending": "\"0.50000000\"",
    "symbol1Amount": "\"1.00000000\"",
    "symbol2Amount": "\"1.00000000\"",
    "tradingFeeUserVolumeAmount": "\"1223.00\"",
    "ta:{symbol2}": "\"1223.00\"",
    "tta:{symbol2}": "\"1223.00\"",
    "fa:{symbol2}": "\"1223.00\"",
    "tfa:{symbol2}": "\"1223.00\"",
    "a:{symbol1}:cds": "\"1223.00\"",
    "tradingFeeMaker": "\"0.0\"",
    "tradingFeeTaker": "\"0.2\"",
    "tradingFeeStrategy": "Promo000Maker",
    "remains": "\"0.232111\"",
    "orderId": "\"12232344\"",
    "pos": "null",
    "prev": false,
    "next": false,
    "vtx": [
      {
        "id": "\"22348164\"",
        "time": "\"2016-08-04T09:28:24.669Z\"",
        "type": "buy",
        "user": "\"11111111\"",
        "c": "user:11111111:a:USD",
        "d": "order:22347874:a:USD",
        "a": "\"204.28000000\"",
        "balance": "\"1391212.24000000\"",
        "amount": "\"1.00000000\"",
        "pending": "\"0.50000000\"",
        "symbol": "BTC",
        "symbol2": "BTC",
        "order": "\"22347874\"",
        "buy": "\"22347874\"",
        "sell": "\"22347877\"",
        "pair": "null",
        "pos": "null",
        "cs": "\"10.121221\"",
        "ds": "0",
        "fee_amount": "0"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
data object false none none
» id string false none order id
» time string false none timestamp
» type OrderType false none Type of order transaction (buy or sell only)
» lastTx string false none number of last transction
» lastTxTime string false none tiome of last transaction (unix time OR in ISO format)
» user string false none user ID into system
» status OrderStatus false none Order status (d = done, c = canceled, cd = partially executed)
» symbol1 Symbol false none Currency code
» symbol2 Symbol false none Currency code
» amount string false none amount
» price string false none price
» pending string false none pending amount (if partially executed)
» symbol1Amount string false none !OPTIONAL! amount (if market order)
» symbol2Amount string false none !OPTIONAL! amount (if market order)
» tradingFeeUserVolumeAmount string false none none
» ta:{symbol2} string false none total amount in current currency (Maker)
» tta:{symbol2} string false none total amount in current currency (Taker)
» fa:{symbol2} string false none fee amount in current currency (Maker)
» tfa:{symbol2} string false none fee amount in current currency (Taker)
» a:{symbol1}:cds string false none credit, debit and saldo merged amount in current currency
» tradingFeeMaker string false none fee % value of Maker transactions
» tradingFeeTaker string false none fee % value of Taker transactions
» tradingFeeStrategy string false none name of trading fee strategy
» remains string false none amount ramains
» orderId string false none order number into system
» pos string false none none
» prev boolean false none none
» next boolean false none none
» vtx [object] false none none
»» id string false none order id
»» time string false none timestamp
»» type OrderType false none Type of order transaction (buy or sell only)
»» user string false none user ID into system
»» c string false none credit account into system
»» d string false none debit account into system
»» a string false none amount
»» balance string false none balance
»» amount string false none amount
»» pending string false none pending amount (if partially executed)
»» symbol Symbol false none Currency code
»» symbol2 Symbol false none Currency code
»» order string false none order number
»» buy string false none none
»» sell string false none none
»» pair string false none none
»» pos string false none none
»» cs string false none none
»» ds number false none none
»» fee_amount string false none none

Transaction

{
  "id": "string",
  "type": "buy",
  "time": "string",
  "user": "string",
  "c": "string",
  "d": "string",
  "a": "string",
  "amount": "string",
  "balance": "string",
  "symbol": "BTC",
  "symbol1": "BTC",
  "symbol2": "BTC",
  "order": "\"22348164\"",
  "buy": "\"22348164\"",
  "sell": "\"22348164\"",
  "pair": "string",
  "pos": "string",
  "cs": "string",
  "ds": 0,
  "fee_amount": 0,
  "price": 0
}

Properties

Name Type Required Restrictions Description
id string false none none
type OrderType false none Type of order transaction (buy or sell only)
time string false none none
user string false none User id
c string false none none
d string false none none
a string false none none
amount string false none none
balance string false none none
symbol Symbol false none Currency code
symbol1 Symbol false none Currency code
symbol2 Symbol false none Currency code
order ShortOrder/properties/id false none order id
buy ShortOrder/properties/id false none order id
sell ShortOrder/properties/id false none order id
pair string false none none
pos string false none none
cs string false none none
ds number false none none
fee_amount number false none none
price number false none none

Symbol

"BTC"

Currency code

Properties

Name Type Required Restrictions Description
anonymous string false none Currency code
Enumerated Values
Property Value
anonymous BTC
anonymous ETH
anonymous BCH
anonymous BTG
anonymous DASH
anonymous XRP
anonymous ZEC
anonymous GHS
anonymous USD
anonymous EUR
anonymous GBP
anonymous LTC

Balance

{
  "available": "1.00000000",
  "orders": "1.00000000"
}

Properties

Name Type Required Restrictions Description
available string false none available balance
orders string false none balance in pending orders

APIkey

"HLixH1aYdOIWOoRyoHkFpHlawrM"

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

Properties

Name Type Required Restrictions Description
anonymous string false none Your own API key. To get an API key, go to Account -> API Access Tab. Set permissions and click "Generate key".

nonce

"1513175715"

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.

Properties

Name Type Required Restrictions Description
anonymous string false none 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.

signature

"0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9"

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).

Properties

Name Type Required Restrictions Description
anonymous string false none 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).

EmptyPrivateRequest

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715"
}

Properties

Name Type Required Restrictions Description
key APIkey false none Your own API key. To get an API key, go to Account -> API Access Tab. Set permissions and click "Generate key".
signature signature false none 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 nonce false none 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

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "id": 89067468
}

Private request that contains some entity's ID

Properties

allOf

Name Type Required Restrictions Description
anonymous EmptyPrivateRequest false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» id number false none none

ArchivedOrdersRequest

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "limit": 10,
  "dateTo": 1506943193,
  "dateFrom": 1506943193,
  "lastTxDateTo": 1506943193,
  "lastTxDateFrom": 1506943193,
  "status": "c"
}

Properties

allOf

Name Type Required Restrictions Description
anonymous EmptyPrivateRequest false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» limit number false none limit the number of entries in response (from 1 to 100)
» dateTo number false none end date for open orders filtering (unix timestamp in seconds, 10 digits), inclusive
» dateFrom number false none start date for open order filtering (unix timestamp in seconds, 10 digits), inclusive
» lastTxDateTo number false none end date for last change orders filtering (unix timestamp in seconds, 10 digits), inclusive
» lastTxDateFrom number false none start date for last change order filtering (unix timestamp in seconds, 10 digits), inclusive
» status OrderStatus false none Order status (d = done, c = canceled, cd = partially executed)

ActiveOrdersRequest

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "orders_list": [
    "8550492",
    "8550495",
    "8550497"
  ]
}

Properties

allOf

Name Type Required Restrictions Description
anonymous EmptyPrivateRequest false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» orders_list [string] false none list of order IDs to get status of

PlaceOrderRequest

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "order_type": "market",
  "type": "buy",
  "amount": 0.2,
  "price": 1155.6
}

Properties

allOf

Name Type Required Restrictions Description
anonymous EmptyPrivateRequest false none none

and

Name Type Required Restrictions Description
anonymous object false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» order_type string false none !OPTIONAL! Order market type (market only availible), if you want add limit order this field must be blank
» type OrderType false none Type of order transaction (buy or sell only)
» amount number false none Amount in first currency for limit order, and amount in first or second currency if type of order is market order (depends from order type - buy or sell)
» price string false none !OPTIONAL! price (must be blank if market order)
Enumerated Values
Property Value
order_type market

OrderRequest

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "id": 1234
}

Properties

allOf

Name Type Required Restrictions Description
anonymous EmptyPrivateRequest false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» id number false none Order ID

AddressRequest

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "currency": "BTC"
}

Properties

allOf

Name Type Required Restrictions Description
anonymous EmptyPrivateRequest false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» currency Symbol false none Currency code

CancelReplaceOrderRequest

{
  "key": "HLixH1aYdOIWOoRyoHkFpHlawrM",
  "signature": "0BDEDB9339DCE83D46F09A1527663762B52C8B12BCD1910E685BEAFEEABECFF9",
  "nonce": "1513175715",
  "type": "buy",
  "amount": 1000,
  "price": 24.15,
  "order_id": "\"22348164\""
}

Properties

allOf

Name Type Required Restrictions Description
anonymous EmptyPrivateRequest false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» type OrderType false none Type of order transaction (buy or sell only)
» amount number false none amount
» price number false none price
» order_id ShortOrder/properties/id false none order id

PairPrice

{
  "curr1": "BTC",
  "curr2": "BTC",
  "lprice": "\"12345.6\""
}

Properties

Name Type Required Restrictions Description
curr1 Symbol false none Currency code
curr2 Symbol false none Currency code
lprice string false none 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

{
  "bid": 1234.12,
  "ask": 1234.12,
  "low": "\"1234.12\"",
  "high": "\"1234.12\"",
  "last": "\"1234.12\"",
  "volume": "\"0.10000000\"",
  "volume30d": "\"1234.00000200\"",
  "timestamp": "\"12345678\""
}

Properties

Name Type Required Restrictions Description
bid number false none Highest buy order price
ask number false none Lowest sell order price
low string false none Current day lowest price
high string false none Current day highest price
last string false none Last price
volume string false none Last 24 hours volume
volume30d string false none Last 30 days volume
timestamp string false none Timestamp of answer

Tickers

{
  "ok": "ok | error",
  "e": "tickers",
  "data": [
    {
      "bid": 1234.12,
      "ask": 1234.12,
      "low": "\"1234.12\"",
      "high": "\"1234.12\"",
      "last": "\"1234.12\"",
      "volume": "\"0.10000000\"",
      "volume30d": "\"1234.000012\"",
      "pair": "BTC:USD",
      "timestamp": "\"12345678\""
    }
  ]
}

Properties

Name Type Required Restrictions Description
ok string false none status of request
e string false none name of event
data [object] false none none
» bid number false none Highest buy order price
» ask number false none Lowest sell order price
» low string false none Current day lowest price
» high string false none Current day highest price
» last string false none Last price
» volume string false none Last 24 hours volume
» volume30d string false none Last 30 days volume
» pair string false none Currency pair of ticker
» timestamp string false none Timestamp of answer

APIResponse

{
  "e": "ticker|ohlcv|...",
  "ok": "ok|success|error",
  "error": "first parameter is wrong, or not specified"
}

Properties

Name Type Required Restrictions Description
e string false none Event type
ok string false none Response status
error string false none Error message

PairPrices

{
  "symbol1": "BTC",
  "symbol2": "BTC",
  "lprice": "\"12345.6\""
}

Properties

Name Type Required Restrictions Description
symbol1 Symbol false none Currency code
symbol2 Symbol false none Currency code
lprice string false none 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.

CancelOrder

{
  "id": "\"22348164\"",
  "time": "\"2016-08-04T09:28:24.669Z\"",
  "type": "buy",
  "price": "\"564\"",
  "amount": "\"1.00000000\"",
  "pending": "\"0.50000000\"",
  "complete": "false"
}

Order object (some fields omitted)

Properties

Name Type Required Restrictions Description
id string false none order id
time string false none timestamp
type OrderType false none Type of order transaction (buy or sell only)
price string false none price
amount string false none amount
pending string false none pending amount (if partially executed)
complete boolean false none status of operations (completed or not)

LimitsResponse

{
  "e": "ticker|ohlcv|...",
  "ok": "ok|success|error",
  "error": "first parameter is wrong, or not specified",
  "data": {
    "pairs": [
      {
        "symbol1": "BTC",
        "symbol2": "BTC",
        "minLotSize": 0.002,
        "minLotSizeS2": 20,
        "maxLotSize": 30,
        "minPrice": "\"1500\"",
        "maxPrice": "\"35000\""
      }
    ]
  }
}

Properties

allOf

Name Type Required Restrictions Description
anonymous APIResponse false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» data object false none Operation result
»» pairs [CurrencyLimit] false none none