> ## 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>

* **إجماع مجمّع**: عرض موحّد لجميع تصنيفات المحللين لورقة مالية
* **إجماع السعر المستهدف**: متوسط الأسعار المستهدفة ونطاقها (الأعلى والأدنى)
* **توزيع التصنيفات**: توزيع حسب شراء قوي، شراء، احتفاظ، بيع، بيع قوي
* **عدد المحللين**: تتبّع العدد الإجمالي وعدد المحللين الفريدين الذين يغطّون الورقة المالية
* **تجميع مرن**: عرض كقيم عددية أو كنسب مئوية

<div id="use-cases">
  ### حالات الاستخدام
</div>

* إنشاء لوحات معلومات وأدوات واجهة لإجماع التقييمات
* تتبّع تغيّرات اتجاه المحللين
* مقارنة التقييمات الفردية مع الإجماع
* مراقبة نطاقات السعر المستهدف (المرتفع، المنخفض، المتوسط)
* تحديد الأوراق المالية التي يشهد إجماع التقييمات عليها تحسّنًا أو تراجعًا

<div id="quick-start">
  ## البدء السريع
</div>

استخدم أداة اختبار ويب سوكيت التفاعلية أعلاه للاتصال بالبث واختباره في الوقت الفعلي.

<div id="connection-url">
  ### رابط الاتصال URL
</div>

```
wss://api.benzinga.com/api/v1/consensus-ratings/stream?token=YOUR_TOKEN
```

<div id="query-parameters">
  ### معاملات الاستعلام
</div>

| المعامل          | إلزامي | الوصف                                                                                       |
| ---------------- | ------ | ------------------------------------------------------------------------------------------- |
| `token`          | Yes    | رمز الوصول الخاص بواجهة برمجة التطبيقات API عبر ويب سوكيت من Benzinga (bz.production\*\*\*) |
| `tickers`        | No     | قائمة من رموز التداول مفصولة بفواصل (على سبيل المثال: `AAPL,MSFT`)                          |
| `isins`          | No     | قائمة من أرقام التعريف الدولي للأوراق المالية ISIN مفصولة بفواصل للتصفية                    |
| `simplify`       | No     | تبسيط التوصيات إلى: شراء، احتفاظ، بيع                                                       |
| `aggregate_type` | No     | نوع التجميع: `number` أو `percentage`                                                       |

<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": {
    "aggregate_ratings": {
      "strong_buy": 15,
      "buy": 25,
      "hold": 8,
      "sell": 2,
      "strong_sell": 0
    },
    "aggregate_type": "number",
    "consensus_rating": "BUY",
    "consensus_rating_val": 4.2,
    "consensus_price_target": 195.50,
    "high_price_target": 225.00,
    "low_price_target": 160.00,
    "total_analyst_count": 50,
    "unique_analyst_count": 48,
    "updated_at": "2024-10-04T19:21:06Z"
  }
}
```

<div id="consensus-ratings">
  ### تقييمات الإجماع
</div>

| Rating        | Numeric Value | Description          |
| ------------- | ------------- | -------------------- |
| `STRONG_BUY`  | 5.0           | إجماع صعودي قوي جدًا |
| `BUY`         | 4.0 - 4.9     | إجماع صعودي          |
| `HOLD`        | 3.0 - 3.9     | إجماع محايد          |
| `SELL`        | 2.0 - 2.9     | إجماع هبوطي          |
| `STRONG_SELL` | 1.0 - 1.9     | إجماع هبوطي قوي جدًا |

<div id="key-metrics">
  ### المقاييس الرئيسية
</div>

| Field                    | Description                           |
| ------------------------ | ------------------------------------- |
| `consensus_rating`       | التقييم الإجمالي (BUY, HOLD, SELL)    |
| `consensus_rating_val`   | القيمة الرقمية للتقييم (1.0-5.0)      |
| `consensus_price_target` | متوسط السعر المستهدف من قِبل المحللين |
| `high_price_target`      | أعلى سعر مستهدف                       |
| `low_price_target`       | أدنى سعر مستهدف                       |
| `total_analyst_count`    | العدد الإجمالي للتقييمات              |
| `unique_analyst_count`   | عدد المحللين المختلفين                |

<div id="interactive-commands">
  ## الأوامر التفاعلية
</div>

| الأمر    | الوصف                                                           |
| -------- | --------------------------------------------------------------- |
| `ping`   | إبقاء الاتصال نشطًا (يستجيب بـ `pong`)                          |
| `replay` | إعادة إرسال ما يصل إلى آخر 100 رسالة مخزَّنة في الذاكرة المؤقتة |

<div id="best-practices">
  ## أفضل الممارسات
</div>

* **تغيُّرات الإجماع**: راقب تغيُّرات `consensus_rating_val` بمرور الوقت
* **نطاق السعر المستهدف**: قارن السعر الحالي بأعلى وأدنى سعر مستهدف للحصول على سياق للتقييم
* **عمق التغطية**: ارتفاع عدد المحللين يشير إلى إجماع أكثر موثوقية
* **تحليل التوزيع**: افحص تفصيل `aggregate_ratings` لفهم أدق لمعنويات السوق
* **عرض النسب المئوية**: استخدم `aggregate_type=percentage` لإجراء مقارنات معيارية


## AsyncAPI

````yaml asyncapi/consensus-ratings-stream.yml consensusRatings
id: consensusRatings
title: Consensus ratings
description: Send action commands; receive real-time consensus ratings updates
servers:
  - id: production
    protocol: wss
    host: api.benzinga.com/api/v1/consensus-ratings
    bindings: []
    variables: []
address: stream
parameters: []
bindings: []
operations:
  - &ref_2
    id: consensusRatings.publish
    title: Consensus 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: consensusRatings
  - &ref_3
    id: consensusRatings.subscribe
    title: Consensus ratings.subscribe
    description: Receive real-time consensus ratings data
    type: send
    messages:
      - &ref_5
        id: subscribe
        contentType: application/json
        payload:
          - name: subscribe
            description: Consensus 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: aggregate_ratings
                    type: object
                    description: Contains all the ratings categorized by SELL, HOLD, BUY
                    required: true
                    properties:
                      - name: strong_buy
                        type: integer
                        description: Total strong_buy count/percentage
                        required: false
                      - name: buy
                        type: integer
                        description: Total buy count/percentage
                        required: false
                      - name: hold
                        type: integer
                        description: Total hold count/percentage
                        required: false
                      - name: sell
                        type: integer
                        description: Total sell count/percentage
                        required: false
                      - name: strong_sell
                        type: integer
                        description: Total strong_sell count/percentage
                        required: false
                  - name: aggregate_type
                    type: string
                    description: Type of aggregation, Number or Percentage
                    enumValues:
                      - number
                      - percentage
                    required: true
                  - name: consensus_price_target
                    type: number
                    description: Average price target
                    required: false
                  - name: consensus_rating
                    type: string
                    description: Scale value, SELL, HOLD, BUY
                    enumValues:
                      - SELL
                      - HOLD
                      - BUY
                    required: true
                  - name: consensus_rating_val
                    type: number
                    description: Value in float
                    required: false
                  - name: high_price_target
                    type: number
                    description: Highest price target in the specific timeline
                    required: false
                  - name: low_price_target
                    type: number
                    description: Lowest price target in the specific timeline
                    required: false
                  - name: total_analyst_count
                    type: integer
                    description: Total analyst ratings in the timeline
                    required: false
                  - name: unique_analyst_count
                    type: integer
                    description: Unique analyst count in the timeline
                    required: false
                  - name: updated_at
                    type: string
                    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:
                - aggregate_ratings
                - aggregate_type
                - consensus_rating
              properties:
                aggregate_ratings:
                  type: object
                  description: Contains all the ratings categorized by SELL, HOLD, BUY
                  properties:
                    strong_buy:
                      type: integer
                      description: Total strong_buy count/percentage
                      x-parser-schema-id: <anonymous-schema-8>
                    buy:
                      type: integer
                      description: Total buy count/percentage
                      x-parser-schema-id: <anonymous-schema-9>
                    hold:
                      type: integer
                      description: Total hold count/percentage
                      x-parser-schema-id: <anonymous-schema-10>
                    sell:
                      type: integer
                      description: Total sell count/percentage
                      x-parser-schema-id: <anonymous-schema-11>
                    strong_sell:
                      type: integer
                      description: Total strong_sell count/percentage
                      x-parser-schema-id: <anonymous-schema-12>
                  x-parser-schema-id: <anonymous-schema-7>
                aggregate_type:
                  type: string
                  enum:
                    - number
                    - percentage
                  description: Type of aggregation, Number or Percentage
                  x-parser-schema-id: <anonymous-schema-13>
                consensus_price_target:
                  type: number
                  description: Average price target
                  x-parser-schema-id: <anonymous-schema-14>
                consensus_rating:
                  type: string
                  enum:
                    - SELL
                    - HOLD
                    - BUY
                  description: Scale value, SELL, HOLD, BUY
                  x-parser-schema-id: <anonymous-schema-15>
                consensus_rating_val:
                  type: number
                  description: Value in float
                  x-parser-schema-id: <anonymous-schema-16>
                high_price_target:
                  type: number
                  description: Highest price target in the specific timeline
                  x-parser-schema-id: <anonymous-schema-17>
                low_price_target:
                  type: number
                  description: Lowest price target in the specific timeline
                  x-parser-schema-id: <anonymous-schema-18>
                total_analyst_count:
                  type: integer
                  description: Total analyst ratings in the timeline
                  x-parser-schema-id: <anonymous-schema-19>
                unique_analyst_count:
                  type: integer
                  description: Unique analyst count in the timeline
                  x-parser-schema-id: <anonymous-schema-20>
                updated_at:
                  type: string
                  format: date-time
                  description: Last updated timestamp in UTC
                  x-parser-schema-id: <anonymous-schema-21>
              x-parser-schema-id: <anonymous-schema-6>
          x-parser-schema-id: <anonymous-schema-2>
        title: Subscribe
        description: Consensus ratings event
        example: No examples found
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribe
          - id: x-parser-message-name
            value: ConsensusRatingsMessage
    bindings: []
    extensions: *ref_1
sendOperations:
  - *ref_2
receiveOperations:
  - *ref_3
sendMessages:
  - *ref_4
receiveMessages:
  - *ref_5
extensions:
  - id: x-parser-unique-object-id
    value: consensusRatings
securitySchemes:
  - id: tokenAuth
    name: token
    type: httpApiKey
    description: Benzinga WebSocket API token (bz.production***)
    in: query
    extensions: []

````