OKTC REST API Documentation

·

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

Response Parameters

👉 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

Response Parameters


Block Data Queries

Fetch Latest Block

Obtain comprehensive information about the most recently confirmed block.

HTTP Request

GET /okexchain/v1/blocks/latest

No 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:


Validator Set Information

Latest Validator Set

GET /okexchain/v1/validatorsets/latest

Returns 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_info

Provides software versions, network ID, P2P configuration, and node identity (moniker).

Check Syncing Status

GET /okexchain/v1/syncing

Returns a boolean syncing value—true if catching up, false if fully synchronized.


Staking Operations

Staking Parameters

GET /okexchain/v1/staking/parameters

Reveals key staking rules:


Delegator & Validator Queries

👉 Start exploring staking analytics and validator performance


Distribution Module

Reward & Commission Management


Wasm Smart Contracts

Interact with WASM-based decentralized applications deployed on OKTC.

Core Endpoints:

These tools empower developers to debug, verify, and integrate dApps securely.


Governance Module

Engage with on-chain governance proposals and voting mechanisms.

Key Features:

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.