Data Websocket
[Calendar] Consensus Ratings Stream
get consensus ratings stream.
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. |
simplify | query | string | Optional | Simplify the ratings to Buy, Hold, Sell. |
aggregate_type | query | string | Optional | Aggregate by which is either number or percentage |
Stream Response
When you subscribe to the stream, you’ll receive updates about analyst insights in the following format:
Responses
- 200 OK
- Description: Success
- Content Type:
application/json
- Schema: RatingsWSResp
Data Structures
RatingsWSResp
Property | Type | Description |
---|---|---|
id | string | Unique UUID for the websocket response |
api_version | string | Websocket API version |
kind | string | Websocket connection stream type |
data | object | Contains the ratings data. See below for properties. |
Data Properties
Property | Type | Description |
---|---|---|
action | string | Websocket data action i.e., created, updated, deleted |
id | string | Data ID for the rating |
content | object | Details about the ratings. See ratings for more properties. |
timestamp | string | Timestamp of the data |
Aggregate_Ratings Properties
Property | Type | Description |
---|---|---|
strong_buy | int | Total strong_buy count/percentage |
buy | int | Total buy count/percentage |
hold | int | Details about the ratings. See ratings for more properties. |
sell | int | Timestamp of the data |
strong_sell | int | Timestamp of the data |
Ratings
Property | Type | Description |
---|---|---|
aggregate_ratings | object | Contains all the ratings categorized by SELL, HOLD, BUY |
aggregate_type | string | Type of aggregation, Number or Percentage |
consensus_price_target | string | Average price target |
consensus_rating | string | Scale value, SELL, HOLD, BUY |
consensus_rating_val | string | Value in float |
high_price_target | string | Highest price target in the specific timeline |
low_price_target | string | Lowest price target in the specific timeline |
total_analyst_count | string | Total analyst ratings in the timeline |
unique_analyst_count | string | Unique analyst count in the timeline |
updated_at | string | Last updated timestamp in UTC |
Success Response
- Success
101
- Websocket connection established successfully.
✅ Connected to wss://api.benzinga.com/api/v1/consensus-ratings/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/consensus-ratings/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/vv1/consensus-ratings/stream?token=bz.p***
Error: Unexpected server response: 502
Handshake Details
Request Method: “GET”
Status Code: “502 Bad Gateway”
Was this page helpful?