WebSocket websocket/v1:

wss://api.benzinga.com/api/v1/consensus-ratings/stream

Parameters

NameLocationTypeRequiredDescription
tokenquerystringYesBenzinga websocket token (bz.production***).
tickersquerystringOptionalList of tickers you want to subscribe for. Seperated by comma.
isinsquerystringOptionalList of isins you want to filter by. Seperated by comma.
simplifyquerystringOptionalSimplify the ratings to Buy, Hold, Sell.
aggregate_typequerystringOptionalAggregate 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:

{
    "id": "e9e75b31-604e-422c-a532-362725b2d59d",
    "api_version": "websocket/v1",
    "kind": "data/v2.1/calendar/ratings",
    "data": {
      "aggregate_ratings": {
        "buy": 123,
        "hold": 123,
        "sell": 123,
        "strong_buy": 123,
        "strong_sell": 123
      },
      "aggregate_type": "number",
      "consensus_price_target": 123,
      "consensus_rating": "SELL",
      "consensus_rating_val": 123,
      "high_price_target": 123,
      "low_price_target": 123,
      "total_analyst_count": 123,
      "unique_analyst_count": 123,
      "updated_at": "2024-10-04T19:21:06.880730108Z"
    }
}

Responses

  • 200 OK
  • Description: Success
  • Content Type: application/json
  • Schema: RatingsWSResp

Data Structures

RatingsWSResp

PropertyTypeDescription
idstringUnique UUID for the websocket response
api_versionstringWebsocket API version
kindstringWebsocket connection stream type
dataobjectContains the ratings data. See below for properties.

Data Properties

PropertyTypeDescription
actionstringWebsocket data action i.e., created, updated, deleted
idstringData ID for the rating
contentobjectDetails about the ratings. See ratings for more properties.
timestampstringTimestamp of the data

Aggregate_Ratings Properties

PropertyTypeDescription
strong_buyintTotal strong_buy count/percentage
buyintTotal buy count/percentage
holdintDetails about the ratings. See ratings for more properties.
sellintTimestamp of the data
strong_sellintTimestamp of the data

Ratings

PropertyTypeDescription
aggregate_ratingsobjectContains all the ratings categorized by SELL, HOLD, BUY
aggregate_typestringType of aggregation, Number or Percentage
consensus_price_targetstringAverage price target
consensus_ratingstringScale value, SELL, HOLD, BUY
consensus_rating_valstringValue in float
high_price_targetstringHighest price target in the specific timeline
low_price_targetstringLowest price target in the specific timeline
total_analyst_countstringTotal analyst ratings in the timeline
unique_analyst_countstringUnique analyst count in the timeline
updated_atstringLast 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?