Querying Wallet Accounts: A Comprehensive Guide

·

Overview

This documentation provides detailed instructions for retrieving wallet account information through the Web3 API. It covers request parameters, response formats, and practical examples for seamless integration.

API Endpoint

Request Path

GET https://web3.okx.com/api/v5/wallet/account/accounts

Parameters

Request Parameters

ParameterTypeRequiredDescription
limitStringNoNumber of records per query (default: 50, max: 100)
cursorStringNoPagination cursor (default: first position)

Response Parameters

ParameterTypeDescription
cursorStringPagination cursor for subsequent requests
accountsArrayList of wallet accounts
> accountIdStringUnique account identifier
> accountTypeStringAccount type (0: Wallet, 1: Watch-only)

Practical Implementation

Example Request

curl --location --request GET 'https://web3.okx.com/api/v5/wallet/account/accounts' \
--header 'Content-Type: application/json' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'

Example Response

{
  "code": "0",
  "data": [
    {
      "cursor": "50",
      "accounts": [
        {
          "accountId": "0xdf54b6c6195ea4d948d03bfd818d365cf175cfc2",
          "accountType": "0"
        },
        {
          "accountId": "0x04ad62387d1f1c7034087bbe4d16163d06fae42d",
          "accountType": "1"
        }
      ]
    }
  ],
  "msg": "success"
}

Best Practices

👉 Optimize your API integration with these professional tips:

FAQ Section

What's the maximum accounts returned per request?

The API returns up to 100 accounts per request when using the limit parameter.

How does pagination work with the cursor?

The cursor parameter tracks your position in the dataset, allowing sequential retrieval of all accounts across multiple requests.

Can I filter accounts by type?

While the current version doesn't support type filtering, you can process the response data client-side to filter by accountType.

What authentication methods are supported?

The API requires project credentials, access keys, and timestamped signatures for secure authentication.

👉 Explore advanced wallet features in our comprehensive developer documentation.

How often should I sync account data?

We recommend synchronizing account data:

  1. During initial application setup
  2. After significant balance changes
  3. On regular intervals (e.g., daily for active accounts)

What's the rate limit for account queries?

Standard API rate limits apply. Contact support for enterprise-tier rate limit adjustments.