Skip to main content
This feature is available on all plans with WebSocket access.

Overview

Subscription tags let you categorize your WebSocket subscriptions by purpose (e.g., “majors”, “long tail”, “defi”) and see a breakdown of usage and credits consumption by tag in the dashboard. Without tags, usage is only broken down by endpoint or by individual API key. Tags give you a third dimension — grouping subscriptions into logical categories across any WebSocket endpoint.

How It Works

Add an optional tag field (max 50 characters) to the payload of any WebSocket subscription message. The tag is tracked per event and aggregated in the usage dashboard under the “By Tag” breakdown view.

Supported Endpoints

Tags work on every WebSocket endpoint:
EndpointEvent Type
Fast Tradesfast-trade
Market Detailsmarket-details
Token Detailstoken-details
OHLCVohlcv
Balancebalance
Positionsposition
Holdersholders
Fundingfunding
Pulse Streamsmarket / pair
Multi-Events Streamstream

Usage Examples

Fast Trades with Tag

{
  "type": "fast-trade",
  "authorization": "YOUR-API-KEY",
  "payload": {
    "assetMode": true,
    "items": [
      { "blockchain": "evm:1", "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" },
      { "blockchain": "evm:1", "address": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599" }
    ],
    "tag": "majors",
    "subscriptionTracking": true
  }
}

Market Details with Tag

{
  "type": "market-details",
  "authorization": "YOUR-API-KEY",
  "payload": {
    "pools": [
      { "blockchain": "evm:1", "address": "0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640" }
    ],
    "tag": "defi",
    "subscriptionTracking": true
  }
}

OHLCV with Tag

{
  "type": "ohlcv",
  "authorization": "YOUR-API-KEY",
  "payload": {
    "asset": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    "chainId": "evm:1",
    "period": "1h",
    "tag": "charts"
  }
}

Multi-Events Stream with Tag

{
  "type": "stream",
  "payload": {
    "authorization": "YOUR-API-KEY",
    "chainIds": ["evm:1", "evm:56"],
    "events": ["swap"],
    "tag": "long tail",
    "subscriptionId": "my-swap-tracker",
    "subscriptionTracking": "true"
  }
}

Viewing Tag Usage in the Dashboard

  1. Go to admin.mobula.io/usage
  2. Select WebSocket as the data source
  3. Use the “By Event” / “By Tag” selector to switch to the tag breakdown view
  4. You’ll see credits and event counts aggregated per tag
Subscriptions without a tag are grouped under “Untagged”.

Tag Guidelines

  • Tags are optional — omit the field or pass null to leave a subscription untagged
  • Maximum length: 50 characters
  • Tags are case-sensitive"Majors" and "majors" are tracked separately
  • Use consistent naming across your subscriptions for clean aggregation
  • You can use different tags on different subscriptions with the same API key
Use CaseExample Tags
Asset categoriesmajors, long tail, stablecoins, memecoins
Product featurescharts, alerts, portfolio, screener
Environmentsstaging, production, dev
Clients/tenantsclient-acme, client-globex

Implementation Example

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

socket.addEventListener("open", () => {
  // Subscribe to majors
  socket.send(JSON.stringify({
    type: "fast-trade",
    authorization: "YOUR_API_KEY",
    payload: {
      assetMode: true,
      items: [
        { blockchain: "evm:1", address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" }
      ],
      tag: "majors"
    }
  }));

  // Subscribe to memecoins with a different tag
  socket.send(JSON.stringify({
    type: "fast-trade",
    authorization: "YOUR_API_KEY",
    payload: {
      assetMode: true,
      items: [
        { blockchain: "solana", address: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263" }
      ],
      tag: "memecoins"
    }
  }));
});

socket.addEventListener("message", (event) => {
  const data = JSON.parse(event.data);
  console.log(`Trade on ${data.token}:`, data);
});

Support

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

Support

Telegram

Support

Slack

Need help?

Email