Utvecklingsportal
Tema

Usage Guide#

The Onchain Core Data API provides public-chain summaries, blocks, transactions, event logs, and address data. Always discover support for the target endpoint before calling it. Support for a chain in one module does not imply support in another module.

API references#

Quick start#

Request conventions#

  • Base URL: https://web3.okx.com
  • chainIndex is a numeric string, such as 1 for Ethereum and 0 for Bitcoin. Chain names are not accepted.
  • Time parameters use Unix timestamps in milliseconds, such as 1597026383085.
  • Every request requires OK-ACCESS-KEY, OK-ACCESS-SIGN, OK-ACCESS-TIMESTAMP, and OK-ACCESS-PASSPHRASE.
  • Generate the signature from the method, path, query, body, and timestamp of the current request. Do not reuse it across URLs or pages.
  • Successful responses use a code, msg, and data envelope. code is a string.
  1. Convert the input chain name to a chainIndex.
  2. Call the target module's supported-chains endpoint.
  3. Match both apiName and chainIndex in the response.
  4. Call the target endpoint only after a match; otherwise return that the endpoint does not currently support the chain.
  5. Split batch parameters and block ranges according to endpoint limits.
  6. Return each cursor unchanged until the response cursor is an empty string.

Composed scenarios#

GoalCalls in orderKey handling
Multi-chain overview1. info/supported-chains
2. Call info/summary, info/block, info/transaction, and info/address in parallel
3. Use info/stats for trends
Validate each apiName + chainIndex; preserve successful cards when one call fails; keep statistics ranges within one year
Time to block and transactions1. block/supported-chains
2. block/block-height-by-time
3. Pass the returned height to block/block-fills and block/transaction-list
closest=before selects the nearest earlier block; after selects the nearest later block
Complete transaction view1. Discover transaction and log support separately
2. transaction/transaction-multi
3. Call internal-transaction-multi, token-transfer-multi, and log/by-transaction in parallel
Send at most 20 hashes per batch; if logs are unsupported, return the base transaction and mark logs as unsupported
Address profile1. address/address-active-chain
2. Validate support per module
3. Call address/information-evm, both address-transaction endpoints, and block/address-balance-history
Send at most 50 addresses per batch and 10,000 blocks per range; do not call information-evm for non-EVM addresses
Contract event monitor1. log/supported-chains
2. log/by-address-and-topic
3. Paginate by cursor
Continue while the cursor is non-empty; deduplicate by chainIndex + txId + logIndex
Multi-address fund flows1. Split addresses into groups of 50
2. Split blocks into windows of 10,000
3. Call both address-transaction endpoints for every slice
4. Merge and deduplicate
Paginate each slice serially; run independent slices concurrently within rate limits; use isFromOrTo for direction

Supported-chain mapping#

Discover support by module#

ModuleDiscovery endpointEndpoints validated
Public chain info/api/v6/explorer/info/supported-chains/info/*
Block/api/v6/explorer/block/supported-chains/block/*
Transaction/api/v6/explorer/transaction/supported-chains/transaction/*
Event log/api/v6/explorer/log/supported-chains/log/*
Address/api/v6/explorer/address/supported-chains/address/*

Store the response as a supported[(module, apiName, chainIndex)] = true set. For example, before calling /api/v6/explorer/transaction/transaction-multi, check supported[("transaction", "transaction-multi", "1")].

apiName-to-endpoint mapping#

ModuleapiNameEndpoint path
infodetail/api/v6/explorer/info/detail
infosummary/api/v6/explorer/info/summary
infotransaction/api/v6/explorer/info/transaction
infoblock/api/v6/explorer/info/block
infoaddress/api/v6/explorer/info/address
infostats/api/v6/explorer/info/stats
infohashes/api/v6/explorer/info/hashes
blockblock-list/api/v6/explorer/block/block-list
blockblock-fills/api/v6/explorer/block/block-fills
blocktransaction-list/api/v6/explorer/block/transaction-list
blockblock-height-by-time/api/v6/explorer/block/block-height-by-time
blockblock-stats/api/v6/explorer/block/block-stats
blockaddress-balance-history/api/v6/explorer/block/address-balance-history
transactiontransaction-multi/api/v6/explorer/transaction/transaction-multi
transactioninternal-transaction-multi/api/v6/explorer/transaction/internal-transaction-multi
transactiontoken-transfer-multi/api/v6/explorer/transaction/token-transfer-multi
transactionnormal-transaction-list-multi/api/v6/explorer/transaction/normal-transaction-list-multi
transactiontoken-transaction-list-multi/api/v6/explorer/transaction/token-transaction-list-multi
logby-block-and-address/api/v6/explorer/log/by-block-and-address
logby-address-and-topic/api/v6/explorer/log/by-address-and-topic
logby-address/api/v6/explorer/log/by-address
logby-transaction/api/v6/explorer/log/by-transaction
addressaddress-active-chain/api/v6/explorer/address/address-active-chain
addressinformation-evm/api/v6/explorer/address/information-evm

Use address/information-evm, event-log endpoints, and endpoints marked EVM-only only after the relevant support response confirms the chain. On 50038, refresh support for the current module instead of permanently marking the chain as globally unsupported. See the appendix for the complete name mapping.

Pagination, batches, and ranges#

Cursor pagination#

  1. Omit cursor on the first request.
  2. Pass the returned cursor unchanged on the next request; do not convert it to a page number.
  3. Stop when cursor is an empty string.
  4. For log endpoints, continue when logList is empty but cursor is non-empty.
  5. Paginate serially within one cursor chain. Independent queries can run concurrently within the rate-limit budget.

Request limits#

Parameter or scenarioLimit
transaction-multi.txIdComma-separated, at most 20; duplicates are removed
internal-transaction-multi.txIdComma-separated, at most 20
token-transfer-multi.txIdComma-separated, at most 20
Address transaction query addressComma-separated, at most 50
tokenContractAddress filterAt most 50 contracts
startBlockHeight to endBlockHeightAt most 10,000 blocks
Standard cursor limitDefault 20, maximum 100
Log scanning limitDefault 100, maximum 1,000
info/stats time rangeAt most one year

Split oversized input on the client. Deduplicate merged results by transaction hash, log index, or another documented business key.

Appendix: complete chainName-to-chainIndex mapping#

Use this table to convert a chain name or alias to a candidate chainIndex. It includes mainnets, testnets, and historical names. It is not an endpoint-support list; before making a business request, match both apiName and chainIndex through the corresponding module's supported-chains endpoint.

Some names identify different networks or historical registry entries, including CORE=70000025 and CORE_EVM=1116, CRO=25 and CRO_COSMOS=394, and CFX=1030 and Conflux=503. Resolve ambiguous names from the network context instead of guessing from the display name alone.

chainNamechainIndexchainNamechainIndex
ACT666ADA1815
ALGO283ARB_ETH42161
ARDR16754ARK111
ASP70000008ASTR_DOT70000090
ATOM118AURORA_ETH1313161554
AVAX43114AXL718
BCH145BITCI70000006
BNB56BOBA_ETH288
BRISE32520BSV236
BTC0BTS308
CELO42220CFX1030
CHZ2182CRO25
CUBE1818DASH5
DOT354ECH70000005
ECOC70000009EGLD70000003
ELA20EOS194
ETC61ETH1
ETL70000010EVER396
EVMOS710FLOW539
FSN32659FTM250
FUSE122GLMR1284
GO60GT86
GXC2303HIVE70000004
HOO70HT128
HTML172ICX74
INT70000007IOST291
IOTX4689JUNO709
KAI70000002KAR686
KAVA459KCS321
Kaia(KLAY)8217KSM434
LTC2LUNC70000001
MAN318MATIC137
METIS1088MOVR1285
MTR82NAS2718
NBT12NEAR397
NULS8964NXT29
OKT66ONE1666600000
ONT1024OP_ETH10
OSMO706QTUM2301
RON2020ROSE474
SCRT529SDN336
SGB19SOL501
STARKNET9004STARS563
STX5757THETA361
TLOS40TOMO88
TRC83TRX195
UBQ8VET818
VITE666666VLX106
WAN5718350WAVES5741564
WAX708XCP9
XDAI100XDC50
XEM43XHB3030
XLM70000088XOR617
XRP144XTZ1729
ZEC133ZIL313
APT637KUJI70000011
AKT70000012ABT260
ACA787AERGO441
ALPHA622AR472
BAND494BCD999
BHP547BNT483
BTG156BTM153
CFG747CMT1122
CSPR506CTC583
DCR42DMD152
DOGE3EFI1155
ELF1616HC(HSR)171
HYC1397ICP70000048
IOTA4218KDA626
LAMB364LAT210425
LET518LSK(KLY)134
LUNA330MINA12586
RVN175SC1991
SRM573TON607
TRUE2049VSYS360
XCH8444XEC899
XMR70000013XNO165
YEE4096YOU534
ZEN121NRG39797
FCTID281KMD141
JEWEL53935mADA2001
XIN2365CANTO70000014
HYDRA609ARB_NOVA42170
SYS57CET52
FRA2152STRAT105
SX416ETP2302
RUNE931TT108
POLIS333999smartBCH10000
ETHW10001ENQ70000016
YOC70000017CELR70000018
SKL70000019ETHF513100
IRIS566IMX1761886
ERA_ETH324SUI784
DEV_SUI783FITFI1234
pCKB71402SERO569
CTXC70000021FLR14
PHA_KHA70000022CLV70000023
EM70000024CORE70000025
CORE_EVM1116YOYOW70000026
WTC70000027AAC512
ZKS13LITE_ETH805
FIL314UMEE70000028
CRO_COSMOS394POM18159
X1_TEST19500OKT_TEST65
GON_ETH1101SEI70000029
KAVA_EVM2222Conflux503
GOERLI_ETH70000030SEI_TEST70000031
BMTC4321ZETA_MAINNET7000
OMN408WEMIX1111
ROSE_EVM42262OAS70000033
XETA70000034BNC788
HASH505POKT635
DNA515DGB70000035
CKB309AVAX_X9000
WICC(WGRT)70000036FAN99999
PLS369ACE648
TIA70000037MNT5000
LINEA59144Base8453
BTC_TestNet70000038OP_BNB204
Sepolia11155111enj70000039
Beacon70000040scroll534352
injective70000041DYDX70000042
Kaspa111111Venom70000043
MANTA_ETH169HAQQ11235
NOSTR1237FacetVM70000044
hnt904gas_n3888
astr_evm592FIL_EVM461
IMX_ZKEVM13371MXC18686
CHZ_V288888Mumbai_Testnet80001
PolygonzkEVM_Testnet1442ETHS70000045
BTC_src2070000046Amoy_Testnet80002
BTC_Signet70000047DYM1100
Rangers2025Blast_Sepolia168587773
WEMIX3_Testnet1112Avocado634
zkSync_Sepolia300Shardeum_Sphinx8082
Mode34443MerLin4200
XION70000051XION_TEST70000052
DYM_TEST70000053Blast81457
Arbitrum_Sepolia421614LUMI94168
BBNylon_TEST70000054B2Network_TEST1102
BEVM_Canary1501TunaChain_TEST10123
XLayer_TEST196BITLAYER_BTC200901
B2Network223ZKLINK_ETH810180
Avail70000055ZETA_COSMOS70000050
STC70000056BOB_ETH60808
BounceBit_BTC6001TAIKO_ETH167000
SOL_Testnet70000057ZORA_ETH7777777
ONCHAIN_ETH27563OVER54176
BEVM_BTC11501frxETH252
MAT698KARAK_ETH2410
KROMA_ETH255Lisk1135
Sonic_Testnet70000058Sonic_Devnet70000059
EVM_SEI1329PLUME_ETH_TEST161221135
MOVEMENT_TestNet70000060B3_ETH8333
G1625FB70000061
APE33139WORLD480
RBTC30Sonic_Testnet_v170000062
TESTNET_IP1516Reya70000063
Zircuit48900CTK70000064
DORA_FACTORY70000065DuckChain_TON5545
HSK177MOVE70000066
SOON_testnet70000067Eclipse70000068
MINT_ETH185S146
PLUME_ETH98865XTERIO_BNB112358
SOON_mainnet70000069tbaby70000070
XYM70000071assetHub70000072
Abstract2741Soneium1868
Unite88899TESTNET_MON10143
SONIC_SOL70000130TESTNET_SAHARA313313
SOON_BNB70000075Plume98866
TAKER1125Endless70000076
BABY70000077ZKCANDY_ETH320
INIT70000078NERO1689
MEZO_BTC31612Noble70000079
BTT199HYPE_TEST998
assethub_ksm70000081FX530
VC207FLOW_EVM70000082
BOTANIX3637XLayer_testnet21952
GOAT_BTC2345USTC70000001
SOPH50104Mind228
Silicon2355Metadium11
AlephZero_EVM41455Ink57073
lens232redstone690
Etherlink42793Superposition55244
Swell1923Vana1480
Corn21000000Fuse122
Degen666666666Glue1300
Hemi43111Lightlink1890
Nibiru6900Peaq3338
RariChain1380012617Hedera295
Shibarium109RadixDLT70000083
MAYA70000084WITNESS1702448187
LUMIA994873017WIREX31415
HAUST938TERNOA752025
PENTAGON3344FORKNET838
ENI173MANTRA70000085
IOTA_MOVE70000086KATANA_ETH747474
MORPH_ETH2818XPL_Plasma9745
EVM_HYPE700000800G16661
FOGO70000087MemeCore4352
ShimmerEVM148MON143
CANTON70000089BITTENSOR964
STABLE988Mega_ETH4326
BRIDGE13441ZANO70000091
Gate_Layer10088PROS1672
Tempo4217Edge3343
Jovay5734951TradeZone70000196
TradeZoneTestNet70000195orbit70000092
KITE2366BittensorDot70000093
Gensyn685689xlayertest1952
HyperCore70000094MMPTestnet70000095
RobinhoodChain4663HPP190415