NAV
cURL Node PHP Python Ruby Java

Introduction

This API allows interacting with decentralized exchange platform based on ESCB9 protocol via RESTful.
Each request must contain version API RESTful.
Each request must be sent on endpoint https://api.escb.exchange

Definitions

General information

Products and Instruments

A product is an asset that is tradable or paid out. A product might be a currency or a commodity or something else. For example, a product might be a US Dollar or a Bitcoin or Ethereum. Fees are denominated in products. (Products may also be referred to as assets in the API calls.)
An instrument is a pair of exchanged products (or fractions of them). For example, US Dollars and Ethereum, or Ethereum and Bitcoins. In conventional parlance, a stock or a bond is called an instrument, but implicit in that is the potential exchange of one product for another (stock for dollars).

Order Types










IdTypeDefinition
1 Market An order to buy or sell an instrument at the best available price. Contains no restrictions on price or time frame.
2 Limit An order to buy or sell a set amount of an instrument at a specified price or better. A limit order may not be executed if the price set is not met during the time that the order is open.
3 StopMarket An order to buy or sell only when an instrument reaches a set price. Once the instrument reaches this price, the order becomes a market order.
4 StopLimit An order to buy or sell only when an instrument reaches a set price. Once the instrument reaches this price, the order becomes a limit order to buy or sell at the limit price or better.
5 TrailingStopMarket An order that sets the stop price for an instrument at a price with a fixed offset relative to the market price. If the market moves and the stop price is reached, the order becomes a market order.
6 TrailingStopLimit An order that recalculates the stop price for an instrument at a fixed offset relative to the market price. It also recalculates the limit price based on a different fixed offset. If the market reaches the stop price, the order becomes a limit order.
7 BlockTrade A privately executed trade.

The Trading Day

ESCB exchange platform operates 24-hour computer-based trading venues. The trading day runs from UTC Midnight to UTC Midnight (essentially, London UK time, but without a summer offset). For values that comprise a per-day quantity (TotalDayDeposits, for example), the day runs from UTC Midnight to UTC Midnight, regardless of the venue’s nominal location.

Timing security

A SIGNED endpoint also requires a parameter, timestamp, to be sent which should be the millisecond timestamp of when the request was created and sent.
An additional parameter, recvWindow, may be sent to specify the number of milliseconds after timestamp the request is valid for. If recvWindow is not sent, it defaults to 5000.
The logic is as follows:

if (timestamp < (serverTime + 1000) && (serverTime - timestamp) <= recvWindow) {
// process request
} else {
// reject request
}

Serious trading is about timing. Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With recvWindow, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server.

It is recommended to use a small recvWindow of 5000 or less!

General requests

Test connectivity

Check connection with API endpoint and get server time.

Type: GET
Parameters:
none

curl "https://api.escb.exchange/v1/ping"
const EscbLib = require('escb_exchange');
EscbLib.ping();
include_once "escb_exchange.php";
$EscbLib = new EscbLib();
$EscbLib->ping();
from escb_exchange import EscbLib
EscbLib.ping()
require 'escb_exchange'
EscbLib::ping()
import exchange.escb.EscbLib;
EscbLib EscbLib = new EscbLib();
EscbLib.ping();

And the response will look like:

{ "status": "success",
"timestamp": "946684800000",
"data": {}
}

Authentication

Requests with authorization and without

ESCB exchange platform API expects for the API key to be included in all API requests to the server in a header that looks like the following:

X-API-Authorization: YOUR_API_KEY

If additionally, there demands to get an access for the certain user, ESCB exchange platform API expects for authToken and userId in all API requests to the server in a header. Those parameters can be obtained during the login process.

Get a token for requests which demands authorization

For authentication you must use a password in SHA-256 hash, prepared on the client side, username and YOUR_API_KEY, in which case your request would look like:

Type: POST
Parameters:
username - string, required
Username for profile.

password - string, required
Strong password for accessing to profile.

curl "https://api.escb.exchange/login"
-H "X-API-Authorization: YOUR_API_KEY"
-d "username=test&password=sha-256-password"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');

EscbLib.login("test", "sha-256-password");
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');

$EscbLib->login("test", "sha-256-password");
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')

EscbLib.login("test", "sha-256-password")
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')

EscbLib::login("test", "sha-256-password")
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');

EscbLib.login("test", "sha-256-password");

And the response will look like:

{ "status": "success",
"timestamp": "946684800000",
"data": {
"authToken": "f2KpRW7KeN9aPmjSZ",
"userId": "fbdpsNf4oHiX79vMJ"
}
}

You’ll need to save the userId and token on the client, for subsequent authenticated requests. Libraries will do it by default.

Logging Out

For logging a user out you have to send a request on logout endpoint. If successful, the auth token that is passed in the request header will be invalidated (removed from the user account), so it will not work in any subsequent requests.

Type: POST
Parameters:
none

curl "https://api.escb.exchange/logout"
-X "POST"
-H "X-API-Authorization: YOUR_API_KEY"
-H "X-Auth-Token: f2KpRW7KeN9aPmjSZ"
-H "X-User-Id: fbdpsNf4oHiX79vMJ"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.logout();
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
$EscbLib->logout();
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib.logout()
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib::logout()
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.logout();

And the response will look like:

{ "status": "success",
"timestamp": "946684800000",
"data": {
"userId": "fbdpsNf4oHiX79vMJ"
}
}

Authenticated Calls

For any endpoints that require the default authentication, you must include the userId and authToken with each request under the following headers:

curl "http://api.escb.exchange/v1/cancelallorders"
-H "X-API-Authorization: YOUR_API_KEY"
-H "X-Auth-Token: f2KpRW7KeN9aPmjSZ"
-H "X-User-Id: fbdpsNf4oHiX79vMJ"

User profile

Get user profile

This API method return profile fields for the current logged in user.

Type: GET
Parameters:
none

curl "http://api.escb.exchange/v1/userprofile"
-X "GET"
-H "X-API-Authorization: YOUR_API_KEY"
-H "X-Auth-Token: f2KpRW7KeN9aPmjSZ"
-H "X-User-Id: fbdpsNf4oHiX79vMJ"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.getProfile();
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
$EscbLib->getProfile();
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib.getProfile()
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib::getProfile()
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.getProfile();

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": {
"UserId": 1,
"UserName": "John Smith",
"Email": "[email protected]",
"AffiliateId": 1,
"RefererId": 1,
"CreatedAt": "946684800000",
"UseOTP": 1,
"UseWhiteListIP": 1,
"Telegram": "tonnyking",
"LoginHistory": [
{"Device": "Android",
"FingerPrint": "16fdjd34348621djhewr",
"TimeStamp": "946684800000"
}
],
"VerificationLevel": 1
}
}













NameTypeValue
UserId string ID number of the user whose information is being set.
UserName string Log-in name of the user; “jsmith”.
Email string Email address of the user; “[email protected]“.
AffiliatedId integer The ID of an affiliated entity, if the user comes from an affiliated link. This is set to 0 if the user it not associated with an affiliated entity.
RefererId integer Captures the ID of the person who referred this account member to the trading venue, usually for marketing purposes. Returns 0 if no referrer.
CreatedAt integer Time in milliseconds when this profile was created.
UseOTP boolean True if the user must use two-factor authentication; false if the user does not need to use two-factor authentication. Defaults to false.
UseWhiteListIP integer True if the user enables checking ip address for new login attempt. Defaults to false.
Telegram string Telegram username for receiving notifications.
LoginHistory array of objects Each object has properties: Device, FingerPrint, TimeStamp for each log in event.
VerificationLevel integerVerification level ID (how much verification does this account require) defined by and set by the trading venue for this account.

Get trades

Requests the details on up to 200 past trade executions for the current profile starting at index i, where i is an integer identifying a specific execution in reverse order; that is, the most recent execution has an index of 0, and increments by one as trade executions recede into the past.
The trading venue determines how long to retain an accessible trading history before archiving.

Type: GET
Parameters:
StartIndex - integer
The starting index into the history of trades, from 0 (the most recent trade).

Count - integer
The number of trades to return. The system can return up to 200 trades.

curl "http://api.escb.exchange/v1/gettrades"
-X "GET"
-H "X-API-Authorization: YOUR_API_KEY"
-H "X-Auth-Token: f2KpRW7KeN9aPmjSZ"
-H "X-User-Id: fbdpsNf4oHiX79vMJ"
-d "..."
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
const data = ...;
*/
EscbLib.GetTrades(data);
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
/*
$data = ...;
*/
$EscbLib->GetTrades($data);
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
/*
data = ...;
*/
EscbLib.GetTrades(data)
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
#data = ...;
EscbLib::GetTrades(data)
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
data = ...;
*/
EscbLib.GetTrades(data);

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": [
{
"Fee": 0,
"FeeProductSymbol": 0,
"ExecutionId": 1,
"TradeId": 1,
"OrderId": "wqueyiefw",
"ClientOrderId": 0,
"InstrumentSymbol": "BTC_USD",
"Side": "Buy",
"Quantity": 1,
"RemainingQuantity": 0,
"Price": 100,
"Value": 100,
"TradeTime": 1501354796406,
"OrderTradeRevision": 1,
"Direction": "NoChange",
"IsBlockTrade": false
},
{
"Fee": 0,
"FeeProductSymbol": 0,
"ExecutionId": 3,
"TradeId": 2,
"OrderId": "kljkerdff",
"ClientOrderId": 0,
"InstrumentSymbol": "BTC_SC",
"Side": "Buy",
"Quantity": 1,
"RemainingQuantity": 0,
"Price": 1,
"Value": 1,
"TradeTime": 1501354796418,
"OrderTradeRevision": 1,
"Direction": "NoChange",
"IsBlockTrade": false
}
]
}


















NameTypeValue
Fee real The fee for this trade in units and fractions of units (a $10 USD fee would be 10.00, a .5-BitCoin fee would be 0.5)
FeeProductSymbol integer The Symbol of the product that denominates the fee. Product types will vary on each trading venue. See GetProduct.
ExecutionId integer The ID of this account’s side of the trade. Every trade has two sides.
TradeId integer The ID of the overall trade.
OrderId string The ID of the order causing the trade.
InstrumentSymbol integer The Symbol of the instrument being traded. See Products and Instruments above for the difference. See GetInstrument to find information about this instrument by its Symbol.
Side string Buy or Sell. Buy, Sell
Quantity real The unit quantity of the trade.
RemainingQuantity real The number of units remaining to be traded by the order after this execution. This number is not revealed to the other party in the trade. This value is also known as “leave size” or “leave quantity”.
Price real The unit price at which the instrument traded.
Value real The total value of the deal. The system calculates this as: unit price X quantity executed.
TradeTime integer The time at which the trade took place, in milliseconds.
Value real The total value of the deal. The system calculates this as: unit price X quantity executed.
OrderTradeRevision integerThis value increments if the trade has changed. Default is 1. For example, if the trade busts (fails to conclude), the trade will need to be modified and a revision number then will apply.
Direction stringShows if this trade has moved the book price up, down, or no change. Values: NoChange, UpTick, DownTick
IsBlockTrade BooleanReturns true if the trade was a reported trade; false otherwise.

Get transactions

Returns a list of transactions for the current profile. The trading venue determines how long to retain order history before archiving.

Type: GET
Parameters:
Depth - integer
The number of transactions that will be returned, starting with the most recent transaction.

curl "http://api.escb.exchange/v1/gettransactions"
-X "GET"
-H "X-API-Authorization: YOUR_API_KEY"
-H "X-Auth-Token: f2KpRW7KeN9aPmjSZ"
-H "X-User-Id: fbdpsNf4oHiX79vMJ"
-d "Depth=10"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
const data = ...;
*/
EscbLib.GetTransactions(data);
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
/*
$data = ...;
*/
$EscbLib->GetTransactions($data);
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
/*
data = ...;
*/
EscbLib.GetTransactions(data)
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
#data = ...;
EscbLib::GetTransactions(data)
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
data = ...;
*/
EscbLib.GetTransactions(data);

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": [
{"TransactionId": "dfjhkj3243",
"Credit": 0,
"Debit": 0,
"TransactionType": "Fee",
"ReferenceId": 0,
"ReferenceType": "Trade",
"ProductSymbol": 0,
"Balance": 0,
"TimeStamp": 0,
}
]
}











NameTypeValue
TransactionId string The ID of the transaction.
Credit real Credit entry for the account on the order book. Funds entering an account.
Debit real Debit entry for the account on the order book. Funds leaving an account.
TransactionType string One of: Fee — transaction is payment of a fee, Trade — transaction is a trade (most usual entry), Other — non-trading transactions such as deposits and withdrawals, Reverse — a hold has been reversed by this transaction, Hold — funds are held while a transaction closes
ReferenceId string The ID of the action or event that triggered this transaction.
ReferenceType string The type of action or event that triggered this transaction. One of: Trade, Deposit, Withdraw, Transfer, OrderHold, WithdrawHold, DepositHold, MarginHold
ProductSymbol string The Symbol of the product on this account’s side of the transaction. For example, in a dollars-for-Bitcoin transaction, one side will have the product Dollar and the other side will have the product Bitcoin. See Products and Instruments for more information about how these two items differ. Use GetProduct to return information about a product based on its ID.
Balance real The balance in the account after the transaction.
TimeStamp integer Time at which the transaction took place, in milliseconds.

Products

Get products

Returns an array of products available on the trading venue. A product is an asset that is tradable or paid out. For more information about the difference between products and instruments, see Products and Instruments above.

Type: GET
Parameters:
none

curl "http://api.escb.exchange/v1/getproducts"
-X "GET"
-H "X-API-Authorization: YOUR_API_KEY"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.GetProducts();
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
$EscbLib->GetProducts();
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib.GetProducts()
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib::GetProducts()
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.GetProducts();

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": [
{"ProductSymbol": "USD",
"ProductFullName": "",
"ProductType": "NationalCurrency",
"DecimalPlaces": 100,
"TickSize": 1,
"NoFees": false,
}
]
}








NameTypeValue
ProductSymbol string The Symbol of the product.
ProductFullName string Full and official name of the product. For example, New Zealand Dollar.
ProductType string The nature of the product. One of: NationalCurrency, CryptoCurrency, Contract
DecimalPlaces integer The number of decimal places in which the product is divided. For example, US Dollars are divided into 100 units, or 2 decimal places. Other products may be different. Burundi Francs use 0 decimal places and the Rial Omani uses 3.
TickSize integer Minimum tradable quantity of the product. See also GetInstrument, where this value is called QuantityIncrement. For example, with a US Dollar, the minimal tradable quantity is $0.01.
NoFees boolean Shows whether trading the product incurs fees. The default is false; that is, if NoFees is false, fees will be incurred. If NoFees is true, no fees are incurred.

Get product

Retrieves the details about a specific product on the trading venue. A product is an asset that is tradable or paid out. See Products and Instruments above for more information about the difference between these two items.

Type: GET
Parameters:
ProductSymbol - integer
The Symbol of the product (often a currency).

curl "http://api.escb.exchange/v1/getproduct"
-X "GET"
-H "X-API-Authorization: YOUR_API_KEY"
-d "ProductSymbol=BTC"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
const data = ...;
*/
EscbLib.GetProduct(data);
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
/*
$data = ...;
*/
$EscbLib->GetProduct($data);
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
/*
data = ...;
*/
EscbLib.GetProduct(data)
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
#data = ...;
EscbLib::GetProduct(data)
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
data = ...;
*/
EscbLib.GetProduct(data);

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": {
"ProductSymbol": "BTC",
"ProductFullName": "Bitcoin",
"ProductType": "CryptoCurrency",
"DecimalPlaces": 0,
"TickSize": 0,
"NoFees": false,
}
}








NameTypeValue
ProductSymbol string The Symbol of the product.
ProductFullName string Full and official name of the product. For example, New Zealand Dollar.
ProductType string The nature of the product. One of: NationalCurrency, CryptoCurrency, Contract
DecimalPlaces integer The number of decimal places in which the product is divided. For example, US Dollars are divided into 100 units, or 2 decimal places. Other products may be different. Burundi Francs use 0 decimal places and the Rial Omani uses 3.
TickSize integer Minimum tradable quantity of the product. See also GetInstrument, where this value is called QuantityIncrement. For example, with a US Dollar, the minimal tradable quantity is $0.01.
NoFees boolean Shows whether trading the product incurs fees. The default is false; that is, if NoFees is false, fees will be incurred. If NoFees is true, no fees are incurred.

Instruments

Get Instruments

Retrieves an array of instrument objects describing all instruments available on a trading venue to the user. An instrument is a pair of exchanged products (or fractions of them) such as US dollars and Bitcoin. See Products and Instruments above for more information about how products and instruments differ.

Type: GET
Parameters:
none

curl "http://api.escb.exchange/v1/getinstruments"
-X "GET"
-H "X-API-Authorization: YOUR_API_KEY"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.GetInstruments();
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
$EscbLib->GetInstruments();
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib.GetInstruments()
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib::GetInstruments()
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.GetInstruments();

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": [
{
"InstrumentSymbol": "",
"Product1Symbol": "",
"Product2Symbol": "",
"SessionStatus": "Running",
"PreviousSessionStatus": "Stopped",
"SessionStatusDateTime": "986684800000",
"QuantityIncrement": 0,
}
]
}









NameTypeValue
InstrumentSymbol string The Symbol of the instrument.
Product1Symbol string The symbol for Product 1 on the trading venue. For example, USD.
Product2Symbol string The symbol for Product 1 on the trading venue. For example, BTC.
SessionStatus string Is the market for this instrument currently open and operational? Returns one of: Running, Paused, Stopped, Starting
PreviousSessionStatus string What was the previous session status for this instrument? One of: Running, Paused, Stopped, Starting
SessionStatusDateTime integer The time and date at which the session status was reported in milliseconds.
QuantityIncrement integer The number of decimal places for the smallest quantity of the instrument that can trade (analogous to smallest lot size). For example, the smallest increment of a US Dollar that can trade is 0.01 (one cent, or 2 decimal places). The default is 0.

Get instrument

Retrieves the details of a specific instrument from the trading venue. An instrument is a pair of exchanged products (or fractions of them) such as US dollars and Bitcoin. See Products and Instruments above for more information about how products and instruments differ.

Type: GET
Parameters:
InstrumentSymbol - string
The ID of the instrument.

curl "http://api.escb.exchange/v1/getinstrument"
-X "GET"
-H "X-API-Authorization: YOUR_API_KEY"
-d "InstrumentSymbol=BTC_USD"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
const data = ...;
*/
EscbLib.GetInstrument(data);
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
/*
$data = ...;
*/
$EscbLib->GetInstrument($data);
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
/*
data = ...;
*/
EscbLib.GetInstrument(data)
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
#data = ...;
EscbLib::GetInstrument(data)
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
data = ...;
*/
EscbLib.GetInstrument(data);

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": {
"InstrumentSymbol": "BTC_SC",
"Product1Symbol": "BTC",
"Product2Symbol": "SC",
"SessionStatus": "Running",
"PreviousSessionStatus": "Paused",
"SessionStatusDateTime": "996684800000",
"QuantityIncrement": 0,
}
}









NameTypeValue
Symbol string The Symbol of the instrument.
Product1Symbol string The symbol for Product 1 on the trading venue. For example, USD.
Product2Symbol string The symbol for Product 1 on the trading venue. For example, BTC.
SessionStatus string Is the market for this instrument currently open and operational? Returns one of: Running, Paused, Stopped, Starting
PreviousSessionStatus string What was the previous session status for this instrument? One of: Running, Paused, Stopped, Starting
SessionStatusDateTime integer The time and date at which the session status was reported in milliseconds.
QuantityIncrement integer The number of decimal places for the smallest quantity of the instrument that can trade (analogous to smallest lot size). For example, the smallest increment of a US Dollar that can trade is 0.01 (one cent, or 2 decimal places). Current maximum is 18 decimal places. The default is 0.

Orders

This API methods allow interacting with orders.

Send order

Creates an order. Anyone submitting an order should also subscribe to the various market data and event feeds, or call GetOpenOrders or GetOrderStatus to monitor the status of the order. If the order is not in a state to be executed, GetOpenOrders will not return it.

Type: POST
Parameters:
ClientOrderId - string
A user-assigned ID for the order (like a purchase-order number assigned by a company). This ID is useful for recognizing future states related to this order. ClientOrderId defaults to 0.

Quantity - real
The quantity of the instrument being ordered.

LimitPrice - real
The price at which to execute the order, if the order is a Limit order.

OrderIdOCO - integer
One Cancels the Other — If this order is order A, OrderIdOCO refers to the order ID of an order B (which is not the order being created by this call). If order B executes, then order A created by this call is canceled. You can also set up order B to watch order A in the same way, but that may require an update to
order B to make it watch this one, which could have implications for priority in the order book. See CancelReplaceOrder and ModifyOrder.

OrderType - string
The type of this order, as expressed in integer format. See Order Types above for an explanation of each type. One of: Market, Limit, StopMarket, StopLimit, TrailingStopMarket, TrailingStopLimit, BlockTrade.

PegPriceType - string
When entering a stop/trailing order, set PegPriceType to an integer that corresponds to the type of price that pegs the stop: Last, Bid, Ask, Midpoint

InstrumentSymbol - string
The Symbol of the instrument being traded in the order.

TrailingAmount - real
The offset by which to trail the market in one of the trailing order types. Set this to the current price of the market to ensure that the trailing offset is the amount intended in a fast-moving market. See Order Types above.

LimitOffset - real
The amount by which a trailing limit order is offset from the activation price.

Side - integer
The side of the trade represented by this order. One of: Buy, Sell

StopPrice - real
The price at which to execute the order, if the order is a Stop order (either buy or sell).

TimeInForce - string
The period during which the order is executable. GTC good ’til canceled, IOC immediate or cancelled, FOK fill or kill — fill the order immediately, or cancel it immediately.

curl "http://api.escb.exchange/v1/sendorder"
-X "POST"
-H "X-API-Authorization: YOUR_API_KEY"
-H "X-Auth-Token: f2KpRW7KeN9aPmjSZ"
-H "X-User-Id: fbdpsNf4oHiX79vMJ"
-d "..."
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
const data = ...;
*/
EscbLib.SendOrder(data);
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
/*
$data = ...;
*/
$EscbLib->SendOrder($data);
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
/*
data = ...;
*/
EscbLib.SendOrder(data)
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
#data = ...;
EscbLib::SendOrder(data)
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
data = ...;
*/
EscbLib.SendOrder(data);

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": {
"OrderId": "jfhweiuriu"
}
}



NameTypeValue
OrderId string The ID assigned to the order by the server. This allows you to track the order.

Modify order

Reduces an order’s quantity without losing priority in the order book. An order’s quantity can only
be reduced. The other call that can modify an order — CancelReplaceOrder — resets order book
priority, but you can use it to increase an order.

Type: POST
Parameters:
OrderId - string
The ID of the Order Management System where the original order was placed.

InstrumentSymbol - string
The Symbol of the instrument traded in the order

PreviousOrderRevision - integer
The order revision number at the time you make the modification order. This ensures that you have the latest order state at the time you make the request.

Quantity - real
The new quantity of the order. This value can only be reduced from a previous quantity.

curl "http://api.escb.exchange/v1/modifyorder"
-X "POST"
-H "X-API-Authorization: YOUR_API_KEY"
-H "X-Auth-Token: f2KpRW7KeN9aPmjSZ"
-H "X-User-Id: fbdpsNf4oHiX79vMJ"
-d "..."
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
const data = ...;
*/
EscbLib.ModifyOrder(data);
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
/*
$data = ...;
*/
$EscbLib->ModifyOrder($data);
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
/*
data = ...;
*/
EscbLib.ModifyOrder(data)
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
#data = ...;
EscbLib::ModifyOrder(data)
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
data = ...;
*/
EscbLib.ModifyOrder(data);

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": {
}
}

Cancel order

Cancels an open order that has been placed but has not yet been executed.

Type: POST
Parameters:
ClientOrderId - string, conditionally optional
A user-assigned ID for the order (like a purchase-order number assigned by a company). ClientOrderId defaults to 0.

OrderId - string, conditionally optional
The order to be cancelled.

curl "http://api.escb.exchange/v1/cancelorder"
-X "POST"
-H "X-API-Authorization: YOUR_API_KEY"
-H "X-Auth-Token: f2KpRW7KeN9aPmjSZ"
-H "X-User-Id: fbdpsNf4oHiX79vMJ"
-d "OrderId=fgh34723dhgweu"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.cancelOrder("fgh34723dhgweu");
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
$EscbLib->cancelOrder("fgh34723dhgweu");
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib.cancelOrder("fgh34723dhgweu")
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib::cancelOrder("fgh34723dhgweu")
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.cancelOrder("fgh34723dhgweu");

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": {
}
}

Cancel replace order

CancelReplaceOrder is single API call that both cancels an existing order and replaces it with a new order. Canceling one order and replacing it with another also cancels the order’s priority in the order book. You can use ModifyOrder to preserve priority in the book; but ModifyOrder only allows a reduction in order quantity.

Type: POST
Parameters:
OrderIdToReplace - string
The ID of the order to replace with this order.

ClientOrderId - string, defaults 0
A user-assigned ID for the new, replacement order (like a purchase-order number assigned by a company). This ID is useful for recognizing future states related to this order.

OrderType - string.
The type of the replacement order: See Order Types above.

Side - string
The side of the replacement order:

InstrumentSymbol - string
The Symbol of the instrument being traded.

TrailingAmount - real
The offset by which to trail the market in one of the trailing order types. Set this to the current price of the market to ensure that the trailing offset is the amount intended in a fast-moving market.

LimitPrice - real
The price at which to execute the new order, if the order is a Limit order.

StopPrice - real
The price at which to execute the new order, if the order is a Stop order (either buy or sell).

PegPriceType - string
When entering a stop/trailing order, set PegPriceType to the type of price that pegs the stop.

TimeInForce - string
The period during which the new order is executable.

OrderIdOCO - string
One Cancels the Other — If the order being canceled in this call is order A, and the order replacing order A in this call is order B, then OrderIdOCO refers to an order C that is currently open. If order C executes, then order B is canceled. You can also set up order C to watch order B in this way, but that will require an update to order C.

Quantity - real
The amount of the order (buy or sell).

curl "http://api.escb.exchange/v1/cancelreplaceorder"
-X "POST"
-H "X-API-Authorization: YOUR_API_KEY"
-H "X-Auth-Token: f2KpRW7KeN9aPmjSZ"
-H "X-User-Id: fbdpsNf4oHiX79vMJ"
-d "..."
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
const data = ...;
*/
EscbLib.CancelReplaceOrder(data);
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
/*
$data = ...;
*/
$EscbLib->CancelReplaceOrder($data);
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
/*
data = ...;
*/
EscbLib.CancelReplaceOrder(data)
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
#data = ...;
EscbLib::CancelReplaceOrder(data)
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
data = ...;
*/
EscbLib.CancelReplaceOrder(data);

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": {
"ReplacementOrderId": 1234,
"ReplacementClOrdId": 1561,
"OrigOrderId": 5678,
"OrigClOrdId": 91011
}
}






NameTypeValue
ReplacementOrderId string The order ID assigned to the replacement order by the server.
ReplacementClOrdId string Echoes the contents of the ClientOrderId value from the request.
OrigOrderId string Echoes OrderIdToReplace, which is the original order you are replacing.
OrigClOrdId string Provides the client order ID of the original order (not specified in the requesting call).

Cancel all orders

Cancels all open matching orders for the specified instrument.

Type: POST
Parameters:
InstrumentSymbol - string, conditionally optional
The Symbol of the instrument for which all orders are being cancelled.

curl "http://api.escb.exchange/v1/cancelallorders"
-X "POST"
-H "X-API-Authorization: YOUR_API_KEY"
-H "X-Auth-Token: f2KpRW7KeN9aPmjSZ"
-H "X-User-Id: fbdpsNf4oHiX79vMJ"
-d "InstrumentSymbol=BTC_USD"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.cancelAllOrders(1);
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
$EscbLib->cancelAllOrders(1);
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib.cancelAllOrders(1)
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib::cancelAllOrders(1)
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.cancelAllOrders(1);

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": {
}
}

Get open orders

Returns an array of 0 or more orders that have not yet been filled (open orders) for a single account for a given user on a specific Order Management System. The call returns an empty array if a user has no open orders.

Type: GET
Parameters:
StartIndex - integer
The starting index into the history of open orders, from 0 (the most recent opened orders).

Count - integer
The number of orders to return. The system can return up to 200 orders.

curl "http://api.escb.exchange/v1/getopenorders"
-X "POST"
-H "X-API-Authorization: YOUR_API_KEY"
-H "X-Auth-Token: f2KpRW7KeN9aPmjSZ"
-H "X-User-Id: fbdpsNf4oHiX79vMJ"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.GetOpenOrders();
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
$EscbLib->GetOpenOrders();
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib.GetOpenOrders()
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib::GetOpenOrders()
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.GetOpenOrders();

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": [
{"Side": "Buy",
"OrderId": "dfgd347dfgj",
"Price": 100,
"Quantity": 1,
"Instrument": 1,
"OrderType": "Limit",
"ClientOrderId": "order_1_22",
"OrderState": "Working",
"ReceiveTime": 1501354241987,
"OrigQuantity": 1,
"QuantityExecuted": 0,
"ChangeReason": "NewInputAccepted",
"OrigOrderId": "fkgjhl34",
"OrigClOrdId": "order_1_21",
"InsideAsk": 9223372036.854775807,
"InsideAskSize": 0,
"InsideBid": 100,
"InsideBidSize": 1,
"LastTradePrice": 0,
"RejectReason": "",
"IsLockedIn": false
},
{
"Side": "Sell",
"OrderId": "dfgskdjhfg",
"Price": 150,
"Quantity": 1,
"Instrument": 1,
"OrderType": "Limit",
"ClientOrderId": 0,
"OrderState": "Working",
"ReceiveTime": 1501354246718,
"OrigQuantity": 1,
"QuantityExecuted": 0,
"ChangeReason": "NewInputAccepted",
"OrigOrderId": "lklkjuewr",
"OrigClOrdId": 0,
"InsideAsk": 150,
"InsideAskSize": 1,
"InsideBid": 100,
"InsideBidSize": 1,
"LastTradePrice": 0,
"RejectReason": "",
"IsLockedIn": false,
}
]
}




















NameTypeValue
Side string The open order can be Buy or Sell. Buy, Sell
OrderId string The ID of the open order. The OrderID is unique in each Order Management System.
Price real The price at which the buy or sell has been ordered.
Quantity real The quantity to be bought or sold.
Instrument integer ID of the instrument being traded. See GetInstruments.
OrderType string There are currently seven types of order. See Order Types above.
ClientOrderId string A user-assigned ID for the order (like a purchase-order number assigned by a company). ClientOrderId defaults to 0.
OrderState string The current condition of the order. There are five order states: Working, InProcess, Rejected, Canceled, Expired, FullyExecuted
ReceiveTime integer The time at which the system received the order, in milliseconds.
OrigQuantity integer Original quantity of the order. The quantity of the actual execution may be lower than this number, but OrigQuantity shows the quantity in the order as placed.
QuantityExecuted integer The number of units executed in this trade.
ChangeReason string The reason that an order has been changed. Values: NewInputAccepted, NewInputRejected, OtherRejected, Expired, Trade, SystemCanceled_NoMoreMarket, SystemCanceled_BelowMinimum, NoChange, UserModified
OrigOrderId string ID of the original order. This number is also appended to CancelReplaceOrder. See CancelReplaceOrder.
InsideAsk/InsideBid real Best price available at time of entry (for ask or bid, respectively).
InsideAskSize/InsideBidSize real Quantity available at the best inside ask (or bid) price.
LastTradePrice real Last trade price for this product before this order was entered.
RejectReason string If this order was rejected, RejectReason holds the reason for the rejection.
IsLockedIn boolean True if both parties to a block trade agree that one party will report the trade for both. Otherwise false.

Get order fee

Returns an estimate of the fee for a specific order and order type. Fees are set and calculated by the trading venue.

Type: GET
Parameters:
InstrumentSymbol - string
The proposed instrument against which a trading fee would be charged.

ProductSymbol - string
The ID of the product (currency) in which the fee will be denominated.

Amount - real
The quantity of the proposed trade for which the Order Management System would charge a fee.

Price - real
The price at which the proposed trade would take place. Supply your price for a limit order; the exact price is difficult to know before execution.

OrderType - string
The type of the proposed order. One of: Market, Limit, StopMarket, StopLimit, TrailingStopMarket, TrailingStopLimit, BlockTrade. See Order Types above.

MakerTaker - string
Depending on the venue, there may be different fees for a maker (the order remains on the books for a period) or taker (the order executes directly). If the user places a large order that is only partially filled, he is a partial maker. Maker, Taker

curl "http://api.escb.exchange/v1/getorderfee"
-X "POST"
-H "X-API-Authorization: YOUR_API_KEY"
-H "X-Auth-Token: f2KpRW7KeN9aPmjSZ"
-H "X-User-Id: fbdpsNf4oHiX79vMJ"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
const data = ...;
*/
EscbLib.GetOrderFee(data);
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
/*
$data = ...;
*/
$EscbLib->GetOrderFee($data);
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
/*
data = ...;
*/
EscbLib.GetOrderFee(data)
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
#data = ...;
EscbLib::GetOrderFee(data)
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
data = ...;
*/
EscbLib.GetOrderFee(data);

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": {
"OrderFee": 0.01,
"ProductSymbol": "ETH"
}
}




NameTypeValue
OrderFee real The estimated fee for the trade as described.
ProductSymbol string The Symbol of the product (currency) in which the fee is denominated.

Get order status

Retrieves the status information for a single order.

Type: GET
Parameters:
OrderId - string
The ID of the order whose status will be returned.

curl "http://api.escb.exchange/v1/getorderstatus"
-X "GET"
-H "X-API-Authorization: YOUR_API_KEY"
-H "X-Auth-Token: f2KpRW7KeN9aPmjSZ"
-H "X-User-Id: fbdpsNf4oHiX79vMJ"
-d "..."
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
const data = ...;
*/
EscbLib.GetOrderStatus(data);
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
/*
$data = ...;
*/
$EscbLib->GetOrderStatus($data);
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
/*
data = ...;
*/
EscbLib.GetOrderStatus(data)
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
#data = ...;
EscbLib::GetOrderStatus(data)
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
data = ...;
*/
EscbLib.GetOrderStatus(data);

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": {
"Side": "Sell",
"OrderId": "sdjhfkaeuryer",
"Price": 0,
"Quantity": 0,
"Instrument": 0,
"OrderType": "TrailingStopLimit",
"ClientOrderId": 0,
"OrderState": "Canceled",
"ReceiveTime": 0,
"OrigQuantity": 0,
"QuantityExecuted": 0,
"ChangeReason": "SystemCanceled_BelowMinimum",
"OrigOrderId": "pqweqw",
"OrigClOrdId": 0,
"InsideAsk": 0,
"InsideAskSize": 0,
"InsideBid": 0,
"InsideBidSize": 0,
"LastTradePrice": 0,
"RejectReason": "",
"IsLockedIn": false,
}
}























NameTypeValue
Side string One of: Buy, Sell.
OrderId string The ID of this order.
Price real Price of the order.
Quantity real Quantity of the order.
Instrument integer The ID of the instrument being ordered.
OrderType string One of: Market, Limit, StopMarket, StopLimit, TrailingStopMarket, TrailingStopLimit, BlockTrade. See Order Types above.
ClientOrderId string A user-assigned ID for the order (like a purchase-order number assigned by a company). ClientOrderId defaults to 0.
OrderState string One of: Working, InProcess, Rejected, Canceled, Expired, FullyExecuted. An open order will probably not yet be fully executed.
ReceiveTime integer The time at which the system received the quote, in milliseconds.
OrigQuantity real If the order has been changed, this value shows the original quantity.
QuantityExecuted real This value states the quantity that was executed in the order. It may be the same as the quantity of the order; it may be different.
ChangeReason string If the order has been changed, this value shows the reason. One of: NewInputAccepted, NewInputRejected, OtherRejected, Expired, Trade, SystemCanceled_NoMoreMarket, SystemCanceled_BelowMinimum, NoChange, UserModified
OrigOrderId string If the order has been changed, shows the original order ID.
OrigClOrdId integer If the order has been changed, shows the original client order ID, a value that the client can create (much like a purchase order).
InsideAsk real Best Ask price available at time of entry (generally available to market makers).
InsideAskSize real Quantity available at the best inside ask price (generally available to market makers).
InsideBid real Best Bid price available at time of entry (generally available to market makers).
InsideBidSize real Quantity available at the best inside Bid price (generally available to market makers).
LastTradePrice real The price at which the instrument last traded.
RejectReason string If the order was rejected, this string value holds the reason.
IsLockedIn boolean True if both parties to a block trade agree that one party will report the trade for both. Otherwise false.

Get order history

Returns a complete list of all orders, both open and executed, for the current account.

Type: GET
Parameters:
StartIndex - integer
The starting index into the history of trades, from 0 (the most recent trade).

Count - integer
The number of trades to return. The system can return up to 200 trades.

curl "http://api.escb.exchange/v1/getorderhistory"
-X "POST"
-H "X-API-Authorization: YOUR_API_KEY"
-H "X-Auth-Token: f2KpRW7KeN9aPmjSZ"
-H "X-User-Id: fbdpsNf4oHiX79vMJ"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.GetOrderHistory();
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
$EscbLib->GetOrderHistory();
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib.GetOrderHistory()
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib::GetOrderHistory()
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.GetOrderHistory();

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": [
{"Side": "Buy",
"OrderId": "iuqemnff",
"Price": 0,
"Quantity": 0,
"Instrument": 0,
"OrderType": "StopMarket",
"ClientOrderId": 0,
"OrderState": "Working",
"ReceiveTime": 0,
"ReceiveTimeTicks": 0,
"OrigQuantity": 0,
"QuantityExecuted": 0,
"ChangeReason": "NewInputRejected",
"OrigOrderId": "jhhjqwgeyu",
"OrigClOrdId": 0,
"InsideAsk": 0,
"InsideAskSize": 0,
"InsideBid": 0,
"InsideBidSize": 0,
"LastTradePrice": 0,
"RejectReason": "",
"IsLockedIn": false,
}
]
}























NameTypeValue
Side string One of: Buy, Sell.
OrderId string The ID of this order.
Price real Price of the order.
Quantity real Quantity of the order.
Instrument integer The ID of the instrument being ordered.
OrderType string One of: Market, Limit, StopMarket, StopLimit, TrailingStopMarket, TrailingStopLimit, BlockTrade. See Order Types above.
ClientOrderId string A user-assigned ID for the order (like a purchase-order number assigned by a company). ClientOrderId defaults to 0.
OrderState string One of: Working, InProcess, Rejected, Canceled, Expired, FullyExecuted. An open order will probably not yet be fully executed.
ReceiveTime integer The time at which the system received the quote, in milliseconds.
OrigQuantity real If the order has been changed, this value shows the original quantity.
QuantityExecuted real This value states the quantity that was executed in the order. It may be the same as the quantity of the order; it may be different.
ChangeReason string If the order has been changed, this value shows the reason. One of: NewInputAccepted, NewInputRejected, OtherRejected, Expired, Trade, SystemCanceled_NoMoreMarket, SystemCanceled_BelowMinimum, NoChange, UserModified
OrigOrderId string If the order has been changed, shows the original order ID.
OrigClOrdId integer If the order has been changed, shows the original client order ID, a value that the client can create (much like a purchase order).
InsideAsk real Best Ask price available at time of entry (generally available to market makers).
InsideAskSize real Quantity available at the best inside ask price (generally available to market makers).
InsideBid real Best Bid price available at time of entry (generally available to market makers).
InsideBidSize real Quantity available at the best inside Bid price (generally available to market makers).
LastTradePrice real The price at which the instrument last traded.
RejectReason string If the order was rejected, this string value holds the reason.
IsLockedIn boolean True if both parties to a block trade agree that one party will report the trade for both. Otherwise false.

Get order history by order id

Retrieves the full order history of a specific order by its order ID, including any changes.

Type: GET
Parameters:
OrderId - string
The ID of the order on the Order Management System

curl "http://api.escb.exchange/v1/getorderhistorybyorderid"
-X "GET"
-H "X-API-Authorization: YOUR_API_KEY"
-H "X-Auth-Token: f2KpRW7KeN9aPmjSZ"
-H "X-User-Id: fbdpsNf4oHiX79vMJ"
-d "OrderId=1"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
const data = ...;
*/
EscbLib.GetOrderHistoryByOrderId(data);
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
/*
$data = ...;
*/
$EscbLib->GetOrderHistoryByOrderId($data);
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
/*
data = ...;
*/
EscbLib.GetOrderHistoryByOrderId(data)
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
#data = ...;
EscbLib::GetOrderHistoryByOrderId(data)
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
data = ...;
*/
EscbLib.GetOrderHistoryByOrderId(data);

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": [
{"Side": "Buy",
"OrderId": "qwehjbfmsdfhh",
"Price": 0,
"Quantity": 0,
"Instrument": 0,
"OrderType": "StopLimit",
"ClientOrderId": 0,
"OrderState": "Canceled",
"ReceiveTime": 0,
"ReceiveTimeTicks": 0,
"OrigQuantity": 0,
"QuantityExecuted": 0,
"ChangeReason": "Expired",
"OrigOrderId": "jhjdsfytrkj",
"OrigClOrdId": 0,
"InsideAsk": 0,
"InsideAskSize": 0,
"InsideBid": 0,
"InsideBidSize": 0,
"LastTradePrice": 0,
"RejectReason": "",
"IsLockedIn": false,
}
]
}






















NameTypeValue
Side string One of: Buy, Sell.
Price real Price of the order.
Quantity real Quantity of the order.
InstrumentSymbol integer The Symbol of the instrument being ordered.
OrderType string One of: Market, Limit, StopMarket, StopLimit, TrailingStopMarket, TrailingStopLimit, BlockTrade. See Order Types above.
ClientOrderId string A user-assigned ID for the order (like a purchase-order number assigned by a company). ClientOrderId defaults to 0.
OrderState string One of: Working, InProcess, Rejected, Canceled, Expired, FullyExecuted. An open order will probably not yet be fully executed.
ReceiveTime integer The time at which the system received the quote, in milliseconds.
OrigQuantity real If the order has been changed, this value shows the original quantity.
QuantityExecuted real This value states the quantity that was executed in the order. It may be the same as the quantity of the order; it may be different.
ChangeReason string If the order has been changed, this value shows the reason. One of: NewInputAccepted, NewInputRejected, OtherRejected, Expired, Trade, SystemCanceled_NoMoreMarket, SystemCanceled_BelowMinimum, NoChange, UserModified
OrigOrderId string If the order has been changed, shows the original order ID.
OrigClOrdId integer If the order has been changed, shows the original client order ID, a value that the client can create (much like a purchase order).
InsideAsk real Best Ask price available at time of entry (generally available to market makers).
InsideAskSize real Quantity available at the best inside ask price (generally available to market makers).
InsideBid real Best Bid price available at time of entry (generally available to market makers).
InsideBidSize real Quantity available at the best inside Bid price (generally available to market makers).
LastTradePrice real The price at which the instrument last traded.
RejectReason string If the order was rejected, this string value holds the reason.
IsLockedIn boolean True if both parties to a block trade agree that one party will report the trade for both. Otherwise false.

Get orders history

Retrieves a history of multiple orders (hence, GetOrdersHistory with plural Orders) for the order ID, instrument, or time stamp, starting at index i, where i is an integer identifying a specific order in reverse order; that is, the most recent order has an index of 0.
“Depth” is the count of trades to report backwards from StartIndex. All values in the call are optional.
The trading venue determines how long to retain order history before archiving.

Type: GET
Parameters:
ClientOrderId - string
A user-assigned ID for the order (like a purchase-order number assigned by a company). ClientOrderId defaults to 0.

OriginalOrderId - string
The original ID of the order. If specified, the call returns changed orders associated with this order ID.

InstrumentSymbol - string
The ID of the instrument named in the order. If not specified, the call returns orders for all instruments for this account.

StartTimeStamp - integer
Date and time at which to begin the orders history, in milliseconds.

EndTimestamp - integer
Date and time at which to end the orders history, in milliseconds.

Depth - integer
In this case, the count of orders to return, counting from the StartIndex. If not specified, returns all orders between BeginTimeStamp and EndTimeStamp, beginning at StartIndex and working backwards.

StartIndex - integer
The starting index into the order history, from 0 (the most recent trade) and moving backwards in time. If not specified, defaults to 0.

curl "http://api.escb.exchange/v1/getordershistory"
-X "GET"
-H "X-API-Authorization: YOUR_API_KEY"
-H "X-Auth-Token: f2KpRW7KeN9aPmjSZ"
-H "X-User-Id: fbdpsNf4oHiX79vMJ"
-d "..."
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
const data = ...;
*/
EscbLib.GetOrdersHistory(data);
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
/*
$data = ...;
*/
$EscbLib->GetOrdersHistory($data);
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
/*
data = ...;
*/
EscbLib.GetOrdersHistory(data)
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
#data = ...;
EscbLib::GetOrdersHistory(data)
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
data = ...;
*/
EscbLib.GetOrdersHistory(data);

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": [
{"Side": "Sell",
"OrderId": "qweuyjdfskjdf",
"Price": 0,
"Quantity": 0,
"InstrumentSymbol": 0,
"OrderType": "Limit",
"ClientOrderId": 0,
"OrderState": "FullyExecuted"
"ReceiveTime": 0,
"OrigQuantity": 0,
"QuantityExecuted": 0,
"ChangeReason": "NewInputRejected",
"OrigOrderId": 0,
"OrigClOrdId": 0,
"InsideAsk": 0,
"InsideAskSize": 0,
"InsideBid": 0,
"InsideBidSize": 0,
"LastTradePrice": 0,
"RejectReason": "",
"IsLockedIn": false,
}
]
}























NameTypeValue
Side string One of: Buy, Sell.
OrderId string The ID of this order.
Price real Price of the order.
Quantity real Quantity of the order.
InstrumentSymbol string The Symbol of the instrument being ordered.
OrderType string One of: Market, Limit, StopMarket, StopLimit, TrailingStopMarket, TrailingStopLimit, BlockTrade. See Order Types above.
ClientOrderId string A user-assigned ID for the order (like a purchase-order number assigned by a company). ClientOrderId defaults to 0.
OrderState string One of: Working, InProcess, Rejected, Canceled, Expired, FullyExecuted. An open order will probably not yet be fully executed.
ReceiveTime integer The time at which the system received the quote, in milliseconds.
OrigQuantity real If the order has been changed, this value shows the original quantity.
QuantityExecuted real This value states the quantity that was executed in the order. It may be the same as the quantity of the order; it may be different.
ChangeReason string If the order has been changed, this value shows the reason. One of: NewInputAccepted, NewInputRejected, OtherRejected, Expired, Trade, SystemCanceled_NoMoreMarket, SystemCanceled_BelowMinimum, NoChange, UserModified
OrigOrderId string If the order has been changed, shows the original order ID.
OrigClOrdId integer If the order has been changed, shows the original client order ID, a value that the client can create (much like a purchase order).
InsideAsk real Best Ask price available at time of entry (generally available to market makers).
InsideAskSize real Quantity available at the best inside ask price (generally available to market makers).
InsideBid real Best Bid price available at time of entry (generally available to market makers).
InsideBidSize real Quantity available at the best inside Bid price (generally available to market makers).
LastTradePrice real The price at which the instrument last traded.
RejectReason string If the order was rejected, this string value holds the reason.
IsLockedIn boolean True if both parties to a block trade agree that one party will report the trade for both. Otherwise false.

Tickers and Feeds

Get ticker history

Requests a ticker history (high, low, open, close, volume, bid, ask, symbol) of a specific instrument from a given date forward to the present. You will need to format the returned data per your requirements.

Type: GET
Parameters:
InstrumentSymbol - string
The Symbol of a specific instrument.

FromDate - integer
Oldest date from which the ticker history will start, in milliseconds

ToDate - integer
Date to which the ticker history will end, in milliseconds

Interval - string
Interval of data aggregation. m is minutes; h is hours; d is days; w is weeks; M is months
1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M

curl "http://api.escb.exchange/v1/gettickerhistory"
-X "GET"
-H "X-API-Authorization: YOUR_API_KEY"
-d "InstrumentSymbol=BTC_USD&FromDate=946684800000"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
const data = ...;
*/
EscbLib.GetTickerHistory(data);
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
/*
$data = ...;
*/
$EscbLib->GetTickerHistory($data);
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
/*
data = ...;
*/
EscbLib.GetTickerHistory(data)
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
#data = ...;
EscbLib::GetTickerHistory(data)
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
data = ...;
*/
EscbLib.GetTickerHistory(data);

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": [
[
1501604532000,
2792.73,
2667.95,
2687.01,
2700.81,
242.61340767,
0,
2871,
"BTC_USD"
]
]
}

The response returns an array of arrays dating from the FromDate value of the request. The data are returned oldest-date first. The data returned in the arrays are not labeled. With comments applied to identify the data being returned (comments are not part of the response):

[
1501604532000, // UTC Date/Time in milliseconds since 1/1/1970
2792.73, // High
2667.95, // Low
2687.01, // Open
2700.81, // Close
242.61340767,// Volume
0, // Inside bid price
2871, // Inside ask price
“BTC_USD” // Instrument Symbol
]

Get trades history

Retrieves a list of trades for the specified order ID, instrument, or starting and ending time stamp. The returned list begins at start index i, where i is an integer identifying a specific trade in reverse order; that is, the most recent trade has an index of 0. “Depth” is the count of trades to report backwards from StartIndex.

The trading venue determines how long to retain order history before archiving.

Type: GET
Parameters:
InstrumentSymbol - string
The Symbol of the instrument whose history is reported. If no instrument Symbol is included, the system returns trades for all instruments associated with the current profile.

TradeId - integer
The ID of a specific trade. If specified, the call can return multiple states for a single trade.

OrderId - string
The ID of the order resulting in the trade. If specified, the call returns all trades associated with the order.

StartTimeStamp - integer
The historical date and time at which to begin the trade report, in milliseconds.

EndTimeStamp - integer
Date at which to end the trade report, in milliseconds.

Depth - integer
In this case, the count of trades to return, counting from the StartIndex. If not specified, returns all trades between BeginTimeStamp and EndTimeStamp, beginning at StartIndex.

StartIndex - integer
The starting index into the history of trades, from 0 (the most recent trade) and moving backwards in time. If not specified, defaults to 0.

ExecutionId - integer
The ID of the individual buy or sell execution. If not specified, returns all.

curl "http://api.escb.exchange/v1/gettradeshistory"
-X "GET"
-H "X-API-Authorization: YOUR_API_KEY"
-H "X-Auth-Token: f2KpRW7KeN9aPmjSZ"
-H "X-User-Id: fbdpsNf4oHiX79vMJ"
-d "..."
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
const data = ...;
*/
EscbLib.GetTradesHistory(data);
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
/*
$data = ...;
*/
$EscbLib->GetTradesHistory($data);
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
/*
data = ...;
*/
EscbLib.GetTradesHistory(data)
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
#data = ...;
EscbLib::GetTradesHistory(data)
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
data = ...;
*/
EscbLib.GetTradesHistory(data);

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": [
{"Fee": 0,
"FeeProductSymbol": 0,
"ExecutionId": 0,
"TradeId": 0,
"OrderId": 0,
"ClientOrderId": 0,
"InstrumentSymbol": 0,
"Side": "Sell",
"Quantity": 0,
"RemainingQuantity": 0,
"Price": 0,
"Value": 0,
"TradeTime": 0,
"OrderTradeRevision": 0,
"Direction": "UpTick",
"IsBlockTrade": false,
}
]
}


















NameTypeValue
Fee real The fee that applied to this trade, if any.
FeeProductSymbol string The Symbol of the product in which the fee is denominated.
ExecutionId string The ID of your sell or buy side portion of the execution, individually.
TradeId string The ID of the overall trade.
OrderId string The ID of the order that resulted in the trade.
ClientOrderId string A user-assigned ID for the order (like a purchase-order number assigned by a company). ClientOrderId defaults to 0.
InstrumentSymbol string The Symbol of the instrument being traded.
Side string One of: Buy, Sell
Quantity real The quantity of the instrument being traded.
RemainingQuantity real Any quantity remaining in the order after this trade.
Price real The unit price of the order.
Value real The overall value of the trade — price X quantity.
TradeTime real Time at which the trade took place, in milliseconds.
OrderTradeRevision integer The ID of any trade revision that took place for the trade.
Direction string Effect of this trade on the market. One of: Nochange, UpTick, DownTick
IsBlockTrade boolean Returns true if the trade was a reported trade; false otherwise.

Get average price

Provides a current average price for Symbol.

Type: GET
Parameters:
InstrumentSymbol - string
The Symbol of the instrument that is the subject of the report. If many symbols then must be comma separated.

curl "http://api.escb.exchange/v1/getaverageprice"
-X "GET"
-H "X-API-Authorization: YOUR_API_KEY"
-d "InstrumentSymbol=BTC_USD"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
const data = ...;
*/
EscbLib.GetAveragePrice("BTC_USD");
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
/*
$data = ...;
*/
$EscbLib->GetAveragePrice("BTC_USD");
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
/*
data = ...;
*/
EscbLib.GetAveragePrice("BTC_USD")
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
#data = ...;
EscbLib::GetAveragePrice()
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
data = ...;
*/
EscbLib.GetAveragePrice("BTC_USD");

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": {
"Minutes": "5",
"Price": "99.35754"
}
}




NameTypeValue
Minutes integer The number of minutes the average price is calculated over.
Price integer Average price for this interval.

Get 24hr ticker price change statistics

Provides 24hr ticker price change statistics for Symbol.

Type: GET
Parameters:
InstrumentSymbol - string
The Symbol of the instrument that is the subject of the report. If many symbols then must be comma separated.

curl "http://api.escb.exchange/v1/get24hrprice"
-X "GET"
-H "X-API-Authorization: YOUR_API_KEY"
-d "InstrumentSymbol=BTC_USD"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
const data = ...;
*/
EscbLib.Get24hrPrice("BTC_USD");
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
/*
$data = ...;
*/
$EscbLib->Get24hrPrice("BTC_USD");
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
/*
data = ...;
*/
EscbLib.Get24hrPrice("BTC_USD")
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
#data = ...;
EscbLib::Get24hrPrice("BTC_USD")
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
data = ...;
*/
EscbLib.Get24hrPrice("BTC_USD");

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": {
"InstrumentSymbol": "BTC_USD",
"PriceChange": "-194.99999800",
"PriceChangePercent": "5.960",
"AveragePrice": "8345.29628482",
"PrevClosePrice": "8345.10002000",
"LastPrice": "8345.00000200",
"LastQty": "10.00000000",
"BidPrice": "8345.00000000",
"AskPrice": "8345.00000200",
"OpenPrice": "8145.00000000",
"HighPrice": "8845.00000000",
"LowPrice": "8045.10000000",
"Volume": "8913.30000000",
"QuoteVolume": "15.30000000",
"OpenTime": 1499783499040,
"CloseTime": 1499869899040,
"TradeCount": 76000
}
}



















NameTypeValue
InstrumentSymbol integer The Symbol of the instrument being traded. See Products and Instruments above for the difference. See GetInstrument to find information about this instrument by its Symbol.
PriceChange real Price change for 24 hr.
PriceChangePercent real Price change for 24 hr in percent.
AveragePrice real Average price for 24 hr.
PrevClosePrice real Previous close price for 24 hr.
OpenPrice real Open price for 24 hr.
LastPrice real Last close price for 24 hr.
LastQty real Last quantity for 24 hr.
BidPrice real Bid price for 24 hr.
AskPrice real Ask price for 24 hr.
HighPrice real High price for 24 hr.
LowPrice real Low price for 24 hr.
Volume real Volume for 24 hr.
QuoteVolume real Quote volume for 24 hr.
OpenTime real Open time in milliseconds.
CloseTime real Close time in milliseconds.
TradeCount real Trade count for 24 hr.

Get latest price

Latest price for a Symbol or Symbols instrument.

Type: GET
Parameters:
InstrumentSymbol - string
The Symbol of the instrument that is the subject of the report. If many symbols then must be comma separated.

curl "http://api.escb.exchange/v1/getlatestprice"
-X "GET"
-H "X-API-Authorization: YOUR_API_KEY"
-d "InstrumentSymbol=BTC_USD"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
const data = ...;
*/
EscbLib.GetLatestPrice("BTC_USD");
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
/*
$data = ...;
*/
$EscbLib->GetLatestPrice("BTC_USD");
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
/*
data = ...;
*/
EscbLib.GetLatestPrice("BTC_USD")
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
#data = ...;
EscbLib::GetLatestPrice("BTC_USD")
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
data = ...;
*/
EscbLib.GetLatestPrice("BTC_USD");

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": [
{ "InstrumentSymbol": "BTC_USD",
"Price": "8544.00000200"
}
]
}




NameTypeValue
InstrumentSymbol integer The Symbol of the instrument being traded. See Products and Instruments above for the difference. See GetInstrument to find information about this instrument by its Symbol.
Price real Latest price for Symbol.

Get depth

Depth for order book.

Type: GET
Parameters:
InstrumentSymbol - string
The Symbol of the instrument that is the subject of the report.

Limit - integer
Limit for depth. Valid limits:[5, 10, 20, 50, 100, 500, 1000]. Default 100

curl "http://api.escb.exchange/v1/getdepth"
-X "GET"
-H "X-API-Authorization: YOUR_API_KEY"
-d "InstrumentSymbol=BTC_USD&Limit=100"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
const data = ...;
*/
EscbLib.GetDepth("BTC_USD");
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
/*
$data = ...;
*/
$EscbLib->GetDepth("BTC_USD");
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
/*
data = ...;
*/
EscbLib.GetDepth("BTC_USD")
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
#data = ...;
EscbLib::GetDepth("BTC_USD")
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
data = ...;
*/
EscbLib.GetDepth("BTC_USD");

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": {
"bids": [
[
"4.00000000",
"431.00000000"
]
],
"asks": [
[
"4.00000200",
"12.00000000"
]
]
}
}

The response returns an array of arrays with bids and asks. The data returned in the arrays for bids and asks are not labeled. With comments applied to identify the data being returned (comments are not part of the response):

[
“4.00000000”, // Price
“431.00000000” // Quantity
]

Subscriptions

Any subscriptions have to be listened by DDP protocol .
DDP Endpoint is “ws://ddp.escb.exchange”

SubscribeAccountEvents

Subscribes the user to notifications about the status of account-level events: orders, trades, position updates, deposits, and withdrawals for a specific account.
The subscription reports all events associated with a given account; there is no filter at the call level to subscribe to some events and not others.

Type: POST
Parameters:
none

curl "http://api.escb.exchange/v1/subscribeaccountevents"
-X "POST"
-H "X-API-Authorization: YOUR_API_KEY"
-H "X-Auth-Token: f2KpRW7KeN9aPmjSZ"
-H "X-User-Id: fbdpsNf4oHiX79vMJ"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.SubscribeAccountEvents();
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
$EscbLib->SubscribeAccountEvents();
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib.SubscribeAccountEvents()
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib::SubscribeAccountEvents()
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.SubscribeAccountEvents();

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": {
}
}

When you call SubscribeAccountEvents, you subscribe to the following list of events. The ESCB exchange platform may supply them at irregular intervals; software must listen for these events.

AccountPositionEvent

AccountPositionEvent Trigger: The balance in your account changes.

{
"ProductSymbol":"BTC", //The Product Symbol for this balance message. [String]
"Amount":10499.1, //The total balance in the account for the specified product. [Dec]
"Hold": 2.1, //The total amount of the balance that is on hold. Your available balance for trading and withdraw is (Amount - Hold). [Decimal]
"PendingDeposits":0, //Total Deposits Pending for the specified product. [Decimal]
"PendingWithdraws":0, //Total Withdrawals Pending for the specified product. [Decimal]
"TotalDayDeposits":0, //The total 24-hour deposits for the specified product. UTC. [Dec]
"TotalDayWithdraws":0 //The total 24-hour withdraws for the specified product. UTC [Dec]
}

CancelAllOrdersRejectEvent

CancelAllOrdersRejectEvent Trigger: All orders for your account are rejected.

{
"InstrumentSymbol": 0, // Symbol of the instrument in the order [String]
"Status": "Rejected", // Accepted/Rejected [String]
"RejectReason": "Instrument not found." // Reason for rejection [String]
}

CancelOrderRejectEvent

CancelOrderRejectEvent Trigger: Your order is canceled.

{
"OrderId": "dsfhkjyiu", //The Order ID from your Cancel request. [String]
"OrderRevision": 0, //The Revision of the Order, if any was found. [64 Bit Integer]
"OrderType": "Market", // See <a href="#Order-Types">Order Types</a> above
"InstrumentSymbol": "BTC_USD", // Symbol of the instrument in the order [String]
"Status": "Rejected", //Always "Rejected" [String]
"RejectReason": "Order Not Found" //A message describing the reason for the rejection. [String]
}

CancelReplaceOrderRejectEvent

CancelReplaceOrderRejectEvent Trigger: Your order is rejected even if a cancel-replace order was placed.

{
"OrderId": "9uuyiwe", // The ID of the rejected order [String]
"ClientOrderId": "1234", // The client-supplied order ID [String]
"LimitPrice": 99.1, // The limit price of the order.
"OrderIdOCO": 0, // The ID of the other ordre to cancel if this is executed.
"OrderType": "Limit", // See <a href="#Order-Types">Order Types</a> above.
"PegPriceType": "Bid", // Where to peg the stop/trailing order.
"OrderIdToReplace": "oiurlkjer", // The ID of the order being cancelled and replaced.
"InstrumentSymbol": "BTC_USD", // Symbol of the instrument in the order
"ReferencePrice": 99.1, // used internally.
"Quantity": 1.0, // Quantity of the replacement order
"Side": "Buy", // Side of the order: Buy, Sell
"StopPrice":0, // The price at which to execute the new order.
"TimeInForce":"GTC", // Period when new order can be executed.
"Status":"Rejected", // Status of the order – always "rejected"
"RejectReason":"Order Not Found" // Reason the order was rejected.
}

NewOrderRejectEvent

NewOrderRejectEvent Trigger: An order associated with your account is rejected.

{
"ClientOrderId": "1234", //Your Client Order Id [String]
"Status": "Rejected", //Always "Rejected"
"RejectReason": "No More Market" //A message describing the reason for the reject.
}

OrderStateEvent

OrderStateEvent Trigger: The status changes for an order associated with your account.

{
"Side":"Sell", // The side of your order. [String] Values are "Sell", "Buy"
"OrderId": "dsjhkjr", //The Server-Assigned Order Id. [String]
"Price": 97, //The Price of your order. [Decimal]
"Quantity": 1, // The Quantity (Remaining if partially or fully executed) of your order. [Decimal]
"InstrumentSymbol": "BTC_USD", // The Symbol of the instrument your order is for. [String]
"OrderType":"Limit", // The type of order. [String] Values are "Market", "Limit", "StopMarket", "StopLimit", "TrailingStopMarket", and "TrailingStopLimit"
"ClientOrderId":0, // Your client order id. [String]
"OrderState":"Working", // The current state of the order. [String] // Values are "Working", "Rejected", "FullyExecuted", "Canceled", "Expired"
"ReceiveTime":0, // Timestamp in POSIX format
"OrigQuantity":1, // The original quantity of your order. [Decimal]
"QuantityExecuted":0, // The total executed quantity. [Decimal]
"ChangeReason":"NewInputAccepted" // The reason for the order state change. [String] Values are "NewInputAccepted", "NewInputRejected", "OtherRejected", "Expired", "Trade", SystemCanceled BelowMinimum", "SystemCanceled NoMoreMarket", "UserModified"

OrderTradeEvent

OrderTradeEvent Trigger: An order associated with your account results in a trade.

{
"TradeId":213, /Trade Id [64-bit Integer]
"OrderId":"iouqwey", //Order Id [64-bit Integer]
"ClientOrderId":0, //Your client order id. [String]
"InstrumentSymbol":1, //Instrument Symbol [String]
"Side":"Buy", //[String] Values are "Buy", "Sell",
"Quantity":0.01, //Quantity [Decimal]
"Price":95, //Price [Decimal]
"Value":0.95, //Value [Decimal]
"TradeTime":946684800000, // TimeStamp milliseconds
"OrderTradeRevision":1, //Usually 1
"Direction":"NoChange" //"Uptick", "Downtick", "NoChange"
}

PendingDepositUpdate

PendingDepositUpdate Trigger: Deposit pending on your account.

{
"ProductSymbol": "BTC", // The Product Symbol of the pending deposit. [string]
"TotalPendingDepositValue": 0.01 //The value of the pending deposit. [Decimal]
}

Unsubscribe account events

Unsubscribes the user to notifications about the status of account-level events: orders, trades, position updates, deposits, and withdrawals for a specific account.

Type: POST
Parameters:
none

curl "http://api.escb.exchange/v1/unsubscribeaccountevents"
-X "POST"
-H "X-API-Authorization: YOUR_API_KEY"
-H "X-Auth-Token: f2KpRW7KeN9aPmjSZ"
-H "X-User-Id: fbdpsNf4oHiX79vMJ"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.UnsubscribeAccountEvents();
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
$EscbLib->UnsubscribeAccountEvents();
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib.UnsubscribeAccountEvents()
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib::UnsubscribeAccountEvents()
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.UnsubscribeAccountEvents();

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": {
}
}

Subscribe ticker

Subscribes a user to a Ticker Market Data Feed for a specific instrument. SubscribeTicker sends a response object as described below, and then periodically returns a TickerDataUpdateEvent that matches the content of the response object.

Type: POST
Parameters:
InstrumentSymbol - string
The ID of the instrument whose information you want to track.

IncludeLastCount - integer
The limit of records returned in the ticker history. The default is 100.

curl "http://api.escb.exchange/v1/subscribeticker"
-X "POST"
-H "X-API-Authorization: YOUR_API_KEY"
-d "InstrumentSymbol=BTC_USD&IncludeLastCount=100"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
const data = ...;
*/
EscbLib.SubscribeTicker(data);
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
/*
$data = ...;
*/
$EscbLib->SubscribeTicker($data);
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
/*
data = ...;
*/
EscbLib.SubscribeTicker(data)
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
#data = ...;
EscbLib::SubscribeTicker(data)
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
/*
data = ...;
*/
EscbLib.SubscribeTicker(data);

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": {
}
}

TickerDataUpdateEvent

The response returns an array of objects, each object an unlabeled, comma-delimited set of numbers. The Open price and Close price are those at the beginning of the tick — the Interval time subscribed to in the request.

A typical response might look like this:
[[1510719222970.21,6943.51,6890.27,6898.41,6891.16,0,6890.98,6891.98,1,
1510718681956.34]],

Here are the values in order with an explanation:

[
{
“EndDateTime”: 0, // POSIX format
“HighPX”: 0,
“LowPX”: 0,
“OpenPX”: 0,
“ClosePX”: 0,
“Volume”: 0,
“Bid”: 0,
“Ask”: 0,
“InstrumentSymbol”: “SC_BTC”,
“BeginDateTime”: 0 // POSIX format
}
]

Unsubscribe ticker

Unsubscribes a user to a Ticker Market Data Feed for a specific instrument.

Type: POST
Parameters:
none

curl "http://api.escb.exchange/v1/unsubscribeticker"
-X "POST"
-H "X-API-Authorization: YOUR_API_KEY"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.UnsubscribeTicker();
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
$EscbLib->UnsubscribeTicker();
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib.UnsubscribeTicker()
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib::UnsubscribeTicker()
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.UnsubscribeTicker();

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": {
}
}

Subscribe trades

Subscribes an authenticated user to the Trades Market Data Feed for a specific instrument. Each trade has two sides: Buy and Sell.
SubscribeTrades periodically sends the OrderTradeEvent documented in SubscribeAccountEvents.

Type: POST
Parameters:
InstrumentSymbol - string
The ID of the instrument whose information you want to track.

IncludeLastCount - integer
The limit of records returned in the ticker history. The default is 100.

curl "http://api.escb.exchange/v1/subscribetrades"
-X "POST"
-H "X-API-Authorization: YOUR_API_KEY"
-H "X-Auth-Token: f2KpRW7KeN9aPmjSZ"
-H "X-User-Id: fbdpsNf4oHiX79vMJ"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.SubscribeTrades();
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
$EscbLib->SubscribeTrades();
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib.SubscribeTrades()
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib::SubscribeTrades()
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.SubscribeTrades();

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": {
}
}

Unsubscribe trades

Unsubscribes an authenticated user to the Trades Market Data Feed for a specific instrument.

Type: POST
Parameters:
none

curl "http://api.escb.exchange/v1/unsubscribetrades"
-X "POST"
-H "X-API-Authorization: YOUR_API_KEY"
const EscbLib = require('escb_exchange');

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.UnsubscribeTrades();
include_once "escb_exchange.php";

$EscbLib = new EscbLib();
$EscbLib->setVersion(1);
$EscbLib->setKey('YOUR_API_KEY');
$EscbLib->UnsubscribeTrades();
from escb_exchange import EscbLib

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib.UnsubscribeTrades()
require 'escb_exchange'

EscbLib.setVersion(1)
EscbLib.setKey('YOUR_API_KEY')
EscbLib::UnsubscribeTrades()
import exchange.escb.EscbLib;

EscbLib EscbLib = new EscbLib();

EscbLib.setVersion(1);
EscbLib.setKey('YOUR_API_KEY');
EscbLib.UnsubscribeTrades();

The above command returns JSON structured like this:

{ "status": "success",
"timestamp": "946684800000",
"data": {
}
}

Errors

Example of response with error:

{ "code": 9134, "msg": "Invalid Instrument ID."}
Error Code Meaning
400 Bad Request – Your request is wrong
401 Unauthorized – Your API key is wrong
403 Forbidden – The requested data is hidden
404 Not Found – The specified data could not be found
405 Method Not Allowed – You tried to access with an invalid method
418 IP Ban – IP has been auto-banned for continuing to send requests after receiving 429 codes.
429 Too Many Requests – You’re requesting breaking a request rate limit! Slow down!
500 Internal Server Error – We had a problem with our server. Try again later.
503 Service Unavailable – We’re temporarily offline for maintenance. Please try again later.
9XXX Request error – Custom error message.