How it works
1
Authenticate
Obtain a Benzinga API token from the Benzinga Console and append it as a
token query parameter when opening the connection.2
Connect
Open a WebSocket connection to the stream URL for the data you need — for example
wss://api.benzinga.com/api/v1/analyst/insights/stream?token=YOUR_TOKEN.3
Receive events
Messages arrive as JSON objects with a consistent envelope: an
id, api_version, kind, and a data block that carries the action (created, updated, or deleted) and the payload.4
Keep the connection alive
Send a
ping plain-text frame periodically (every 30–60 s). The server responds with pong. The server also sends its own ping every 10 s — most WebSocket libraries handle this automatically.One connection per API key
Each API key may hold one active connection per stream at a time. The limit is per stream and enforced across all of Benzinga’s servers. You can run connections to several different streams at once with the same key — but only one connection to any given stream. This keeps delivery ordering consistent for your key on each stream and prevents a single token from fanning out into unbounded concurrent connections to the same stream.What this means in practice
- Don’t open more than one connection to the same stream with a single key (per browser tab, worker, or server instance) — consolidate to one connection per stream and distribute messages internally.
- Connecting to different streams with the same key is fine — each stream permits its own single connection.
- If you need multiple concurrent consumers of the same stream, request additional API keys.
- Treat a
429on connect as “another session is already active for this key on this stream,” not as a rate limit on message volume.
Reconnecting
When a connection drops (network blip, deploy, or a missed keepalive ping), reconnect — but expect a brief hand-off window before the previous session’s slot frees:1
Reconnect with backoff
Retry with exponential backoff (e.g. start at ~2 s, cap around 15 s). A
429 means your previous session for that stream is still considered active; keep backing off and retry until it succeeds.2
Deduplicate
Use the message
id to drop any events you may see again around the reconnect boundary.If your process exits without closing the socket cleanly, the slot is released automatically after a short server-side timeout — no manual cleanup is required. Just reconnect with backoff; a freshly dropped connection can take a few seconds to free.
Available streams
Analyst Insights
Real-time analyst ratings, price targets, and detailed recommendations as they’re published.
Ratings
Analyst rating changes and price target updates from major firms.
Consensus Ratings
Aggregated consensus ratings and price targets across all tracked analysts.
Earnings
Earnings announcements with EPS, revenue, estimates, and surprise metrics.
Bulls/Bears Say
Bull and bear case scenarios for securities, published in real time.
News
Breaking news articles and market updates from Benzinga’s editorial team.
Earnings Call Transcripts
Live earnings call transcripts delivered sentence-by-sentence as they’re spoken.
Message envelope
Every stream message follows the same top-level structure:Reference pages
Authentication
How to obtain and use your API token.
Supported Actions
ping and replay commands you can send on any stream.Errors
Error codes and how to handle connection failures.