> ## 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/transcripts/stream?token=YOUR_TOKEN
```

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

| المعامل | إلزامي | الوصف                                                                      |
| ------- | ------ | -------------------------------------------------------------------------- |
| `token` | نعم    | رمز الوصول الخاص بك إلى واجهة برمجة التطبيقات WebSocket الخاصة بـ Benzinga |

<div id="subscription-commands">
  ## أوامر الاشتراك
</div>

أرسل أوامر JSON للتحكم في اشتراكاتك:

<div id="subscribe-to-a-ticker">
  ### الاشتراك في رمز التداول
</div>

```json theme={null}
{
  "action": "subscribe",
  "ticker": "AAPL"
}
```

<div id="subscribe-to-all-transcripts">
  ### الاشتراك في جميع التفريغات
</div>

```json theme={null}
{
  "action": "subscribe",
  "ticker": "*"
}
```

<div id="unsubscribe-from-a-ticker">
  ### إلغاء الاشتراك في رمز التداول
</div>

```json theme={null}
{
  "action": "unsubscribe",
  "ticker": "AAPL"
}
```

<div id="list-active-transcripts">
  ### عرض النصوص النشطة
</div>

```json theme={null}
{
  "action": "list"
}
```

<div id="keep-connection-alive">
  ### الحفاظ على الاتصال نشطًا
</div>

```json theme={null}
{
  "action": "ping"
}
```

<div id="test-with-mock-data">
  ### الاختبار باستخدام بيانات وهمية
</div>

عندما لا تتوفر نصوص حية، استخدم وضع المحاكاة للاختبار:

```json theme={null}
{
  "action": "subscribe",
  "ticker": "AAPL",
  "mock": true
}
```

رموز أسهم تجريبية مدعومة: `AAPL`, `MSFT`, `TSLA`

<div id="message-example">
  ## مثال لرسالة
</div>

```json theme={null}
{
  "call_id": "call_123456",
  "transcript_id": "550e8400-e29b-41d4-a716-446655440000",
  "call_title": "Apple Inc. Q4 2024 Earnings Call",
  "sentence": "Revenue for the quarter was 89.5 billion dollars.",
  "start_time": "2024-01-15T16:30:15Z",
  "end_time": "2024-01-15T16:30:19Z",
  "symbol": "AAPL",
  "exchange": "NASDAQ",
  "name": "Apple Inc.",
  "sequence": 42,
  "status": "IN_PROGRESS",
  "speaker": "Tim Cook, CEO",
  "type": "LIVE",
  "language": "en",
  "confidence": 0.98,
  "words": [
    {
      "text": "Revenue",
      "confidence": 0.99,
      "start": 0,
      "end": 450
    },
    {
      "text": "for",
      "confidence": 0.98,
      "start": 450,
      "end": 600
    }
  ],
  "created_time": "2024-01-15T16:30:19Z"
}
```

<div id="key-fields">
  ### الحقول الأساسية
</div>

| Field                     | Description                                       |
| ------------------------- | ------------------------------------------------- |
| `sentence`                | النص الكامل للجملة المنطوقة                       |
| `sequence`                | ترتيب هذه الجملة في النص الحرفي (0، 1، 2...)      |
| `speaker`                 | اسم/معرّف المتحدث                                 |
| `status`                  | `IN_PROGRESS` (قيد التقدّم) أو `COMPLETE` (مكتمل) |
| `confidence`              | نسبة الثقة الإجمالية في الدقة (0.0 - 1.0)         |
| `words`                   | مصفوفة من الكلمات الفردية مع التوقيت ونسبة الثقة  |
| `start_time` / `end_time` | طوابع زمنية بصيغة ISO 8601 لتوقيت الجملة          |

<div id="transcript-status">
  ### حالة النص الحرفي
</div>

| الحالة        | الوصف                                                |
| ------------- | ---------------------------------------------------- |
| `IN_PROGRESS` | النص الحرفي قيد التحديث حاليًا ويتلقى تحديثات        |
| `COMPLETE`    | اكتمل النص الحرفي، ولا يُتوقع تلقي مزيد من التحديثات |

<div id="word-level-data">
  ## بيانات على مستوى الكلمة
</div>

تتضمن كل جملة معلومات تفصيلية على مستوى كل كلمة:

```json theme={null}
{
  "text": "Revenue",
  "confidence": 0.99,
  "start": 0,
  "end": 450
}
```

* **text**: الكلمة نفسها
* **confidence**: درجة الثقة في التعرف (0.0 - 1.0)
* **start/end**: الإزاحات الزمنية بالميلي ثانية من بداية الجملة

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

| الأمر         | المعلمات  | الوصف                                  |
| ------------- | --------- | -------------------------------------- |
| `subscribe`   | `ticker`  | الاشتراك في تحديثات النص لرمز تداول    |
| `unsubscribe` | `ticker`  | إيقاف استلام التحديثات لرمز تداول      |
| `list`        | -         | جلب قائمة النصوص النشطة/المتاحة        |
| `subscribed`  | -         | جلب قائمة اشتراكاتك الحالية            |
| `ping`        | -         | إبقاء الاتصال نشطًا (يستجيب بـ `pong`) |
| `echo`        | `message` | اختبار الصدى (يستجيب برسالتك)          |

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

<div id="real-time-display">
  ### العرض اللحظي
</div>

* **إدارة التخزين المؤقت (buffer)**: اعرض الجمل حسب ترتيبها التسلسلي باستخدام الحقل `sequence`
* **تنسيق المتحدث**: نسِّق العرض بشكل مختلف بناءً على قيمة `speaker` (المديرين التنفيذيين مقابل المحللين)
* **مؤشرات الحالة**: اعرض مؤشرات مرئية لحالتي `IN_PROGRESS` و`COMPLETE`

<div id="performance">
  ### الأداء
</div>

* **تحذير من البدل (Wildcard)**: استخدام `ticker: "*"` يعني الاشتراك في جميع المحاضر، ما قد ينتج عنه حجم بيانات كبير
* **اشتراكات موجهة**: اشترك فقط في رموز التداول التي تحتاجها لتقليل استهلاك عرض النطاق الترددي
* **نبضة (Heartbeat)**: أرسل `ping` كل 30-60 ثانية للحفاظ على الاتصال

<div id="data-quality">
  ### جودة البيانات
</div>

* **التصفية بناءً على مستوى الثقة**: فكّر في تجاهل أو تمييز الجمل ذات درجات الثقة المنخفضة
* **دقة الكلمات**: استخدم درجة الثقة لكل كلمة لتحديد عمليات النسخ غير المؤكدة
* **التعامل مع اللغة**: تحقق من الحقل `language` لضمان العرض الصحيح للنص

<div id="testing">
  ### الاختبار
</div>

* **وضع المحاكاة (Mock Mode)**: استخدم `mock: true` أثناء التطوير عند عدم وجود اتصالات مباشرة فعّالة
* **اختبار الصدى (Echo Testing)**: استخدم الإجراء `echo` للتحقق من الاتصال والتعامل مع الرسائل
* **أمر القائمة (List Command)**: تحقّق من `list` لمعرفة ما هو متاح حاليًا

<div id="example-integration">
  ## مثال للتكامل
</div>

```javascript theme={null}
const ws = new WebSocket(
  'wss://api.benzinga.com/api/v1/transcripts/stream?token=YOUR_TOKEN'
);

ws.onopen = () => {
  // الاشتراك في نصوص محاضر Apple
  ws.send(JSON.stringify({
    action: 'subscribe',
    ticker: 'AAPL'
  }));
};

ws.onmessage = (event) => {
  const data = JSON.parse(event.data);

  // عرض الجملة مع اسم المتحدث
  console.log(`[${data.sequence}] ${data.speaker}: ${data.sentence}`);

  // التحقق من اكتمال المحضر
  if (data.status === 'COMPLETE') {
    console.log('Transcript finished');
  }
};

// الحفاظ على الاتصال نشطاً
setInterval(() => {
  ws.send(JSON.stringify({ action: 'ping' }));
}, 30000);
```

<div id="related-documentation">
  ## التوثيق المرتبط
</div>

* [مقدمة ويب سوكيت](../introduction) - مفاهيم ويب سوكيت العامة وأساسيات الاتصال
* [المصادقة](../authentication) - كيفية الحصول على رموز وصول واجهة برمجة التطبيقات API واستخدامها


## AsyncAPI

````yaml asyncapi/transcripts-stream.yml transcripts
id: transcripts
title: Transcripts
description: Send action commands; receive real-time transcript updates
servers:
  - id: production
    protocol: wss
    host: api.benzinga.com/api/v1/transcripts
    bindings: []
    variables: []
address: stream
parameters: []
bindings: []
operations:
  - &ref_1
    id: transcripts.publish
    title: Transcripts.publish
    description: Send commands to the server
    type: receive
    messages:
      - &ref_3
        id: publish
        contentType: application/json
        payload:
          - name: publish
            description: WebSocket command to interact with transcript stream
            type: object
            properties:
              - name: action
                type: string
                description: Action to perform
                enumValues:
                  - list
                  - subscribe
                  - unsubscribe
                  - subscribed
                  - echo
                  - ping
                required: true
              - name: ticker
                type: string
                description: Stock ticker symbol (e.g., AAPL) or '*' for all transcripts
                required: false
              - name: message
                type: string
                description: Optional message for echo testing
                required: false
              - name: mock
                type: boolean
                description: Optional boolean for mock testing when no live transcripts
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - action
          properties:
            action:
              type: string
              enum:
                - list
                - subscribe
                - unsubscribe
                - subscribed
                - echo
                - ping
              description: Action to perform
              x-parser-schema-id: <anonymous-schema-2>
            ticker:
              type: string
              description: Stock ticker symbol (e.g., AAPL) or '*' for all transcripts
              x-parser-schema-id: <anonymous-schema-3>
            message:
              type: string
              description: Optional message for echo testing
              x-parser-schema-id: <anonymous-schema-4>
            mock:
              type: boolean
              description: Optional boolean for mock testing when no live transcripts
              x-parser-schema-id: <anonymous-schema-5>
          x-parser-schema-id: <anonymous-schema-1>
        title: Publish
        description: WebSocket command to interact with transcript stream
        example: |-
          {
            "action": "list"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: publish
          - id: x-parser-message-name
            value: ActionRequest
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: transcripts
  - &ref_2
    id: transcripts.subscribe
    title: Transcripts.subscribe
    description: Receive real-time transcript data
    type: send
    messages:
      - &ref_4
        id: subscribe
        contentType: application/json
        payload:
          - name: subscribe
            description: Real-time transcript message
            type: object
            properties:
              - name: call_id
                type: string
                description: Unique identifier for the earnings call
                required: true
              - name: transcript_id
                type: string
                description: Unique identifier for this transcript
                required: true
              - name: call_title
                type: string
                description: Title of the earnings call
                required: false
              - name: sentence
                type: string
                description: The spoken sentence text
                required: true
              - name: start_time
                type: string
                description: When this sentence started
                required: false
              - name: end_time
                type: string
                description: When this sentence ended
                required: false
              - name: symbol
                type: string
                description: Stock ticker symbol (e.g., AAPL)
                required: true
              - name: exchange
                type: string
                description: Exchange where security is listed
                required: false
              - 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: Company name
                required: false
              - name: sequence
                type: integer
                description: Sequence number of this sentence in the transcript
                required: true
              - name: status
                type: string
                description: Status of the transcript
                enumValues:
                  - IN_PROGRESS
                  - COMPLETE
                required: true
              - name: words
                type: array
                description: Individual words with timing and confidence
                required: false
                properties:
                  - name: confidence
                    type: number
                    description: Confidence score for word recognition
                    required: false
                  - name: start
                    type: integer
                    description: Start time offset in milliseconds
                    required: false
                  - name: end
                    type: integer
                    description: End time offset in milliseconds
                    required: false
                  - name: text
                    type: string
                    description: The word text
                    required: false
              - name: confidence
                type: number
                description: Overall confidence score for the sentence
                required: false
              - name: speaker
                type: string
                description: Name or identifier of the speaker
                required: false
              - name: type
                type: string
                description: Type of transcript (LIVE for real-time)
                enumValues:
                  - LIVE
                required: false
              - name: language
                type: string
                description: Language code (e.g., en, en-US)
                required: false
              - name: participants
                type: array
                description: List of call participants
                required: false
                properties:
                  - name: item
                    type: object
                    required: false
              - name: created_time
                type: string
                description: When this transcript entry was created
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - call_id
            - transcript_id
            - sentence
            - symbol
            - sequence
            - status
          properties:
            call_id:
              type: string
              description: Unique identifier for the earnings call
              x-parser-schema-id: <anonymous-schema-7>
            transcript_id:
              type: string
              format: uuid
              description: Unique identifier for this transcript
              x-parser-schema-id: <anonymous-schema-8>
            call_title:
              type: string
              description: Title of the earnings call
              x-parser-schema-id: <anonymous-schema-9>
            sentence:
              type: string
              description: The spoken sentence text
              x-parser-schema-id: <anonymous-schema-10>
            start_time:
              type: string
              format: date-time
              description: When this sentence started
              x-parser-schema-id: <anonymous-schema-11>
            end_time:
              type: string
              format: date-time
              description: When this sentence ended
              x-parser-schema-id: <anonymous-schema-12>
            symbol:
              type: string
              description: Stock ticker symbol (e.g., AAPL)
              x-parser-schema-id: <anonymous-schema-13>
            exchange:
              type: string
              description: Exchange where security is listed
              x-parser-schema-id: <anonymous-schema-14>
            isin:
              type: string
              description: International Securities Identification Number
              x-parser-schema-id: <anonymous-schema-15>
            cusip:
              type: string
              description: CUSIP identifier
              x-parser-schema-id: <anonymous-schema-16>
            name:
              type: string
              description: Company name
              x-parser-schema-id: <anonymous-schema-17>
            sequence:
              type: integer
              description: Sequence number of this sentence in the transcript
              x-parser-schema-id: <anonymous-schema-18>
            status:
              type: string
              enum:
                - IN_PROGRESS
                - COMPLETE
              description: Status of the transcript
              x-parser-schema-id: <anonymous-schema-19>
            words:
              type: array
              description: Individual words with timing and confidence
              items:
                type: object
                properties:
                  confidence:
                    type: number
                    description: Confidence score for word recognition
                    x-parser-schema-id: <anonymous-schema-22>
                  start:
                    type: integer
                    description: Start time offset in milliseconds
                    x-parser-schema-id: <anonymous-schema-23>
                  end:
                    type: integer
                    description: End time offset in milliseconds
                    x-parser-schema-id: <anonymous-schema-24>
                  text:
                    type: string
                    description: The word text
                    x-parser-schema-id: <anonymous-schema-25>
                x-parser-schema-id: <anonymous-schema-21>
              x-parser-schema-id: <anonymous-schema-20>
            confidence:
              type: number
              description: Overall confidence score for the sentence
              x-parser-schema-id: <anonymous-schema-26>
            speaker:
              type: string
              description: Name or identifier of the speaker
              x-parser-schema-id: <anonymous-schema-27>
            type:
              type: string
              enum:
                - LIVE
              description: Type of transcript (LIVE for real-time)
              x-parser-schema-id: <anonymous-schema-28>
            language:
              type: string
              description: Language code (e.g., en, en-US)
              x-parser-schema-id: <anonymous-schema-29>
            participants:
              type: array
              nullable: true
              description: List of call participants
              items:
                type: object
                x-parser-schema-id: <anonymous-schema-31>
              x-parser-schema-id: <anonymous-schema-30>
            created_time:
              type: string
              format: date-time
              description: When this transcript entry was created
              x-parser-schema-id: <anonymous-schema-32>
          x-parser-schema-id: <anonymous-schema-6>
        title: Subscribe
        description: Real-time transcript message
        example: No examples found
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribe
          - id: x-parser-message-name
            value: TranscriptMessage
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_1
receiveOperations:
  - *ref_2
sendMessages:
  - *ref_3
receiveMessages:
  - *ref_4
extensions:
  - id: x-parser-unique-object-id
    value: transcripts
securitySchemes:
  - id: tokenAuth
    name: token
    type: httpApiKey
    description: Benzinga WebSocket API token
    in: query
    extensions: []

````