NAV
Shell HTTP JavaScript Node.JS PHP Ruby Python Java GO
  • Getting started
  • Authentication
  • REST APIs
  • WebSockets
  • Standards and Conventions
  • Errors and Rate Limits
  • Private APIs

    Currently, Crypto APIs supports Binance, Bitfinex, Bitstamp, Kraken, Exmo and Kucoin with more exchanges coming soon. Trading APIs allow you to work with the supported exchanges's authenticated endpoints. Provided you have credentials for the exchange, you will be able to get information from that exchange about your balance, trades, open orders and deposit address. You will also be able to create or cancel an order, as well as withdraw.

    In order to use this module, you first need to create an account in Trading APIs (see section Exchange Accounts). The number of accounts you can use is determined by your subscription plan.

    List All Exchanges

    Sample Data

    
    curl -X GET \
      'https://api.cryptoapis.io/v1/trading/private-apis' \
      -H 'Content-Type: application/json' \
      -H 'X-API-Key: my-api-key'
    
    
    
    GET https://api.cryptoapis.io/v1/trading/private-apis HTTP/1.1
    Host: https://api.cryptoapis.io
    Content-Type: application/json
    X-API-Key: my-api-key
    
    
    
    $.ajaxSetup({
      headers:{
        "Content-Type": "application/json" ,
        "X-API-Key": "my-api-key"
      }
    });
    
    $.get('https://api.cryptoapis.io/v1/trading/private-apis').then(function(d) {console.log(d)});
    
    
    
    const https = require('https');
    
    var options = {
      "method": "GET",
      "hostname": "https://api.cryptoapis.io",
      "path": "/v1/trading/private-apis",
      "headers": {
        'Content-Type': 'application/json',
        'X-API-Key': 'my-api-key'
      }
    };
    
    var request = https.request(options, function (response) {
      response.on("data", function (data) {
        console.log(data);
      });
    });
    
    request.end();
    
    
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://api.cryptoapis.io/v1/trading/private-apis');
    $request->setMethod(HTTP_METH_GET);
    $request->setHeaders(array(
      'Content-Type' => 'application/json',
      'X-API-Key' => 'my-api-key'
    ));
    
    try {
      $response = $request->send();
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    ?>
    
    
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.cryptoapis.io/v1/trading/private-apis")
    http = Net::HTTP.new(url.host, url.port)
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["X-API-Key"] = 'my-api-key'
    response = http.request(request)
    puts response.read_body
    
    
    
    import requests
    url = 'https://api.cryptoapis.io/v1/trading/private-apis'
    headers = {
      'Content-Type' : 'application/json',
      'X-API-Key' : 'my-api-key'
    }
    response = requests.get(url, headers=headers)
    
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://api.cryptoapis.io/v1/trading/private-apis")
      .post(body)
      .addHeader("Content-Type", "application/json")
      .addHeader("X-API-Key", "my-api-key")
      .build();
    
    Response response = client.newCall(request).execute();
    
    
    
    import (
      "gopkg.in/resty.v0"
    )
    
    func main()
    {
        resp, err := resty.R().
          SetHeader("Content-Type", "application/json").
          SetHeader("X-API-Key", "my-api-key").
          Get("https://api.cryptoapis.io/v1/trading/private-apis")
    }
    
    

    Response Body

    {
        "payload": {
            "supported": [
                "binance",
                "bitfinex",
                "bitstamp",
                "coinbasepro",
                "exmo",
                "kraken",
                "kucoin"
            ]
        }
    }
    

    Show all exchanges supported in Trading APIs

    HTTP Request

    GET /v1/trading/private-apis

    Output Variables

    Variable Type Required Description
    supported array Yes Exchanges supported in Trading APIs

    Get Balance

    Sample Data

    
    curl -X POST \
      https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/balance \
      -H 'Content-Type: application/json' \
      -H 'X-API-Key: my-api-key' \
      -d '{
        "params" : {
            "key": "value"
        }
    }'
    
    
    
    
    POST /v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/balance HTTP/1.1
    Host: api.cryptoapis.io
    Content-Type: application/json
    X-API-Key: my-api-key
    
    {
        "params" : {
            "key": "value"
        }
    }
    
    
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/balance",
      "method": "POST",
      "headers": {
        "Content-Type": "application/json",
        "X-API-Key": "my-api-key"
      },
      "processData": false,
      "data": "{\n\t\"params\" : {\"key\": \"value\"}\n}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    
    
    var http = require("http");
    
    var options = {
      "method": "POST",
      "hostname": "api.cryptoapis.io",
      "path": "/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/balance",
      "headers": {
        "Content-Type": "application/json",
        "X-API-Key": "my-api-key"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      params: { key : 'value' }
    }));
    req.end();
    
    
    
    
    &lt;?php
    
    $request = new HttpRequest();
    $request->setUrl('https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/balance');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'Content-Type' => 'application/json',
      'X-API-Key' => 'my-api-key'
    ));
    
    $request->setBody('{
        "params" : {
            "key" : "value"
        }
    }');
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    
    ?>
    
    
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/balance")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["Content-Type"] = 'application/json'
    request["X-API-Key"] = 'my-api-key'
    request.body = "{\n\t\"params\" : {\"key\": \"value\"}\n}"
    
    response = http.request(request)
    puts response.read_body
    
    
    
    
    import http.client
    
    conn = http.client.HTTPConnection("https://api.cryptoapis.io")
    
    payload = "{\n\t\"params\" : {\"key\": \"value\"}\n}"
    
    headers = {
      'Content-Type': "application/json",
      'X-API-Key': "my-api-key"
    }
    
    conn.request("POST", "/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/balance", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    
    
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\\n\t\"params\" : {\"key\": \"value\"}\n}");
    Request request = new Request.Builder()
      .url("https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/balance")
      .post(body)
      .addHeader("Content-Type", "application/json")
      .addHeader("X-API-Key", "my-api-key")
      .build();
    
    Response response = client.newCall(request).execute();
    
    
    
    
    package main
    
    import (
        "fmt"
        "strings"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/balance"
    
        payload := strings.NewReader("{\n\t\"params\" : {\"key\": \"value\"}\n}")
    
        req, _ := http.NewRequest("POST", url, payload)
    
        req.Header.Add("Content-Type", "application/json")
        req.Header.Add("X-API-Key", "my-api-key")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    
    

    Response Body

    {
        "payload": [
            {
                "currency": "ETH",
                "free": 0.25,
                "total": 0.25
            },
            {
                "currency": "XLM",
                "free": 1,
                "total": 1
            }
        ]
    }
    

    Show account balance for a given exchange.

    HTTP Request

    POST /v1/trading/private-apis/{accountId}/balance

    URL Parameters

    Variable Type Description
    accountId string Id used for authentication. (After a successful account creation in Crypto APIs)

    Body/Query Parameters

    Variable Type Required Description
    params object No Some exchanges need additional parameters

    Output Variables

    Variable Type Required Description
    currency string Yes Code/currency in the exchange
    free float Yes Available funds
    used float No Funds used/locked
    total float No All funds

    Get Deposit Address

    Sample Data

    
    curl -X POST \
      https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/depositAddress/XLM \
      -H 'Content-Type: application/json' \
      -H 'X-API-Key: my-api-key' \
      -d '{
        "params" : {
            "key": "value"
        }
    }'
    
    
    
    
    POST /v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/depositAddress/XLM HTTP/1.1
    Host: api.cryptoapis.io
    Content-Type: application/json
    X-API-Key: my-api-key
    
    {
        "params" : {
            "key": "value"
        }
    }
    
    
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/depositAddress/XLM",
      "method": "POST",
      "headers": {
        "Content-Type": "application/json",
        "X-API-Key": "my-api-key"
      },
      "processData": false,
      "data": "{\n\t\"params\" : {\"key\": \"value\"}\n}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    
    
    var http = require("http");
    
    var options = {
      "method": "POST",
      "hostname": "api.cryptoapis.io",
      "path": "/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/depositAddress/XLM",
      "headers": {
        "Content-Type": "application/json",
        "X-API-Key": "my-api-key"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      params: { key : 'value' }
    }));
    req.end();
    
    
    
    
    &lt;?php
    
    $request = new HttpRequest();
    $request->setUrl('https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/depositAddress/XLM');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'Content-Type' => 'application/json',
      'X-API-Key' => 'my-api-key'
    ));
    
    $request->setBody('{
        "params" : {
            "key": "value"
        }
    }');
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    
    ?>
    
    
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/depositAddress/XLM")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["Content-Type"] = 'application/json'
    request["X-API-Key"] = 'my-api-key'
    request.body = "{\n\t\"params\" : {\"key\": \"value\"}\n}"
    
    response = http.request(request)
    puts response.read_body
    
    
    
    
    import http.client
    
    conn = http.client.HTTPConnection("https://api.cryptoapis.io")
    
    payload = "{\n\t\"params\" : {\"key\": \"value\"}\n}"
    
    headers = {
      'Content-Type': "application/json",
      'X-API-Key': "my-api-key"
    }
    
    conn.request("POST", "/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/depositAddress/XLM", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    
    
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\\n\t\"params\" : {\"key\": \"value\"}\n}");
    Request request = new Request.Builder()
      .url("https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/depositAddress/XLM")
      .post(body)
      .addHeader("Content-Type", "application/json")
      .addHeader("X-API-Key", "my-api-key")
      .build();
    
    Response response = client.newCall(request).execute();
    
    
    
    
    package main
    
    import (
        "fmt"
        "strings"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/depositAddress/XLM"
    
        payload := strings.NewReader("{\n\t\"params\" : {\"key\": \"value\"}\n}")
    
        req, _ := http.NewRequest("POST", url, payload)
    
        req.Header.Add("Content-Type", "application/json")
        req.Header.Add("X-API-Key", "my-api-key")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    
    

    Response Body

    {
        "payload": {
            "currency": "XLM",
            "address": "GAHK7EEG2WWHVKDNT4CEQFZGKF2LGDSW2IVM4S5DP42RBW0000000000",
            "tag": "1004490000"
        }
    }
    

    Shows open orders as provided by a given exchange's Private APIs.

    HTTP Request

    POST /v1/trading/private-apis/{accountId}/depositAddress/{code}

    URL Parameters

    Variable Type Description
    accountId string Id used for authentication. (After a successful account creation in Crypto APIs)
    code string Code/currency with which the address is going to be funded (e.g. 'XLM')

    Body/Query Parameters

    Variable Type Required Description
    params object No Some exchanges need additional parameters

    Output Variables

    Variable Type Required Description
    currency string Yes Code/currency in the exchange
    address string Yes Funding address
    tag string No Some exchanges provide tag which needs to be included when funding the address

    Get My Trades

    Sample Data

    
    curl -X POST \
      https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/myTrades \
      -H 'Content-Type: application/json' \
      -H 'X-API-Key: my-api-key' \
      -d '{
        "symbol" : "BTC/ETH",
        "since" : 1568194801718,
        "limit" : 10,
        "params" : {
            "key": "value"
        }
    }'
    
    
    
    
    POST /v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/myTrades HTTP/1.1
    Host: api.cryptoapis.io
    Content-Type: application/json
    X-API-Key: my-api-key
    
    {
        "symbol" : "BTC/ETH",
        "since" : 1568194801718,
        "limit" : 10,
        "params" : {
            "key": "value"
        }
    }
    
    
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/myTrades",
      "method": "POST",
      "headers": {
        "Content-Type": "application/json",
        "X-API-Key": "my-api-key"
      },
      "processData": false,
      "data": "{\n\t\"symbol\" : \"BTC/ETH\",\n\t\"since\" : 1568194801718,\n\t\"limit\" : 10,\n\t\"params\" : {\"key\": \"value\"}\n}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    
    
    var http = require("http");
    
    var options = {
      "method": "POST",
      "hostname": "api.cryptoapis.io",
      "path": "/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/myTrades",
      "headers": {
        "Content-Type": "application/json",
        "X-API-Key": "my-api-key"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      symbol: 'BTC/ETH',
      since: 1568194801718,
      limit: 10,
      params: { key : 'value' }
    }));
    req.end();
    
    
    
    
    &lt;?php
    
    $request = new HttpRequest();
    $request->setUrl('https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/myTrades');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'Content-Type' => 'application/json',
      'X-API-Key' => 'my-api-key'
    ));
    
    $request->setBody('{
        "symbol" : "BTC/ETH",
        "since" : 1568194801718,
        "limit" : 10,
        "params" : {
            "key": "value"
        }
    }');
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    
    ?>
    
    
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/myTrades")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["Content-Type"] = 'application/json'
    request["X-API-Key"] = 'my-api-key'
    request.body = "{\n\t\"symbol\" : \"BTC/ETH\",\n\t\"since\" : 1568194801718,\n\t\"limit\" : 10,\n\t\"params\" : {\"key\": \"value\"}\n}"
    
    response = http.request(request)
    puts response.read_body
    
    
    
    
    import http.client
    
    conn = http.client.HTTPConnection("https://api.cryptoapis.io")
    
    payload = "{\n\t\"symbol\" : \"BTC/ETH\",\n\t\"since\" : 1568194801718,\n\t\"limit\" : 10,\n\t\"params\" : {\"key\": \"value\"}\n}"
    
    headers = {
      'Content-Type': "application/json",
      'X-API-Key': "my-api-key"
    }
    
    conn.request("POST", "/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/myTrades", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    
    
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\\n\t\"symbol\" : \"BTC/ETH\",\n\t\"since\" : 1568194801718,\n\t\"limit\" : 10,\n\t\"params\" : {\"key\": \"value\"}\n}");
    Request request = new Request.Builder()
      .url("https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/myTrades")
      .post(body)
      .addHeader("Content-Type", "application/json")
      .addHeader("X-API-Key", "my-api-key")
      .build();
    
    Response response = client.newCall(request).execute();
    
    
    
    
    package main
    
    import (
        "fmt"
        "strings"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/myTrades"
    
        payload := strings.NewReader("{\n\t\"symbol\" : \"BTC/ETH\",\n\t\"since\" : 1568194801718,\n\t\"limit\" : 10,\n\t\"params\" : {\"key\": \"value\"}\n}")
    
        req, _ := http.NewRequest("POST", url, payload)
    
        req.Header.Add("Content-Type", "application/json")
        req.Header.Add("X-API-Key", "my-api-key")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    
    

    Response Body

    {
        "payload": [
            {
                "id": "6980000",
                "timestamp": "1568379689000",
                "datetime": "2019-09-13T13:01:29.473Z",
                "symbol": "XLM/ETH",
                "order": "77339000",
                "side": "buy",
                "price": 0.00032729000,
                "amount": 31,
                "cost": 0.0101463,
                "fee": {
                    "cost": 0.030999000,
                    "currency": "XLM"
                },
                "taker_or_maker": "taker"
            },
            ...
            {
                "id": "6985000",
                "timestamp": "1568711003000",
                "datetime": "2019-09-17T09:03:23.509Z",
                "symbol": "XLM/ETH",
                "order": "77675000",
                "side": "sell",
                "price": 0.00029525000,
                "amount": 34,
                "cost": 0.0100000,
                "fee": {
                    "cost": 0.00001000,
                    "currency": "ETH"
                },
                "taker_or_maker": "taker"
            }
        ]
    }
    

    Shows trades as provided by a given exchange's Private APIs.

    HTTP Request

    POST /v1/trading/private-apis/{accountId}/myTrades

    URL Parameters

    Variable Type Description
    accountId string Id used for authentication. (After a successful account creation in Crypto APIs)

    Body/Query Parameters

    Variable Type Required Description
    symbol string No Most exchanges need a symbol (e.g. 'BTC/ETH', 'XLM/BTC', etc.)
    since int No Timestamp
    limit int No Limit number of results (Supported by some exchanges)
    params object No Some exchanges need additional parameters

    Get Open Orders

    Sample Data

    
    curl -X POST \
      https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/openOrders \
      -H 'Content-Type: application/json' \
      -H 'X-API-Key: my-api-key' \
      -d '{
        "symbol" : "BTC/ETH",
        "since" : 1568194801718,
        "limit" : 10,
        "params" : {
            "key": "value"
        }
    }'
    
    
    
    
    POST /v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/openOrders HTTP/1.1
    Host: api.cryptoapis.io
    Content-Type: application/json
    X-API-Key: my-api-key
    
    {
        "symbol" : "BTC/ETH",
        "since" : 1568194801718,
        "limit" : 10,
        "params" : {
            "key": "value"
        }
    }
    
    
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/openOrders",
      "method": "POST",
      "headers": {
        "Content-Type": "application/json",
        "X-API-Key": "my-api-key"
      },
      "processData": false,
      "data": "{\n\t\"symbol\" : \"BTC/ETH\",\n\t\"since\" : 1568194801718,\n\t\"limit\" : 10,\n\t\"params\" : {\"key\": \"value\"}\n}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    
    
    var http = require("http");
    
    var options = {
      "method": "POST",
      "hostname": "api.cryptoapis.io",
      "path": "/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/openOrders",
      "headers": {
        "Content-Type": "application/json",
        "X-API-Key": "my-api-key"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      symbol: 'BTC/ETH',
      since: 1568194801718,
      limit: 10,
      params: { key : 'value' }
    }));
    req.end();
    
    
    
    
    &lt;?php
    
    $request = new HttpRequest();
    $request->setUrl('https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/openOrders');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'Content-Type' => 'application/json',
      'X-API-Key' => 'my-api-key'
    ));
    
    $request->setBody('{
        "symbol" : "BTC/ETH",
        "since" : 1568194801718,
        "limit" : 10,
        "params" : {
            "key" : "value"
        }
    }');
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    
    ?>
    
    
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/openOrders")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["Content-Type"] = 'application/json'
    request["X-API-Key"] = 'my-api-key'
    request.body = "{\n\t\"symbol\" : \"BTC/ETH\",\n\t\"since\" : 1568194801718,\n\t\"limit\" : 10,\n\t\"params\" : {\"key\": \"value\"}\n}"
    
    response = http.request(request)
    puts response.read_body
    
    
    
    
    import http.client
    
    conn = http.client.HTTPConnection("https://api.cryptoapis.io")
    
    payload = "{\n\t\"symbol\" : \"BTC/ETH\",\n\t\"since\" : 1568194801718,\n\t\"limit\" : 10,\n\t\"params\" : {\"key\": \"value\"}\n}"
    
    headers = {
      'Content-Type': "application/json",
      'X-API-Key': "my-api-key"
    }
    
    conn.request("POST", "/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/openOrders", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    
    
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\\n\t\"symbol\" : \"BTC/ETH\",\n\t\"since\" : 1568194801718,\n\t\"limit\" : 10,\n\t\"params\" : {\"key\": \"value\"}\n}");
    Request request = new Request.Builder()
      .url("https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/openOrders")
      .post(body)
      .addHeader("Content-Type", "application/json")
      .addHeader("X-API-Key", "my-api-key")
      .build();
    
    Response response = client.newCall(request).execute();
    
    
    
    
    package main
    
    import (
        "fmt"
        "strings"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/openOrders"
    
        payload := strings.NewReader("{\n\t\"symbol\" : \"BTC/ETH\",\n\t\"since\" : 1568194801718,\n\t\"limit\" : 10,\n\t\"params\" : {\"key\": \"value\"}\n}")
    
        req, _ := http.NewRequest("POST", url, payload)
    
        req.Header.Add("Content-Type", "application/json")
        req.Header.Add("X-API-Key", "my-api-key")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    
    

    Response Body

    {
        "payload": [
            {
                "id": "77677000",
                "datetime": "2019-09-17T09:35:48.355Z",
                "timestamp": "1568712948000",
                "status": "open",
                "symbol": "XLM/ETH",
                "type": "limit",
                "side": "sell",
                "price": 0.0014788000,
                "amount": 40,
                "remaining": 40,
                "fee": []
            }
        ]
    }
    

    Shows open orders as provided by a given exchange's Private APIs.

    HTTP Request

    POST /v1/trading/private-apis/{accountId}/openOrders

    URL Parameters

    Variable Type Description
    accountId string Id used for authentication. (After a successful account creation in Crypto APIs)

    Body/Query Parameters

    Variable Type Required Description
    symbol string No Most exchanges need a symbol (e.g. 'BTC/ETH', 'XLM/BTC', etc.)
    since int No Timestamp
    limit int No Limit number of results (Supported by some exchanges)
    params object No Some exchanges need additional parameters

    Create Order

    Sample Data

    
    curl -X POST \
      https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/createOrder \
      -H 'Content-Type: application/json' \
      -H 'X-API-Key: my-api-key' \
      -d '{
        "symbol" : "BTC/ETH",
        "type" : "market",
        "side" : "buy",
        "amount" : 1,
        "price" : 0.01,
        "params" : {
            "key": "value"
        }
    }'
    
    
    
    
    POST /v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/createOrder HTTP/1.1
    Host: api.cryptoapis.io
    Content-Type: application/json
    X-API-Key: my-api-key
    
    {
        "symbol" : "BTC/ETH",
        "type" : "market",
        "side" : "buy",
        "amount" : 1,
        "price" : 0.01,
        "params" : {
            "key": "value"
        }
    }
    
    
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/createOrder",
      "method": "POST",
      "headers": {
        "Content-Type": "application/json",
        "X-API-Key": "my-api-key"
      },
      "processData": false,
      "data": "{\n\t\"symbol\" : \"BTC/ETH\",\n\t\"type\" : \"market\",\n\t\"side\" : \"buy\",\n\t\"amount\" : 1,\n\t\"price\" : 0.01,\n\t\"params\" : {\"key\": \"value\"}\n}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    
    
    var http = require("http");
    
    var options = {
      "method": "POST",
      "hostname": "api.cryptoapis.io",
      "path": "/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/createOrder",
      "headers": {
        "Content-Type": "application/json",
        "X-API-Key": "my-api-key"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
        symbol: 'BTC/ETH',
        type: 'market',
        side: 'buy',
        amount: 1,
        price: 0.01,
        params: {
            key: 'value'
        }
    }));
    req.end();
    
    
    
    
    &lt;?php
    
    $request = new HttpRequest();
    $request->setUrl('https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/createOrder');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'Content-Type' => 'application/json',
      'X-API-Key' => 'my-api-key'
    ));
    
    $request->setBody('{
        "symbol" : "BTC/ETH",
        "type" : "market",
        "side" : "buy",
        "amount" : 1,
        "price" : 0.01,
        "params" : {
            "key" : "value"
        }
    }');
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    
    ?>
    
    
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/createOrder")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["Content-Type"] = 'application/json'
    request["X-API-Key"] = 'my-api-key'
    request.body = "{\n\t\"symbol\" : \"BTC/ETH\",\n\t\"type\" : \"market\",\n\t\"side\" : \"buy\",\n\t\"amount\" : 1,\n\t\"price\" : 0.01,\n\t\"params\" : {\"key\": \"value\"}\n}"
    
    response = http.request(request)
    puts response.read_body
    
    
    
    
    import http.client
    
    conn = http.client.HTTPConnection("https://api.cryptoapis.io")
    
    payload = "{\n\t\"symbol\" : \"BTC/ETH\",\n\t\"type\" : \"market\",\n\t\"side\" : \"buy\",\n\t\"amount\" : 1,\n\t\"price\" : 0.01,\n\t\"params\" : {\"key\": \"value\"}\n}"
    
    headers = {
      'Content-Type': "application/json",
      'X-API-Key': "my-api-key"
    }
    
    conn.request("POST", "/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/createOrder", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    
    
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\\n\t\"symbol\" : \"BTC/ETH\",\n\t\"type\" : \"market\",\n\t\"side\" : \"buy\",\n\t\"amount\" : 1,\n\t\"price\" : 0.01,\n\t\"params\" : {\"key\": \"value\"}\n}");
    Request request = new Request.Builder()
      .url("https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/createOrder")
      .post(body)
      .addHeader("Content-Type", "application/json")
      .addHeader("X-API-Key", "my-api-key")
      .build();
    
    Response response = client.newCall(request).execute();
    
    
    
    
    package main
    
    import (
        "fmt"
        "strings"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/createOrder"
    
        payload := strings.NewReader("{\n\t\"symbol\" : \"BTC/ETH\",\n\t\"type\" : \"market\",\n\t\"side\" : \"buy\",\n\t\"amount\" : 1,\n\t\"price\" : 0.01,\n\t\"params\" : {\"key\": \"value\"}\n}")
    
        req, _ := http.NewRequest("POST", url, payload)
    
        req.Header.Add("Content-Type", "application/json")
        req.Header.Add("X-API-Key", "my-api-key")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    
    

    Response Body

    {
       "payload": {
           "id": "77330000",
           "datetime": "2019-09-13T13:01:29.473Z",
           "timestamp": "1568379680000",
           "status": "closed",
           "symbol": "XLM/ETH",
           "type": "market",
           "side": "buy",
           "price": 0.00032729999,
           "amount": 31,
           "filled": 31,
           "cost": 0.0101463,
           "fee": {
               "cost": 0.030999999,
               "currency": "XLM"
           }
       }
    }
    

    Create an order in an exchange.

    HTTP Request

    POST /v1/trading/private-apis/{accountId}/createOrder

    URL Parameters

    Variable Type Description
    accountId string Id used for authentication. (After a successful account creation in Crypto APIs)

    Body/Query Parameters

    Variable Type Required Description
    symbol string Yes Symbol (e.g. 'BTC/ETH', 'XLM/BTC', etc.)
    type string Yes Type of order (market/limit)
    side string Yes Side (buy/sell)
    amount float Yes Amount in base currency
    price float Yes Price in quote currency
    params object No Some exchanges need additional parameters

    Output Variables

    Variable Type Required Description
    id string Yes Order id
    datetime string Yes ISO8601 datetime of 'timestamp' with milliseconds
    timestamp int Yes Timestamp of order placing or opening (Unix)
    last_trade_timestamp int Yes Timestamp of the most recent trade on this order (Unix)
    status string Yes open/closed/canceled
    symbol string Yes Symbol (e.g. 'BTC/ETC')
    type string Yes market/limit
    side string Yes buy/sell
    price float Yes Price in quote currency
    amount float Yes Amount in base currency
    filled float Yes Filled amount of base currency
    remaining float Yes Remaining amount to be filled
    trades array Yes Order trades/executions
    fee Object Yes Fee (e.g. {'currency': 'ETH', 'cost': 0.00001, 'rate': 0.0002)
    cost float No Meta - filled * price

    Cancel Order

    Sample Data

    
    curl -X POST \
      https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/cancelOrder \
      -H 'Content-Type: application/json' \
      -H 'X-API-Key: my-api-key' \
      -d '{
        "id": 23423452666
        "symbol" : "BTC/ETH",
        "params" : {
            "key": "value"
        }
    }'
    
    
    
    
    POST /v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/cancelOrder HTTP/1.1
    Host: api.cryptoapis.io
    Content-Type: application/json
    X-API-Key: my-api-key
    
    {
        "id": 23423452666
        "symbol" : "BTC/ETH",
        "params" : {
            "key": "value"
        }
    }
    
    
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/cancelOrder",
      "method": "POST",
      "headers": {
        "Content-Type": "application/json",
        "X-API-Key": "my-api-key"
      },
      "processData": false,
      "data": "{\n\t\"id\" : 23423452666,\n\t\"symbol\" : \"BTC/ETH\",\n\t\"params\" : {\"key\": \"value\"}\n}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    
    
    var http = require("http");
    
    var options = {
      "method": "POST",
      "hostname": "api.cryptoapis.io",
      "path": "/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/cancelOrder",
      "headers": {
        "Content-Type": "application/json",
        "X-API-Key": "my-api-key"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
        id: 23423452666
        symbol: 'BTC/ETH',
        params: {
            key: 'value'
        }
    }));
    req.end();
    
    
    
    
    &lt;?php
    
    $request = new HttpRequest();
    $request->setUrl('https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/cancelOrder');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'Content-Type' => 'application/json',
      'X-API-Key' => 'my-api-key'
    ));
    
    $request->setBody('{
        "id": 23423452666
        "symbol" : "BTC/ETH",
        "params" : {
            "key": "value"
        }
    }');
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    
    ?>
    
    
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/cancelOrder")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["Content-Type"] = 'application/json'
    request["X-API-Key"] = 'my-api-key'
    request.body = "{\n\t\"id\" : 23423452666,\n\t\"symbol\" : \"BTC/ETH\",\n\t\"params\" : {\"key\": \"value\"}\n}"
    
    response = http.request(request)
    puts response.read_body
    
    
    
    
    import http.client
    
    conn = http.client.HTTPConnection("https://api.cryptoapis.io")
    
    payload = "{\n\t\"id\" : 23423452666,\n\t\"symbol\" : \"BTC/ETH\",\n\t\"params\" : {\"key\": \"value\"}\n}"
    
    headers = {
      'Content-Type': "application/json",
      'X-API-Key': "my-api-key"
    }
    
    conn.request("POST", "/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/cancelOrder", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    
    
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\\n\t\"id\" : 23423452666,\n\t\"symbol\" : \"BTC/ETH\",\n\t\"params\" : {\"key\": \"value\"}\n}");
    Request request = new Request.Builder()
      .url("https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/cancelOrder")
      .post(body)
      .addHeader("Content-Type", "application/json")
      .addHeader("X-API-Key", "my-api-key")
      .build();
    
    Response response = client.newCall(request).execute();
    
    
    
    
    package main
    
    import (
        "fmt"
        "strings"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/cancelOrder"
    
        payload := strings.NewReader("{\n\t\"id\" : 23423452666,\n\t\"symbol\" : \"BTC/ETH\",\n\t\"params\" : {\"key\": \"value\"}\n}")
    
        req, _ := http.NewRequest("POST", url, payload)
    
        req.Header.Add("Content-Type", "application/json")
        req.Header.Add("X-API-Key", "my-api-key")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    
    

    Response Body

    {
        "payload": {
            "success": true    
        }
    }
    

    Cancels an order in an exchange.

    HTTP Request

    POST /v1/trading/private-apis/{accountId}/cancelOrder

    URL Parameters

    Variable Type Description
    accountId string Id used for authentication. (After a successful account creation in Crypto APIs)

    Body/Query Parameters

    Variable Type Required Description
    id string Yes Order id
    symbol string No Most exchanges need a symbol (e.g. 'BTC/ETH', 'XLM/BTC', etc.)
    params object No Some exchanges need additional parameters

    Output Variables

    Variable Type Required Description
    success bool Yes Status of the cancellation

    Withdraw

    Sample Data

    
    curl -X POST \
      https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/withdraw \
      -H 'Content-Type: application/json' \
      -H 'X-API-Key: my-api-key' \
      -d '{
        "code" : "ETH",
        "amount" : 1.2,
        "address" : "ser23f-32r2r23r-23r-24r2",
        "tag" : "3334234242",
        "params" : {
            "key" : "value"
        }
    }'
    
    
    
    
    POST /v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/withdraw HTTP/1.1
    Host: api.cryptoapis.io
    Content-Type: application/json
    X-API-Key: my-api-key
    
    {
        "code" : "ETH",
        "amount" : 1.2,
        "address" : "ser23f-32r2r23r-23r-24r2",
        "tag" : "3334234242",
        "params" : {
            "key" : "value"
        }
    }
    
    
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/withdraw",
      "method": "POST",
      "headers": {
        "Content-Type": "application/json",
        "X-API-Key": "my-api-key"
      },
      "processData": false,
      "data": "{\n\t\"code\" : \"ETH\",\n\t\"amount\" : 1.2,\n\t\"address\" : \"ser23f-32r2r23r-23r-24r2\", \n\t\"tag\" : \"3334234242\",\n\t\"params\" : {\"key\": \"value\"}\n}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    
    
    var http = require("http");
    
    var options = {
      "method": "POST",
      "hostname": "api.cryptoapis.io",
      "path": "/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/withdraw",
      "headers": {
        "Content-Type": "application/json",
        "X-API-Key": "my-api-key"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
        code: 'ETH',
        amount: 1.2,
        address: 'ser23f-32r2r23r-23r-24r2',
        tag: '3334234242',
        params: {
            key: 'value'
        }
    }));
    req.end();
    
    
    
    
    &lt;?php
    
    $request = new HttpRequest();
    $request->setUrl('https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/withdraw');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'Content-Type' => 'application/json',
      'X-API-Key' => 'my-api-key'
    ));
    
    $request->setBody('{
        "code" : "ETH",
        "amount" : 1.2,
        "address" : "ser23f-32r2r23r-23r-24r2",
        "tag" : "3334234242",
        "params" : {
            "key" : "value"
        }
    }');
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    
    ?>
    
    
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/withdraw")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["Content-Type"] = 'application/json'
    request["X-API-Key"] = 'my-api-key'
    request.body = "{\n\t\"code\" : \"ETH\",\n\t\"amount\" : 1.2,\n\t\"address\" : \"ser23f-32r2r23r-23r-24r2\", \n\t\"tag\" : \"3334234242\",\n\t\"params\" : {\"key\": \"value\"}\n}"
    
    response = http.request(request)
    puts response.read_body
    
    
    
    
    import http.client
    
    conn = http.client.HTTPConnection("https://api.cryptoapis.io")
    
    payload = "{\n\t\"code\" : \"ETH\",\n\t\"amount\" : 1.2,\n\t\"address\" : \"ser23f-32r2r23r-23r-24r2\", \n\t\"tag\" : \"3334234242\",\n\t\"params\" : {\"key\": \"value\"}\n}"
    
    headers = {
      'Content-Type': "application/json",
      'X-API-Key': "my-api-key"
    }
    
    conn.request("POST", "/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/withdraw", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    
    
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\\n\t\"code\" : \"ETH\",\n\t\"amount\" : 1.2,\n\t\"address\" : \"ser23f-32r2r23r-23r-24r2\", \n\t\"tag\" : \"3334234242\",\n\t\"params\" : {\"key\": \"value\"}\n}");
    Request request = new Request.Builder()
      .url("https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/withdraw")
      .post(body)
      .addHeader("Content-Type", "application/json")
      .addHeader("X-API-Key", "my-api-key")
      .build();
    
    Response response = client.newCall(request).execute();
    
    
    
    
    package main
    
    import (
        "fmt"
        "strings"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api.cryptoapis.io/v1/trading/private-apis/068924dc-d66b-4319-baab-d96ab05521ef/withdraw"
    
        payload := strings.NewReader("{\n\t\"code\" : \"ETH\",\n\t\"amount\" : 1.2,\n\t\"address\" : \"ser23f-32r2r23r-23r-24r2\", \n\t\"tag\" : \"3334234242\",\n\t\"params\" : {\"key\": \"value\"}\n}")
    
        req, _ := http.NewRequest("POST", url, payload)
    
        req.Header.Add("Content-Type", "application/json")
        req.Header.Add("X-API-Key", "my-api-key")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    
    

    Response Body

    {
       "payload": {
           "id": "13060000"
       }
    }
    

    Withdraw funds to an address.

    HTTP Request

    POST /v1/trading/private-apis/{accountId}/withdraw

    URL Parameters

    Variable Type Description
    accountId string Id used for authentication. (After a successful account creation in Crypto APIs)

    Body/Query Parameters

    Variable Type Required Description
    code string Yes Code/currency with which the address is going to be funded (e.g. 'XLM')
    amount float Yes Amount in base currency
    address string Yes Funding address
    tag string No Some exchanges provide tag which needs to be included when funding the address
    params object No Some exchanges need additional parameters

    Output Variables

    Variable Type Required Description
    id string Yes Id of the withdrawal request