API Examples

    Ready-to-use code examples for the Bitkub API.

    Get Server Timestamp

    Get the current server timestamp

    GET /api/servertime

    Request

    curl -X GET "https://api.bitkub.com/api/servertime" \
      -H "Accept: application/json"

    Response

    {
      "error": 0,
      "result": 1633564800
    }

    Market Ticker

    Get ticker information for all symbols

    GET /api/market/ticker

    Request

    curl -X GET "https://api.bitkub.com/api/market/ticker" \
      -H "Accept: application/json"

    Response

    {
      "THB_BTC": {
        "id": 1,
        "last": "1234567.00",
        "lowestAsk": "1234568.00",
        "highestBid": "1234566.00",
        "percentChange": "2.34",
        "baseVolume": "12.34567890",
        "quoteVolume": "15234567.89",
        "isFrozen": "0",
        "high24hr": "1245678.00",
        "low24hr": "1223456.00"
      }
    }

    Order Book

    Get order book for a specific symbol

    GET /api/market/depth

    Request

    curl -X GET "https://api.bitkub.com/api/market/depth?sym=THB_BTC&lmt=5" \
      -H "Accept: application/json"

    Response

    {
      "error": 0,
      "result": {
        "bids": [
          [1234566, 0.1],
          [1234565, 0.2]
        ],
        "asks": [
          [1234568, 0.1],
          [1234569, 0.2]
        ]
      }
    }