Real-Time Websockets for Cryptocurrency Exchange Trade Data

photo-1507413245164-6160d8298b31.jpg

The Shrimpy team is excited to announce we have released free websockets for trade data across the 16 top exchanges. This universal websocket allows crypto application developers, traders, and institutions to access real-time trade streams in the most simple way possible.

This development is released on the heals of our real-time full depth order book data websocket. You can learn more about how to access the order book websocket in our previous blog post here:

Universal Websockets for Real-Time Crypto Exchange Order Book Data

Just like all our data endpoints for the Shrimpy Developer APIs, the trade data websocket is free. Sign up for the Shrimpy developer APIs to begin accessing this data at absolutely no cost!

Keep up with our development team by joining the developer telegram.

Trade Websocket Example

The Trade channel provides the executed trades for the given pair. Each update after the subscription will simply provide the executed trade along with their respective quantities. Updates are published every time a trade is executed on the exchange for the given pair.

Accessing the trade websocket stream is easy. The rest of this section will detail a simple example of how to connect to this channel. Once connected, freely collect data for any service you are providing.

The Shrimpy Real-Time Trade Stream Websocket

Access the websocket stream at wss://ws-feed.shrimpy.io/.

Trade Subscription

{
    "type": "subscribe",
    "exchange": "coinbasepro",
    "pair": "btc-ltc",
    "channel": "trade"
}

Trade Stream Format

The trade channel provides the live trades for the given pair and exchange. The format of the stream is as follows.

{
    "exchange": "coinbasepro",
    "pair": "btc-ltc",
    "channel": "trade",
    "snapshot": false,
    "sequence": 0,
    "content": {
        "trades": [
            {
                "id": 138368370,
                "price": "0.0130650000000000",
                "quantity": "2.0300000000000000",
                "time": "2019-05-31T20:25:14.000Z",
                "btcValue": 0.02652195,
                "usdValue": 224.16218805254
            },
            {
                "id": 138368371,
                "price": "0.0130650000000000",
                "quantity": "1.0000000000000000",
                "time": "2019-05-31T20:25:14.000Z",
                "btcValue": 0.013065,
                "usdValue": 110.42472317859
            },
            ...
        ]
    }
}

That’s all!

With only a little effort, you can now integrate live trade data into your cryptocurrency application.

Our real-time trade stream is accessible across all 16 exchanges we support. Whether you’re developing institutional services, mobile applications, or websites, Shrimpy is designed to help you scale.

Learn about other Shrimpy API features:

Free Historical OHLCV Trade Charting Data for Crypto Exchanges

Order Book - Universal APIs for Real-Time Crypto Exchange Data 

Limit Orders  -  Universal APIs for Crypto Exchange Trade Execution

Crypto API for Smart Order Routing

Universal Websockets for Real-Time Crypto Exchange Order Book Data

About Shrimpy

Shrimpy is a free application for constructing custom cryptocurrency index funds, rebalancing, and managing a diverse portfolio of digital assets. Automate your portfolio by linking to any of the 16 crypto exchanges we support.

Shrimpy’s Universal Crypto Exchange APIs are designed for developers. Integrating with our unified APIs gives you instant access to uniform endpoints for trading, data collection, user management, and more across every major cryptocurrency exchange.

CoinOrderBook is a real-time order book data provider. Browse asset listings, analyze arbitrage opportunities, collect order book data, and evaluate trading pair spreads.

~The Shrimpy Team