This endpoint is only available to Growth and Enterprise plans.

Product demo

Endpoint details

  • URL: wss://production-api.mobula.io
  • Message (string):
{
    "type": "ohlcv",
    "payload": {
        "apiKey": "xxxxxxxxxx",
        "address": "0x123456789",
        "chainId": "evm:1",
        "period": "1h",
    }
};

Parameters

  • apiKey: your Mobula API key (you can get one here)
  • address: the address of the pool you want to get OHLCV data for
  • chainId: details here
  • period: the period of the OHLCV data you want to get (1min, 5min, 15min, 1h, 4h, 1d, 1w, 1M)

Implementation example

Let’s take a look at:

const socket = new WebSocket("wss://production-api.mobula.io");

socket.addEventListener("open", () => {
  socket.send(`{
    "type": "ohlcv",
    "payload": {
      "address": "0x123456789",
      "chainId": "evm:1",
      "period": "1h",
    }
}`);
});

socket.addEventListener("message", (event) => {
  const data = JSON.parse(event.data);

  console.log(data);

  // ...
});

// No need to close the socket, it will close automatically.
You can use the Network tab in your browser to see the WSS requests.

Can’t find what you’re looking for? Reach out to us, response times < 1h.