Market data is a vital aspect of any major crypto product. Understanding the value of the assets you hold is crucial. It can help you make quick decisions based on the movements of the market. 

Our team understands the importance of having the most reliable data in the market. For this reason, we support 3 different REST endpoints which provide access to the live ticker, complete order books, and candles for each exchange we support.

Get Ticker

The market ticker REST API request returns the current price of an asset in terms of BTC and USD, along with the percent change over the last 24 hours. 

This endpoint will return the most recent pricing data point collected by Shrimpy. This pricing information is updated on a 1 minute interval. This data is not intended to be used as a way to calculate trades. Instead, the Shrimpy market ticker uses the average between the current best bid and ask price on the order book to determine the price.

Note: Many exchanges will define the ticker as the price of the last trade which was executed by the exchange. While this is ideal for exchanges, we don't use our ticker in this way since this would result in rapid price fluctuations. Our ticker is intended for display purposes on portfolio management applications, providing a clean user experience. 

Example Response:

[
  {
    "name": "Bitcoin",
    "symbol": "BTC",
    "priceUsd": "3700.0089335",
    "priceBtc": "1",
    "percentChange24hUsd": "4.191224354581092",
    "lastUpdated": "2018-12-19T22:51:13.000Z"
  },
  {
    "name": "Ethereum",
    "symbol": "ETH",
    "priceUsd": "100.114205389399",
    "priceBtc": "0.027057825",
    "percentChange24hUsd": "5.432113558652999",
    "lastUpdated": "2018-12-19T22:51:13.000Z"
  },
  ...
]

Get Order Books

Unlike the ticker endpoint, this REST API endpoint is designed for trading. Accessing data from the order book endpoint is live. That means there is no interval for when this data is updated. The data is updated live. As soon as the order book changes on the exchange, Shrimpy instantly updates our copy of the order book and will serve the latest version upon request.

If you are looking to execute trades through the Shrimpy Developer APIs, this is a great endpoint for you to get comfortable with. This can provide a quick and robust way to access the order book, select a price, and place a limit order.

In addition to providing the full order book of a single asset, you can also collect order book data for any number of assets on an individual exchange or even across exchanges. This makes the endpoint ideal for customizing what data you collect. For example, you can easily get the order book for LTC on 10 different exchanges or get the order books for 10 different assets on 4 different exchanges. Whatever data you need, this endpoint is versatile to fit your needs.

Example Response:

[{
  "baseSymbol": "XLM",
  "quoteSymbol": "BTC",
  "orderBooks": [{
    "exchange": "Bittrex",
    "orderBook": {
      "asks": [
        {
          "price": "0.00002585",
          "quantity": "1891.1316431"
        },
        {
          "price": "0.00002594",
          "quantity": "35200"
        },
        ...
      ],
      "bids": [
        {
          "price": "0.00002577",
          "quantity": "774.92250177"
        },
        {
          "price": "0.00002576",
          "quantity": "3509.07031022"
        },
        ...
      ]
    }
  }]
}]

Get Candles

Besides order books, many traders enjoy viewing candlesticks (OHLCV Charting Data). As a result, the Shrimpy Developer APIs provide a unified candlestick endpoint. This makes it easy to access candles on a 1m, 5m, 15m, 1h, 6h, and 1d period. Shrimpy automatically normalizes the time periods across exchanges, so you don't need to deal with the inconsistencies with the candle periods which each exchange supports. 

The process for collecting candlestick data goes something like this: First, call the endpoint to retrieve the historical candlestick data for a pair. This is done without specifying a start time for the data. Once you have received this data, periodically call the same endpoint with the start time of the last candle you received to continuously update the most recent candle. Once the most recent candle is closed, move the start Time to the next most recent candle stick.

This allows you to keep your candlesticks up to date. That way your users have a seamless experience watching the price of the candles change in real-time.

Example Response:

[
  {
    "open": "0.0000157300000000",
    "high": "0.0000157800000000",
    "low": "0.0000155800000000",
    "close": "0.0000157100000000",
    "volume": "219444.0000000000000000",
    "quoteVolume": 3.44176145,
    "btcVolume": 3.44176145,
    "usdVolume": 27437.297915762,
    "time": "2019-05-24T23:00:00.000Z"
  },
  {
    "open": "0.0000157100000000",
    "high": "0.0000157500000000",
    "low": "0.0000156900000000",
    "close": "0.0000157300000000",
    "volume": "1603.0000000000000000",
    "quoteVolume": 0.02520959,
    "btcVolume": 0.02520959,
    "usdVolume": 201.98615317277,
    "time": "2019-05-25T00:00:00.000Z"
  },
  ...
]

Did this answer your question?