Market Public Data REST API

Savitar offers a general use public REST API to provide basic information about all pairs on our platform.

API is hosted at https://api.savitar.io

Currencies

A currency is a crypto or fiat currency.

Currency Index

GET /v2/currencies

  • Description: Return all currencies

  • Parameters

    Name

    Description

    Type

    Required

    Position

    type

    Currency type

    string

    False

    query

    cURL
    curl -X GET \
    'https://api.savitar.io/api/v2/currencies'
    

    Sample response:

    [
       {
         "id":"eur",
         "symbol":"€",
         "fullname":"Euro",
         "type":"fiat",
         "min_deposit_amount":"0.0",
         "deposit_fee":"0.0",
         "withdraw_fee":"0.99",
         "quick_withdraw_limit":"1000.0",
         "deposit_status":true,
         "withdraw_status":true,
         "base_factor":1,
         "precision":2
       },
       {
         "id":"btc",
         "symbol":"฿",
         "fullname":"Bitcoin",
         "type":"coin",
         "min_deposit_amount":"0.0",
         "deposit_fee":"0.0",
         "withdraw_fee":"0.0005",
         "quick_withdraw_limit":"1.0",
         "deposit_status":true,
         "withdraw_status":true,
         "base_factor":100000000,
         "precision":8
      },
    ]
    

    Markets

    A market allow to exchange a pair of currencies. Each market has a base and a quote currency. For example, btceur has base btc and quote eur.

    Market Index

    GET /v2/markets

  • Description: Return all markets.

  • cURL
    curl -X GET \
    'https://api.savitar.io/api/v2/markets'
    

    Sample response:

    [
      {
        "id":"btceur",
        "name":"BTC/EUR",
        "ask_unit":"btc",
        "bid_unit":"eur",
        "ask_fee":"0.001",
        "bid_fee":"0.001",
        "trading_enabled":true
      }
    ]
    

    Market Ticker

    GET /v2/tickers/{market}

  • Description: Returns the current ticker of a market.

  • Parameters

    Name

    Description

    Type

    Required

    Position

    market

    market id

    string

    True

    path

    cURL
    curl -X GET \
    'https://api.savitar.io/api/v2/tickers/{market}'
    

    Sample response:

    {
      "at":1560937470,
      "ticker":{
        "buy":"8133.6564",
        "sell":"8145.5101",
        "low":"8002.9691",
        "high":"8267.7961",
        "last":"8134.3456",
        "last24h":"8248.6781",
        "variation24h":"-1.39",
        "vol":"5.7432"
      }
    }
    

    Market OHLC

    GET /v2/ohlc

  • Description: Returns the OHLC candlestick data of a market.

  • Parameters

    Name

    Description

    Type

    Required

    Position

    market

    Only return OHLC for this market

    string

    True

    query

    resolution

    OHLC resolution

    string

    False

    query

    from

    Return OHLC from a Unix timestamp

    integer

    False

    query

    to

    Return OHLC up to a Unix timestamp

    integer

    False

    query

    cURL
    curl -X GET \
    'https://api.savitar.io/api/v2/ohlc?market=<market>'
    

    Supported resolutions are:

    resolution

    description

    60

    1 hour

    120

    2 hours

    720

    12 hours

    1D

    1 day

    Sample response:

    {
      "s":"ok",
      "t":[
        1559376000,
        1559379600,
        1559383200,
        1559386800,
        1559390400,
        1559394000,
        1559397600,
        1559401200
      ],
      "o":[
        "7639.1472000000000000",
        "7694.6263000000000000",
        "7663.9815000000000000",
        "7673.7134000000000000",
        "7661.7665000000000000",
        "7650.1766000000000000",
        "7603.1232000000000000",
        "7642.4403000000000000"
      ],
      "h":[
        "7680.4928",
        "7716.343",
        "7713.2547",
        "7693.091",
        "7685.5593",
        "7670.204",
        "7657.2903",
        "7660.3477"
      ],
      "c":[
        "7620.2531000000000000",
        "7684.4232000000000000",
        "7678.9546000000000000",
        "7648.2364000000000000",
        "7665.4967000000000000",
        "7643.3491000000000000",
        "7618.2906000000000000",
        "7660.3477000000000000"
      ],
      "l":[
        "7620.2531",
        "7672.365",
        "7663.9815",
        "7648.2364",
        "7655.3117",
        "7630.7265",
        "7587.8634",
        "7607.6202"
      ],
      "v":[
        "0.3947",
        "0.3056",
        "0.2343",
        "0.1996",
        "0.2608",
        "0.2368",
        "0.4419",
        "0.257"
      ]
    }
    

    Market Trades

    GET /v2/trades

  • Description: Returns a market’s most recent trades.

  • Parameters

    Name

    Description

    Type

    Required

    Position

    market

    market id

    string

    True

    query

    limit

    Limit the number of returned trades. Default to 50.

    integer

    False

    query

    cURL
    curl -X GET \
    'https://api.savitar.io/api/v2/trades?market=<market>'
    

    Sample response:

    [
     {
       "id":55107,
       "price":"8180.9451",
       "volume":"0.0332",
       "funds":"272.42",
       "trend":"buy",
       "market":"btceur",
       "created_at":"2019-06-19T14:03:32+02:00"
     }
    ]