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

# Live volume footprint stream

> On subscription the stream forwards an initial historical snapshot starting at `since` (profile frames ended by an `isLast` boundary) and then live complete-profile replacements. Without `since` the snapshot is empty (a bare `isLast` boundary frame) and the first live profile arrives when the next timeframe period opens; the period already in progress is not streamed. Before the first profile one `rowSize` frame announces the price grid resolved for this subscription; echo that value as the `rowSizeValue` query parameter of the REST endpoint `GET /api/v1/marketdata/footprint` to receive history on the identical grid. If the grid ever changes on an open subscription, a new `rowSize` frame is sent and every affected profile is re-sent in full.

History depth is limited per timeframe, counted back from the security's newest candle (by default 30 days for minute frames below 5m, rising with the timeframe to 3 years for 1w and above). When that limit moves the requested start forward, a `rangeTruncated` frame is sent before the initial snapshot; its presence is the flag that distinguishes a trimmed answer from a security with no data that far back. The initial snapshot is also capped at a bounded number of profiles, and a `since` exceeding that cap is rejected at the handshake. Historical range parameters (`from`, `to`, `period`, `limit`) are rejected. Live profile replacements are additionally rate-limited upstream by a small minimum delay even when throttlingDelay is 0. A terminal upstream error is delivered as an `error` frame and closes the socket.

**Cost:** 25 credits per subscription, charged again in every quota window the connection stays open in.



## AsyncAPI

````yaml platform-api/specs/asyncapi.yaml footprint
id: footprint
title: Live volume footprint stream
description: >-
  On subscription the stream forwards an initial historical snapshot starting at
  `since` (profile frames ended by an `isLast` boundary) and then live
  complete-profile replacements. Without `since` the snapshot is empty (a bare
  `isLast` boundary frame) and the first live profile arrives when the next
  timeframe period opens; the period already in progress is not streamed. Before
  the first profile one `rowSize` frame announces the price grid resolved for
  this subscription; echo that value as the `rowSizeValue` query parameter of
  the REST endpoint `GET /api/v1/marketdata/footprint` to receive history on the
  identical grid. If the grid ever changes on an open subscription, a new
  `rowSize` frame is sent and every affected profile is re-sent in full.


  History depth is limited per timeframe, counted back from the security's
  newest candle (by default 30 days for minute frames below 5m, rising with the
  timeframe to 3 years for 1w and above). When that limit moves the requested
  start forward, a `rangeTruncated` frame is sent before the initial snapshot;
  its presence is the flag that distinguishes a trimmed answer from a security
  with no data that far back. The initial snapshot is also capped at a bounded
  number of profiles, and a `since` exceeding that cap is rejected at the
  handshake. Historical range parameters (`from`, `to`, `period`, `limit`) are
  rejected. Live profile replacements are additionally rate-limited upstream by
  a small minimum delay even when throttlingDelay is 0. A terminal upstream
  error is delivered as an `error` frame and closes the socket.


  **Cost:** 25 credits per subscription, charged again in every quota window the
  connection stays open in.
servers:
  - id: production
    protocol: wss
    host: public-api.takeprofit.com
    bindings: []
    variables: []
address: /api/v1/marketdata/footprint/stream
parameters: []
bindings:
  - protocol: ws
    version: 0.1.0
    value:
      method: GET
      query:
        type: object
        additionalProperties: false
        required:
          - exchange
          - symbol
          - timeframe
        properties:
          exchange: &ref_0
            type: string
            description: >-
              TakeProfit exchange code as returned by GET
              /api/v1/marketdata/exchanges.
            example: CXBNCE
            x-parser-schema-id: ExchangeCode
          symbol: &ref_1
            type: string
            description: >-
              TakeProfit security symbol as returned by GET
              /api/v1/marketdata/exchanges/{exchange}/securities.
            example: BTC/USDT
            x-parser-schema-id: SecuritySymbol
          timeframe:
            type: string
            description: >-
              Public timeframe id restricted to minute (1m-59m), hour (1h-24h),
              day (1d-31d), week (1w-4w), or month (1M) frames.
            example: 1h
            x-parser-schema-id: FootprintTimeframeId
          rowSize:
            type: integer
            minimum: 0
            maximum: 1000000
            description: >-
              Price row height in ticks; 0 or omitted enables automatic row size
              detection.
          rowSizeValue:
            type: string
            description: >-
              Absolute price row height in quote currency units, echoed back
              from a rowSize value a previous response returned. Pins the price
              grid, which a tick count cannot always express. Omitted means not
              pinned.
            example: '0.5'
          sessionType:
            type: string
            description: >-
              Optional session filter; MAINSESSION, PRE_MARKET, POST_MARKET.
              Repeat the parameter or pass comma-separated values. When omitted,
              profiles of every session type are delivered.
            example: MAINSESSION
            x-parser-schema-id: FootprintSessionTypeQuery
          since:
            type: string
            description: >-
              Start of the initial snapshot as Unix seconds or RFC3339
              timestamp; must be in the past. Omitted starts the snapshot at the
              current time. The snapshot is capped at a bounded number of
              profiles per subscription.
            example: '1790000000'
          throttlingDelay:
            type: integer
            minimum: 0
            maximum: 60000
            default: 0
            description: >-
              Throttling delay in milliseconds; a positive delay coalesces
              updates into at most one frame per delay, 0 or omitted applies no
              gateway-side throttling.
            x-parser-schema-id: ThrottlingDelay
    schemaProperties:
      - name: method
        type: string
        description: GET
        required: false
      - name: query
        type: object
        required: false
        properties:
          - name: exchange
            type: string
            description: >-
              TakeProfit exchange code as returned by GET
              /api/v1/marketdata/exchanges.
            required: true
          - name: symbol
            type: string
            description: >-
              TakeProfit security symbol as returned by GET
              /api/v1/marketdata/exchanges/{exchange}/securities.
            required: true
          - name: timeframe
            type: string
            description: >-
              Public timeframe id restricted to minute (1m-59m), hour (1h-24h),
              day (1d-31d), week (1w-4w), or month (1M) frames.
            required: true
          - name: rowSize
            type: integer
            description: >-
              Price row height in ticks; 0 or omitted enables automatic row size
              detection.
            required: false
          - name: rowSizeValue
            type: string
            description: >-
              Absolute price row height in quote currency units, echoed back
              from a rowSize value a previous response returned. Pins the price
              grid, which a tick count cannot always express. Omitted means not
              pinned.
            required: false
          - name: sessionType
            type: string
            description: >-
              Optional session filter; MAINSESSION, PRE_MARKET, POST_MARKET.
              Repeat the parameter or pass comma-separated values. When omitted,
              profiles of every session type are delivered.
            required: false
          - name: since
            type: string
            description: >-
              Start of the initial snapshot as Unix seconds or RFC3339
              timestamp; must be in the past. Omitted starts the snapshot at the
              current time. The snapshot is capped at a bounded number of
              profiles per subscription.
            required: false
          - name: throttlingDelay
            type: integer
            description: >-
              Throttling delay in milliseconds; a positive delay coalesces
              updates into at most one frame per delay, 0 or omitted applies no
              gateway-side throttling.
            required: false
operations:
  - &ref_3
    id: streamFootprint
    title: Stream volume footprint profiles
    description: Frames the gateway delivers to a connected footprint stream client.
    type: send
    messages:
      - &ref_4
        id: rowSize
        contentType: application/json
        payload:
          - name: Row size frame
            description: The price grid resolved for this subscription.
            type: object
            properties:
              - name: const
                type: string
                description: rowSize
                required: false
              - name: meta
                type: object
                description: Echo of the normalized subscription parameters.
                required: true
                properties:
                  - name: exchange
                    type: string
                    description: >-
                      TakeProfit exchange code as returned by GET
                      /api/v1/marketdata/exchanges.
                    required: true
                  - name: symbol
                    type: string
                    description: >-
                      TakeProfit security symbol as returned by GET
                      /api/v1/marketdata/exchanges/{exchange}/securities.
                    required: true
                  - name: timeframe
                    type: string
                    description: >-
                      Public timeframe id as returned by GET
                      /api/v1/marketdata/timeframes, for example 1m, 5m, 1h, or
                      1d.
                    required: true
              - name: rowSize
                type: string
                description: Price increment per row, in quote currency units.
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - type
            - meta
            - rowSize
          properties:
            type:
              const: rowSize
              x-parser-schema-id: <anonymous-schema-15>
            meta: &ref_2
              type: object
              description: Echo of the normalized subscription parameters.
              required:
                - exchange
                - symbol
                - timeframe
              properties:
                exchange: *ref_0
                symbol: *ref_1
                timeframe:
                  type: string
                  description: >-
                    Public timeframe id as returned by GET
                    /api/v1/marketdata/timeframes, for example 1m, 5m, 1h, or
                    1d.
                  example: 1m
                  x-parser-schema-id: TimeframeId
              x-parser-schema-id: StreamMeta
            rowSize:
              type: string
              description: Price increment per row, in quote currency units.
              x-parser-schema-id: <anonymous-schema-16>
          x-parser-schema-id: <anonymous-schema-14>
        title: Row size frame
        description: The price grid resolved for this subscription.
        example: |-
          {
            "type": "rowSize",
            "meta": {
              "exchange": "CXBNCE",
              "symbol": "BTC/USDT",
              "timeframe": "1h"
            },
            "rowSize": "100"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: rowSize
      - &ref_5
        id: rangeTruncated
        contentType: application/json
        payload:
          - name: Range truncated frame
            description: The history depth limit moved the requested start forward.
            type: object
            properties:
              - name: const
                type: string
                description: rangeTruncated
                required: false
              - name: meta
                type: object
                description: Echo of the normalized subscription parameters.
                required: true
                properties:
                  - name: exchange
                    type: string
                    description: >-
                      TakeProfit exchange code as returned by GET
                      /api/v1/marketdata/exchanges.
                    required: true
                  - name: symbol
                    type: string
                    description: >-
                      TakeProfit security symbol as returned by GET
                      /api/v1/marketdata/exchanges/{exchange}/securities.
                    required: true
                  - name: timeframe
                    type: string
                    description: >-
                      Public timeframe id as returned by GET
                      /api/v1/marketdata/timeframes, for example 1m, 5m, 1h, or
                      1d.
                    required: true
              - name: firstBoundTime
                type: integer
                description: The bound the answer actually starts at, in Unix seconds.
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - type
            - meta
            - firstBoundTime
          properties:
            type:
              const: rangeTruncated
              x-parser-schema-id: <anonymous-schema-18>
            meta: *ref_2
            firstBoundTime:
              type: integer
              format: int64
              description: The bound the answer actually starts at, in Unix seconds.
              x-parser-schema-id: <anonymous-schema-19>
          x-parser-schema-id: <anonymous-schema-17>
        title: Range truncated frame
        description: The history depth limit moved the requested start forward.
        example: |-
          {
            "type": "rangeTruncated",
            "meta": {
              "exchange": "CXBNCE",
              "symbol": "BTC/USDT",
              "timeframe": "1h"
            },
            "firstBoundTime": 1774800000
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: rangeTruncated
      - &ref_6
        id: footprint
        contentType: application/json
        payload:
          - name: Footprint profile frame
            description: One complete volume footprint profile.
            type: object
            properties:
              - name: const
                type: string
                description: footprint
                required: false
              - name: meta
                type: object
                description: Echo of the normalized subscription parameters.
                required: true
                properties:
                  - name: exchange
                    type: string
                    description: >-
                      TakeProfit exchange code as returned by GET
                      /api/v1/marketdata/exchanges.
                    required: true
                  - name: symbol
                    type: string
                    description: >-
                      TakeProfit security symbol as returned by GET
                      /api/v1/marketdata/exchanges/{exchange}/securities.
                    required: true
                  - name: timeframe
                    type: string
                    description: >-
                      Public timeframe id as returned by GET
                      /api/v1/marketdata/timeframes, for example 1m, 5m, 1h, or
                      1d.
                    required: true
              - name: isLast
                type: boolean
                description: >-
                  True on the frame that ends the initial snapshot; delivered
                  exactly once per subscription.
                required: true
              - name: profile
                type: object
                required: false
                properties:
                  - name: profileStart
                    type: string
                    required: true
                  - name: profileEnd
                    type: string
                    required: false
                  - name: sessionType
                    type: string
                    enumValues:
                      - MAINSESSION
                      - PRE_MARKET
                      - POST_MARKET
                    required: true
                  - name: rowSize
                    type: string
                    description: >-
                      Price increment per row, in quote currency units.
                      Identical for every profile of one subscription, and every
                      row price is a whole multiple of it.
                    required: true
                  - name: rows
                    type: array
                    description: Price rows ordered from lowest to highest price.
                    required: true
                    properties:
                      - name: item
                        type: array
                        description: >-
                          One price row as the positional array [price,
                          volumeBuy, volumeSell, tradesCountBuy,
                          tradesCountSell]. price is the lower bound of the
                          half-open interval [price, price + rowSize); price and
                          volumes are decimal strings, trade counts are
                          integers. Future fields extend the array, so clients
                          must ignore extra trailing elements.
                        required: false
                  - name: totalVolumeSell
                    type: string
                    required: true
                  - name: totalVolumeBuy
                    type: string
                    required: true
                  - name: totalTradesCountSell
                    type: integer
                    required: true
                  - name: totalTradesCountBuy
                    type: integer
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - type
            - meta
            - isLast
          properties:
            type:
              const: footprint
              x-parser-schema-id: <anonymous-schema-21>
            meta: *ref_2
            isLast:
              type: boolean
              description: >-
                True on the frame that ends the initial snapshot; delivered
                exactly once per subscription.
              x-parser-schema-id: <anonymous-schema-22>
            profile:
              type: object
              required:
                - profileStart
                - sessionType
                - rowSize
                - rows
                - totalVolumeSell
                - totalVolumeBuy
                - totalTradesCountSell
                - totalTradesCountBuy
              properties:
                profileStart:
                  type: string
                  format: date-time
                  x-parser-schema-id: <anonymous-schema-23>
                profileEnd:
                  type: string
                  format: date-time
                  x-parser-schema-id: <anonymous-schema-24>
                sessionType:
                  type: string
                  enum:
                    - MAINSESSION
                    - PRE_MARKET
                    - POST_MARKET
                  x-parser-schema-id: SessionType
                rowSize:
                  type: string
                  description: >-
                    Price increment per row, in quote currency units. Identical
                    for every profile of one subscription, and every row price
                    is a whole multiple of it.
                  x-parser-schema-id: <anonymous-schema-25>
                rows:
                  type: array
                  description: Price rows ordered from lowest to highest price.
                  items:
                    type: array
                    description: >-
                      One price row as the positional array [price, volumeBuy,
                      volumeSell, tradesCountBuy, tradesCountSell]. price is the
                      lower bound of the half-open interval [price, price +
                      rowSize); price and volumes are decimal strings, trade
                      counts are integers. Future fields extend the array, so
                      clients must ignore extra trailing elements.
                    minItems: 5
                    items:
                      x-parser-schema-id: <anonymous-schema-27>
                    example:
                      - '109250'
                      - '0.0595'
                      - '1.55473'
                      - 78
                      - 30
                    x-parser-schema-id: FootprintRow
                  x-parser-schema-id: <anonymous-schema-26>
                totalVolumeSell:
                  type: string
                  x-parser-schema-id: <anonymous-schema-28>
                totalVolumeBuy:
                  type: string
                  x-parser-schema-id: <anonymous-schema-29>
                totalTradesCountSell:
                  type: integer
                  format: int64
                  x-parser-schema-id: <anonymous-schema-30>
                totalTradesCountBuy:
                  type: integer
                  format: int64
                  x-parser-schema-id: <anonymous-schema-31>
              x-parser-schema-id: FootprintProfile
          x-parser-schema-id: <anonymous-schema-20>
        title: Footprint profile frame
        description: One complete volume footprint profile.
        example: |-
          {
            "type": "footprint",
            "meta": {
              "exchange": "CXBNCE",
              "symbol": "BTC/USDT",
              "timeframe": "1h"
            },
            "isLast": false,
            "profile": {
              "profileStart": "2026-09-21T10:00:00Z",
              "profileEnd": "2026-09-21T11:00:00Z",
              "sessionType": "MAINSESSION",
              "rowSize": "100",
              "rows": [
                [
                  "84100",
                  "66.32422",
                  "63.42842",
                  8305,
                  6430
                ],
                [
                  "84200",
                  "185.50922",
                  "151.98043",
                  25221,
                  22635
                ],
                [
                  "84300",
                  "103.05549",
                  "75.71044",
                  13722,
                  12348
                ],
                [
                  "84400",
                  "67.85132",
                  "72.35893",
                  10385,
                  10509
                ],
                [
                  "84500",
                  "349.05247",
                  "260.16653",
                  34101,
                  27199
                ],
                [
                  "84600",
                  "108.17618",
                  "98.62807",
                  13821,
                  13449
                ],
                [
                  "84700",
                  "55.2806",
                  "34.94816",
                  5132,
                  4522
                ],
                [
                  "84800",
                  "1.75602",
                  "2.40955",
                  229,
                  186
                ]
              ],
              "totalVolumeSell": "759.63053",
              "totalVolumeBuy": "937.00552",
              "totalTradesCountSell": 97278,
              "totalTradesCountBuy": 110916
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: footprint
      - &ref_7
        id: error
        contentType: application/json
        payload:
          - name: Error frame
            description: >-
              Terminal error converted from an upstream status; closes the
              socket.
            type: object
            properties:
              - name: const
                type: string
                description: error
                required: false
              - name: meta
                type: object
                description: Echo of the normalized subscription parameters.
                required: true
                properties:
                  - name: exchange
                    type: string
                    description: >-
                      TakeProfit exchange code as returned by GET
                      /api/v1/marketdata/exchanges.
                    required: true
                  - name: symbol
                    type: string
                    description: >-
                      TakeProfit security symbol as returned by GET
                      /api/v1/marketdata/exchanges/{exchange}/securities.
                    required: true
                  - name: timeframe
                    type: string
                    description: >-
                      Public timeframe id as returned by GET
                      /api/v1/marketdata/timeframes, for example 1m, 5m, 1h, or
                      1d.
                    required: true
              - name: error
                type: object
                required: true
                properties:
                  - name: code
                    type: string
                    description: Stable public error code.
                    enumValues:
                      - canceled
                      - invalid_argument
                      - unauthenticated
                      - permission_denied
                      - not_found
                      - conflict
                      - rate_limited
                      - too_much_data
                      - deadline_exceeded
                      - unimplemented
                      - unavailable
                      - upstream_error
                    required: true
                  - name: message
                    type: string
                    description: Human-readable public error message.
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - type
            - meta
            - error
          properties:
            type:
              const: error
              x-parser-schema-id: <anonymous-schema-33>
            meta: *ref_2
            error:
              type: object
              required:
                - code
                - message
              properties:
                code:
                  type: string
                  description: Stable public error code.
                  enum:
                    - canceled
                    - invalid_argument
                    - unauthenticated
                    - permission_denied
                    - not_found
                    - conflict
                    - rate_limited
                    - too_much_data
                    - deadline_exceeded
                    - unimplemented
                    - unavailable
                    - upstream_error
                  x-parser-schema-id: <anonymous-schema-12>
                message:
                  type: string
                  description: Human-readable public error message.
                  x-parser-schema-id: <anonymous-schema-13>
              x-parser-schema-id: ErrorBody
          x-parser-schema-id: <anonymous-schema-32>
        title: Error frame
        description: Terminal error converted from an upstream status; closes the socket.
        example: |-
          {
            "type": "error",
            "meta": {
              "exchange": "CXBNCE",
              "symbol": "UNKNOWN",
              "timeframe": "1h"
            },
            "error": {
              "code": "not_found",
              "message": "security not found"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: error
    bindings: []
    extensions:
      - id: x-parser-unique-object-id
        value: footprint
sendOperations: []
receiveOperations:
  - *ref_3
sendMessages: []
receiveMessages:
  - *ref_4
  - *ref_5
  - *ref_6
  - *ref_7
extensions:
  - id: x-parser-unique-object-id
    value: footprint
securitySchemes:
  - id: ApiKeyAuth
    name: x-api-key
    type: httpApiKey
    description: >-
      API key sent on the WebSocket upgrade request. Exactly one header value is
      required; duplicate or comma-combined values are rejected.
    in: header
    extensions: []

````