Backpack Position API

Positions and futures data.

Operations 3

GET /api/v1/position Get open positions #
GET /wapi/v1/history/funding Get funding payments #
GET /wapi/v1/history/position Get position history #

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/backpack-position-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

backpack-position-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Backpack Exchange Position API
  description: '# Introduction


    Welcome to the Backpack Exchange API.'
  version: '1.0'
  x-logo:
    url: https://cdn.prod.website-files.com/66830ad123bea7f626bcf58f/68eccb03852237fd98ffad9b_Backpack-Icon-Color.svg
    altText: Backpack Exchange
  contact:
    name: Backpack Exchange Support
    url: https://support.backpack.exchange/
  license:
    name: Proprietary
servers:
- url: https://api.backpack.exchange
tags:
- name: Position
  description: Positions and futures data.
paths:
  /api/v1/position:
    get:
      tags:
      - Position
      summary: Get open positions
      description: 'Retrieves account position summary.


        **Instruction:** `positionQuery`'
      parameters:
      - name: X-API-KEY
        schema:
          type: string
        in: header
        description: API key
        required: true
        deprecated: false
        explode: true
      - name: X-SIGNATURE
        schema:
          type: string
        in: header
        description: Signature of the request
        required: true
        deprecated: false
        explode: true
      - name: X-TIMESTAMP
        schema:
          type: integer
          format: int64
        in: header
        description: Timestamp of the request in milliseconds
        required: true
        deprecated: false
        explode: true
      - name: X-WINDOW
        schema:
          type: integer
          format: uint64
        in: header
        description: Time the request is valid for in milliseconds (default `5000`, maximum `60000`)
        required: false
        deprecated: false
        explode: true
      - name: symbol
        schema:
          type: string
        in: query
        description: Filter for a single position by symbol.
        required: false
        deprecated: false
        explode: true
      - name: marketType
        schema:
          $ref: '#/components/schemas/MarketType'
        in: query
        description: The market for the orders (SPOT or PERP).
        required: false
        deprecated: false
        explode: true
      responses:
        '200':
          description: Success.
          content:
            application/json; charset=utf-8:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FuturePositionWithMargin'
        '400':
          description: Bad request.
          content:
            application/json; charset=utf-8:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json; charset=utf-8:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '404':
          description: Position not found.
          content:
            application/json; charset=utf-8:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json; charset=utf-8:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      operationId: get_positions
  /wapi/v1/history/funding:
    get:
      tags:
      - Position
      summary: Get funding payments
      description: 'Users funding payment history for futures.


        **Instruction:** `fundingHistoryQueryAll`'
      parameters:
      - name: X-API-KEY
        schema:
          type: string
        in: header
        description: API key
        required: false
        deprecated: false
        explode: true
      - name: X-SIGNATURE
        schema:
          type: string
        in: header
        description: Signature of the request
        required: false
        deprecated: false
        explode: true
      - name: X-TIMESTAMP
        schema:
          type: integer
          format: int64
        in: header
        description: Timestamp of the request in milliseconds
        required: false
        deprecated: false
        explode: true
      - name: X-WINDOW
        schema:
          type: integer
          format: uint64
        in: header
        description: Time the request is valid for in milliseconds (default `5000`, maximum `60000`)
        required: false
        deprecated: false
        explode: true
      - name: subaccountId
        schema:
          type: integer
          format: uint16
        in: query
        description: Filter for a subaccount.
        required: false
        deprecated: false
        explode: true
      - name: symbol
        schema:
          type: string
        in: query
        description: Market symbol to query. If not set, all markets are returned.
        required: false
        deprecated: false
        explode: true
      - name: limit
        schema:
          type: integer
          format: uint64
        in: query
        description: Maximum number to return. Default `100`, maximum `1000`.
        required: false
        deprecated: false
        explode: true
      - name: offset
        schema:
          type: integer
          format: uint64
        in: query
        description: Offset for pagination. Default `0`.
        required: false
        deprecated: false
        explode: true
      - name: sortDirection
        schema:
          $ref: '#/components/schemas/SortDirection'
        in: query
        description: Sort direction.
        required: false
        deprecated: false
        explode: true
      responses:
        '200':
          description: Success.
          content:
            application/json; charset=utf-8:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FundingPayment'
          headers:
            ACCESS-CONTROL-EXPOSE-HEADERS:
              required: true
              deprecated: false
              schema:
                type: string
            X-PAGE-COUNT:
              required: true
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-CURRENT-PAGE:
              required: true
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-PAGE-SIZE:
              required: true
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-TOTAL:
              required: true
              deprecated: false
              schema:
                type: integer
                format: uint64
            CACHE-CONTROL:
              required: true
              deprecated: false
              schema:
                type: string
        '400':
          description: Bad request.
          content:
            application/json; charset=utf-8:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json; charset=utf-8:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json; charset=utf-8:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      operationId: get_funding_payments
  /wapi/v1/history/position:
    get:
      tags:
      - Position
      summary: Get position history
      description: 'Retrieves historical positions, with optional filtering for a specific symbol.


        **Instruction:** `positionHistoryQueryAll`'
      parameters:
      - name: X-API-KEY
        schema:
          type: string
        in: header
        description: API key
        required: false
        deprecated: false
        explode: true
      - name: X-SIGNATURE
        schema:
          type: string
        in: header
        description: Signature of the request
        required: false
        deprecated: false
        explode: true
      - name: X-TIMESTAMP
        schema:
          type: integer
          format: int64
        in: header
        description: Timestamp of the request in milliseconds
        required: false
        deprecated: false
        explode: true
      - name: X-WINDOW
        schema:
          type: integer
          format: uint64
        in: header
        description: Time the request is valid for in milliseconds (default `5000`, maximum `60000`)
        required: false
        deprecated: false
        explode: true
      - name: symbol
        schema:
          type: string
        in: query
        description: Market symbol to query position history for.
        required: false
        deprecated: false
        explode: true
      - name: state
        schema:
          $ref: '#/components/schemas/PositionState'
        in: query
        description: Position state to filter positions.
        required: false
        deprecated: false
        explode: true
      - name: marketType
        schema:
          type: array
          items:
            $ref: '#/components/schemas/MarketType'
        in: query
        description: Market type.
        required: false
        deprecated: false
        explode: true
      - name: limit
        schema:
          type: integer
          format: uint64
        in: query
        description: Maximum number to return. Default `100`, maximum `1000`.
        required: false
        deprecated: false
        explode: true
      - name: offset
        schema:
          type: integer
          format: uint64
        in: query
        description: Offset for pagination. Default `0`.
        required: false
        deprecated: false
        explode: true
      - name: sortDirection
        schema:
          $ref: '#/components/schemas/SortDirection'
        in: query
        description: Sort direction.
        required: false
        deprecated: false
        explode: true
      responses:
        '200':
          description: Success.
          content:
            application/json; charset=utf-8:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PositionHistoryRow'
          headers:
            CACHE-CONTROL:
              required: true
              deprecated: false
              schema:
                type: string
        '400':
          description: Bad request.
          content:
            application/json; charset=utf-8:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json; charset=utf-8:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json; charset=utf-8:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      operationId: get_position_history
components:
  schemas:
    PositionState:
      type: string
      enum:
      - Open
      - Closed
    SortDirection:
      type: string
      enum:
      - Asc
      - Desc
    ApiErrorResponse:
      type: object
      title: ApiErrorResponse
      required:
      - code
      - message
      properties:
        code:
          $ref: '#/components/schemas/ApiErrorCode'
        message:
          type: string
    FuturePositionWithMargin:
      type: object
      title: FuturePositionWithMargin
      required:
      - breakEvenPrice
      - entryPrice
      - estLiquidationPrice
      - imf
      - imfFunction
      - markPrice
      - mmf
      - mmfFunction
      - netCost
      - netQuantity
      - netExposureQuantity
      - netExposureNotional
      - pnlRealized
      - pnlUnrealized
      - cumulativeFundingPayment
      - symbol
      - userId
      - positionId
      - cumulativeInterest
      properties:
        breakEvenPrice:
          type: string
          format: decimal
          description: Break-even price for this position.
        entryPrice:
          type: string
          format: decimal
          description: Entry price for this position.
        estLiquidationPrice:
          type: string
          format: decimal
          description: Estimated liquidation price for this position.
        imf:
          type: string
          format: decimal
          description: Initial margin fraction for this position.
        imfFunction:
          description: IMF function.
          allOf:
          - $ref: '#/components/schemas/PositionImfFunction'
          - description: IMF function.
        markPrice:
          type: string
          format: decimal
          description: Mark price for this position's market.
        mmf:
          type: string
          format: decimal
          description: Maintenance margin fraction for this position.
        mmfFunction:
          description: MMF function.
          allOf:
          - $ref: '#/components/schemas/PositionImfFunction'
          - description: MMF function.
        netCost:
          type: string
          format: decimal
          description: 'Positive if long. Negative if short.


            The net cost to enter into the position,i.e., price*quantity for

            all positions adjusting this position.'
        netQuantity:
          type: string
          format: decimal
          description: Positive if long. Negative if short.
        netExposureQuantity:
          type: string
          format: decimal
          description: Quantity of this futures position including worst case open positions.
        netExposureNotional:
          type: string
          format: decimal
          description: 'Notional value of the futures position including worst case open

            positions.'
        pnlRealized:
          type: string
          format: decimal
          description: Aggregates the amount of pnl realized on this position since opening.
        pnlUnrealized:
          type: string
          format: decimal
          description: Unrealized profit and loss for this position.
        cumulativeFundingPayment:
          type: string
          format: decimal
          description: Cumulative funding payment for this position.
        subaccountId:
          type: integer
          format: uint16
          description: ID of the user subaccount that the position is for.
        symbol:
          type: string
          description: Future to which this position belongs.
        userId:
          type: integer
          format: int32
          description: Id of the user.
        positionId:
          type: string
          description: Id of the position.
        cumulativeInterest:
          type: string
          format: decimal
          description: Cumulative interest paid for this position's unrealized pnl.
    SqrtFunction:
      type: object
      title: SqrtFunction
      required:
      - base
      - factor
      properties:
        base:
          type: string
          format: decimal
        factor:
          type: string
          format: decimal
    PositionImfFunction:
      type: object
      anyOf:
      - $ref: '#/components/schemas/PositionImfFunction_SqrtFunction'
      discriminator:
        propertyName: type
        mapping:
          sqrt: '#/components/schemas/PositionImfFunction_SqrtFunction'
    MarketType:
      type: string
      enum:
      - SPOT
      - PERP
      - IPERP
      - DATED
      - PREDICTION
      - RFQ
    PositionHistoryRow:
      type: object
      title: PositionHistoryRow
      required:
      - id
      - symbol
      - netQuantity
      - netExposureQuantity
      - netExposureNotional
      - netCost
      - markPrice
      - entryPrice
      - cumulativePnlRealized
      - unrealizedPnl
      - fundingQuantity
      - interest
      - liquidated
      - imf
      - fees
      - state
      - closedVolume
      - liquidationFees
      properties:
        id:
          type: string
        symbol:
          type: string
        netQuantity:
          type: string
          format: decimal
        netExposureQuantity:
          type: string
          format: decimal
        netExposureNotional:
          type: string
          format: decimal
        netCost:
          type: string
          format: decimal
        markPrice:
          type: string
          format: decimal
        entryPrice:
          type: string
          format: decimal
        cumulativePnlRealized:
          type: string
          format: decimal
        unrealizedPnl:
          type: string
          format: decimal
        fundingQuantity:
          type: string
          format: decimal
        interest:
          type: string
          format: decimal
        liquidated:
          type: string
          format: decimal
        imf:
          type: string
          format: decimal
        fees:
          type: string
          format: decimal
          description: Total trading fees paid for this position.
        state:
          $ref: '#/components/schemas/PositionState'
        closedVolume:
          type: string
          format: decimal
        liquidationFees:
          type: string
          format: decimal
          description: Total liquidation fees paid for this position.
        closingPrice:
          type: string
          format: decimal
        accountLeverage:
          type: string
          format: decimal
        openedAt:
          type: string
          format: naive-date-time
        closedAt:
          type: string
          format: naive-date-time
    FundingPayment:
      type: object
      title: FundingPayment
      required:
      - userId
      - symbol
      - quantity
      - intervalEndTimestamp
      - fundingRate
      properties:
        userId:
          type: integer
          format: int32
          description: User id of the account the payment is associated with.
        subaccountId:
          type: integer
          format: uint16
          description: Id of the subaccount the payment is associated with, if any.
        symbol:
          type: string
          description: The symbol of the market the payment is associated with.
        quantity:
          type: string
          format: decimal
          description: Quantity of the payment. Positive if received, negative if paid.
        intervalEndTimestamp:
          type: string
          format: naive-date-time
          description: The end of the funding interval for the payment.
        fundingRate:
          type: string
          format: decimal
          description: The funding rate for the payment.
    PositionImfFunction_SqrtFunction:
      allOf:
      - type: object
        required:
        - type
        properties:
          type:
            type: string
            enum:
            - sqrt
            example: sqrt
      - $ref: '#/components/schemas/SqrtFunction'
    ApiErrorCode:
      type: string
      enum:
      - ACCOUNT_DEACTIVATED
      - ACCOUNT_LIQUIDATING
      - BORROW_LIMIT
      - BORROW_REQUIRES_LEND_REDEEM
      - FORBIDDEN
      - INSUFFICIENT_FUNDS
      - INSUFFICIENT_MARGIN
      - INSUFFICIENT_SUPPLY
      - INVALID_ASSET
      - INVALID_CLIENT_REQUEST
      - INVALID_MARKET
      - INVALID_ORDER
      - INVALID_PRICE
      - INVALID_POSITION_ID
      - INVALID_QUANTITY
      - INVALID_RANGE
      - INVALID_SIGNATURE
      - INVALID_SOURCE
      - INVALID_SYMBOL
      - INVALID_TWO_FACTOR_CODE
      - LEND_LIMIT
      - LEND_REQUIRES_BORROW_REPAY
      - MAINTENANCE
      - MAX_LEVERAGE_REACHED
      - NOT_IMPLEMENTED
      - ORDER_LIMIT
      - POSITION_LIMIT
      - PRECONDITION_FAILED
      - RESOURCE_NOT_FOUND
      - SERVER_ERROR
      - TIMEOUT
      - TOO_EARLY
      - TOO_MANY_REQUESTS
      - TRADING_PAUSED
      - UNAUTHORIZED
x-tagGroups:
- name: Public Endpoints
  tags:
  - Assets
  - Borrow Lend Markets
  - Markets
  - System
  - Trades
- name: Authenticated Endpoints
  tags:
  - Account
  - Borrow Lend
  - Capital
  - Order
  - Position
  - RFQ
  - Strategy
- name: Websocket
  tags:
  - Streams