> ## 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.

# getCompressedAccount

> Returns the compressed account with the given address or hash.

## Request Parameters

<ParamField body="address" type="string" default="11111112D1oxKts8YPdTJRG5FzxTNpMtWmq8hkVx3">
  The Solana public key of the compressed account to retrieve data for
</ParamField>

<ParamField body="hash" type="string">
  The data hash identifier of the compressed Solana account if the address is not available
</ParamField>


## OpenAPI

````yaml openapi/zk-compression/getCompressedAccount.yaml POST /
openapi: 3.0.3
info:
  title: Solana State Compression API
  description: >
    Advanced Solana indexer for compressed state accounts using zero-knowledge
    proofs for efficient data storage and retrieval.

    This API enables cost-efficient NFT and token operations through Solana's
    state compression technology,

    reducing storage costs by up to 1000x compared to traditional accounts.
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 0.50.0
servers:
  - url: https://mainnet.helius-rpc.com
    description: Mainnet RPC endpoint
  - url: https://devnet.helius-rpc.com
    description: Devnet RPC endpoint
security: []
paths:
  /:
    summary: getCompressedAccount
    post:
      description: >
        Retrieve detailed data for a compressed Solana account using state
        compression technology.

        This endpoint provides access to efficient on-chain data storage with up
        to 1000x cost savings 

        compared to regular Solana accounts. Query compressed NFTs and token
        accounts by address or hash 

        to get complete account information, ownership details, and on-chain
        data.


        Key benefits:

        - Dramatically lower costs for Solana NFT projects and token issuers

        - Reduced storage fees for high-volume applications

        - Full compatibility with Solana's security and consensus model

        - Scalable solution for large NFT collections and token sets

        - Increased throughput for compressed asset operations
      operationId: getCompressedAccount
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  description: The version of the JSON-RPC protocol.
                  enum:
                    - '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: An ID to identify the request.
                  default: '1'
                method:
                  type: string
                  description: The name of the method to invoke.
                  enum:
                    - getCompressedAccount
                  default: getCompressedAccount
                params:
                  type: object
                  description: >
                    Request parameters for retrieving compressed account data on
                    Solana, including 

                    address identifier or data hash for compressed NFTs and
                    tokens
                  default:
                    address: null
                    hash: '11111111111111111111111111111111'
                  properties:
                    address:
                      type: string
                      allOf:
                        - $ref: '#/components/schemas/SerializablePubkey'
                      nullable: true
                      description: >-
                        The Solana public key of the compressed account to
                        retrieve data for
                    hash:
                      type: string
                      allOf:
                        - $ref: '#/components/schemas/Hash'
                      nullable: true
                      description: >-
                        The data hash identifier of the compressed Solana
                        account if the address is not available
                  additionalProperties: false
                  example:
                    address: null
                    hash: '11111111111111111111111111111111'
        required: true
      responses:
        '200':
          description: >-
            Successfully retrieved compressed account data from the Solana
            blockchain
          content:
            application/json:
              schema:
                type: object
                required:
                  - context
                properties:
                  context:
                    $ref: '#/components/schemas/Context'
                  value:
                    $ref: '#/components/schemas/Account'
                additionalProperties: false
        '400':
          description: Bad Request - Invalid request parameters or malformed request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: Invalid params
                id: '1'
        '401':
          description: Unauthorized - Invalid or missing API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: Unauthorized
                id: '1'
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: Too many requests
                id: '1'
        '500':
          description: Internal Server Error - An error occurred on the server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: Internal error
                id: '1'
        '503':
          description: Service Unavailable - The service is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: Service unavailable
                id: '1'
        '504':
          description: Gateway Timeout - The request timed out.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: Gateway timeout
                id: '1'
      security:
        - ApiKeyQuery: []
components:
  schemas:
    SerializablePubkey:
      type: string
      description: >-
        A Solana public key represented as a base58 encoded string, used to
        identify accounts, programs, and users.
      default: 11111112D1oxKts8YPdTJRG5FzxTNpMtWmq8hkVx3
      example: 11111112D1oxKts8YPdTJRG5FzxTNpMtWmq8hkVx3
    Hash:
      type: string
      description: >-
        A 32-byte cryptographic hash represented as a base58 string, used for
        Solana compressed account verification.
      example: 11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP
    Context:
      type: object
      required:
        - slot
      properties:
        slot:
          type: integer
          default: 100
          example: 100
          description: The current Solana blockchain slot context for this request
    Account:
      type: object
      required:
        - hash
        - owner
        - lamports
        - tree
        - leafIndex
        - seq
        - slotCreated
      properties:
        address:
          $ref: '#/components/schemas/SerializablePubkey'
          description: Unique identifier address for the compressed Solana account
        data:
          $ref: '#/components/schemas/AccountData'
          description: On-chain data stored in the compressed Solana account
        hash:
          $ref: '#/components/schemas/Hash'
          description: Cryptographic hash of the compressed account data for verification
        lamports:
          $ref: '#/components/schemas/UnsignedInteger'
          description: >-
            SOL balance held by this compressed account in lamports (1 SOL =
            1,000,000,000 lamports)
        leafIndex:
          $ref: '#/components/schemas/UnsignedInteger'
          description: >-
            Position index in the merkle tree where this compressed account is
            stored
        owner:
          $ref: '#/components/schemas/SerializablePubkey'
          description: >-
            Solana program that owns this compressed account (typically the
            compression program)
        seq:
          $ref: '#/components/schemas/UnsignedInteger'
          description: Sequence number for tracking updates to this compressed account
        slotCreated:
          $ref: '#/components/schemas/UnsignedInteger'
          description: Solana blockchain slot when this compressed account was created
        tree:
          $ref: '#/components/schemas/SerializablePubkey'
          description: Address of the merkle tree where this compressed account is stored
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          description: The JSON-RPC protocol version.
          enum:
            - '2.0'
          example: '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              description: The error code.
              example: -32602
            message:
              type: string
              description: The error message.
            data:
              type: object
              description: Additional data about the error.
        id:
          type: string
          description: Identifier matching the request.
          example: '1'
    AccountData:
      type: object
      required:
        - discriminator
        - data
        - dataHash
      properties:
        data:
          $ref: '#/components/schemas/Base64String'
        dataHash:
          $ref: '#/components/schemas/Hash'
        discriminator:
          $ref: '#/components/schemas/UnsignedInteger'
      additionalProperties: false
    UnsignedInteger:
      type: integer
      default: 100
      example: 100
      description: >-
        A non-negative integer value used for various numeric parameters in
        Solana compressed accounts
    Base64String:
      type: string
      description: A base64 encoded string representing compressed account data on Solana.
      default: SGVsbG8sIFdvcmxkIQ==
      example: SGVsbG8sIFdvcmxkIQ==
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: >-
        Your Helius API key. You can get one for free in the
        [dashboard](https://dashboard.helius.dev/api-keys).

````