How to get real-time crypto data with WebSocket price feed?

How to get real-time crypto data  with WebSocket price feed?

Mobula's Websocket Price Feed enables you to track up to 100 assets simultaneously, providing real-time updates on prices, volume, price changes, and other critical market metrics. This tool is particularly valuable for users who need to make quick, informed decisions based on the latest market movements.

Key Features:

  • Simultaneous Tracking: Monitor up to 100 assets at the same time.
  • Real-Time Updates: Receive instant updates on price, volume, and more.
  • Customizable Intervals: Choose update intervals as per your need (minimum 5 seconds, default 30 seconds).

Eligibility:

This endpoint is exclusively available to users subscribed to the Growth and Enterprise plans.

How to Use the Websocket Price Feed

To start receiving data from the Websocket Price Feed, follow these steps:

  1. Connect to the Websocket URL: wss://general-api-wss-fgpupeioaa-uc.a.run.app
  2. Set Up Your Message:
    Compose a message in the following format, including your API key and preferred assets:jsonCopy code{
    "type": "market",
    "authorization": "YOUR-API-KEY",
    "payload": {
    "assets": [
    { "name": "Bitcoin" },
    {
    "address": "0x059fd118aa8988f5e97b66fcd489765111e069c9",
    "blockchain": "1"
    }
    ],
    "interval": 15
    }
    }

Parameters Details:

  • assets: An array of assets to track. You can query by name, symbol, or address combined with blockchain.
  • interval: The frequency of updates in seconds.

Understanding the Data Model

The data response from the Websocket Price Feed is consistent with the market/multi-data format, ensuring you get comprehensive and familiar data structures for ease of analysis.

Need Help?

If you're unsure about anything or need further assistance, don't hesitate to reach out. We pride ourselves on quick response times, typically less than one hour.


💡
Need a custom solution for your project? Mobula is dedicated to meeting your needs swiftly and ensuring the blockchain data or the endpoint you require is available within 24 hours.

Request a new blockchain
Request a new endpoint
Need something else

Read more