Api

API is set of functions and procedures that gives access to the features on the market.
We have Private and public API, the information below details our public API, later in feature we will give information about our private API.
Our API produces result in JSON format

PUBLIC API

GET MARKET
The end result gets all market.

Http Request

GET https://www.coinlayers.com/api/v1/get_markets
{
markets: [
    {
    
        id: "1",
        slug: "BCH/BTC",
        last_price: "0.00000000",
        date_listed: "2018-05-08 19:22:16",
    
    },
    ...
],
status: {

        type: "success",
        msg: "Query successful",
    }

}
Get Currencies
The end result gets market currencies

Http Request

GET https://www.coinlayers.com/api/v1/get_currencies
{
currencies: [
    {
    
        id: "1",
        name: "Bitcoin",
        symbol: "BTC",
        is_erc20: false,
        token_address: "",
    
    },
    {

        id: "13",
        name: "EOS",
        symbol: "EOS",
        is_erc20: true,
        token_address: "0x86Fa049857E0209aa7D9e616F7eb3b3B78ECfdb0",

	},
    ...
],
status: {

        type: "success",
        msg: "Query successful",
    }

}
GET Market orders
The end result gets market orders

Http Request

GET https://www.coinlayers.com/api/v1/get_market_orders?market_id=1
 {
market: {

    id: "1917",
    slug: "ETH/BTC",
    created_date: "1518513201",
    last_price: "0.10000000",
    high: "0",
    low: "0",
    ask: "0.07850037",
    bid: "0.10005000",
    growth: "0",
    volume: "0.00",

},
buy_orders: [
    {
    
        price: "0.10005000",
        amount: "0.02564998",
        total: "0.00256628",
    
    },
	...
],
sell_orders: [
    {
    
        price: "0.07850037",
        amount: "11.00000000",
        total: "0.86350407",
    
    },
	...
],
status: {

        type: "success",
        msg: "Query successful",
    }
}
GET Market histories
The end result gets all market pairs hstories.

Http Request

GET https://www.coinlayers.com/api/v1/get_market_history?market_id=1

{
market: {

    id: "1917",
    slug: "ETH/BTC",
    created_date: "1518513201",
    last_price: "0.10000000",
    high: "0",
    low: "0",
    ask: "0.07850037",
    bid: "0.10005000",
    growth: "0",
    volume: "0.00",

},
history: [
    {
    
        created_date: "2018-03-19 13:38:06",
        type: "sell",
        price: "0.10000000",
        amount: "1.00000000",
        total: "0.10000000",
        display_type: "Sell",
        class: "danger",
    
    },
    ...
],
status: {

        type: "success",
        msg: "Query successful",
    }

}