Skip to main content

Server Endpoint

ParameterValue
Hosttcp-v1.benzinga.io
Port11337
ProtocolTCP
TLSOptional (disabled by default)

Authentication

Connect using your username and API key:
bztcp -v -user YOUR_USERNAME -key YOUR_API_KEY

Command Line Options

OptionDescription
-userYour Benzinga TCP username
-keyYour API access key
-vEnable verbose output

Connection Flow

Connection States

Once connected, youโ€™ll see initialization messages:
Benzinga TCP Client initializing.
Connecting to 'tcp-v1.benzinga.io:11337' as user 'YOUR_USERNAME' (w/TLS: false)
Connected. Waiting for events.
After the connection is established, JSON messages begin streaming automatically.

TLS Configuration

By default, connections are made without TLS. To enable TLS encryption, use the appropriate flag provided by your client library.

Connection Best Practices

Keep your connection alive to receive continuous updates. Implement reconnection logic to handle network interruptions gracefully.
  1. Implement Reconnection Logic: Network interruptions can occur; implement exponential backoff for reconnection attempts
  2. Handle Disconnections: Monitor connection state and reconnect when needed
  3. Buffer Messages: Process messages asynchronously to avoid blocking the receive loop
  4. Log Connection Events: Track connection status for debugging and monitoring

Example Connection

conn, err := bztcp.Dial("tcp-v1.benzinga.io:11337", "USERNAME", "API_KEY")
if err != nil {
    log.Fatal(err)
}

Next Steps