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

# Events Historical

> Provides historical order book events for options contracts, detailing bid and ask levels, volumes, and order counts at specific timestamps to track market depth and activity over time across supported exchanges.

<Warning>
  The maximum time range (difference between `startDate` and `endDate`) is **1 hour**.
</Warning>

<Note>
  If the `startDate` and `endDate` query parameters are not provided, the API will return the data from the previous 10 minutes.
</Note>


## OpenAPI

````yaml get /options/order-book-events/{instrument}
openapi: 3.1.0
info:
  title: market-api
  version: '2'
servers:
  - url: https://api.amberdata.com/markets
security:
  - ApiKeyAuth: []
paths:
  /options/order-book-events/{instrument}:
    get:
      summary: Events Historical
      description: >-
        Provides historical order book events for options contracts, detailing
        bid and ask levels, volumes, and order counts at specific timestamps to
        track market depth and activity over time across supported exchanges.
      operationId: options-order-book-events-historical
      parameters:
        - name: instrument
          in: path
          description: The instrument for which to retrieve the requested data.
          schema:
            type: string
            default: BTC-27DEC24-100000-C
          required: true
        - name: exchange
          in: query
          description: >-
            The exchange(s) for which to retrieve the requested data (comma
            separated). **[Default]** All available exchanges.
          required: true
          schema:
            type: string
        - name: startDate
          in: query
          description: >-
            **[Optional]** Payload only includes data after this date
            (inclusive). **[Defaults]** Beginning of the current hour (max time
            range is 1 hour).
          schema:
            type: string
            format: date-time
        - name: endDate
          in: query
          description: >-
            **[Optional]** Payload only includes data before this date
            (exclusive). **[Defaults]** One hour after the beginning of the
            current hour (max time range is 1 hour).
          schema:
            type: string
            format: date-time
        - name: timeFormat
          in: query
          description: >-
            **[Optional]** Time format of the timestamps in the return payload.
            **[Defaults]** `milliseconds | ms* | iso | iso8601 | hr |
            human_readable`
          schema:
            type: string
        - name: sortDirection
          in: query
          description: >-
            **[Optional]** Specifies the direction in which the data is sorted
            (by timestamp).   **[Defaults]** asc (ascending order).   **[Usage
            Conditions]** This parameter can only be used if the `startDate` and
            `endDate` timeframe is within the most recent 24 hours, or if the
            `startDate` and `endDate` parameters are not used at all.  
            **[Examples]** ascending | descending | asc | desc
          schema:
            type: string
        - name: Accept-Encoding
          in: header
          required: true
          description: ''
          schema:
            type: string
            default: gzip, deflate, br
        - name: api-version
          in: header
          schema:
            type: string
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Success:
                  value:
                    status: 200
                    title: OK
                    description: Successful request
                    payload:
                      metadata:
                        next: >-
                          https://api.amberdata.com/markets/options/order-book-events/BTC-18SEP24-60000-C?cursor=N4IgpgHgxgFghgOwOZhALhAIwJ6YJYAuIANCFAK4BOAzgPaXoLkA2zp1BclBAInAajQBGAOwAmAGwBWAMySAnEPnyppMAgAmfAelGSJQsVIAcU%2BTIAspPAijNyGsAFUE1cgAd39ARoCi0eGQwanQAMzhmajBSAjwAWzAAMXo4-nQQOLxWPCioWk0Q0lCUtIwAKzoEEhA6bgBpMGx0vWk5CUVlKQB9AAYunHwCLoV5CzF5CRl5MS6AIQAVAGEAWiFjAGVfAAUxC2WJHsOe5cWusDAJOGMZUNCQAF8gA
                        api-version: '2023-09-30'
                      data:
                        - instrument: BTC-18SEP24-60000-C
                          exchange: bybit
                          exchangeTimestamp: 1726526186266
                          exchangeTimestampNanoseconds: 0
                          sequence: '26992247584'
                          ask:
                            - price: 95
                              volume: 3.92
                              numOrders: null
                            - price: 100
                              volume: 26.97
                              numOrders: null
                          bid: []
              schema:
                type: object
                properties: {}
      deprecated: false
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````