Rate Limit: 6 requests per second.
For querying historical information, use the height parameter. The default value is 0 (latest block). Note that nodes may delete historical data; it's recommended to query the latest information within 10 blocks.
Account Management
Retrieve Account Balance
Fetch the balance of all currencies for a specified address. By default, only partial currencies are displayed. Use show=all to view all currencies or symbol=btc to filter for a specific currency.
HTTP Request
GET okexchain/v1/accounts/{address}Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| address | String | Yes | Wallet address |
| show | String | No | all (show all) or partial (default) |
| symbol | String | No | Filter by currency (e.g., btc) |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| address | String | Account wallet address |
| currencies | Array | List of currencies |
| > symbol | String | Currency symbol (e.g., BTC) |
| > available | String | Available balance |
| > locked | String | Locked balance |
Retrieve Account Number and Sequence
Fetch the account_number and sequence for a user.
HTTP Request
GET okexchain/v1/auth/accounts/{address}Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| address | String | Yes | Account wallet address |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| address | String | Wallet address |
| eth_address | String | Ethereum-compatible address |
| public_key | String | Account public key |
| account_number | String | Account creation sequence number |
| sequence | String | Account nonce |
| code_hash | String | Contract code hash |
| coins | Array | List of coins |
| > denom | String | Coin denomination |
| > amount | String | Coin amount |
Block Information
Retrieve Latest Blocks
Fetch the latest block information.
HTTP Request
GET okexchain/v1/blocks/latestResponse Parameters
| Parameter | Type | Description |
|---|---|---|
| block_id | Object | Block identifier |
| > hash | String | Block hash |
| block | Object | Block details |
| > height | String | Block height |
| > time | String | Block creation timestamp |
Retrieve Block by Height
Fetch block details by height.
HTTP Request
GET okexchain/v1/blocks/{height}Response Parameters
(See "Retrieve Latest Blocks" for response structure.)
Retrieve Transaction by Hash
Fetch transaction details using its hash.
HTTP Request
GET okexchain/v1/txs/{hash}Response Parameters
| Parameter | Type | Description |
|---|---|---|
| hash | String | Transaction hash |
| blockNumber | String | Block number containing the transaction |
| from | String | Sender address |
| to | String | Receiver address |
| value | String | Transaction amount |
FAQ
How often can I query the API?
The API rate limit is 6 requests per second.
Can I retrieve historical block data?
Yes, but nodes may prune old data. Query the latest 10 blocks for reliability.
๐ Explore OKTC API Documentation
What if my query exceeds the rate limit?
Your requests will be throttled. Implement retry logic with exponential backoff.
Validator Information
Retrieve Latest Validator Set
Fetch the current validator set.
HTTP Request
GET okexchain/v1/validatorsets/latestResponse Parameters
| Parameter | Type | Description |
|---|---|---|
| validators | Array | List of validators |
| > address | String | Validator wallet address |
| > voting_power | String | Validator voting power |
Retrieve Validator Set by Height
Fetch validator set for a specific block height.
HTTP Request
GET okexchain/v1/validatorsets/{height}Response Parameters
(Same as "Retrieve Latest Validator Set.")
Node Information
Check Node Sync Status
Verify if a node is syncing with the network.
HTTP Request
GET okexchain/v1/syncingResponse Parameters
| Parameter | Type | Description |
|---|---|---|
| syncing | Bool | true if syncing, false otherwise |
๐ Learn More About OKTC Staking