Coinbase Balances API

Retrieve portfolio balance information across all assets.

OpenAPI Specification

coinbase-balances-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Coinbase Advanced Trade Accounts Balances API
  description: The Coinbase Advanced Trade API provides programmatic access to advanced trading features on the Coinbase platform. Developers can automate market, limit, and stop-limit orders, manage portfolios, retrieve real-time and historical market data, and monitor fees. The REST API is available at api.coinbase.com/api/v3/brokerage and supports authenticated access using API keys with HMAC SHA-256 signatures. Public market data endpoints do not require authentication.
  version: '3.0'
  contact:
    name: Coinbase Developer Support
    url: https://help.coinbase.com
  termsOfService: https://www.coinbase.com/legal/user-agreement
servers:
- url: https://api.coinbase.com/api/v3/brokerage
  description: Production Server
security:
- apiKeyAuth: []
tags:
- name: Balances
  description: Retrieve portfolio balance information across all assets.
paths:
  /portfolios/{portfolio_id}/balances:
    get:
      operationId: listPortfolioBalances
      summary: List portfolio balances
      description: Retrieves all asset balances for a specific portfolio, including available, held, and total amounts for each currency.
      tags:
      - Balances
      parameters:
      - $ref: '#/components/parameters/PortfolioIdParam'
      - name: symbols
        in: query
        description: Filter by currency symbols
        schema:
          type: string
      - $ref: '#/components/parameters/CursorParam'
      - $ref: '#/components/parameters/LimitParam'
      - $ref: '#/components/parameters/SortDirectionParam'
      responses:
        '200':
          description: Successfully retrieved balances
          content:
            application/json:
              schema:
                type: object
                properties:
                  balances:
                    type: array
                    items:
                      $ref: '#/components/schemas/Balance'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
components:
  parameters:
    CursorParam:
      name: cursor
      in: query
      description: Cursor for pagination
      schema:
        type: string
    SortDirectionParam:
      name: sort_direction
      in: query
      description: Sort direction for results
      schema:
        type: string
        enum:
        - ASC
        - DESC
        default: DESC
    LimitParam:
      name: limit
      in: query
      description: Maximum number of results to return
      schema:
        type: integer
        minimum: 1
        maximum: 3000
        default: 100
    PortfolioIdParam:
      name: portfolio_id
      in: path
      required: true
      description: Portfolio identifier
      schema:
        type: string
  schemas:
    Balance:
      type: object
      description: An asset balance within a portfolio
      properties:
        symbol:
          type: string
          description: Currency symbol
        amount:
          type: string
          description: Total amount
        holds:
          type: string
          description: Amount on hold
        bonded_amount:
          type: string
          description: Amount bonded in staking
        reserved_amount:
          type: string
          description: Reserved amount
        unbonding_amount:
          type: string
          description: Amount currently unbonding
        unvested_amount:
          type: string
          description: Unvested amount
        pending_rewards_amount:
          type: string
          description: Pending staking rewards
        past_rewards_amount:
          type: string
          description: Previously claimed staking rewards
        bondable_amount:
          type: string
          description: Amount available for staking
        withdrawable_amount:
          type: string
          description: Amount available for withdrawal
        fiat_amount:
          type: string
          description: Fiat equivalent value
    Pagination:
      type: object
      description: Pagination information for list responses
      properties:
        next_cursor:
          type: string
          description: Cursor for the next page
        sort_direction:
          type: string
          description: Sort direction
        has_next:
          type: boolean
          description: Whether there are more results
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: CB-ACCESS-KEY
      description: Coinbase API key authentication using HMAC SHA-256 signatures. Requires CB-ACCESS-KEY, CB-ACCESS-SIGN, and CB-ACCESS-TIMESTAMP headers.
externalDocs:
  description: Coinbase Advanced Trade API Documentation
  url: https://docs.cdp.coinbase.com/coinbase-app/advanced-trade-apis/rest-api