Open Account Support Tutorial
  • BTC/USD: 15 937.48751
  • BTC/EUR: 13 990
  • LTC/USD: 148.73179
  • BTC/RUR: 1 036 000
  • EMC/USD: 0.98207
  • EMC/BTC: 0.00006406
  • LTC/BTC: 0.00939966
  • DASH/BTC: 0.04386792
  • DOGE/BTC: 0.00000017
  • DOGE/USD: 0.00256492
  • PPC/BTC: 0.00020538
  • NMC/BTC: 0.00017045
  • MONA/BTC: 0.00095929
  • CURE/BTC: 0.00003029
  • ETH/BTC: 0.02807699
  • SIB/BTC: 0.0001531
  • TX/BTC: 0.00026331
  • RBIES/BTC: 0.00000177
  • MAID/BTC: 0.00002929
  • ADZ/BTC: 0.00000169
  • MOJO/BTC: 0.00000106
  • FST/BTC: 0.00000079
  • BSD/BTC: 0.00006401
  • SXC/BTC: 0.00000404
  • BTA/BTC: 0.00002423
  • VOX/BTC: 0.00001279
  • CRBIT/BTC: 0.00001925
  • SHIFT/BTC: 0.00014109
  • YOC/BTC: 0.00000141
  • CREVA/BTC: 0.00000004
  • ETH/USD: 445.5479
  • ETH/RUR: 28 398.99999
  • LSK/BTC: 0.0005092
  • EL/BTC: 0.00000245
  • EL/RUR: 2.86
  • HNC/BTC: 0.00000069
  • YOC/USD: 0.02314
  • YOC/RUR: 3.99978
  • MOIN/BTC: 0.00000662
  • BLU/BTC: 0.000001
  • LEO/BTC: 0.00001549
  • EMC/RUR: 74
  • REE/BTC: 0.00000001
  • LEO/USD: 0.2435
  • LEO/RUR: 21
  • GAME/BTC: 0.00013123
  • SLR/BTC: 0.0000312
  • BLK/BTC: 0.00002128
  • SYS/BTC: 0.00002103
  • DGB/BTC: 0.00000084
  • VRC/BTC: 0.00003627
  • THS/BTC: 0.00005706
  • GYC/BTC: 0.0000005
  • XMR/BTC: 0.01586367
  • XMR/USD: 255.5
  • THS/USD: 0.84003
  • BTS/BTC: 0.00001075
  • CLOAK/BTC: 0.00051779
  • GB/BTC: 0.00001597
  • VRM/BTC: 0.00014371
  • VRM/VRC: 14.999999
  • ARC/BTC: 0.00000397
  • ATX/BTC: 0.00000029
  • POST/BTC: 0.00000122
  • BURST/BTC: 0.00000096
  • ENT/BTC: 0.00000435
  • CRBIT/LEO: 1.902
  • NXT/BTC: 0.00003872
  • EDR/BTC: 0.00000028
  • KRB/BTC: 0.00007494
  • OD/BTC: 0.00048179
  • DMC/BTC: 0.00000014
  • DMC/USD: 0.00197
  • ADZ/USD: 0.02542
  • EL/USD: 0.03812
  • LSK/USD: 7.9211
  • DASH/USD: 702.90527
  • VRS/BTC: 0.00000001
  • XRC/BTC: 0.00000143
  • BIT/BTC: 0.00000068
  • CLOAK/USD: 8.59999
  • CLOAK/EUR: 11.98
  • DOLLAR/BTC: 0.00000223
  • XAUR/BTC: 0.00001205
  • GOLOS/BTC: 0.00001245
  • FRST/BTC: 0.0010497
  • VLTC/BTC: 0.00000006
  • SIB/RUR: 159.99996
  • CCRB/BTC: 0.00002289
  • UNC/BTC: 0.00000001
  • BPC/BTC: 0.0000005
  • VSL/BTC: 0.00000476
  • FST/USD: 0.01201
  • BLU/USD: 0.0165
  • DIME/RUR: 0.00028
  • DIME/USD: 0.00001
  • DIME/EUR: 0.00001
  • DIME/BTC: 0.00000001
  • ICN/BTC: 0.0000777
  • PRES/BTC: 0.00000024
  • ZBC/BTC: 0.0000018
  • DIBC/BTC: 0.00000064
  • LUNA/BTC: 0.0000016
  • ABN/BTC: 0.00000101
  • BCC/BTC: 0.02440256
  • NVC/BTC: 0.00040793
  • XSPEC/BTC: 0.00002095
  • ACN/BTC: 0.00000004
  • CRBIT/ETH: 0.0008
  • LDC/BTC: 0.0000001
  • MSCN/ETH: 0.0000033
  • MSCN/BTC: 0.00000004
  • MSCN/RUR: 0.07797
  • MSCN/USD: 0.00068
  • MSCN/EUR: 0.0007
  • POSW/BTC: 0.00001212
  • POSW/ETH: 0.00030284
  • POSW/ICN: 0.39999998
  • POSW/CRBIT: 0.4999
  • OBITS/BTC: 0.00007987
  • EDR/USD: 0.00477
  • EDR/RUR: 0.7
  • TIME/BTC: 0.00113063
  • OBITS/BTS: 3.75
  • OBITS/ETH: 0.0044842
  • OBITS/USD: 1.3995
  • OBITS/EUR: 1.5
  • WAVES/BTC: 0.00060844
  • INCNT/BTC: 0.00001679
  • VRS/USD: 0.00001
  • ZBC/USD: 0.02565
  • ZBC/ETH: 0.00014857
  • ZBC/EUR: 0.04
  • ZBC/XMR: 0.0000455
  • ZBC/RUR: 3.33333
  • EMC/ETH: 0.00219
  • EMC/XMR: 0.00400446
  • EMC/DASH: 0.0014
  • DBIX/BTC: 0.00041019
  • TAAS/USD: 4.3
  • ARC/USD: 0.05541
  • ARC/RUR: 5.4999
  • ARC/ETH: 0.00019091
  • POSW/DASH: 0.000722
  • POSW/RUR: 14.44444
  • POSW/USD: 0.12014
  • POSW/EUR: 0.2
  • POSW/XMR: 0.000415
  • POSW/LTC: 0.002579
  • TAAS/BTC: 0.00026033
  • XMS/BTC: 0.00000006
  • THS/ETH: 0.00234071
  • POST/ETH: 0.00004049
  • DIBC/ETH: 0.00002
  • LEO/ETH: 0.0005
  • DANC/BTC: 0.00000006
  • CCRB/ETH: 0.00059038
  • SOAR/BTC: 0.00000139
  • FUNC/USD: 0.01859
  • FUNC/ETH: 0.00008915
  • FUNC/BTC: 0.00000132
  • PIVX/BTC: 0.00031359
  • PIVX/USD: 4.50122
  • PIVX/EUR: 4.5
  • PIVX/DASH: 0.02484937
  • PIVX/RUR: 430.33
  • PIVX/ETH: 0.01049346
  • PIVX/XMR: 0.01615811
  • KRB/USD: 1.158
  • KRB/RUR: 93.99997
  • ITI/BTC: 0.00080002
  • ITI/RUR: 1 500
  • ITI/ETH: 0.0323
  • ITI/EUR: 23
  • PUT/BTC: 0.0000014
  • PUT/ETH: 0.00004999
  • GUP/BTC: 0.00002001
  • GUP/ETH: 0.00050134
  • MNE/BTC: 0.0000368
  • MNE/ETH: 0.00142208
  • WINGS/BTC: 0.00003207
  • WINGS/ETH: 0.00196887
  • UNRC/BTC: 0.00000004
  • PUT/USD: 0.025
  • RLT/BTC: 0.00000608
  • RLT/RUR: 26.99999
  • RLT/ETH: 0.00046652
  • RLT/USD: 0.0866
  • UNY/BTC: 0.00000076
  • UNY/ETH: 0.00002748
  • UNY/LTC: 0.000095
  • UNY/USD: 0.01286
  • STRAT/BTC: 0.00056876
  • STRAT/ETH: 0.02597891
  • STRAT/USD: 9.5
  • FORTYTWO/BTC: 2.20000048
  • FORTYTWO/ETH: 199.99999999
  • FORTYTWO/USD: 39 999.00001
  • UNRC/USD: 0.00081
  • INSN/BTC: 0.00000445
  • INSN/ETH: 0.0002979
  • INSN/USD: 0.1098
  • QAU/BTC: 0.0000075
  • QAU/ETH: 0.00027366
  • QAU/USD: 0.12499
  • TRUMP/BTC: 0.00000462
  • TRUMP/ETH: 0.00021631
  • FNC/BTC: 0.00000224
  • FNC/ETH: 0.00009989
  • FNC/USD: 0.03055
  • MCO/BTC: 0.00076044
  • MCO/ETH: 0.03200192
  • MCO/USD: 13.2
  • DANC/USD: 0.0015
  • DIBC/USD: 0.01954
  • XRC/USD: 0.023
  • PUT/RUR: 1.99999
  • PPY/BTC: 0.00027078
  • PPY/ETH: 0.012
  • PPY/USD: 3.90005
  • ASAFE2/BTC: 0.00000078
  • PLBT/BTC: 0.00039701
  • PLBT/USD: 6.58999
  • PLBT/ETH: 0.0136
  • ASAFE2/USD: 0.01083
  • EL/DANC: 35
  • EL/UNRC: 99.5
  • EL/ZBC: 1.419998
  • DIME/ETH: 0.00000001
  • KPL/BTC: 0.00000219
  • KPL/USD: 0.03
  • KPL/ETH: 0.00007118
  • BCH/BTC: 0.0861427
  • BCH/USD: 1 353.9902
  • BCH/ETH: 3.067
  • BCH/ZBC: 20 010.2001
  • BCH/RUR: 104 999
  • NVC/USD: 6.49
  • MCR/BTC: 0.00010208
  • MCR/ETH: 0.00288653
  • FU/BTC: 0.00000046
  • FU/ETH: 0.0000164
  • WIC/BTC: 0.00000017
  • WIC/ETH: 0.00000511
  • PIPL/BTC: 0.00000159
  • PIPL/ETH: 0.00005718
  • HVN/BTC: 0.00000303
  • HVN/ETH: 0.00008
  • HVN/USD: 0.04204
  • XRL/BTC: 0.00001375
  • XRL/ETH: 0.0004675
  • MGO/BTC: 0.00003187
  • MGO/ETH: 0.00147999
  • CTR/BTC: 0.00003121
  • CTR/ETH: 0.00083021
  • THS/RUR: 12.02223
  • THS/EUR: 0.45055
  • CTR/USD: 0.39105
  • GRS/BTC: 0.00006784
  • GRS/ETH: 0.00160105
  • XEM/BTC: 0.0000259
  • XEM/ETH: 0.00094366
  • XEM/USD: 0.43718
  • PRO/BTC: 0.00002017
  • PRO/ETH: 0.00124845
  • PRO/USD: 0.33
  • REE/ETH: 0.00000007
  • REE/USD: 0.00003
  • GRS/USD: 1.4999
  • SOAR/ETH: 0.00004369
  • VOISE/BTC: 0.00000058
  • VOISE/ETH: 0.00003441
  • VOISE/USD: 0.01393
  • VOISE/EUR: 0.011
  • CPC/BTC: 0.00002741
  • CPC/ETH: 0.00148899
  • CPC/USD: 0.38007
  • eETT/BTC: 0.00000682
  • eETT/ETH: 0.00050994
  • eETT/USD: 0.1
  • wETT/BTC: 0.00001203
  • wETT/ETH: 0.00099978
  • wETT/USD: 0.599
  • MTCoin/BTC: 0.00007418
  • MTCoin/ETH: 0.003981
  • MTCoin/USD: 0.5
  • SUMO/BTC: 0.00005799
  • SUMO/ETH: 0.00240999
  • VIB/USD: 0.13
  • VIB/ETH: 0.00024552
  • VIB/BTC: 0.000008
  • GNT/BTC: 0.00002144
  • GNT/ETH: 0.00055127
  • GNT/USD: 0.30102
  • KNC/BTC: 0.00006472
  • KNC/ETH: 0.00205004
  • KNC/USD: 1.88863
  • CVC/BTC: 0.0000179
  • CVC/ETH: 0.00068339
  • CVC/USD: 0.301
  • DGD/BTC: 0.00951047
  • DGD/ETH: 0.869999
  • DGD/USD: 69.99999
  • MTL/BTC: 0.00033499
  • MTL/ETH: 0.02199994
  • MTL/USD: 4.11013
  • REP/BTC: 0.00236634
  • REP/ETH: 0.10999996
  • REP/USD: 29
  • BAT/BTC: 0.00001332
  • BAT/ETH: 0.00057999
  • BAT/USD: 0.25
  • EOS/BTC: 0.0002513
  • EOS/ETH: 0.00900623
  • EOS/USD: 3.95
  • BNT/BTC: 0.00018088
  • BNT/ETH: 0.0055015
  • BNT/USD: 2.25
  • ZRX/BTC: 0.000014
  • ZRX/ETH: 0.00057999
  • ZRX/USD: 0.21026
  • GNO/BTC: 0.00999976
  • GNO/ETH: 0.89999997
  • GNO/USD: 151
  • SNT/BTC: 0.00000364
  • SNT/ETH: 0.00030842
  • SNT/USD: 0.05506
  • SNGLS/BTC: 0.00000726
  • SNGLS/ETH: 0.00028
  • SNGLS/USD: 0.118
  • RLC/BTC: 0.00004069
  • RLC/ETH: 0.00195607
  • RLC/USD: 0.50056
  • STORJ/BTC: 0.00005946
  • STORJ/ETH: 0.00309974
  • STORJ/USD: 1.09
  • ANT/BTC: 0.00014965
  • ANT/ETH: 0.00380013
  • ANT/USD: 2
  • EDG/BTC: 0.00009064
  • EDG/ETH: 0.01899853
  • EDG/USD: 1.443
  • FUN/BTC: 0.00000165
  • FUN/ETH: 0.00009078
  • FUN/USD: 0.03557
  • QTUM/BTC: 0.00061483
  • QTUM/ETH: 0.04199894
  • QTUM/USD: 12.885
  • OMG/BTC: 0.00050666
  • OMG/ETH: 0.0130033
  • OMG/USD: 8.08543
  • PAY/BTC: 0.000135
  • PAY/ETH: 0.00427011
  • PAY/USD: 2.005
  • TRST/BTC: 0.00002934
  • TRST/ETH: 0.00030116
  • TRST/USD: 0.7891
  • MLN/BTC: 0.00549781
  • MLN/ETH: 0.28999997
  • MLN/USD: 130.00008
  • TKN/BTC: 0.00004089
  • TKN/ETH: 0.00150001
  • TKN/USD: 0.75
  • FirstBlood/BTC: 0.00003674
  • FirstBlood/ETH: 0.0011
  • FirstBlood/USD: 0.5
  • NEO/BTC: 0.00216229
  • NEO/ETH: 0.0753311
  • NEO/USD: 33.8
  • BIO/BTC: 0.0000011
  • BIO/ETH: 0.00006097
  • BIO/USD: 0.01998
  • BIO/RUR: 0.90615
  • OTN/BTC: 0.00079
  • OTN/ETH: 0.03198999
  • BCC/ETH: 0.87999995
  • BCC/USD: 390
  • FRST/ETH: 0.0362
  • FRST/USD: 16
  • MNX/BTC: 0.00165082
  • MNX/ETH: 0.056
  • DAY/BTC: 0.00032487
  • DAY/ETH: 0.01
  • ENJ/BTC: 0.00000265
  • ENJ/ETH: 0.00009
  • HNC/USD: 0.00927
  • HNC/EUR: 0.00777
  • HNC/ETH: 0.00003888
  • ATM/BTC: 0.00000125
  • ATM/ETH: 0.00005887
  • ETHP/BTC: 0.0000639
  • ETHP/ETH: 0.00249992
  • PLBT/EMC: 5.8
  • DMD/BTC: 0.00100002
  • DMD/ETH: 0.05
  • DMD/USD: 15.89994
  • OXY/BTC: 0.00001327
  • OXY/ETH: 0.0007388
  • OXY/USD: 0.19998
  • CLD/BTC: 0.00001049
  • CLD/ETH: 0.000389
  • MNX/USD: 26.10004
  • OTN/USD: 12.65
  • ARTE/BTC: 0.00003175
  • ARTE/ETH: 0.005999
  • ARTE/MNE: 0
  • CDX/BTC: 0.00000738
  • CDX/ETH: 0.0003598
  • CLP/BTC: 0.00011139
  • CLP/ETH: 0.00212558
  • ESP/BTC: 0.00000001
  • ESP/ETH: 0.00000019
  • BTB/BTC: 0.0019
  • BTB/ETH: 0.06799997
  • ESC/BTC: 0.00014049
  • ESC/ETH: 0.00270031
  • BCC/ESC: 90.00000001
  • CLP/USD: 1.15001
  • ARC/BCH: 0.00002102
  • YOC/ETH: 0.00008433
  • BPC/ETH: 0.0000008
  • ETHOS/BTC: 0.000091
  • ETHOS/ETH: 0.00479982
  • ETHOS/USD: 2.1
  • PRG/BTC: 0.00001848
  • PRG/ETH: 0.00061815
  • PRG/USD: 0.29467
  • AMM/BTC: 0.00001977
  • AMM/ETH: 0.00062029
  • AMM/USD: 0.421
  • HST/BTC: 0.000022
  • HST/ETH: 0.00067001
  • HST/USD: 0.31
  • ERO/BTC: 0.00000825
  • ERO/ETH: 0.00026001
  • KICK/BTC: 0
  • KICK/ETH: 0
  • KICK/USD: 0
  • KICK/RUR: 0
  • SHIFT/ETH: 0.005
  • SHIFT/USD: 2
  • UQC/BTC: 0.0000875
  • UQC/ETH: 0.00172104
  • UQC/USD: 1.29999
  • UQC/BCC: 0.0025
  • GRX/BTC: 0.00030006
  • GRX/ETH: 0.0118291
  • INS/BTC: 0
  • INS/ETH: 0
  • ICOS/BTC: 0
  • ICOS/ETH: 0
  • ICOS/USD: 0
  • TER/BTC: 13
  • TER/ETH: 595
  • FLP/BTC: 0
  • FLP/ETH: 0
  • RBM/BTC: 0
  • RBM/ETH: 0
  • RBM/USD: 0
  • RBM/EUR: 0
  • FLIXX/BTC: 0.0000045
  • FLIXX/ETH: 0.0002
  • DTR/BTC: 0.00000097
  • DTR/ETH: 0.00002314
  • SPF/BTC: 0
  • SPF/ETH: 0
  • EVC/BTC: 0
  • EVC/ETH: 0

API

API Examples

Authorization

Some of the services are available without authorization but most of the services require an API key and digital signature for the data transmitted in queries. The API key and signature should be sent as HTTP headers "Api-key" and "Sign".

A signature is a HMAC-SHA256 encoded message. The HMAC-SHA256 code must be generated using a secret key that was generated with your API key. Generated signatures must be converted into hexadecimal format and uppercase characters.

Important (!) To build a string for a signature, parameters should be concatenated in strict alphabetical order of the parameter names. Otherwise the e-signature verification process will fail.

CUrl

curl  -w "\n%%{http_code}"\
      -H "Api-Key: gJx7Wa7qXkPtmTAaK3ADCtr6m5rCYYMy"\
      -H "Sign: EA4AB0289512C3A65092321F9BF25058B84104F1D99D37D0D8BFC4CF7AF0F9CD"\
      --data "price=60&quantity=1&currencyPair=BTC/USD"\
      https://api.livecoin.net/exchange/buylimit


PHP

POST request

<?php
 
$url = "https://api.livecoin.net/exchange/buylimit";
$apiKey = "gJx7Wa7qXkPtmTAaK3ADCtr6m5rCYYMy";
$secretKey = "8eLps29wsXszNyEhOl9w8dxsOsM2lTzg";
 
$params = array(
    'currencyPair'=> 'BTC/USD',
    'price'=> 60,
    'quantity'=>1
);
 
ksort($params);
$postFields = http_build_query($params, '', '&');
$signature = strtoupper(hash_hmac('sha256', $postFields, $secretKey));
 
$headers = array(
    "Api-Key: $apiKey",
    "Sign: $signature"
);
 
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
 
$response = curl_exec($ch);
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
 
if ($statusCode!=200) {
    //dump info:
    echo "Status code: $statusCode, response: $response";
    //throw new Exception('Can not execute the query!');
}
 
var_dump(json_decode($response));

GET request

<?php
 
$url = "https://api.livecoin.net/exchange/client_orders";
$apiKey = "gJx7Wa7qXkPtmTAaK3ADCtr6m5rCYYMy";
$secretKey = "8eLps29wsXszNyEhOl9w8dxsOsM2lTzg";
 
$params = array(
    'currencyPair'=> 'BTC/USD'
);
 
ksort($params);
$fields = http_build_query($params, '', '&');
$signature = strtoupper(hash_hmac('sha256', $fields, $secretKey));
 
$headers = array(
    "Api-Key: $apiKey",
    "Sign: $signature"
);
 
$ch = curl_init($url."?".$fields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
 
$response = curl_exec($ch);
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
 
if ($statusCode!=200) {
    //dump info:
    echo "Status code: $statusCode, response: $response";
    //throw new Exception('Can not execute the query!');
}
 
var_dump(json_decode($response));

Voucher creation

<?php
 
$url = "https://api.livecoin.net/payment/voucher/make";
$apiKey = "gJx7Wa7qXkPtmTAaK3ADCtr6m5rCYYMy";
$secretKey = "8eLps29wsXszNyEhOl9w8dxsOsM2lTzg";
 
$params = array(
    'amount'=> '1',
    'currency'=> 'USD',
    'description'=>'test voucher'
);
 
ksort($params);
$postFields = http_build_query($params, '', '&');
$signature = strtoupper(hash_hmac('sha256', $postFields, $secretKey));
 
$headers = array(
    "Api-Key: $apiKey",
    "Sign: $signature"
);
 
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
 
$response = curl_exec($ch);
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
 
if ($statusCode!=200) {
    //dump info:
    echo "Status code: $statusCode, response: $response";
    //throw new Exception('Can not execute the query!');
}
 
var_dump($response);

Java

POST request

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.TreeMap;
import java.util.Map;
 
public class ExtAPIExample {
    public static final java.lang.String HMAC_SHA256_ALGORITHM = "HmacSHA256";
    public static final java.lang.String UNICODE_CODE = "UTF-8";
    public static final String URL = "https://api.livecoin.net/exchange/buylimit";
 
    // your API key
    public static final String apiKey = "YYYYYYYYYYYYYYYYYYYYYYYYYYYYY";
    // your secret key
    public static final String secKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
 
    public static void main(String[] args) {
        try {
            Map<String, String> postData = new TreeMap<>();
            postData.put("currencyPair", "BTC/USD");
            postData.put("price", "60");
            postData.put("quantity", "1");
            String queryString = buildQueryString(postData);
            String signature = createSignature(queryString, secKey);
 
            URL queryUrl = new URL(URL);
            HttpURLConnection connection = (HttpURLConnection)queryUrl.openConnection();
            connection.setDoOutput(true);
            connection.setRequestProperty("Api-Key", apiKey);
            connection.setRequestProperty("Sign", signature);
            connection.getOutputStream().write(queryString.getBytes());
 
            BufferedReader rd = new BufferedReader(new InputStreamReader(connection.getInputStream()));
            StringBuilder sb = new StringBuilder();
            String line;
            while ((line = rd.readLine()) != null) {
                sb.append(line + '\n');
            }
            System.out.println(sb.toString());
 
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
 
    private static String buildQueryString(Map<String, String> args) {
        StringBuilder result = new StringBuilder();
        for (String hashKey : args.keySet()) {
            if (result.length() > 0) result.append('&');
            try {
                result.append(URLEncoder.encode(hashKey, "UTF-8"))
                    .append("=").append(URLEncoder.encode(args.get(hashKey), "UTF-8"));
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
        return result.toString();
    }
 
    private static String createSignature(String paramData, String plainSecretKey) {
        try {
            SecretKeySpec secretKey = new SecretKeySpec(plainSecretKey.getBytes(UNICODE_CODE), HMAC_SHA256_ALGORITHM);
            Mac mac = Mac.getInstance(HMAC_SHA256_ALGORITHM);
            mac.init(secretKey);
            byte[] hmacData = mac.doFinal(paramData.getBytes(UNICODE_CODE));
            return byteArrayToHexString(hmacData).toUpperCase();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
 
    private static String byteArrayToHexString(byte[] bytes) {
        final char[] hexArray = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
        char[] hexChars = new char[bytes.length * 2];
        int v;
        for (int j = 0; j < bytes.length; j++) {
            v = bytes[j] & 0xFF;
            hexChars[j * 2] = hexArray[v >>> 4];
            hexChars[j * 2 + 1] = hexArray[v & 0x0F];
        }
        return new String(hexChars);
    }
}

GET request

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
 
public class ExtAPIExample {
    public static void main(String[] args) {
        try {
            URL queryUrl = new URL("https://api.livecoin.net/exchange/order_book?currencyPair=LTC/BTC");
            HttpURLConnection connection = (HttpURLConnection)queryUrl.openConnection();
            connection.setDoOutput(true);
 
            BufferedReader rd = new BufferedReader(new InputStreamReader(connection.getInputStream()));
            StringBuilder sb = new StringBuilder();
            String line;
            while ((line = rd.readLine()) != null) {
                sb.append(line + '\n');
            }
            System.out.println(sb.toString());
 
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}

Ruby

POST request

require "net/http"
require "uri"
require 'openssl'
require "base64"
require "rubygems"
require "json"
 
uri = URI::parse("https://api.livecoin.net/exchange/buylimit")
api_key = "gJx7Wa7qXkPtmTAaK3ADCtr6m5rCYYMy"
secret_key = "8eLps29wsXszNyEhOl9w8dxsOsM2lTzg"
 
data = {
'currencyPair'=> 'BTC/USD',
'price'=>'100',
'quantity'=>'0.01'
}
 
sorted_data = data.sort_by { |key, value| key }
 
sha256 = OpenSSL::Digest::SHA256.new
signature = OpenSSL::HMAC.hexdigest(sha256, secret_key, URI.encode_www_form(sorted_data)).upcase
 
request = Net::HTTP::Post.new(uri)
request.set_form_data(sorted_data)
request.add_field("Api-key", api_key)
request.add_field("Sign", signature)
 
response = Net::HTTP.start(uri.hostname, uri.port, :use_ssl =>uri.scheme == 'https') {|http|
http.request(request)
}
 
response_data = JSON.parse(response.body())
 
print response_data

GET request

require "net/http"
require "uri"
require 'openssl'
require "base64"
require "rubygems"
require "json"
 
uri = URI::parse("https://api.livecoin.net/exchange/client_orders")
api_key = "gJx7Wa7qXkPtmTAaK3ADCtr6m5rCYYMy"
secret_key = "8eLps29wsXszNyEhOl9w8dxsOsM2lTzg"
 
uri.query = URI.encode_www_form({
'currencyPair'=> 'BTC/USD'
})
 
sha256 = OpenSSL::Digest::SHA256.new
signature = OpenSSL::HMAC.hexdigest(sha256, secret_key, uri.query).upcase
 
request = Net::HTTP::Get.new(uri)
request.add_field("Api-key", api_key)
request.add_field("Sign", signature)
 
response = Net::HTTP.start(uri.hostname, uri.port, :use_ssl =>uri.scheme == 'https') {|http|
http.request(request)
}
 
response_data = JSON.parse(response.body())
 
print response_data

Python 2.7

POST request

import httplib
import urllib
import json
import hashlib
import hmac
from collections import OrderedDict
 
server = "api.livecoin.net"
method = "/exchange/buylimit"
api_key = "gJx7Wa7qXkPtmTAaK3ADCtr6m5rCYYMy"
secret_key = "8eLps29wsXszNyEhOl9w8dxsOsM2lTzg"
 
data = OrderedDict(sorted([('currencyPair', 'BTC/USD'),('price', '100'),('quantity', '0.01')]))
 
encoded_data = urllib.urlencode(data)
 
sign = hmac.new(secret_key, msg=encoded_data, digestmod=hashlib.sha256).hexdigest().upper()
 
headers = {"Api-key": api_key, "Sign": sign, "Content-type": "application/x-www-form-urlencoded"}
 
conn = httplib.HTTPSConnection(server)
conn.request("POST", method, encoded_data, headers)
 
response = conn.getresponse()
data = json.load(response)
conn.close()
 
print data

GET request

import httplib
import urllib
import json
import hashlib
import hmac
from collections import OrderedDict
 
server = "api.livecoin.net"
method = "/exchange/client_orders"
api_key = "gJx7Wa7qXkPtmTAaK3ADCtr6m5rCYYMy"
secret_key = "8eLps29wsXszNyEhOl9w8dxsOsM2lTzg"
 
data = OrderedDict([('currencyPair', 'BTC/EUR')])
 
encoded_data = urllib.urlencode(data)
 
sign = hmac.new(secret_key, msg=encoded_data, digestmod=hashlib.sha256).hexdigest().upper()
 
headers = {"Api-key": api_key, "Sign": sign}
 
conn = httplib.HTTPSConnection(server)
conn.request("GET", method + '?' + encoded_data, '', headers)
 
response = conn.getresponse()
data = json.load(response)
conn.close()
 
print data

C++

POST request

#include "stdafx.h"
#using <mscorlib.dll>
#using <System.dll>
#using <System.Web.dll>
 
using namespace System;
using namespace System::Text;
using namespace System::Web;
using namespace System::Net;
using namespace System::Security::Cryptography;
using namespace System::IO;
String^ ByteArrayToString(array<Byte>^ ba)
{
	StringBuilder ^hex = gcnew StringBuilder(ba->Length * 2);
	for each (Byte b in ba)
	{
		hex->AppendFormat("{0:x2}", b);
	}
	return hex->ToString();
}
 
String^ HashHMAC(String ^key, String ^message)
{
	System::Text::UTF8Encoding ^encoding = gcnew System::Text::UTF8Encoding();
	array<Byte> ^keyByte = encoding->GetBytes(key);
 
	HMACSHA256 ^hmacsha256 = gcnew HMACSHA256(keyByte);
 
	array<Byte> ^messageBytes = encoding->GetBytes(message);
	array<Byte> ^hashmessage = hmacsha256->ComputeHash(messageBytes);
	return ByteArrayToString(hashmessage);
}
 
 
String^ http_build_query(String^ formdata)
{
	String ^str = formdata->Replace("/", "%2F");
	str = str->Replace("@", "%40");
	str = str->Replace(";", "%3B");
	return str;
}
 
 
int _tmain(int argc, _TCHAR* argv[])
{
	String^ ApiKey = "gJx7Wa7qXkPtmTAaK3ADCtr6m5rCYYMy";
	String^ SecretKey = "8eLps29wsXszNyEhOl9w8dxsOsM2lTzg";
	String^ param = http_build_query("currencyPair=BTC/USD&price=60&quantity=1");
	String^ Sign = HashHMAC(SecretKey, param)->ToUpper();
	String^ uri = "https://api.livecoin.net/exchange/buylimit";
	String^ ResponseFromServer = "";
	HttpStatusCode StatusCode;
	array<Byte> ^bytes = Encoding::UTF8->GetBytes(param);
	HttpWebRequest ^request = safe_cast<HttpWebRequest^>(WebRequest::Create(uri));
	request->Method = "POST";
	request->ContentType = "application/x-www-form-urlencoded";
	request->ContentLength = bytes->Length;
	request->Headers["Api-Key"] = ApiKey;
	request->Headers["Sign"] = Sign;
	Stream ^dataStream = request->GetRequestStream();
	dataStream->Write(bytes, 0, bytes->Length);
	try
	{
		WebResponse ^WebResponse = request->GetResponse();
		dataStream = WebResponse->GetResponseStream();
		StreamReader ^StreamReader = gcnew System::IO::StreamReader(dataStream);
		ResponseFromServer = StreamReader->ReadToEnd();
		dataStream->Close();
		WebResponse->Close();
		StatusCode = HttpStatusCode::OK;
	}
	catch (WebException ^ex)
	{
		if (ex->Response != nullptr)
		{
			dataStream = ex->Response->GetResponseStream();
			StreamReader ^StreamReader = gcnew System::IO::StreamReader(dataStream);
			StatusCode = (safe_cast<HttpWebResponse^>(ex->Response))->StatusCode;
			ResponseFromServer = ex->Message;
		}
		else
		{
			StatusCode = HttpStatusCode::ExpectationFailed;
			ResponseFromServer = "Неизвестная ошибка";
		}
	}
	catch (Exception ^ex)
	{
		StatusCode = HttpStatusCode::ExpectationFailed;
		ResponseFromServer = "Неизвестная ошибка";
	}
	Console::WriteLine("Response Code: " + StatusCode.ToString());
	Console::WriteLine("Response String: " + ResponseFromServer);
 
}
 
 

GET request

#include "stdafx.h"
#using <mscorlib.dll>
#using <System.dll>
#using <System.Web.dll>
 
using namespace System;
using namespace System::Text;
using namespace System::Web;
using namespace System::Net;
using namespace System::Security::Cryptography;
using namespace System::IO;
 
int _tmain(int argc, _TCHAR* argv[])
{
	String^ param = "currencyPair=BTC/USD";
	String^ uri = "https://api.livecoin.net/exchange/ticker?";
	String^ ResponseFromServer = "";
	HttpStatusCode StatusCode;
	HttpWebRequest ^request = safe_cast<HttpWebRequest^>(WebRequest::Create(uri + param));
	request->Method = "GET";
	request->Timeout = 12000;
	request->ContentType = "application/x-www-form-urlencoded";
 
	Stream ^dataStream;
	try
	{
		WebResponse ^WebResponse = request->GetResponse();
		dataStream = WebResponse->GetResponseStream();
		StreamReader ^StreamReader = gcnew System::IO::StreamReader(dataStream);
		ResponseFromServer = StreamReader->ReadToEnd();
		dataStream->Close();
		WebResponse->Close();
		StatusCode = HttpStatusCode::OK;
	}
	catch (WebException ^ex)
	{
		if (ex->Response != nullptr)
		{
			dataStream = ex->Response->GetResponseStream();
			StreamReader ^StreamReader = gcnew System::IO::StreamReader(dataStream);
			StatusCode = (safe_cast<HttpWebResponse^>(ex->Response))->StatusCode;
			ResponseFromServer = ex->Message;
		}
		else
		{
			StatusCode = HttpStatusCode::ExpectationFailed;
			ResponseFromServer = "Неизвестная ошибка";
		}
	}
	catch (Exception ^ex)
	{
		StatusCode = HttpStatusCode::ExpectationFailed;
		ResponseFromServer = "Неизвестная ошибка";
	}
	Console::WriteLine("Response Code: " + StatusCode.ToString());
	Console::WriteLine("Response String: " + ResponseFromServer);
 
}

C#

POST request

using System;
using System.Text;
using System.Web;
using System.Net;
using System.Security.Cryptography;
using System.IO;
namespace apice
{
    class Program
    {
        private static string HashHMAC(string key, string message)
        {
            System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
            byte[] keyByte = encoding.GetBytes(key);
 
            HMACSHA256 hmacsha256 = new HMACSHA256(keyByte);
 
            byte[] messageBytes = encoding.GetBytes(message);
            byte[] hashmessage = hmacsha256.ComputeHash(messageBytes);
            return ByteArrayToString(hashmessage);
        }
 
        public static string ByteArrayToString(byte[] ba)
        {
            StringBuilder hex = new StringBuilder(ba.Length * 2);
            foreach (byte b in ba)
                hex.AppendFormat("{0:x2}", b);
            return hex.ToString();
        }
        public static string http_build_query(String formdata ){
            string str = formdata.Replace("/", "%2F");
            str = str.Replace("@", "%40");
            str = str.Replace(";", "%3B");
            return str;
        }
 
        static void Main(string[] args)
        {
            string ApiKey = "gJx7Wa7qXkPtmTAaK3ADCtr6m5rCYYMy";
            string SecretKey = "8eLps29wsXszNyEhOl9w8dxsOsM2lTzg";
            string param = http_build_query("currencyPair=BTC/USD&price=60&quantity=0.01");
            string Sign = HashHMAC(SecretKey, param).ToUpper();
            string uri = "https://api.livecoin.net/exchange/buylimit";
            string ResponseFromServer = "";
            HttpStatusCode StatusCode;
            byte[] bytes = Encoding.UTF8.GetBytes(param);
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
            request.Method = "POST";
            request.ContentType = "application/x-www-form-urlencoded";
            request.ContentLength = bytes.Length;
            request.Headers["Api-Key"] = ApiKey;
            request.Headers["Sign"] = Sign;
            Stream dataStream = request.GetRequestStream();
            dataStream.Write(bytes, 0, bytes.Length);
          try{
            WebResponse WebResponse = request.GetResponse();
            dataStream = WebResponse.GetResponseStream();
            StreamReader StreamReader = new StreamReader(dataStream);
            ResponseFromServer = StreamReader.ReadToEnd();
            dataStream.Close();
            WebResponse.Close();
            StatusCode = HttpStatusCode.OK;
          }
          catch (WebException ex)
          {
              if (ex.Response != null) {
                dataStream =ex.Response.GetResponseStream();
                StreamReader StreamReader = new StreamReader(dataStream);
                StatusCode = ((HttpWebResponse)ex.Response).StatusCode ;
                ResponseFromServer = ex.Message;
              }else{
                StatusCode = HttpStatusCode.ExpectationFailed;
                ResponseFromServer = "Неизвестная ошибка";
              }
          }
          catch (Exception ex){
              StatusCode = HttpStatusCode.ExpectationFailed;
              ResponseFromServer = "Неизвестная ошибка";
          }
          Console.WriteLine("Response Code: " + StatusCode);
          Console.WriteLine("Response String: " + ResponseFromServer);
 
        }
 
    }
}
 

GET request

using System;
using System.Text;
using System.Web;
using System.Net;
using System.Security.Cryptography;
using System.IO;
namespace apice
{
    class Program
    {
         static void Main(string[] args)
        {
            string param = "currencyPair=BTC/USD";
            string uri = "https://api.livecoin.net/exchange/ticker?";
            string ResponseFromServer = "";
            HttpStatusCode StatusCode;
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri + param);
            request.Method = "GET";
            request.ContentType = "application/x-www-form-urlencoded";
            Stream dataStream;
            try
            {
                WebResponse WebResponse = request.GetResponse();
                dataStream = WebResponse.GetResponseStream();
                StreamReader StreamReader = new StreamReader(dataStream);
                ResponseFromServer = StreamReader.ReadToEnd();
                dataStream.Close();
                WebResponse.Close();
                StatusCode = HttpStatusCode.OK;
            }
            catch (WebException ex)
            {
                if (ex.Response != null)
                {
                    dataStream = ex.Response.GetResponseStream();
                    StreamReader StreamReader = new StreamReader(dataStream);
                    StatusCode = ((HttpWebResponse)ex.Response).StatusCode;
                    ResponseFromServer = ex.Message;
                }
                else
                {
                    StatusCode = HttpStatusCode.ExpectationFailed;
                    ResponseFromServer = "Неизвестная ошибка";
                }
            }
            catch (Exception ex)
            {
                StatusCode = HttpStatusCode.ExpectationFailed;
                ResponseFromServer = "Неизвестная ошибка";
            }
            Console.WriteLine("Response Code: " + StatusCode);
            Console.WriteLine("Response String: " + ResponseFromServer);
 
        }
 
    }
}
 

VB.NET

POST request

Imports System
Imports System.Data
Imports System.Net
Imports System.IO
Imports System.Security.Cryptography
Imports System.Text
Imports System.Web
Module Module1
 
    Sub Main()
        Dim Uri As String
        Dim param As String
        Dim statuscode As HttpStatusCode
        Dim dataStream As Stream = Nothing
        Dim StreamReader As StreamReader
        Dim ResponseFromServer As String
        Dim ApiKey As String
        Dim SecretKery As String
 
        Uri = "https://api.livecoin.net/exchange/buylimit"
        param = http_build_query("currencyPair=BTC/USD&price=60&quantity=1")
        ApiKey = "gJx7Wa7qXkPtmTAaK3ADCtr6m5rCYYMy"
        SecretKery = "gJx7Wa7qXkPtmTAaK3ADCtr6m5rCYYMy"
 
        Try
            Dim request As WebRequest = WebRequest.Create(Uri)
            request.Timeout = 120000
            request.Method = "POST"
 
            Dim byteArray As Byte() = System.Text.Encoding.UTF8.GetBytes(param)
 
            request.Headers.Add("Api-Key", ApiKey)
            request.Headers.Add("Sign", HashHMAC(SecretKery, param).ToUpper)
            request.ContentType = "application/x-www-form-urlencoded"
            request.ContentLength = byteArray.Length
            dataStream = request.GetRequestStream()
            dataStream.Write(byteArray, 0, byteArray.Length)
            dataStream.Close()
 
            Dim WebResponse As WebResponse = request.GetResponse()
            dataStream = WebResponse.GetResponseStream()
            StreamReader = New StreamReader(dataStream)
            responseFromServer = StreamReader.ReadToEnd()
            dataStream.Close()
            WebResponse.Close()
            statuscode = HttpStatusCode.OK
 
        Catch ex As WebException
            If ex.Response IsNot Nothing Then
                dataStream = ex.Response.GetResponseStream()
                Dim reader As New StreamReader(dataStream)
                statuscode = DirectCast(ex.Response, HttpWebResponse).StatusCode
                responseFromServer = ex.Message
            Else
                Dim resp As String = ""
                statuscode = HttpStatusCode.ExpectationFailed
                responseFromServer = "Неизвестная ошибка"
            End If
 
        Catch ex As Exception
            statuscode = HttpStatusCode.ExpectationFailed
            responseFromServer = "Неизвестная ошибка"
        End Try
        Console.WriteLine("Response Code: " & statuscode)
        Console.WriteLine("Response String: " & responseFromServer)
    End Sub
    Public Function http_build_query(formdata As String) As String
        http_build_query = formdata.Replace("/", "%2F")
        http_build_query = http_build_query.Replace("@", "%40")
        http_build_query = http_build_query.Replace(";", "%3B")
    End Function
    Public Function HashHMAC(key As String, message As String) As String
        Dim encoding As System.Text.UTF8Encoding
        Dim keyByte As Byte()
        Dim hmacsha256 As HMACSHA256
        Dim messageBytes As Byte()
        Dim hashmessage As Byte()
        encoding = New System.Text.UTF8Encoding()
        keyByte = encoding.GetBytes(key)
        hmacsha256 = New HMACSHA256(keyByte)
        messageBytes = encoding.GetBytes(message)
        hashmessage = hmacsha256.ComputeHash(messageBytes)
        Return ByteArrayToString(hashmessage)
    End Function
    Public Function ByteArrayToString(ba As Byte()) As String
        Dim hex As StringBuilder
        Dim b As Byte
        hex = New StringBuilder(ba.Length * 2)
        For Each b In ba
            hex.AppendFormat("{0:x2}", b)
        Next
        Return hex.ToString()
    End Function
 
End Module

GET request

Imports System
Imports System.Data
Imports System.Net
Imports System.IO
Imports System.Security.Cryptography
Imports System.Text
Imports System.Web
Module Module1
 
    Sub Main()
        Dim Uri As String
        Dim param As String
        Dim statuscode As HttpStatusCode
        Dim dataStream As Stream = Nothing
        Dim StreamReader As StreamReader
        Dim ResponseFromServer As String
 
        Uri = "https://api.livecoin.net/exchange/ticker?"
        param = "currencyPair=BTC/USD"
 
        Try
            Dim request As WebRequest = WebRequest.Create(Uri & param)
            request.Timeout = 120000
            request.Method = "GET"
            request.ContentType = "application/x-www-form-urlencoded"
            Dim WebResponse As WebResponse = request.GetResponse()
            dataStream = WebResponse.GetResponseStream()
            StreamReader = New StreamReader(dataStream)
            ResponseFromServer = StreamReader.ReadToEnd()
            dataStream.Close()
            WebResponse.Close()
            statuscode = HttpStatusCode.OK
 
        Catch ex As WebException
            If ex.Response IsNot Nothing Then
                dataStream = ex.Response.GetResponseStream()
                Dim reader As New StreamReader(dataStream)
                statuscode = DirectCast(ex.Response, HttpWebResponse).StatusCode
                responseFromServer = ex.Message
            Else
                Dim resp As String = ""
                statuscode = HttpStatusCode.ExpectationFailed
                responseFromServer = "Неизвестная ошибка"
            End If
 
        Catch ex As Exception
            statuscode = HttpStatusCode.ExpectationFailed
            responseFromServer = "Неизвестная ошибка"
        End Try
        Console.WriteLine("Response Code: " & statuscode)
        Console.WriteLine("Response String: " & responseFromServer)
    End Sub
 
End Module