> ## 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 staking context

> Fetches the staking context for an address given the network, asset, address and [custom options](/staking/staking-api/introduction/api-usage#staking-options).

This API offers a point-in-time snapshot of key staking details, such as current stakeable, unstakeable, and claimable balances, which reflect the address’s staking position at the time of the request.

This information can be used to gate staking actions on your platform or to provide users with precise details on their staking positions. For example, knowing the current unstakeable balance allows you to inform users of the maximum amount they can unstake at that moment.




## OpenAPI

````yaml POST /v1/stake/context
openapi: 3.0.3
info:
  title: Coinbase Developer Platform API
  license:
    name: MIT License
    url: https://opensource.org/license/mit
  version: 0.0.1-alpha
servers:
  - url: https://api.cdp.coinbase.com/platform
security:
  - bearerAuth: []
tags:
  - name: Addresses
    description: Addresses belong to a wallet and are scoped to a network.
  - name: Assets
    description: Assets are the digital assets that can be held in a wallet.
  - name: Networks
    description: Blockchain networks that are supported by the platform.
  - name: Staking
    description: Staking operations and rewards for addresses on supported networks.
paths:
  /v1/stake/context:
    post:
      tags:
        - Staking
      summary: Get staking context
      description: >
        Fetches the staking context for an address given the network, asset,
        address and [custom
        options](/staking/staking-api/introduction/api-usage#staking-options).


        This API offers a point-in-time snapshot of key staking details, such as
        current stakeable, unstakeable, and claimable balances, which reflect
        the address’s staking position at the time of the request.


        This information can be used to gate staking actions on your platform or
        to provide users with precise details on their staking positions. For
        example, knowing the current unstakeable balance allows you to inform
        users of the maximum amount they can unstake at that moment.
      operationId: getStakingContext
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                network_id:
                  type: string
                  example: ethereum-mainnet
                  description: The ID of the blockchain network.
                asset_id:
                  type: string
                  example: ETH
                  description: The symbol of the asset being staked.
                address_id:
                  type: string
                  example: '0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a'
                  description: >-
                    The onchain address for which the staking context is being
                    fetched
                options:
                  type: object
                  description: >-
                    Additional options for getting the staking context. See
                    [here](/staking/staking-api/introduction/api-usage#staking-options)
                    for detailed options.
                  additionalProperties:
                    type: string
              required:
                - network_id
                - asset_id
                - address_id
                - options
      responses:
        '200':
          description: staking context for an address fetched successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StakingContext'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Error response
components:
  schemas:
    StakingContext:
      description: Context needed to perform a staking operation
      type: object
      properties:
        context:
          type: object
          properties:
            stakeable_balance:
              $ref: '#/components/schemas/Balance'
              description: >-
                The balance that can be staked. This is typically the wallet
                balance in atomic units.
            unstakeable_balance:
              $ref: '#/components/schemas/Balance'
              description: >-
                The total staked balance of the wallet that can be unstaked in
                atomic units.
            claimable_balance:
              $ref: '#/components/schemas/Balance'
              description: The total unstaked balance that can be claimed in atomic units.
          required:
            - stakeable_balance
            - unstakeable_balance
            - claimable_balance
      required:
        - context
      xml:
        name: staking_context
    Error:
      description: An error response from the Coinbase Developer Platform API
      properties:
        code:
          description: >-
            A short string representing the reported error. Can be use to handle
            errors programmatically.
          maxLength: 5000
          type: string
        message:
          description: A human-readable message providing more details about the error.
          maxLength: 5000
          type: string
        correlation_id:
          description: >-
            A unique identifier for the request that generated the error. This
            can be used to help debug issues with the API.
          type: string
      required:
        - code
        - message
      type: object
      xml:
        name: error
    Balance:
      description: The balance of an asset onchain
      type: object
      properties:
        amount:
          type: string
          example: '12345678'
          description: The amount in the atomic units of the asset
        asset:
          $ref: '#/components/schemas/Asset'
      required:
        - amount
        - asset
      xml:
        name: balance
    Asset:
      description: >-
        An asset onchain scoped to a particular network, e.g. ETH on
        base-sepolia, or the USDC ERC20 Token on ethereum-mainnet.
      type: object
      properties:
        network_id:
          type: string
          example: base-sepolia
          description: The ID of the blockchain network.
        asset_id:
          type: string
          example: USDC
          description: The ID for the asset on the network
        decimals:
          type: integer
          example: 18
          description: >-
            The number of decimals the asset supports. This is used to convert
            from atomic units to base units.
        contract_address:
          type: string
          description: >-
            The optional contract address for the asset. This will be specified
            for smart contract-based assets, for example ERC20s.
          example: '0x036CbD53842c5426634e7929541eC2318f3dCF7e'
      required:
        - network_id
        - asset_id
      xml:
        name: asset
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Enter your JSON Web Token (JWT) here. Refer to the [Generate
        JWT](/api-reference/authentication#2-generate-jwt-server-only) section
        of our Authentication docs for information on how to generate your
        Bearer Token.

````