> ## Documentation Index
> Fetch the complete documentation index at: https://docs.benzinga.com/llms.txt
> Use this file to discover all available pages before exploring further.

# レーティングストリーム

> リアルタイムのアナリスト・レーティングと目標株価の変更

<div id="overview">
  ## 概要
</div>

アナリストのレーティング変更および目標株価の更新をリアルタイムで購読できます。格上げ、格下げ、新規カバレッジ開始、目標株価の調整を、発生したタイミングで監視できます。

<div id="key-features">
  ### 主な機能
</div>

* **リアルタイム・レーティング**: アナリストのレーティング変更をリアルタイムに通知
* **目標株価**: 現在および過去の目標株価とその調整履歴を追跡
* **アナリスト詳細**: アナリスト名、所属機関、過去の的中率などの指標を提供
* **アクション分類**: アップグレード、ダウングレード、維持、新規、再提示
* **銘柄でフィルタリング**: 特定のティッカーまたはISINを購読

<div id="use-cases">
  ### ユースケース
</div>

* リアルタイムのレーティング変更アラートと通知を構築する
* アナリスト・ファームのパフォーマンスと精度を追跡する
* 目標株価コンセンサスの変化を監視する
* レーティングの格上げ／格下げダッシュボードを作成する
* アナリストのアクションに基づく自動売買戦略を構築する

<div id="quick-start">
  ## クイックスタート
</div>

上部のインタラクティブなウェブソケットテスターを使って、リアルタイムでストリーム接続をテストします。

<div id="connection-url">
  ### 接続URL
</div>

```
wss://api.benzinga.com/api/v2.1/calendar/ratings/stream?token=YOUR_TOKEN
```

<div id="query-parameters">
  ### クエリパラメータ
</div>

| パラメータ     | 必須  | 説明                                                  |
| --------- | --- | --------------------------------------------------- |
| `token`   | Yes | お客様の Benzinga ウェブソケット API トークン（bz.production\*\*\*） |
| `tickers` | No  | ティッカーシンボルのカンマ区切りリスト（例: `AAPL,TSLA`）                 |
| `isins`   | No  | 絞り込み対象の ISIN（国際証券識別番号）のカンマ区切りリスト                    |

<div id="message-example">
  ## メッセージ例
</div>

```json theme={null}
{
  "id": "e9e75b31-604e-422c-a532-362725b2d59d",
  "api_version": "websocket/v1",
  "kind": "data/v2.1/calendar/ratings",
  "data": {
    "action": "created",
    "id": "66fffdc08f3f630001a2ea51",
    "timestamp": "2024-10-04T19:21:06Z",
    "content": {
      "ticker": "AAPL",
      "name": "Apple",
      "exchange": "NASDAQ",
      "date": "2024-10-04",
      "time": "10:37:52",
      "action_company": "Upgrades",
      "rating_current": "Buy",
      "rating_prior": "Neutral",
      "pt_current": "200.00",
      "pt_prior": "180.00",
      "analyst": "Goldman Sachs",
      "firm_id": "57f832ab6b87f600016fa383",
      "importance": 4
    }
  }
}
```

<div id="rating-actions">
  ### レーティングアクション
</div>

| アクション        | 説明                               |
| ------------ | -------------------------------- |
| `Upgrades`   | レーティングが引き上げられた（例: Neutral → Buy） |
| `Downgrades` | レーティングが引き下げられた（例: Buy → Hold）    |
| `Maintains`  | レーティングは変更なし                      |
| `Initiates`  | 初めてのレーティング付与                     |
| `Reiterates` | 既存レーティングの再表明                     |

<div id="message-actions">
  ### メッセージアクション
</div>

| Action                | 説明             |
| --------------------- | -------------- |
| `created` / `Created` | 新規レーティングが公開された |
| `updated` / `Updated` | レーティングが更新された   |
| `deleted` / `Deleted` | レーティングが削除された   |

<div id="interactive-commands">
  ## 対話型コマンド
</div>

| Command  | 説明                         |
| -------- | -------------------------- |
| `ping`   | 接続を維持する（`pong` で応答）        |
| `replay` | 最大で直近100件のキャッシュ済みメッセージを再送信 |

<div id="best-practices">
  ## ベストプラクティス
</div>

* **変更の追跡**: アップグレード/ダウングレードを検知するために `rating_current` と `rating_prior` を比較する
* **目標株価の変動**: 目標株価の変更を把握するために `pt_current` と `pt_prior` を監視する
* **アナリストの信頼性**: 証券会社（ファーム）の重要度と過去の予想精度を考慮する
* **重要度フィルター**: インパクトの大きなケースでは重要度が高い (4〜5) レーティングに注目する


## AsyncAPI

````yaml asyncapi/calendar-ratings-stream.yml calendarRatings
id: calendarRatings
title: Calendar ratings
description: Send action commands; receive real-time ratings updates
servers:
  - id: production
    protocol: wss
    host: api.benzinga.com/api/v2.1/calendar/ratings
    bindings: []
    variables: []
address: stream
parameters: []
bindings: []
operations:
  - &ref_2
    id: calendarRatings.publish
    title: Calendar ratings.publish
    description: Send commands to the server
    type: receive
    messages:
      - &ref_4
        id: publish
        contentType: text/plain
        payload:
          - type: string
            enum: &ref_0
              - ping
              - replay
            description: Send action commands (ping, replay)
            x-parser-schema-id: <anonymous-schema-1>
            name: publish
        headers: []
        jsonPayloadSchema:
          type: string
          enum: *ref_0
          description: Action to perform (ping for heartbeat, replay for message history)
          x-parser-schema-id: <anonymous-schema-1>
        title: Publish
        description: Send action commands (ping, replay)
        example: '{}'
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: publish
          - id: x-parser-message-name
            value: ActionRequest
    bindings: []
    extensions: &ref_1
      - id: x-parser-unique-object-id
        value: calendarRatings
  - &ref_3
    id: calendarRatings.subscribe
    title: Calendar ratings.subscribe
    description: Receive real-time ratings data
    type: send
    messages:
      - &ref_5
        id: subscribe
        contentType: application/json
        payload:
          - name: subscribe
            description: Analyst ratings event
            type: object
            properties:
              - name: id
                type: string
                description: Unique UUID for the websocket response
                required: true
              - name: api_version
                type: string
                description: Websocket API version
                enumValues:
                  - websocket/v1
                required: true
              - name: kind
                type: string
                description: Websocket connection stream type
                enumValues:
                  - data/v2.1/calendar/ratings
                required: true
              - name: data
                type: object
                required: true
                properties:
                  - name: action
                    type: string
                    description: Websocket data action
                    enumValues:
                      - created
                      - updated
                      - deleted
                      - Created
                      - Updated
                      - Deleted
                    required: true
                  - name: id
                    type: string
                    description: Data ID for the rating
                    required: true
                  - name: timestamp
                    type: string
                    description: Timestamp of the data
                    required: true
                  - name: content
                    type: object
                    required: true
                    properties:
                      - name: id
                        type: string
                        description: Unique ID of this entry
                        required: true
                      - name: date
                        type: string
                        description: Date for rating
                        required: true
                      - name: time
                        type: string
                        description: Time for rating
                        required: false
                      - name: ticker
                        type: string
                        description: >-
                          Ticker symbol of the company that is the subject of
                          the rating
                        required: true
                      - name: exchange
                        type: string
                        description: Exchange (NYSE, NASDAQ, etc...)
                        required: true
                      - name: isin
                        type: string
                        description: International Securities Identification Number
                        required: false
                      - name: cusip
                        type: string
                        description: CUSIP identifier
                        required: false
                      - name: name
                        type: string
                        description: Name of the company that is the subject of the rating
                        required: true
                      - name: currency
                        type: string
                        description: Currency the data is denominated in
                        required: false
                      - name: action_pt
                        type: string
                        description: >-
                          Description of the change in price target from the
                          firm's last price target
                        required: false
                      - name: action_company
                        type: string
                        description: >-
                          Description of the change in rating from the firm's
                          last rating
                        required: false
                      - name: rating_current
                        type: string
                        description: The analyst's current rating for the company
                        required: false
                      - name: pt_current
                        type: string
                        description: Analyst's current price target
                        required: false
                      - name: adjusted_pt_current
                        type: string
                        description: >-
                          Analyst's current price target, adjusted for stock
                          splits and dividends
                        required: false
                      - name: rating_prior
                        type: string
                        description: Prior analyst rating for the company
                        required: false
                      - name: pt_prior
                        type: string
                        description: Analyst's prior price target
                        required: false
                      - name: adjusted_pt_prior
                        type: string
                        description: >-
                          Analyst's prior price target, adjusted for stock
                          splits and dividends
                        required: false
                      - name: url
                        type: string
                        description: >-
                          URL for the analyst ratings page for this ticker on
                          Benzinga.com
                        required: false
                      - name: url_calendar
                        type: string
                        description: >-
                          URL for the analyst ratings page for this ticker on
                          Benzinga.com
                        required: false
                      - name: url_news
                        type: string
                        description: >-
                          URL for the analyst ratings news articles for this
                          ticker on Benzinga.com
                        required: false
                      - name: analyst
                        type: string
                        description: Name of the analyst firm that published the rating
                        required: false
                      - name: analyst_id
                        type: string
                        description: ID of the analyst
                        required: false
                      - name: analyst_name
                        type: string
                        description: Name of the analyst (person) that published the rating
                        required: false
                      - name: firm_id
                        type: string
                        description: Unique identifier for the firm
                        required: false
                      - name: importance
                        type: integer
                        description: >-
                          Subjective basis of how important the event is to the
                          market (5 = High)
                        required: false
                      - name: notes
                        type: string
                        description: >-
                          Additional notes provided by the Benzinga Newsdesk
                          where applicable
                        required: false
                      - name: updated
                        type: integer
                        description: Last updated timestamp in UTC
                        required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - id
            - api_version
            - kind
            - data
          properties:
            id:
              type: string
              format: uuid
              description: Unique UUID for the websocket response
              x-parser-schema-id: <anonymous-schema-3>
            api_version:
              type: string
              enum:
                - websocket/v1
              description: Websocket API version
              x-parser-schema-id: <anonymous-schema-4>
            kind:
              type: string
              enum:
                - data/v2.1/calendar/ratings
              description: Websocket connection stream type
              x-parser-schema-id: <anonymous-schema-5>
            data:
              type: object
              required:
                - action
                - id
                - content
                - timestamp
              properties:
                action:
                  type: string
                  enum:
                    - created
                    - updated
                    - deleted
                    - Created
                    - Updated
                    - Deleted
                  description: Websocket data action
                  x-parser-schema-id: <anonymous-schema-7>
                id:
                  type: string
                  description: Data ID for the rating
                  x-parser-schema-id: <anonymous-schema-8>
                timestamp:
                  type: string
                  format: date-time
                  description: Timestamp of the data
                  x-parser-schema-id: <anonymous-schema-9>
                content:
                  type: object
                  required:
                    - id
                    - date
                    - ticker
                    - exchange
                    - name
                  properties:
                    id:
                      type: string
                      description: Unique ID of this entry
                      x-parser-schema-id: <anonymous-schema-11>
                    date:
                      type: string
                      format: date
                      description: Date for rating
                      x-parser-schema-id: <anonymous-schema-12>
                    time:
                      type: string
                      description: Time for rating
                      x-parser-schema-id: <anonymous-schema-13>
                    ticker:
                      type: string
                      description: >-
                        Ticker symbol of the company that is the subject of the
                        rating
                      x-parser-schema-id: <anonymous-schema-14>
                    exchange:
                      type: string
                      description: Exchange (NYSE, NASDAQ, etc...)
                      x-parser-schema-id: <anonymous-schema-15>
                    isin:
                      type: string
                      description: International Securities Identification Number
                      x-parser-schema-id: <anonymous-schema-16>
                    cusip:
                      type: string
                      description: CUSIP identifier
                      x-parser-schema-id: <anonymous-schema-17>
                    name:
                      type: string
                      description: Name of the company that is the subject of the rating
                      x-parser-schema-id: <anonymous-schema-18>
                    currency:
                      type: string
                      description: Currency the data is denominated in
                      x-parser-schema-id: <anonymous-schema-19>
                    action_pt:
                      type: string
                      description: >-
                        Description of the change in price target from the
                        firm's last price target
                      x-parser-schema-id: <anonymous-schema-20>
                    action_company:
                      type: string
                      description: >-
                        Description of the change in rating from the firm's last
                        rating
                      x-parser-schema-id: <anonymous-schema-21>
                    rating_current:
                      type: string
                      description: The analyst's current rating for the company
                      x-parser-schema-id: <anonymous-schema-22>
                    pt_current:
                      type: string
                      description: Analyst's current price target
                      x-parser-schema-id: <anonymous-schema-23>
                    adjusted_pt_current:
                      type: string
                      description: >-
                        Analyst's current price target, adjusted for stock
                        splits and dividends
                      x-parser-schema-id: <anonymous-schema-24>
                    rating_prior:
                      type: string
                      description: Prior analyst rating for the company
                      x-parser-schema-id: <anonymous-schema-25>
                    pt_prior:
                      type: string
                      description: Analyst's prior price target
                      x-parser-schema-id: <anonymous-schema-26>
                    adjusted_pt_prior:
                      type: string
                      description: >-
                        Analyst's prior price target, adjusted for stock splits
                        and dividends
                      x-parser-schema-id: <anonymous-schema-27>
                    url:
                      type: string
                      format: uri
                      description: >-
                        URL for the analyst ratings page for this ticker on
                        Benzinga.com
                      x-parser-schema-id: <anonymous-schema-28>
                    url_calendar:
                      type: string
                      format: uri
                      description: >-
                        URL for the analyst ratings page for this ticker on
                        Benzinga.com
                      x-parser-schema-id: <anonymous-schema-29>
                    url_news:
                      type: string
                      format: uri
                      description: >-
                        URL for the analyst ratings news articles for this
                        ticker on Benzinga.com
                      x-parser-schema-id: <anonymous-schema-30>
                    analyst:
                      type: string
                      description: Name of the analyst firm that published the rating
                      x-parser-schema-id: <anonymous-schema-31>
                    analyst_id:
                      type: string
                      description: ID of the analyst
                      x-parser-schema-id: <anonymous-schema-32>
                    analyst_name:
                      type: string
                      description: Name of the analyst (person) that published the rating
                      x-parser-schema-id: <anonymous-schema-33>
                    firm_id:
                      type: string
                      description: Unique identifier for the firm
                      x-parser-schema-id: <anonymous-schema-34>
                    importance:
                      type: integer
                      minimum: 0
                      maximum: 5
                      description: >-
                        Subjective basis of how important the event is to the
                        market (5 = High)
                      x-parser-schema-id: <anonymous-schema-35>
                    notes:
                      type: string
                      description: >-
                        Additional notes provided by the Benzinga Newsdesk where
                        applicable
                      x-parser-schema-id: <anonymous-schema-36>
                    updated:
                      type: integer
                      format: int64
                      description: Last updated timestamp in UTC
                      x-parser-schema-id: <anonymous-schema-37>
                  x-parser-schema-id: <anonymous-schema-10>
              x-parser-schema-id: <anonymous-schema-6>
          x-parser-schema-id: <anonymous-schema-2>
        title: Subscribe
        description: Analyst ratings event
        example: No examples found
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribe
          - id: x-parser-message-name
            value: RatingsMessage
    bindings: []
    extensions: *ref_1
sendOperations:
  - *ref_2
receiveOperations:
  - *ref_3
sendMessages:
  - *ref_4
receiveMessages:
  - *ref_5
extensions:
  - id: x-parser-unique-object-id
    value: calendarRatings
securitySchemes:
  - id: tokenAuth
    name: token
    type: httpApiKey
    description: Benzinga WebSocket API token (bz.production***)
    in: query
    extensions: []

````