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

# ウォレット残高の取得

> Solanaウォレットアドレスのトークン残高とSOL保有を取得します。

各リクエストには**100クレジット**がかかります。

## リクエストパラメータ

<ParamField body="wallet" type="string" required default="GQUtvPx89ZNCwmvQqFmH59bJcU8fW8siETpaxod7Aydz">
  Solanaウォレットアドレス（base58エンコード）
</ParamField>

<ParamField body="page" type="number" default="1">
  ページネーションのためのページ番号（1から開始）
</ParamField>

<ParamField body="limit" type="number" default="100">
  ページごとの最大トークン数
</ParamField>

<ParamField body="showZeroBalance" type="boolean" default="false">
  残高ゼロのトークンを含める
</ParamField>

<ParamField body="showNative" type="boolean" default="true">
  結果にネイティブSOLを含める
</ParamField>

<ParamField body="showNfts" type="boolean" default="false">
  結果にNFTを含める（最大100、最初のページのみ）
</ParamField>


## OpenAPI

````yaml ja/openapi/wallet-api/openapi.yaml GET /v1/wallet/{wallet}/balances
openapi: 3.0.3
info:
  title: Wallet API
  description: |
    Solanaのウォレットデータ（残高、取引履歴、転送、ID情報）を照会するための高性能なREST APIです。

    ## 認証

    すべてのリクエストには、以下のいずれかとして渡されたAPIキーが必要です:
    - クエリパラメータ: `?api-key=YOUR_API_KEY`
    - ヘッダー: `X-Api-Key: YOUR_API_KEY`
  version: 1.0.0
  contact:
    name: API サポート
    url: https://helius.dev
servers:
  - url: https://api.helius.xyz
    description: プロダクションサーバー
security:
  - ApiKeyQuery: []
  - ApiKeyHeader: []
tags:
  - name: Identity
    description: ウォレットIDと既知のアドレスを検索
  - name: Balances
    description: トークンとNFTの残高を照会
  - name: History
    description: 取引履歴と残高の変動
  - name: Transfers
    description: トークン転送の活動
  - name: Funding
    description: ウォレットの資金に関する情報
paths:
  /v1/wallet/{wallet}/balances:
    get:
      tags:
        - Balances
      summary: ウォレット残高を取得
      description: >
        ウォレットのトークンとNFT残高を取得します。**ページングは手動**で行います - APIは1リクエストあたり最大100トークンを返します。


        結果はUSD価値の降順でソートされます。価格データがあるトークンが最初に表示され、次に価格がないトークンが続きます。


        **ページング:** `ページ` パラメータを使用して追加ページを取得します。レスポンスには `pagination.hasMore`
        が含まれており、さらに結果が利用可能かどうかが示されています。各リクエストは1回のAPIコールを行い、100クレジットが必要です。
      operationId: getWalletBalances
      parameters:
        - $ref: '#/components/parameters/WalletAddress'
        - name: page
          in: query
          description: ページ番号（1から始まる）
          schema:
            type: integer
            minimum: 1
            default: 1
          example: 1
        - name: limit
          in: query
          description: ページごとの最大トークン数
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 100
          example: 100
        - name: showZeroBalance
          in: query
          description: 残高がゼロのトークンを含める
          schema:
            type: boolean
            default: false
        - name: showNative
          in: query
          description: 結果にネイティブSOLを含める
          schema:
            type: boolean
            default: true
        - name: showNfts
          in: query
          description: 結果にNFTを含める（最大100、最初のページのみ）
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: ウォレットの残高を正常に取得しました
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalancesResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    WalletAddress:
      name: wallet
      in: path
      required: true
      description: Solanaウォレットアドレス（base58エンコードされた）
      schema:
        type: string
        pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
        default: GQUtvPx89ZNCwmvQqFmH59bJcU8fW8siETpaxod7Aydz
      example: GQUtvPx89ZNCwmvQqFmH59bJcU8fW8siETpaxod7Aydz
  schemas:
    BalancesResponse:
      type: object
      properties:
        balances:
          type: array
          items:
            $ref: '#/components/schemas/TokenBalance'
          description: >
            現在のページのトークン残高の配列、ネイティブSOLを含みます。

            showNative=trueの場合、SOLはミントアドレスSo11111111111111111111111111111111111111112で最初に表示されます。

            他のトークンはUSD価値の降順でソートされます。
        nfts:
          type: array
          items:
            $ref: '#/components/schemas/Nft'
          description: NFT保有物の配列（showNfts=trueの場合のみ含まれます、最大100、最初のページのみ）
        totalUsdValue:
          type: number
          description: このページの残高の合計USD価値（総ポートフォリオ価値ではありません）
          example: 217.98
        pagination:
          type: object
          description: ページングメタデータ。ユーザーはページパラメータを使用して手動で追加ページをリクエストする必要があります。
          properties:
            page:
              type: integer
              description: 現在のページ番号
              example: 1
            limit:
              type: integer
              description: ページごとのアイテム数
              example: 100
            hasMore:
              type: boolean
              description: さらに結果が利用可能な場合は、ページパラメータを増やして次のページを取得します。
              example: true
          required:
            - page
            - limit
            - hasMore
      required:
        - balances
        - totalUsdValue
        - pagination
    TokenBalance:
      type: object
      properties:
        mint:
          type: string
          description: トークンミントアドレス
          example: So11111111111111111111111111111111111111112
        symbol:
          type: string
          nullable: true
          description: トークンシンボル
          example: SOL
        name:
          type: string
          nullable: true
          description: トークン名
          example: Solana
        balance:
          type: number
          description: トークン残高（小数点で調整済み）
          example: 1.5
        decimals:
          type: integer
          description: 小数点以下の桁数
          example: 9
        pricePerToken:
          type: number
          nullable: true
          description: USDでのトークンごとの価格
          example: 145.32
        usdValue:
          type: number
          nullable: true
          description: 保有分の合計USD価値
          example: 217.98
        logoUri:
          type: string
          nullable: true
          description: トークンロゴ画像のURL
          example: https://example.com/sol-logo.png
        tokenProgram:
          type: string
          enum:
            - spl-token
            - token-2022
          description: トークンプログラムタイプ（レガシーのspl-token、新標準のtoken-2022）
          example: spl-token
      required:
        - mint
        - balance
        - decimals
        - tokenProgram
    Nft:
      type: object
      properties:
        mint:
          type: string
          description: NFT mint address
          example: 7Xq8wXyXVqfBPPqVJjPDwG9zN5wCVxBYZ6z7vPYBzr6F
        name:
          type: string
          nullable: true
          description: NFT name
          example: Degen Ape
        imageUri:
          type: string
          nullable: true
          description: NFT画像のURI
          example: https://example.com/nft.png
        collectionName:
          type: string
          nullable: true
          description: コレクション名
          example: Degen Ape Academy
        collectionAddress:
          type: string
          nullable: true
          description: コレクションのアドレス
          example: DegN1dXmU2uYa4n7U9qTh7YNYpK4u8L9qXx7XqYqJfGH
        compressed:
          type: boolean
          description: これが圧縮NFTかどうか
          example: false
      required:
        - mint
        - compressed
    Error:
      type: object
      properties:
        error:
          type: string
          description: エラーメッセージ
          example: Invalid wallet address
        code:
          type: integer
          description: HTTPステータスコード
          example: 400
        details:
          type: string
          description: 追加のエラー詳細
          example: '''invalid-address'' is not a valid Solana address'
      required:
        - error
        - code
  responses:
    BadRequest:
      description: 無効なリクエストパラメータ
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Invalid wallet address
            code: 400
            details: '''invalid-address'' is not a valid Solana address'
    Unauthorized:
      description: APIキーが不足しているか無効です
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: API key required. Pass via ?api-key=xxx or X-Api-Key header
            code: 401
    RateLimited:
      description: レート制限が超過しました。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: RATE_LIMIT_EXCEEDED
            code: 429
            details: Too many requests. Retry after 2 seconds.
    InternalError:
      description: 一時的なサーバーエラー。指数バックオフで再試行可能です。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: INTERNAL_ERROR
            code: 500
            details: An unexpected error occurred. Please retry.
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: クエリパラメータとして渡されるAPIキー
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-Api-Key
      description: リクエストヘッダーで渡されるAPIキー

````