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

# Get positions

> Returns a page of real-time positions.



## OpenAPI

````yaml /api-reference/clearing-api/rest-api/cbc-spec.json post /api/position/get-page
openapi: 3.0.3
info:
  title: Coinbase Clearing REST API
  description: >-
    Read-only queries of Coinbase Clearing LLC (CBC) trades, instrument prices,
    settlement results, positions, and balances.
  version: 5.1.5
servers:
  - url: https://{host}/cdp-api
    variables:
      host:
        default: host
        description: >-
          Host name for your environment. REST API host names are not published
          yet; environments are described on the Coinbase Clearing Connectivity
          page.
security:
  - bearerAuth: []
tags:
  - name: Trades
    description: Trades.
  - name: Prices
    description: Instrument prices.
  - name: Settlement Results
    description: Settlement results for instruments.
  - name: Positions
    description: Real-time positions.
  - name: Balances
    description: Account balances.
paths:
  /api/position/get-page:
    post:
      tags:
        - Positions
      summary: Get positions
      description: Returns a page of real-time positions.
      operationId: getPositions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PositionDecoratedQuery'
            example:
              bookmark: null
              queryArgs: null
              rangeLimit: 50
              paging: NEXT_PAGE
      responses:
        '200':
          description: A page of results.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PositionDecoratedPage'
              example:
                bookmark: eyJsYXN0S2V5IjoiMTAwMSJ9
                content:
                  - instrumentId: 5678
                    instrumentCode: WC26-FRW
                    accountId: 1001
                    accountCode: ACC-MAIN-001
                    subAccount: DEFAULT
                    clearingMemberId: 200
                    clearingMemberCode: CM-ALPHA
                    position:
                      positionQuantities:
                        longQuantity: 15
                        shortQuantity: 0
                        netQuantity: 15
                        zero: false
                      marketValue:
                        amount: 9.75
                        currency: USDC
                        zero: false
                      binaryTradeValue:
                        amount: 9.75
                        currency: USDC
                        zero: false
                      empty: false
                atEnd: true
components:
  schemas:
    PositionDecoratedQuery:
      description: Query request for positions.
      allOf:
        - $ref: '#/components/schemas/PageRequest'
        - type: object
          properties:
            queryArgs:
              type: object
              description: >-
                Filter and sort arguments. Use `null` to return all results
                unfiltered.
              nullable: true
              allOf:
                - $ref: '#/components/schemas/PositionDecoratedQueryArgs'
    PositionDecoratedPage:
      description: Page of positions.
      allOf:
        - $ref: '#/components/schemas/PageResponse'
        - type: object
          properties:
            content:
              type: array
              description: Page of positions.
              items:
                $ref: '#/components/schemas/PositionDecorated'
    PageRequest:
      type: object
      description: Fields shared by every query request.
      required:
        - rangeLimit
        - paging
      properties:
        bookmark:
          type: string
          nullable: true
          description: >-
            Pagination cursor from the previous response. Use `null` for the
            first page.
          example: null
        rangeLimit:
          type: integer
          format: int32
          description: Maximum number of results per page.
          example: 50
        paging:
          $ref: '#/components/schemas/Paging'
    PositionDecoratedQueryArgs:
      type: object
      description: Filter and sort arguments for positions. All fields are optional.
      properties:
        instrumentCode:
          description: Filter by resolved instrument code.
          allOf:
            - $ref: '#/components/schemas/StringQueryArg'
        accountId:
          description: Filter by account ID.
          allOf:
            - $ref: '#/components/schemas/LongQueryArg'
        accountCode:
          description: Filter by resolved account code.
          allOf:
            - $ref: '#/components/schemas/StringQueryArg'
        subAccount:
          description: Filter by sub-account.
          allOf:
            - $ref: '#/components/schemas/StringQueryArg'
        clearingMemberId:
          description: Filter by clearing member ID.
          allOf:
            - $ref: '#/components/schemas/LongQueryArg'
        clearingMemberCode:
          description: Filter by resolved clearing member code.
          allOf:
            - $ref: '#/components/schemas/StringQueryArg'
        position:
          description: Filters on the position quantities and values.
          allOf:
            - $ref: '#/components/schemas/PositionQueryArgs'
    PageResponse:
      type: object
      description: Fields shared by every query response.
      properties:
        bookmark:
          type: string
          description: Cursor to fetch the next or previous page.
          example: eyJsYXN0S2V5IjoiMTAwMyJ9
        atEnd:
          type: boolean
          description: '`true` when there are no more pages in the current direction.'
          example: false
    PositionDecorated:
      type: object
      description: Position with resolved codes.
      properties:
        instrumentId:
          type: integer
          format: int64
          description: ID of the instrument in the position.
          example: 5678
        instrumentCode:
          type: string
          description: Resolved instrument code.
          example: WC26-FRW
        accountId:
          type: integer
          format: int64
          description: ID of the account the position is related to.
          example: 1001
        accountCode:
          type: string
          description: Resolved account code.
          example: ACC-MAIN-001
        subAccount:
          type: string
          description: Sub-account of the position.
          example: DEFAULT
        clearingMemberId:
          type: integer
          format: int64
          description: ID of the clearing member.
          example: 200
        clearingMemberCode:
          type: string
          description: Resolved clearing member code.
          example: CM-ALPHA
        position:
          description: Position quantities and values.
          allOf:
            - $ref: '#/components/schemas/Position'
    Paging:
      type: string
      description: Page direction.
      enum:
        - NEXT_PAGE
        - PREVIOUS_PAGE
      example: NEXT_PAGE
    StringQueryArg:
      type: object
      description: Filter and sort argument for a string field.
      properties:
        filters:
          type: array
          description: Filter conditions on this field.
          items:
            $ref: '#/components/schemas/StringFilter'
        sorter:
          $ref: '#/components/schemas/Sorter'
    LongQueryArg:
      type: object
      description: Filter and sort argument for a 64-bit integer field.
      properties:
        filters:
          type: array
          description: Filter conditions on this field.
          items:
            $ref: '#/components/schemas/LongFilter'
        sorter:
          $ref: '#/components/schemas/Sorter'
    PositionQueryArgs:
      type: object
      description: Filters on the position quantities and values.
      properties:
        positionQuantities:
          description: Filters on the position quantities.
          allOf:
            - $ref: '#/components/schemas/PositionQuantitiesQueryArgs'
        marketValue:
          description: Filter by market value.
          allOf:
            - $ref: '#/components/schemas/MonetaryAmountQueryArgs'
        binaryTradeValue:
          description: Filter by binary trade value.
          allOf:
            - $ref: '#/components/schemas/MonetaryAmountQueryArgs'
    Position:
      type: object
      description: Position quantities and values.
      properties:
        positionQuantities:
          description: Long, short, and net quantities.
          allOf:
            - $ref: '#/components/schemas/PositionQuantities'
          example:
            longQuantity: 15
            shortQuantity: 0
            netQuantity: 15
            zero: false
        marketValue:
          description: Market value of the position.
          allOf:
            - $ref: '#/components/schemas/MonetaryAmount'
          example:
            amount: 9.75
            currency: USDC
            zero: false
        binaryTradeValue:
          description: Binary trade value of the position.
          allOf:
            - $ref: '#/components/schemas/MonetaryAmount'
          example:
            amount: 9.75
            currency: USDC
            zero: false
        empty:
          type: boolean
          readOnly: true
          description: >-
            `true` when all position quantities, `marketValue`, and
            `binaryTradeValue` are 0. Included in every response.
          example: false
    StringFilter:
      type: object
      description: Filter condition for a string field.
      required:
        - group
        - operator
        - value
      properties:
        group:
          type: integer
          format: int32
          description: >-
            Filter group. Filters in the same group are combined with AND;
            groups are combined with OR.
          example: 0
        operator:
          type: string
          description: Filter operator.
          enum:
            - EQUALS
            - NOT_EQUALS
            - CONTAINS
            - STARTS_WITH
            - ENDS_WITH
            - NOT_CONTAINS
          example: EQUALS
        value:
          type: string
          description: String value to compare.
          example: ACC-5001
    Sorter:
      type: object
      description: Sort configuration for a field.
      properties:
        priority:
          type: integer
          format: int32
          description: Sort priority. A lower value has a higher priority.
          example: 0
        sortingDirection:
          type: string
          description: Sort direction.
          enum:
            - ASCENDING
            - DESCENDING
          example: DESCENDING
    LongFilter:
      type: object
      description: Filter condition for a 64-bit integer field.
      required:
        - group
        - operator
        - value
      properties:
        group:
          type: integer
          format: int32
          description: >-
            Filter group. Filters in the same group are combined with AND;
            groups are combined with OR.
          example: 0
        operator:
          type: string
          description: Filter operator.
          enum:
            - EQUALS
            - NOT_EQUALS
            - GREATER_THAN
            - GREATER_THAN_OR_EQUALS
            - LESS_THAN
            - LESS_THAN_OR_EQUALS
          example: EQUALS
        value:
          type: integer
          format: int64
          description: Integer value to compare.
          example: 12345
    PositionQuantitiesQueryArgs:
      type: object
      description: Filters on position quantities.
      properties:
        longQuantity:
          description: Filter by long quantity.
          allOf:
            - $ref: '#/components/schemas/BigDecimalQueryArg'
        shortQuantity:
          description: Filter by short quantity.
          allOf:
            - $ref: '#/components/schemas/BigDecimalQueryArg'
        netQuantity:
          description: Filter by net quantity.
          allOf:
            - $ref: '#/components/schemas/BigDecimalQueryArg'
    MonetaryAmountQueryArgs:
      type: object
      description: Filters on a monetary amount.
      properties:
        amount:
          description: Filter by amount.
          allOf:
            - $ref: '#/components/schemas/BigDecimalQueryArg'
        currency:
          description: Filter by currency code.
          allOf:
            - $ref: '#/components/schemas/StringQueryArg'
    PositionQuantities:
      type: object
      description: Long, short, and net quantities of the position.
      properties:
        longQuantity:
          type: number
          description: Long quantity based on previous and today's trading activity.
          example: 15
        shortQuantity:
          type: number
          description: Short quantity based on previous and today's trading activity.
          example: 0
        netQuantity:
          type: number
          description: Long quantity minus short quantity.
          example: 15
        zero:
          type: boolean
          readOnly: true
          description: >-
            `true` when the long, short, and net quantities are all 0. Included
            in every response.
          example: false
    MonetaryAmount:
      type: object
      description: Amount in a currency.
      properties:
        amount:
          type: number
          description: Amount.
          example: 1425
        currency:
          type: string
          description: Currency code.
          example: USDC
        zero:
          type: boolean
          readOnly: true
          description: '`true` when `amount` is 0. Included in every response.'
          example: false
    BigDecimalQueryArg:
      type: object
      description: Filter and sort argument for a decimal field.
      properties:
        filters:
          type: array
          description: Filter conditions on this field.
          items:
            $ref: '#/components/schemas/BigDecimalFilter'
        sorter:
          $ref: '#/components/schemas/Sorter'
    BigDecimalFilter:
      type: object
      description: Filter condition for a decimal field.
      required:
        - group
        - operator
        - value
      properties:
        group:
          type: integer
          format: int32
          description: >-
            Filter group. Filters in the same group are combined with AND;
            groups are combined with OR.
          example: 0
        operator:
          type: string
          description: Filter operator.
          enum:
            - EQUALS
            - NOT_EQUALS
            - GREATER_THAN
            - GREATER_THAN_OR_EQUALS
            - LESS_THAN
            - LESS_THAN_OR_EQUALS
          example: EQUALS
        value:
          type: number
          description: Decimal number to compare.
          example: 142.5
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT generated from a Coinbase Developer Platform (CDP) API key. See CDP
        API key JWT authentication.

````