WebSocket websocket/v1:
Parameters:
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
token | query | string | Yes | Benzinga websocket token (bz.production***). |
tickers | query | string | Optional | List of tickers you want to subscribe for. Seperated by comma. |
isins | query | string | Optional | List of isins you want to filter by. Seperated by comma. |
Stream Response:
When you subscribe to the stream, you’ll receive updates about analyst insights in the following format:Supported Actions
| Action | Description | Example |
|---|---|---|
list | Replays up to the last 100 messages. The actual number may vary based on cache availability. | replay |
ping | Keeps the WebSocket connection alive. | ping |
Note: You cannot specify the number of messages to replay. The number returned depends on how many are currently cached for the associated key.
Responses
- 200 OK
- Description: Success
- Content Type:
application/json - Schema: AnalystInsightsWSResp
AnalystInsightWSResp
| Property | Type | Description |
|---|---|---|
| id | string | Unique UUID for the websocket response. |
| api_version | string | Websocket API version. Defaults to websocket/v1. |
| kind | string | Websocket connection stream type. |
| data | object | Contains details about the websocket data. |
| - action | string | Websocket data action (e.g., created, updated, deleted). |
| - id | string | Data ID for the analyst insight. |
| - content | object | Reference to AnalystInsight schema. |
| - timestamp | string | Timestamp of the data. |
AnalystInsight
| Property | Type | Description |
|---|---|---|
| action | string | Analyst’s action on the stock (e.g., Maintains, Upgrades). |
| analyst_insights | string | Detailed insights from the analyst. |
| date | string | Date of the analyst insight (formatted as date). |
| firm | string | Name of the firm providing the insight. |
| firm_id | string | Unique identifier for the firm. |
| id | string | Unique identifier for the analyst insight (formatted as UUID). |
| pt | string | Price target given by the analyst. |
| rating | string | Rating provided by the analyst. |
| rating_id | string | Unique identifier for the rating. |
| security | object | Contains security details for which the insight is provided. |
| - cik | string | Central Index Key of the security. |
| - exchange | string | Exchange where the security is listed. |
| - isin | string | International Securities Identification Number. |
| - name | string | Name of the security. |
| - symbol | string | Ticker symbol of the security. |
| updated | integer | Timestamp of when the insight was last updated (formatted as int64). |
Success Response
- Success
101- Websocket connection established successfully.
✅ Connected to wss://api.benzinga.com/api/v1/analyst/insights/stream?token=bz.p***
Handshake Details
Request Method: “GET”
Status Code: “101 Switching Protocols”
Error Response
- Unauthorized
401- Invalid token, check the token provided.
❗ Could not connect to wss://api.benzinga.com/api/v1/analyst/insights/stream?token=bz.p***
Error: Unexpected server response: 401
Handshake Details
Request Method: “GET”
Status Code: “401 Unauthorized”
- Bad Gateway
502- Either invalid route or server error.
❗ Could not connect to wss://api.benzinga.com/api/v1/analyst/insights/stream?token=bz.p***
Error: Unexpected server response: 502
Handshake Details
Request Method: “GET”
Status Code: “502 Bad Gateway”