NAV
shell php javascript java csharp ruby python go

Market Data APIs

Exchange list

curl -X GET 'https://api.blocksdk.com/v2/market/exchanges' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$exchanges = $marketClient->getExchanges();
var exchanges = marketClient.getExchanges()
exchanges = marketClient.getExchanges()
exchanges = marketClient.getExchanges()
exchanges := marketClient.GetExchanges()

Response Body

{
    "payload": [
        {
            "exchange_id": "binance_com",
            "exchange_name": "Binance",
            "exchange_domain": "binance.com"
        },
        {
            "exchange_id": "bithumb_com",
            "exchange_name": "Bithumb",
            "exchange_domain": "bithumb.com"
        },

        ...

    ],
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Returns a list of exchanges that can fetch the price information registered in BLOCKSDK.

HTTP Request

GET https://api.blocksdk.com/v2/market/exchanges

Response

Variable Type Description
exchange_id string Exchange unique ID
exchange_name string Exchange name
exchange_domain string Exchange domain

List of average transaction data

curl -X GET 'https://api.blocksdk.com/v2/market/trades' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$trades = $marketClient->getTrades([
    "to" => "USD"
]);
var trades = marketClient.getTrades({
    "to" : "USD"
})
trades = marketClient.getTrades({
    "to" => "USD"
})
trades = marketClient.getTrades({
    "to" : "USD"
})
trades := marketClient.GetTrades(map[string]interface{}{
      "to" : "USD"
})

Response Body

{
    "payload": {
        "trades": [
            "BTC" : {
                "from": "BTC",
                "to": "USD",
                "price": 41584.008174,
                "low_price": 40408.12580714286,
                "high_price": 42134.14267514286,
                "opening_price": 40886.82083485714,
                "transaction_volume": 148031.30036874252,
                "transaction_amount": 5913657831.613066,
                "change_rate": 1.71
            },
            "ETH" : {
                "from": "ETH",
                "to": "USD",
                "price": 1361.801899457143,
                "low_price": 1224.8774101428571,
                "high_price": 1371.8270646857143,
                "opening_price": 1250.7742719714286,
                "transaction_volume": 3255669.1626990964,
                "transaction_amount": 4075610814.3152122,
                "change_rate": 8.88
            },

            ...
        ],
        "trade_count": 609
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Get the average value of the cryptocurrency market price of the exchanges.

HTTP Request

GET https://api.blocksdk.com/v2/market/trades

Query Parameters

Parameter Type Default Description
from string --- Cryptocurrency symbol
to string USD Legal tender Symbol

Response

Variable Type Description
from string Cryptocurrency symbol
to string Legal tender Symbol
price double Price per piece
low_price double 24 hours low price
high_price double 24 hours high price
opening_price double 24 hours opening price
transaction_volume double 24 hours total trading volume
transaction_amount double 24 hours total transaction amount amount
change_rate float Rate of change

Get exchange rates

curl -X GET https://api.blocksdk.com/v2/market/rates/USD?from_amount=1000&to=BTC' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$rates = $marketClient->getRates([
    "from" => "USD",
    "to" => "BTC",
    "from_amount" => 1000
]);
var rates = marketClient.getRates({
    "from" : "USD",
    "to" : "BTC",
    "from_amount" : 1000
})
rates = marketClient.getRates({
    "from" => "USD",
    "to" => "BTC",
    "from_amount" => 1000
})
rates = marketClient.getRates({
    "from" : "USD",
    "to" : "BTC",
    "from_amount" : 1000
})
rates := marketClient.GetRates(map[string]interface{}{
    "from" : "USD",
    "to" : "BTC",
    "from_amount" : 1000
})

Response Body

{
    "payload": {
        "from": "USD",
        "from_amount": 1000,
        "to": "BTC",
        "to_amount": 0.02408363,
        "price": 41521.98316229
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

The exchange rate is calculated and returned using the average market price of the exchanges.

HTTP Request

GET https://api.blocksdk.com/v2/market/rates/<from>

URL Parameters

Parameter Type Description
from* string Basic base asset symbol.

Query Parameters

Parameter Type Description
to* string This is the symbol of the asset to be converted.
from_amount* double This is the quantity used to calculate the price.

Response

Variable Type Description
from string Asset symbol subject to exchange rate calculation
to string The symbol of the asset against which the exchange rate is calculated
from_amount double Amount of amount subject to exchange rate calculation
to_amount double Exchange rate calculation result
price double One reference price of the target asset

List of transaction data for a specific exchange

curl -X GET https://api.blocksdk.com/v2/market/trades/binance_com' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$trades = $marketClient->getExchangeTrades([
    "exchage_id" => "binance_com",
    "to" => "USD"
]);
var trades = marketClient.getExchangeTrades({
    "exchage_id" : "binance_com",
    "to" : "USD"
})
trades = marketClient.getExchangeTrades({
    "exchage_id" => "binance_com",
    "to" => "USD"
})
trades = marketClient.getExchangeTrades({
    "exchage_id" : "binance_com",
    "to" : "USD"
})
trades := marketClient.GetExchangeTrades(map[string]interface{}{
    "exchage_id" : "binance_com",
    "to" : "USD"
})

Response Body

{
    "payload": {
        "exchange_id": "binance_com",
        "trades": [
            "BTC" : {
                "from": "BTC",
                "to": "USD",
                "price": 40732.12,
                "low_price": 39480.26,
                "high_price": 41380,
                "opening_price": 39535.27,
                "transaction_volume": 70594.646981,
                "transaction_amount": 2866632830.445893,
                "change_rate": 3.027
            },
            "ETH" : {
                "from": "ETH",
                "to": "USD",
                "price": 1335.45,
                "low_price": 1191.63,
                "high_price": 1348.33,
                "opening_price": 1193.66,
                "transaction_volume": 1509839.32962,
                "transaction_amount": 1914382851.1286056,
                "change_rate": 11.879
            },

            ...

        ],
        "trade_count": 252
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Get a list of transaction data for a specific exchange.

HTTP Request

GET https://api.blocksdk.com/v2/market/trades/<exchage_id>

URL Parameters

Parameter Type Description
exchage_id* string This is the ID of the exchange to get the price list.

Query Parameters

Parameter Type Default Description
from string --- Cryptocurrency symbol
to string USD Legal tender Symbol

Response

Variable Type Description
from string Cryptocurrency symbol
to string Legal tender Symbol
price double Price per piece
low_price double 24 hours low price
high_price double 24 hours high price
opening_price double 24 hours opening price
transaction_volume double 24 hours total trading volume
transaction_amount double 24 hours total transaction amount amount
change_rate float Rate of change

Get the exchange rate for a specific exchange

curl -X GET https://api.blocksdk.com/v2/market/rates/binance_com/USD?to=BTC&from_amount=1000' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$rates = $marketClient->getExchangeRates([
    "exchage_id" => "binance_com",
    "from" => "USD",
    "to" => "BTC",
    "from_amount" => 1000
]);
var rates = marketClient.getExchangeRates({
    "exchage_id" : "binance_com",
    "from" : "USD",
    "to" : "BTC",
    "from_amount" : 1000
})
rates = marketClient.getExchangeRates({
    "exchage_id" => "binance_com",
    "from" => "USD",
    "to" => "BTC",
    "from_amount" => 1000
})
rates = marketClient.getExchangeRates({
    "exchage_id" : "binance_com",
    "from" : "USD",
    "to" : "BTC",
    "from_amount" : 1000
})
rates := marketClient.GetExchangeRates(map[string]interface{}{
    "exchage_id" : "binance_com",
    "from" : "USD",
    "to" : "BTC",
    "from_amount" : 1000
})

Response Body

{
    "payload": {
        "exchange_id": "binance_com",
        "from": "USD",
        "from_amount": 1000,
        "to": "btc",
        "to_amount": 0.02454185,
        "price": 40746.73
    },
    "state": {
        "code": 200,
        "success": true
    }
}   

Info

The exchange rate is calculated and returned using the market price data of a specific exchange

HTTP Request

GET https://api.blocksdk.com/v2/market/rates/<exchage_id>/<from>

URL Parameters

Parameter Type Description
exchage_id* string Exchange ID
from* string This is the basic base asset symbol.

Query Parameters

Parameter Type Description
to* string This is the symbol of the asset to be converted.
from_amount* double This is the quantity used to calculate the price.

Response

Variable Type Description
from string Asset symbol subject to exchange rate calculation
to string The symbol of the asset against which the exchange rate is calculated
from_amount double Amount of amount subject to exchange rate calculation
to_amount double Exchange rate calculation result
price double One reference price of the target asset