Skip to main content

WebSocket Connection Setup

Connect to real-time financial news streams using WebSocket API. Setup Steps:
  • Configure WebSocket client with API key authentication
  • Subscribe to filtered news streams
  • Handle real-time data events
  • Implement error handling and reconnection logic

Prerequisites

WebSocket requires Pro Plan ($99/month) or Enterprise Plan. Upgrade your plan if needed.

Step 1: Get Your API Key

  1. Login to Byul API Dashboard
  2. Your API key is automatically generated and displayed
  3. Copy your API key (starts with byul_v2_)

Step 2: Install Dependencies

Step 3: Create Your First Connection

Step 4: Run Your Code

Expected output:

Connection Complete

WebSocket connection established and receiving real-time news updates.

What’s Next?

Authentication

Learn about API key authentication and security best practices

Filtering News

Filter news by importance, symbols, and categories

Error Handling

Handle connection errors and implement retry logic

Production Examples

See production-ready implementation examples

Troubleshooting

Common Issues

Authentication Failed
  • Verify API key format (starts with byul_v2_)
  • Check API key at Dashboard
  • Confirm Pro or Enterprise plan access
WebSocket Not Supported
  • Requires Pro or Enterprise plan
  • Check current plan status
Connection Timeout
  • Verify network connectivity
  • Check firewall settings
  • Test from different network if needed

Additional Resources

Security: Use environment variables in production to store API keys securely: