Skip to main content

WebSocket websocket/v1:

wss://api.benzinga.com/api/v1/analyst/insights/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.

Stream Response:

When you subscribe to the stream, you’ll receive updates about analyst insights in the following format:
{
  "id": "unique-uuid-for-response",
  "api_version": "websocket/v1",
  "kind": "stream_type",
  "data": {
    "action": "created/updated/deleted",
    "id": "insight-id",
    "content": {
      "action": "Upgrades",
      "analyst_insights": "The analyst has upgraded the stock...",
      "date": "2024-10-08",
      "firm": "Goldman Sachs",
      "firm_id": "firm-uuid",
      "id": "insight-uuid",
      "pt": "150.00",
      "rating": "Buy",
      "rating_id": "rating-uuid",
      "security": {
        "cik": "0000320193",
        "exchange": "NASDAQ",
        "isin": "US0378331005",
        "name": "Apple Inc.",
        "symbol": "AAPL"
      },
      "updated": 1696790400000
    },
    "timestamp": "2024-10-08T10:00:00Z"
  }
}

Supported Actions

ActionDescriptionExample
listReplays up to the last 100 messages. The actual number may vary based on cache availability.replay
pingKeeps 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

AnalystInsightWSResp

PropertyTypeDescription
idstringUnique UUID for the websocket response.
api_versionstringWebsocket API version. Defaults to websocket/v1.
kindstringWebsocket connection stream type.
dataobjectContains details about the websocket data.
- actionstringWebsocket data action (e.g., created, updated, deleted).
- idstringData ID for the analyst insight.
- contentobjectReference to AnalystInsight schema.
- timestampstringTimestamp of the data.

AnalystInsight

PropertyTypeDescription
actionstringAnalyst’s action on the stock (e.g., Maintains, Upgrades).
analyst_insightsstringDetailed insights from the analyst.
datestringDate of the analyst insight (formatted as date).
firmstringName of the firm providing the insight.
firm_idstringUnique identifier for the firm.
idstringUnique identifier for the analyst insight (formatted as UUID).
ptstringPrice target given by the analyst.
ratingstringRating provided by the analyst.
rating_idstringUnique identifier for the rating.
securityobjectContains security details for which the insight is provided.
- cikstringCentral Index Key of the security.
- exchangestringExchange where the security is listed.
- isinstringInternational Securities Identification Number.
- namestringName of the security.
- symbolstringTicker symbol of the security.
updatedintegerTimestamp 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”