WebSocket API

Real-time financial news streaming through WebSocket connections. Endpoint: wss://api.byul.ai/news-v2

Features

  • Real-time news delivery
  • Event-based messaging
  • Subscription filtering
  • Automatic reconnection
  • Error handling

Authentication

Authenticate using your API key in the connection options:
const socket = io('wss://api.byul.ai/news-v2', {
  auth: { apiKey: 'byul_api_key' }
});

Events

Client to Server:
  • news:subscribe - Subscribe to news stream
  • news:unsubscribe - Unsubscribe from stream
  • news:unsubscribe:all - Unsubscribe from all
Server to Client:
  • auth:success - Authentication confirmed
  • news:data - Real-time news articles
  • news:subscribed - Subscription confirmed
  • news:error - Error notifications

Plan Requirements

WebSocket streaming requires Pro or Enterprise plan.
PlanSupportConnections
Test (Free)No-
StarterNo-
ProYes10
EnterpriseYes50

Quick Example

import { io } from 'socket.io-client';

const socket = io('wss://api.byul.ai/news-v2', {
  auth: { apiKey: 'byul_api_key' }
});

socket.on('connect', () => {
  socket.emit('news:subscribe', { 
    minImportance: 8,
    startDate: '2024-01-01T00:00:00.000Z',
    endDate: '2024-01-31T23:59:59.999Z'
  });
});

socket.on('news:data', (response) => {
  response.data.news.forEach(article => {
    console.log(`${article.title} (${article.importanceScore})`);
  });
});

Next Steps