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

# Bid Ask Spread

> This endpoint allows users to explore the bid-ask spread for a specific trading pair or underlying asset across one or more exchanges. It provides both the absolute dollar spread (based on the best bid and offer) and the spread as a percentage of the mid-price.



## OpenAPI

````yaml get /depth/bid-ask-spread
openapi: 3.1.0
info:
  title: spot-analytics
  version: '2'
servers:
  - url: https://api.amberdata.com/markets/spot/analytics
security:
  - sec0: []
paths:
  /depth/bid-ask-spread:
    get:
      summary: Bid Ask Spread
      description: >-
        This endpoint allows users to explore the bid-ask spread for a specific
        trading pair or underlying asset across one or more exchanges. It
        provides both the absolute dollar spread (based on the best bid and
        offer) and the spread as a percentage of the mid-price.
      operationId: spot-analytics-order-book-depth-bid-ask-spread
      parameters:
        - name: pair
          in: query
          description: |-
            **[Required]** The currency pair for the spot instrument.
            **[Examples]** ` btc_usd | btc_usdc | eth_usd `
          required: true
          schema:
            type: string
            default: btc_usd
        - name: fuzzyMatch
          in: query
          description: >-
            **[Required]** This parameter controls how the provided trading pair
            symbol is interpreted. When set to FALSE, it returns data only for
            the exact pair specified (e.g., btc_usd). When set to TRUE, it
            enables fuzzy matching—users can then pass just the base asset
            (e.g., btc) returns all pairs with that base (e.g., btc_eur,
            btc_usd, btc_usdt, etc.), while passing a full pair like btc_usd
            returns all pairs with the same base and similar USD-related quote
            assets (e.g., btc_usd, btc_usdt, btc_usdc, etc.).
          required: true
          schema:
            type: boolean
            default: false
        - name: exchange
          in: query
          description: |-
            **[Optional]** The exchange for the associated bid ask spread.
            **[Examples]** ` gdax | okex | binance | binanceus`
          schema:
            type: string
        - name: startDate
          in: query
          description: >-
            **[Optional]** Payload only includes data after this date
            (inclusive).

            **[Formats]** `seconds | milliseconds | iso8601` 

            **[Examples]** `1578531600 | 1578531600000 | 2025-02-27`
          schema:
            type: string
            default: '2025-05-01'
        - name: endDate
          in: query
          description: >-
            **[Optional]** Payload only includes data up to this date
            (exclusive).

            **[Formats]** `seconds | milliseconds | iso8601` 

            **[Examples]** `1578531600 | 1578531600000 | 2025-02-28`
          schema:
            type: string
            default: '2025-05-02'
        - 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
            default: hr
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    status: 200
                    title: OK
                    description: Successful request
                    payload:
                      data:
                        - bestAskPrice: 96589.6
                          bestBidPrice: 96222.19
                          exchange: binanceus
                          midPrice: 96405.895
                          pair: btc_usd
                          spread: 367.4100000000035
                          spreadPercent: 0.3811074001232015
                          timestamp: 1746144000000
                        - bestAskPrice: 96524.98
                          bestBidPrice: 96523.62
                          exchange: gdax
                          midPrice: 96524.29999999999
                          pair: btc_usd
                          spread: 1.360000000000582
                          spreadPercent: 0.0014089716268344678
                          timestamp: 1746144000000
                        - bestAskPrice: 96469.9
                          bestBidPrice: 96469.8
                          exchange: kraken
                          midPrice: 96469.85
                          pair: btc_usd
                          spread: 0.09999999999126885
                          spreadPercent: 0.00010365932982301604
                          timestamp: 1746144000000
                        - bestAskPrice: 96504.1
                          bestBidPrice: 96486.8
                          exchange: okex
                          midPrice: 96495.45000000001
                          pair: btc_usd
                          spread: 17.30000000000291
                          spreadPercent: 0.017928306464193813
                          timestamp: 1746144000000
                        - bestAskPrice: 96589.61
                          bestBidPrice: 96222.19
                          exchange: binanceus
                          midPrice: 96405.9
                          pair: btc_usd
                          spread: 367.41999999999825
                          spreadPercent: 0.3811177531665575
                          timestamp: 1746143940000
                        - bestAskPrice: 96537.56
                          bestBidPrice: 96537.55
                          exchange: gdax
                          midPrice: 96537.555
                          pair: btc_usd
                          spread: 0.00999999999476131
                          spreadPercent: 0.000010358663004010523
                          timestamp: 1746143940000
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 200
                  title:
                    type: string
                    example: OK
                  description:
                    type: string
                    example: Successful request
                  payload:
                    type: object
                    properties:
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            bestAskPrice:
                              type: number
                              example: 96589.6
                              description: The ask side of the BBO
                            bestBidPrice:
                              type: number
                              example: 96222.19
                              description: The bid side of the BBO
                            exchange:
                              type: string
                              example: binanceus
                              description: The subject exchange
                            midPrice:
                              type: number
                              example: 96405.895
                              description: The mid-price of the BBO
                            pair:
                              type: string
                              example: btc_usd
                              description: The subject pair
                            spread:
                              type: number
                              example: 367.4100000000035
                              description: The absolute BBO spread in quote terms
                            spreadPercent:
                              type: number
                              example: 0.3811074001232015
                              description: The absolute BBO spread divided by the mid-price
                            timestamp:
                              type: integer
                              example: 1746144000000
                              description: The observation timestamp
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: {}
              schema:
                type: object
                properties: {}
      deprecated: false
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````