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
| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | String | No | Number of records per query (default: 50, max: 100) |
| cursor | String | No | Pagination cursor (default: first position) |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| cursor | String | Pagination cursor for subsequent requests |
| accounts | Array | List of wallet accounts |
| > accountId | String | Unique account identifier |
| > accountType | String | Account 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:
- Implement proper error handling for API responses
- Cache frequent queries to reduce server load
- Use pagination for large account datasets
- Monitor rate limits to maintain service reliability
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:
- During initial application setup
- After significant balance changes
- 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.