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

# Barras históricas

<ResponseExample>
  ```json Respuesta (200 OK) theme={null}
  [
    {
      "symbol": "AAPL",
      "interval": 7200,
      "candles": [
        {
          "time": "1765202400000",
          "open": 278.11,
          "high": 279.6693,
          "low": 277.05,
          "close": 277.335,
          "volume": "9174901",
          "dateTime": "2025-12-08T09:00:00.000-05:00"
        },
        {
          "time": "1765209600000",
          "open": 277.335,
          "high": 277.88,
          "low": 276.7,
          "close": 277.33,
          "volume": "6501561",
          "dateTime": "2025-12-08T11:00:00.000-05:00"
        },
        {
          "time": "1765987200000",
          "open": 274.6,
          "high": 275.07,
          "low": 272.28,
          "close": 273.38,
          "volume": "7179965",
          "dateTime": "2025-12-17T11:00:00.000-05:00"
        },
        {
          "time": "1766073600000",
          "open": 272,
          "high": 273.164,
          "low": 269.94,
          "close": 272.4,
          "volume": "8374648",
          "dateTime": "2025-12-18T11:00:00.000-05:00"
        },
        {
          "time": "1766080800000",
          "open": 272.37,
          "high": 272.96,
          "low": 270.5,
          "close": 270.865,
          "volume": "6415588",
          "dateTime": "2025-12-18T13:00:00.000-05:00"
        },
        {
          "time": "1767636000000",
          "open": 267.57,
          "high": 267.89,
          "low": 266.14,
          "close": 266.61,
          "volume": "5846734",
          "dateTime": "2026-01-05T13:00:00.000-05:00"
        }
      ]
    }
  ]
  ```
</ResponseExample>


## OpenAPI

````yaml es/openapi/data-api-proxy.spec.yml GET /api/v2/bars
openapi: 3.0.0
info:
  contact: {}
  description: >-
    توفّر واجهة برمجة التطبيقات REST هذه نقاط نهاية للبحث في الأساسيات المالية
    والحصول على تفاصيلها.
  termsOfService: http://swagger.io/terms/
  title: Data API Proxy
  version: 2.0.0
servers:
  - url: https://api.benzinga.com
    description: PROD
security: []
paths:
  /api/v2/bars:
    get:
      tags:
        - Market Data
      summary: البيانات التاريخية لأشرطة الأسعار
      description: >-
        يسترجع بيانات الشموع السعرية التاريخية OHLCV (سعر الافتتاح، الأعلى،
        الأدنى، الإغلاق، الحجم) للأوراق المالية المحددة. يُرجِع بيانات أسعار
        مجمَّعة استنادًا إلى الفاصل الزمني المحدَّد. يدعم رموز تداول متعددة
        ونطاقات زمنية متنوعة بما في ذلك التواريخ النسبية.
      operationId: get-bars-v2
      parameters:
        - description: >-
            قائمة من رموز تداول الأسهم مفصولة بفواصل (مثل: AAPL,MSFT,TSLA). حقل
            مطلوب.
          in: query
          name: symbols
          required: true
          schema:
            type: string
        - description: >-
            تاريخ/وقت البداية لـ bars. الصيغ المدعومة: YYYY-MM-DD،
            ‏YYYY-MM-DDTHH:MM:SS، ‏YTD ‏(منذ بداية السنة)، أو قيم نسبية مثل
            1MONTH/1m/1M، ‏1WEEK/1w/1W، ‏1DAY/1d/1D. هذا الحقل مطلوب.
          in: query
          name: from
          required: true
          schema:
            type: string
        - description: >-
            تاريخ/وقت الانتهاء للبيانات الشريطية (bars). التنسيق: YYYY-MM-DD أو
            YYYY-MM-DDTHH:MM:SS. القيمة الافتراضية هي التاريخ/الوقت الحالي إذا
            لم يُحدَّد.
          in: query
          name: to
          schema:
            type: string
        - description: >-
            الفاصل الزمني لتجميع شموع الأسعار. القيم المدعومة: 1m (دقيقة واحدة)،
            5m (5 دقائق)، 15m (15 دقيقة)، 30m (30 دقيقة)، 1h (ساعة واحدة)، 1d
            (يوم واحد)، 1w (أسبوع واحد)، 1M (شهر واحد). القيمة الافتراضية: 1d
          in: query
          name: interval
          schema:
            type: string
        - description: >-
            عامل تصفية لجلسة التداول. القيم المدعومة: ANY (جميع الجلسات)،
            PRE_MARKET (تداول ما قبل الافتتاح)، REGULAR (ساعات التداول العادية)،
            AFTER_MARKET (تداول ما بعد الإغلاق). القيمة الافتراضية: ANY
          in: query
          name: session
          schema:
            type: string
      responses:
        '200':
          description: مصفوفة لبيانات المخططات تتضمن أشرطة OHLCV لكل رمز
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/httpapi.Chart'
                type: array
        '400':
          description: طلب غير صالح - معلمات إلزامية مفقودة أو غير صالحة
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bzhttp.Resp'
        '500':
          description: خطأ داخلي في الخادم
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bzhttp.Resp'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    httpapi.Chart:
      properties:
        candles:
          items:
            properties:
              close:
                type: number
              dateTime:
                type: string
              high:
                type: number
              low:
                type: number
              open:
                type: number
              time:
                type: string
              volume:
                type: string
            type: object
          type: array
        interval:
          type: integer
        symbol:
          type: string
      type: object
    bzhttp.Resp:
      properties:
        data:
          additionalProperties: true
          type: object
        errors:
          items:
            $ref: '#/components/schemas/bzhttp.Error'
          type: array
        ok:
          type: boolean
      type: object
    bzhttp.Error:
      properties:
        code:
          $ref: '#/components/schemas/bzhttp.ErrorCode'
        id:
          type: string
        value:
          type: string
      type: object
    bzhttp.ErrorCode:
      enum:
        - json_unmarshaling_error
        - no_data_found
        - no_matching_endpoint
        - bad_request
        - db_error
        - internal_server_error
        - auth_failed
        - forbidden
        - failed_dependency
        - service_unavailable
        - upstream_api_error
        - unsupported_message_type
        - database_query_error
      type: string
      x-enum-varnames:
        - ErrorJSONUnmarshaling
        - ErrorNoDataFound
        - ErrorNoMatchingEndpoint
        - ErrorBadRequest
        - ErrorDBError
        - ErrorInternalServerError
        - ErrorAuthFailed
        - ErrorForbidden
        - ErrorFailedDependency
        - ErrorServiceUnavailable
        - ErrorUpstreamAPIError
        - ErrorUnsupportedMessageType
        - ErrorDBQueryError
  securitySchemes:
    ApiKeyAuth:
      in: query
      name: token
      type: apiKey

````