The OKTC (OKX Chain) REST API provides developers with a powerful and efficient interface to interact with the blockchain. Whether you're retrieving account balances, querying block data, or analyzing staking and governance activities, this API supports a wide range of endpoints designed for scalability and real-time access. With a rate limit of 6 requests per second, the API ensures stable performance while maintaining network integrity.
All endpoints are accessible via the base URL structure: https://www.okx.com/join/8265080api/v5/oktc/, followed by specific route paths. Historical data queries support an optional height parameter—defaulting to the latest block (0)—though nodes may purge older records, so it's recommended to query within the most recent 10 blocks for reliability.
Account Information
Retrieve Account Balance
Fetch the token balance for any given address across all supported currencies. By default, only partial currency data is returned. Use show=all to display all balances or specify a single currency like symbol=btc.
HTTP Request
GET /okexchain/v1/accounts/{address}Request Parameters
- address (string, required): The wallet address to query.
- show (string, optional): Set to
allto show all currencies; default shows partial. - symbol (string, optional): Filter by specific currency symbol (e.g.,
btc).
Response Parameters
- address: Wallet address queried.
currencies: List of currency holdings.
- symbol: Currency ticker (e.g., OKT, BTC).
- available: Spendable balance.
- locked: Balance currently locked in transactions or staking.
👉 Explore real-time blockchain data with advanced tools
Get Account Number and Sequence
Retrieve critical account metadata including account_number and sequence, essential for constructing valid transactions on the OKTC network.
HTTP Request
GET /okexchain/v1/auth/accounts/{address}Request Parameters
- address (string, required): The blockchain address.
Response Parameters
- address: OKExChain address.
- eth_address: Corresponding Ethereum-compatible address.
- public_key: Public key of the account.
- account_number: Account creation sequence number.
- sequence: Nonce used for transaction ordering.
coins: Array of coin balances.
- denom: Token denomination.
- amount: Quantity held.
Block Data Queries
Fetch Latest Block
Obtain comprehensive information about the most recently confirmed block.
HTTP Request
GET /okexchain/v1/blocks/latestNo parameters required.
Key Response Fields
Includes block hash, height, header metadata, validator set references, consensus details, timestamps, and transaction data.
Query Block by Height
Retrieve full block information using a specific block height.
HTTP Request
GET /okexchain/v1/blocks/{height}Useful for auditing, forensic analysis, or syncing off-chain systems with on-chain events.
Get Transaction Details by Hash
Fetch detailed transaction data using its unique hash.
HTTP Request
GET /okexchain/v1/txs/{hash}Response Includes:
- from, to: Sender and receiver addresses.
- value: Transferred amount.
- gas, gasPrice: Execution cost metrics.
- blockNumber, blockHash: Associated block identifiers.
- input, nonce, signature components (r, s, v).
Validator Set Information
Latest Validator Set
GET /okexchain/v1/validatorsets/latestReturns active validators with voting power, public keys, and proposer priority.
Validator Set at Specific Height
GET /okexchain/v1/validatorsets/{height}Enables historical validation state analysis.
Node Information & Sync Status
Get Node Info
GET /okexchain/v1/node_infoProvides software versions, network ID, P2P configuration, and node identity (moniker).
Check Syncing Status
GET /okexchain/v1/syncingReturns a boolean syncing value—true if catching up, false if fully synchronized.
Staking Operations
Staking Parameters
GET /okexchain/v1/staking/parametersReveals key staking rules:
unbonding_time: Duration before unstaked tokens are released.max_bonded_validators: Maximum number of active validators.min_delegation: Minimum OKT required to delegate.
Delegator & Validator Queries
- Get Delegator Info: View delegation status and shares.
- Unbonding Tokens: Check pending unstake amounts and completion times.
- All Validators: List all validators with status, commission rates, and uptime.
- Validator Details: Inspect individual validator metadata and self-delegation requirements.
- Voting Shares: See total voting power attributed to a validator.
- Staking Pool: Monitor total bonded vs. non-bonded token supply.
👉 Start exploring staking analytics and validator performance
Distribution Module
Reward & Commission Management
- Distribution Parameters: View tax rates (
community_tax) and reward settings. - Delegator Rewards: Query cumulative or per-validator rewards.
- Validator Commission: Retrieve earned fees.
- Outstanding Rewards: Check unclaimed distributions.
- Withdraw Address: Identify where rewards are sent.
- Community Pool: Monitor shared ecosystem funding reserves.
Wasm Smart Contracts
Interact with WASM-based decentralized applications deployed on OKTC.
Core Endpoints:
- Query All Codes: List all uploaded contract bytecodes.
- Get Contract Code: Retrieve code by
codeID. - Contract Info: Get metadata (creator, label, code ID) via contract address.
- Contracts by Code ID: Find all instances derived from a specific codebase.
- Contract History: Audit deployment and migration events.
- Raw State Query: Access contract storage via hex-encoded keys.
- Smart Queries: Execute custom read functions using base64-encoded JSON messages.
- Full State Data: Retrieve all key-value pairs stored by a contract.
These tools empower developers to debug, verify, and integrate dApps securely.
Governance Module
Engage with on-chain governance proposals and voting mechanisms.
Key Features:
- Proposal Parameters: View deposit thresholds, voting periods, quorum, and veto rules.
- List Proposals: Retrieve all active and historical governance proposals.
- Proposal Details: Access content, status, deposit amounts, tally results, and timelines.
- Proposer Info: Identify who submitted a proposal.
- Vote Tally & Individual Votes: Analyze voting power distribution and voter choices.
This transparency supports decentralized decision-making and community participation.
Frequently Asked Questions (FAQ)
Q: What is the rate limit for OKTC REST API?
A: The API allows up to 6 requests per second per IP address to ensure fair usage and system stability.
Q: Can I query historical blockchain data?
A: Yes, use the height parameter in block and transaction queries. However, nodes may not retain data beyond recent blocks—query within the last 10 blocks for best results.
Q: How do I check if my node is synced?
A: Call GET /okexchain/v1/syncing. A response of {"syncing": false} means your node is up-to-date.
Q: What does 'sequence' mean in account data?
A: Sequence is a counter that increments with each transaction from an account. It prevents replay attacks and ensures transaction order.
Q: How can I find my validator’s commission rate?
A: Use GET /okexchain/v1/staking/validators/{validatorAddr} and check the commission.commission_rates.rate field.
Q: Is there a way to explore smart contract state without running a node?
A: Yes—use the Wasm module’s /state or /raw/{key} endpoints to inspect live contract data directly via API.
Core Keywords:
OKTC REST API, blockchain data query, staking info, validator set, governance proposals, WASM smart contracts, account balance, transaction lookup
With robust endpoints covering accounts, blocks, staking, distribution, contracts, and governance, the OKTC REST API delivers everything developers need to build transparent, high-performance blockchain applications.