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

# Batch Historical

> Delivers historical OHLCV (Open, High, Low, Close, Volume) data in batch format for multiple Spot market trading pairs, providing comprehensive price and volume history over specified time ranges for efficient analysis across multiple assets.

<Accordion title="BitMEX Volume Calculation Warning">
  <Warning>
    BitMEX’s `volume` field represents the **number of contracts traded**, not the volume in the base asset.

    To obtain the correct volume, users must adjust for **contract size** using the `underlyingToPositionMultiplier` from our [Reference endpoint](/http/md/spot-exchanges-reference).

    For details on this calculation and how to retrieve the correct values, see our [Changelog Update](/changelog/bitmex-volume-mapping).
  </Warning>
</Accordion>

<Warning>
  The maximum time range (difference between `startDate` and `endDate`) is:

  * 62 days of daily, hourly or minutely data
  * This endpoint only stores the most recent 62 days of data.
  * Queries with a startDate older than 62 days from the current date will result in a 410 error.

  In order to get more than the maximum allowed, you can use the Historical endpoint found [here](/http/md/spot-ohlcv) .
</Warning>

<Note>
  If you omit `startDate` and `endDate`, the API will return the most recent 62 days of daily data (not data older than 62 days from the current date).
</Note>


## OpenAPI

````yaml get /spot/batch-ohlcv/{exchange}
openapi: 3.1.0
info:
  title: market-api
  version: '2'
servers:
  - url: https://api.amberdata.com/markets
security:
  - ApiKeyAuth: []
paths:
  /spot/batch-ohlcv/{exchange}:
    get:
      summary: Batch Historical
      description: >-
        Delivers historical OHLCV (Open, High, Low, Close, Volume) data in batch
        format for multiple Spot market trading pairs, providing comprehensive
        price and volume history over specified time ranges for efficient
        analysis across multiple assets.
      operationId: batch-historical-ond
      parameters:
        - name: exchange
          in: path
          description: The exchange for which to retrieve OHLCV
          schema:
            type: string
            default: binance
          required: true
        - name: instruments
          in: query
          description: >-
            **[Required]** The pair(s) for which to retrieve the most current
            data (comma separated).  **[Maximum]** 50 pairs
          required: true
          schema:
            type: string
            default: btc_usdt,eth_usdt
        - name: startDate
          in: query
          description: >-
            **[Optional]** Payload only includes data after this date
            (inclusive).  **[Formats]** `seconds | milliseconds | iso8601`
            **[Examples]** `1578531600 | 1578531600000 | 2020-09-01T01:00:00`
          schema:
            type: string
            format: date-time
        - name: endDate
          in: query
          description: >-
            **[Optional]** Payload only includes data before this date
            (exclusive).  **[Formats]** `seconds | milliseconds | iso8601`
            **[Examples]** `1578531600 | 1578531600000 | 2020-09-01T01:00:00`
          schema:
            type: string
            format: date-time
        - name: timeInterval
          in: query
          description: >-
            **[Optional]** Time interval. **[Defaults]** `minutes | hours |
            days*`
          schema:
            type: string
        - 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: 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:
                Result:
                  value:
                    status: 200
                    title: OK
                    description: Successful request
                    payload:
                      metadata:
                        next: null
                        api-version: '2023-09-30'
                      data:
                        - instrument: btc_usdt
                          exchangeTimestamp: 1735948800000
                          open: 98174.17
                          high: 98778.43
                          low: 97514.79
                          close: 98220.5
                          volume: 8990.05651
                        - instrument: eth_usdt
                          exchangeTimestamp: 1735948800000
                          open: 3609
                          high: 3671.6
                          low: 3572.42
                          close: 3656.88
                          volume: 229266.3133
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  title:
                    type: string
                  description:
                    type: string
                  payload:
                    type: object
                    properties:
                      metadata:
                        type: object
                        properties:
                          next:
                            type: string
                          api-version:
                            type: string
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            instrument:
                              type: string
                            exchangeTimestamp:
                              type: integer
                            open:
                              type: number
                            high:
                              type: number
                            low:
                              type: number
                            close:
                              type: number
                            volume:
                              type: number
      deprecated: false
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````