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

# getAccountInfo

> Trả về tất cả thông tin liên quan đến tài khoản của Pubkey được cung cấp.

<Info>
  **Tính năng mới**: `getAccountInfo` hiện hỗ trợ tham số `changedSinceSlot` để cập nhật tăng dần. Khi được chỉ định, phương thức chỉ trả về các tài khoản đã được sửa đổi tại hoặc sau số slot đã cho. Đối với các tài khoản tồn tại nhưng không thay đổi kể từ slot được chỉ định, phản hồi sẽ chứa `status: "unchanged"`.
</Info>

## Tham số yêu cầu

<ParamField body="pubkey" type="string" required>
  Pubkey của tài khoản cần truy vấn, ở dạng chuỗi được mã hóa base-58.
</ParamField>

<ParamField body="commitment" type="string">
  Mức commitment cho truy vấn.

  * `finalized`
  * `confirmed`
  * `processed`
</ParamField>

<ParamField body="encoding" type="string">
  Định dạng mã hóa cho dữ liệu tài khoản.

  * `base58`
  * `base64`
  * `base64+zstd`
  * `jsonParsed`
</ParamField>

<ParamField body="dataSlice" type="object">
  Yêu cầu một phần dữ liệu của tài khoản.
</ParamField>

<ParamField body="dataSlice.offset" type="number">
  Độ lệch byte bắt đầu đọc.
</ParamField>

<ParamField body="dataSlice.length" type="number">
  Số byte cần trả về.
</ParamField>

<ParamField body="minContextSlot" type="number">
  Slot tối thiểu mà tại đó yêu cầu có thể được đánh giá.
</ParamField>

<ParamField body="changedSinceSlot" type="number">
  Chỉ trả về tài khoản nếu tài khoản đã được sửa đổi tại hoặc sau số slot này. Nếu tài khoản tồn tại nhưng không thay đổi kể từ slot được chỉ định, phản hồi sẽ chứa trạng thái "unchanged".
</ParamField>


## OpenAPI

````yaml vi/openapi/rpc-http/getAccountInfo.yaml POST /
openapi: 3.1.0
info:
  title: Solana RPC API
  version: 1.0.0
  description: >-
    API truy xuất dữ liệu tài khoản Solana toàn diện để truy cập thông tin về
    chương trình sở hữu, số dư và dữ liệu trên chuỗi, với nhiều tùy chọn mã hóa
    và cấp độ commitment có thể cấu hình.
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://mainnet.helius-rpc.com
    description: Điểm cuối RPC Mainnet
  - url: https://devnet.helius-rpc.com
    description: Điểm cuối RPC Devnet
security: []
paths:
  /:
    post:
      tags:
        - RPC
      summary: getAccountInfo
      operationId: getAccountInfo
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  description: Phiên bản giao thức JSON-RPC.
                  enum:
                    - '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: Mã định danh duy nhất cho yêu cầu.
                  example: '1'
                  default: '1'
                method:
                  type: string
                  description: Tên của phương thức RPC cần gọi.
                  enum:
                    - getAccountInfo
                  default: getAccountInfo
                params:
                  type: array
                  default:
                    - 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri
                  items:
                    oneOf:
                      - title: Pubkey
                        type: string
                        description: >-
                          Pubkey của tài khoản cần truy vấn, dưới dạng chuỗi
                          được mã hóa base-58.
                        example: 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri
                      - title: Đối tượng cấu hình
                        type: object
                        description: Đối tượng cấu hình.
                        properties:
                          commitment:
                            type: string
                            description: Cấp độ commitment cho truy vấn.
                            enum:
                              - finalized
                              - confirmed
                              - processed
                            example: confirmed
                          encoding:
                            type: string
                            description: Định dạng mã hóa cho dữ liệu tài khoản.
                            enum:
                              - base58
                              - base64
                              - base64+zstd
                              - jsonParsed
                            example: base58
                          dataSlice:
                            type: object
                            description: Yêu cầu một phần dữ liệu của tài khoản.
                            properties:
                              offset:
                                type: integer
                                description: Độ lệch byte để bắt đầu đọc.
                                example: 0
                              length:
                                type: integer
                                description: Số byte cần trả về.
                                example: 64
                          minContextSlot:
                            type: integer
                            description: >-
                              Slot tối thiểu mà tại đó yêu cầu có thể được đánh
                              giá.
                            example: 100000000
                          changedSinceSlot:
                            type: integer
                            description: >-
                              Chỉ trả về tài khoản nếu tài khoản đã được sửa đổi
                              tại hoặc sau số slot này. Nếu tài khoản tồn tại
                              nhưng không thay đổi kể từ slot được chỉ định,
                              phản hồi sẽ chứa trạng thái "unchanged".
                            example: 464175999
      responses:
        '200':
          description: Đã truy xuất thành công thông tin tài khoản.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    description: Phiên bản giao thức JSON-RPC.
                    example: '2.0'
                  result:
                    type: object
                    properties:
                      context:
                        type: object
                        description: Ngữ cảnh của yêu cầu.
                        properties:
                          apiVersion:
                            type: string
                            description: Phiên bản API của yêu cầu.
                            example: 2.0.15
                          slot:
                            type: integer
                            description: Số slot của phản hồi.
                            example: 341197053
                      value:
                        oneOf:
                          - type: object
                            description: Dữ liệu tài khoản nếu tài khoản tồn tại.
                            properties:
                              lamports:
                                type: integer
                                description: Số lamport được gán cho tài khoản này.
                                example: 88849814690250
                              owner:
                                type: string
                                description: >-
                                  Pubkey được mã hóa base-58 của chương trình mà
                                  tài khoản này được gán cho.
                                example: '11111111111111111111111111111111'
                              data:
                                type: array
                                items:
                                  type: string
                                description: >-
                                  Dữ liệu liên kết với tài khoản, ở dạng dữ liệu
                                  nhị phân đã mã hóa hoặc định dạng JSON.
                                example:
                                  - ''
                                  - base58
                              executable:
                                type: boolean
                                description: >-
                                  Cho biết tài khoản có chứa chương trình hay
                                  không.
                                example: false
                              rentEpoch:
                                type: integer
                                description: >-
                                  Epoch mà tại đó tài khoản này sẽ đến hạn trả
                                  phí thuê tiếp theo.
                                example: 18446744073709552000
                              space:
                                type: integer
                                description: Kích thước dữ liệu của tài khoản.
                                example: 0
                          - type: object
                            description: >-
                              Phản hồi chỉ chứa trạng thái khi tài khoản tồn tại
                              nhưng không thay đổi kể từ slot được chỉ định.
                            properties:
                              status:
                                type: string
                                description: >-
                                  Trạng thái cho biết tài khoản không thay đổi
                                  kể từ slot được chỉ định.
                                enum:
                                  - unchanged
                                example: unchanged
                  id:
                    type: integer
                    description: Mã định danh duy nhất khớp với ID của yêu cầu.
                    example: 1
                  method:
                    type: string
                    description: Phương thức đang được gọi.
                    example: getAccountInfo
                  params:
                    type: array
                    description: Các tham số của yêu cầu.
                    items:
                      oneOf:
                        - type: string
                        - type: object
                          properties:
                            encoding:
                              type: string
              examples:
                response:
                  value:
                    jsonrpc: '2.0'
                    result:
                      context:
                        apiVersion: 2.0.15
                        slot: 341197053
                      value:
                        lamports: 88849814690250
                        owner: '11111111111111111111111111111111'
                        data:
                          - ''
                          - base58
                        executable: false
                        rentEpoch: 18446744073709552000
                        space: 0
                    id: 1
        '400':
          description: >-
            Yêu cầu không hợp lệ - Tham số yêu cầu không hợp lệ hoặc yêu cầu sai
            định dạng.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: Tham số không hợp lệ
                id: '1'
        '401':
          description: Không được phép - Khóa API không hợp lệ hoặc bị thiếu.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: Không được phép
                id: '1'
        '429':
          description: Quá nhiều yêu cầu - Đã vượt quá giới hạn tốc độ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: Quá nhiều yêu cầu
                id: '1'
        '500':
          description: Lỗi máy chủ nội bộ - Đã xảy ra lỗi trên máy chủ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: Lỗi nội bộ
                id: '1'
        '503':
          description: Dịch vụ không khả dụng - Dịch vụ tạm thời không khả dụng.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: Dịch vụ không khả dụng
                id: '1'
        '504':
          description: Hết thời gian chờ cổng kết nối - Yêu cầu đã hết thời gian chờ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: Hết thời gian chờ cổng kết nối
                id: '1'
      security:
        - ApiKeyQuery: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          description: Phiên bản giao thức JSON-RPC.
          enum:
            - '2.0'
          default: '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              description: Mã lỗi.
            message:
              type: string
              description: Thông báo lỗi.
        id:
          type: string
          description: Mã định danh duy nhất cho yêu cầu.
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: >-
        Khóa API Helius của bạn. Bạn có thể nhận khóa miễn phí trong [bảng điều
        khiển](https://dashboard.helius.dev/api-keys).

````