WebSocket websocket/v1:

wss://api.benzinga.com/api/v2.1/calendar/ratings/stream

Parameters

NameLocationTypeDescription
tokenquerystringBenzinga websocket token (bz.production***).
fieldsqueryarraySelect fields to return. Default fields are: id, date, time, ticker, exchange, name, currency, action_pt, action_company, rating_current, pt_current, rating_prior, pt_prior, url, url_calendar, url_news, analyst, analyst_name, importance, notes, updated.
pagequeryintegerPage offset. Limited from 0 - 100000.
pagesizequeryintegerNumber of results returned. Limit is 1000.
parameters[date]querystringDate to query for calendar data. Shorthand for date_from and date_to if they are the same. Defaults to latest.
parameters[date_from]querystringDate to query from point in time.
parameters[date_to]querystringDate to query to point in time.
parameters[tickers]querystringOne or more ticker symbols separated by a comma. Maximum 50 tickers.
parameters[importance]queryintegerThe importance level to filter by. Uses Greater Than or Equal To the importance indicated.
parameters[updated]queryintegerRecords last updated Unix timestamp (UTC). Forces the sort order to be Greater Than or Equal to the timestamp indicated.
parameters[action]querystringFilter by a specific action_company (action for rating).
parameters[analyst_id]querystringOne or more analyst ids (analyst_id) separated by a comma.
parameters[firm_id]querystringOne or more firm ids (firm_id) separated by a comma.
analystquerystringA comma separated list of analyst (person) IDs to return. Omitting will return all available analysts.
firmquerystringA comma separated list of analyst firm IDs to return. Omitting will return all available firms.

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": {
        "action": "created",
        "id": "66fffdc08f3f630001a2ea51",
        "content": {
            "action_company": "Maintains",
            "action_pt": "",
            "adjusted_pt_current": "",
            "adjusted_pt_prior": "154.00",
            "analyst": "RBC Capital",
            "currency": "USD",
            "cusip": "037833100",
            "date": "2024-10-04",
            "exchange": "NASDAQ",
            "firm_id": "57f832ab6b87f600016fa383",
            "id": "66fffdc08f3f630001a2ea51",
            "importance": 0,
            "isin": "US0378331005",
            "name": "Apple",
            "notes": "",
            "pt_current": "",
            "pt_prior": "154.00",
            "rating_current": "Buy",
            "rating_prior": "Outperform",
            "ticker": "AAPL",
            "time": "10:37:52",
            "updated": 1728069650,
            "url": "https://www.benzinga.com/quote/AAPL/analyst-ratings",
            "url_calendar": "https://www.benzinga.com/quote/AAPL/analyst-ratings",
            "url_news": "https://www.benzinga.com/stock-articles/AAPL/analyst-ratings"
        },
        "timestamp": "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

Ratings

PropertyTypeDescription
idstringUnique ID of this entry
datestringDate for rating
timestringTime for rating
tickerstringTicker symbol of the company that is the subject of the rating
exchangestringExchange (NYSE, NASDAQ, etc…)
namestringName of the company that is the subject of the rating
currencystringCurrency the data is denominated in
action_ptstringDescription of the change in price target from the firm’s last price target
action_companystringDescription of the change in rating from the firm’s last rating
rating_currentstringThe analyst’s current rating for the company
pt_currentstringAnalyst’s current price target
adjusted_pt_currentstringAnalyst’s current price target, adjusted for stock splits and dividends
rating_priorstringPrior analyst rating for the company
pt_priorstringAnalyst’s prior price target
adjusted_pt_priorstringAnalyst’s prior price target, adjusted for stock splits and dividends
urlstringURL for the analyst ratings page for this ticker on Benzinga.com
url_calendarstringURL for the analyst ratings page for this ticker on Benzinga.com
url_newsstringURL for the analyst ratings news articles for this ticker on Benzinga.com
analyststringName of the analyst firm that published the rating
analyst_idstringID of the analyst
analyst_namestringName of the analyst (person) that published the rating
ratings_accuracyobjectAccuracy metrics for ratings. See ratings_accuracy for more properties.
importancestringSubjective basis of how important the event is to the market (5 = High)
notesstringAdditional notes provided by the Benzinga Newsdesk where applicable.
updatedintegerLast updated timestamp in UTC

Ratings Accuracy

PropertyTypeDescription
smart_scorestringA weighted average of the total_ratings_percentile, overall_avg_return_percentile, and overall_success_rate
overall_success_ratestringThe percentage of gain/loss ratings that resulted in a gain overall
overall_avg_return_percentilestringThe percentile of this analyst’s overall average return per rating in comparison to other analysts
total_ratings_percentilestringThe percentile of this analyst’s total number of ratings in comparison to the total number of ratings published
total_ratingsintegerNumber of recommendations made by this analyst
overall_gain_countintegerThe number of ratings that have gained value since the date of recommendation
overall_loss_countintegerThe number of ratings that have lost value since the date of recommendation
overall_average_returnstringThe average percent price difference per rating since the date of recommendation
overall_stdevstringThe standard deviation in percent price difference in the analyst’s ratings since the date of recommendation
1m_gain_countstringThe number of ratings that have gained value over the last month
1m_loss_countstringThe number of ratings that have lost value over the last month
1m_average_returnstringThe average percent price difference per rating over the last month
1m_stdevstringThe standard deviation in percent price difference in the analyst’s ratings over the last month
3m_gain_countstringThe number of ratings that have gained value over the last three months
3m_loss_countstringThe number of ratings that have lost value over the last three months
3m_average_returnstringThe average percent price difference per rating over the last three months
3m_stdevstringThe standard deviation in percent price difference in the analyst’s ratings over the last three months
9m_gain_countstringThe number of ratings that have gained value over the last nine months
9m_loss_countstringThe number of ratings that have lost value over the last nine months

Success Response

  • Success 101 - Websocket connection established successfully.

✅ Connected to wss://api.benzinga.com/api/v2.1/calendar/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/v2.1/calendar/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/v2.1/calendar/ratings/stream?token=bz.p***

Error: Unexpected server response: 502

Handshake Details

Request Method: “GET”
Status Code: “502 Bad Gateway”