The OKTC (OKX Chain) REST API provides developers and blockchain enthusiasts with a powerful interface to interact with the OKTC network. Whether you're retrieving account balances, querying block data, or analyzing staking and governance activities, this comprehensive API enables seamless integration into decentralized applications (dApps), analytics platforms, and wallet services.
With a rate limit of 6 requests per second, the API ensures high availability while maintaining network stability. Historical data can be queried using the height parameter—though nodes may prune old records—so it's recommended to query within the latest 10 blocks for reliable results.
This guide walks through all major endpoints grouped by functional modules: Account, Blocks, Staking, Distribution, WASM, and Governance.
Account Information
Access key wallet and balance details via simple HTTP GET requests.
Get Balance
Retrieve all currency balances for a specific address.
Endpoint: GET okexchain/v1/accounts/{address}
Parameters:
address(string, required): The user’s wallet address.show(string, optional): Useallto display all currencies; default is partial.symbol(string, optional): Filter by currency symbol (e.g.,btc).
Response Fields:
address: Wallet address.currencies[]: List of currency holdings.symbol: Currency ticker.available: Spendable amount.locked: Temporarily unavailable balance due to staking or trades.
👉 Explore blockchain account data with powerful tools
Get Account Number and Sequence
Fetch critical transaction metadata used in signing operations.
Endpoint: GET okexchain/v1/auth/accounts/{address}
Response Includes:
account_number: Unique account creation sequence.sequence: Nonce counter for transaction ordering.eth_address: EVM-compatible address.coins[]: Native token balances (denom + amount).
This data is essential when constructing signed transactions manually.
Block Data Queries
Monitor chain activity by accessing real-time and historical block information.
Get Latest Block
Obtain the most recent block on the chain.
Endpoint: GET okexchain/v1/blocks/latest
No parameters required. Returns full block header, metadata, validator signatures, and transaction hashes.
Get Block by Height
Query a specific block using its height.
Endpoint: GET okexchain/v1/blocks/{height}
Useful for auditing or replaying historical state changes.
Get Transaction Info
Retrieve details of a transaction using its hash.
Endpoint: GET okexchain/v1/txs/{hash}
Key Response Data:
from,to: Sender and receiver addresses.value: Transfer amount.blockNumber,blockHash: Contextual block info.gas,gasPrice: Execution cost metrics.input: Smart contract interaction payload.
Node Status Endpoints
Monitor node health and synchronization status.
Get Node Info: GET okexchain/v1/node_info
Returns software versions, network ID, P2P settings, and consensus details.
Check Sync Status: GET okexchain/v1/syncing
Returns boolean syncing field—true if catching up, false if fully synced.
Staking & Validator Management
Interact with OKTC’s proof-of-stake ecosystem.
Staking Parameters
View current staking rules:
Endpoint: GET okexchain/v1/staking/parameters
Includes:
unbonding_timemax_bonded_validatorsmin_delegationepochduration
Delegator and Validator Data
- Get Delegator Info: Check delegation status and voting power.
- Unbonding Tokens: Track pending unstaked tokens and completion time.
- All Validators: List all validators with status, commission rates, and uptime.
- Validator Details: Query individual validator stats including self-delegation and jail status.
Special endpoints include:
- Proxy Relationships: Identify proxy staking arrangements.
- Staking Pool: View total bonded vs. non-bonded tokens in the network.
👉 Maximize your staking insights with advanced blockchain tools
Distribution Module
Manage rewards distribution for delegators and validators.
Distribution Parameters
Endpoint: GET okexchain/v1/distribution/parameters
Reveals:
community_tax- Reward truncation precision
- Withdrawal enablement flags
Reward Queries
- Delegator Rewards: Total rewards across all validators.
- Per Validator Rewards: Breakdown of earnings from a specific validator.
- Validator Commission: Earned commission before withdrawal.
- Outstanding Rewards: Unclaimed rewards for a validator and its delegators.
- Withdraw Address: Destination address for reward payouts.
Also includes:
- Community Pool: Total funds allocated for ecosystem development.
WASM Smart Contract Interactions
OKTC supports WebAssembly-based smart contracts. These APIs allow deep interaction with deployed dApps.
Contract Code Management
- Query All Codes: List all uploaded contract codes with pagination support.
- Get Contract Code by ID: Retrieve metadata and bytecode hash.
- Contracts by Code ID: Find all instances created from a specific code base.
Contract State & Data Access
- Contract Info: Get creator, label, and code ID.
- Contract History: View instantiation and migration events.
- Raw Key Query: Fetch raw storage values using hex-encoded keys (
encoding=hex). - Smart Queries: Execute custom query messages via base64-encoded payloads (
encoding=base64). - Full State: Retrieve all key-value pairs in contract storage (with pagination).
These tools are indispensable for debugging, front-end integration, and analytics.
Governance Participation
Engage with on-chain governance proposals and voting mechanisms.
Governance Parameters
Fetch rules for:
- Deposit Periods
- Voting Durations
- Quorum & Thresholds
Use {ParamsType} in the endpoint: deposit, voting, or tallying.
Proposal Tracking
Get Proposals:
List all active and past proposals with full metadata:
- Title, description
- Status (DepositPeriod, VotingPeriod, Passed, etc.)
- Deposit amounts and timelines
- Final tally results
Additional endpoints:
- Proposer Lookup: Identify who submitted a proposal.
- Vote Tally: Real-time voting power distribution.
- Individual Votes: See how each validator voted.
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.
Q: Can I query historical blocks older than 100 blocks?
A: While possible using the height parameter, nodes may have pruned old data. For reliability, query within the last 10 blocks.
Q: How do I decode smart contract query responses?
A: Use Base64 decoding for /smart endpoint outputs. Ensure your query message is properly encoded before sending.
Q: Is there a way to monitor validator uptime?
A: Yes—check the jailed status and compare signing activity over time using block proposer data.
Q: How often does the staking pool update?
A: The bonded and non-bonded token values update in real time as delegations and unbondings occur.
Q: Can I use these APIs for building a wallet?
A: Absolutely. Endpoints like balance lookup, transaction history, and account sequence are ideal for wallet development.
Core Keywords
OKTC REST API, blockchain developer tools, staking API, smart contract queries, governance data, transaction lookup, validator information, OKX Chain endpoints