NAV
English 中文
Java Python Go C++

Application for API Key

OkLink provides institutional customers, developers, and researchers with a powerful API product that covers multi-chain real-time data, on-chain transactions, and address analysis, eliminating the cost of self-built nodes, synchronized blocks, and operational maintenance.

The current API rate limit is 120 calls per minute.

If you need to apply for use or higher frequency, please provide the following information to email: [email protected]

Introduction

Welcome to the developer documentation.

Usage Process

  1. Apply for your exclusive key

  2. Contact the administrator and add the key

  3. Access interface.

Usage Mode

Speed Limit Rules

Overview

Our API includes the query of blockchain, block, transaction and address. For the convenience of users, we also provide a series of statistical interfaces, which are rich in content and can be customized to meet your needs.

REST API

Common Interface

Token Ambiguity Matching Interface

The token is fuzzily matched according to the input content.

Rate Limit: 10 requests per 2 seconds

HTTP Requests

GET /api/explorer/v1/{chain}/matchTokens

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/matchTokens

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case of the symbol of the blockchain to be queried
QueryString q String Yes Ambiguous search for tokens, token names, contract addresses

Example Response

{
 "code":0,
 "msg":"", 
 "detailMsg":"", 
 "total":50,
 "hits":[
   {
     "symbol":"BNB", 
     "coinName":"BNB",
      "tokenContractAddress":"aadfsdfafdaffasdafs", 
    } 
  ] 
 }

Response Parameters

Parameters Types Description
symbol String Symbol
coinName String Coin name
tokenContractAddress String Contract address

Common Query Interface of Main Chain

根The type of query is returned based on the input height / transaction Hash/ address and other data.

HTTP Request

GET /api/explorer/v1/{chain}/search

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/search

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case of the symbol of the blockchain to be queried
QueryString q String/Long Yes Height / transaction hash/ address to be inquired

Example Response

{
 "code":0,
 "msg":"", 
 "detailMsg":"", 
 "data":{
   "dataType":"BLOCK", 
   "chain":"BTC"
  }
 }

Response Parameters

Parameters Types Description
dataType String Data type,include block / transaction / address
chain String Chain

Inquire About the Details of Chain

Query the detailed information of a blockchain.

HTTP Request

GET /api/explorer/v1/{chain}/info

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/info

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case of the symbol of the blockchain to be queried

Example Response

{
 "code":0,
 "msg":"", 
 "detailMsg":"", 
 "data":{
   "id": 1, 
   "coinType": "chain", 
   "name": "bitcoin",
   "symbol": "BTC", 
   "coinName": "Bitcoin", 
   "fullName": "Bitcoin (BTC)",
   "websiteSlug": "bitcoin", 
   "iconPath": "https://oss.bafang.com/blockchain/icon/eth/BTC.jpg",
   "rank": 1, 
   "mineable": true, 
   "algorithm": "SHA-256", 
   "proofType": "PoW",
   "fullyPremined": false, 
   "preMinedValue": null,
   "netHashesPerSecond": 91054733765.6216, 
   "blockReward": 12.5, 
   "blockPeriodTime": 600, 
   "circulatingSupply": 18018812.5, 
   "totalSupply": 18018812.5,
   "maxSupply": 21000000,
   "tokenAddress": null, 
   "firstBlockTime": null, 
   "firstBlockHeight": null,
   "firstHistoricalData": null,
   "lastHistoricalData": 1573747209390, 
   "lastSyncTime": 1573747209390, 
   "createTime": 1570691307644, 
   "updateTime": 1573747209390, 
   "icoPrice": null, 
   "market": {
     "symbol": "BTC", 
     "marketSymbol": "CNY", 
     "price": 64922, 
     "volume24h": 190837349081.5128, 
     "percentChange1h": 0, 
     "percentChange24h": 0.5698582219203002,
     "percentChange7d": 0,
     "marketCap": 1170673140208.1343,
     "timestamp": 1572872407
   },
   "address": { 
     "validAddressCount": 1102795, 
     "newAddressCount24h": 0
   },
   "block": { 
     "height": 603841, 
     "firstExchangeHistoricalTime": 0,
     "firstBlockTime": 0, 
     "firstBlockHeight": 0, 
     "avgBlockInterval": 627, 
     "avgBlockSize24h": 0, 
     "avgBlockSize24hPercent": 0, 
     "mediaBlockSize": 0,
     "halveTime": 0
   }
   "fee": {
     "bestFeePerKbyte": 23332
     "bestFeePerKwu": 0, 
     "bestFeePerKvbyte": 0, 
     "bestGasPrice": null
   },
   "globalDifficulty": { 
     "currentDiffculty": "12.72T",
     "currentDiffcultyPercentChange": -0.07095469361664279, 
     "currentDiffcultyChangeTime": 1573169436000,
     "currentDiffcultyChangeHeight": 602784,
     "nextDiffculty": "12.45T", 
     "nextDiffcultyChangeTime": 1574373589000, 
     "nextDiffcultyChangeHeight": 0,
     "nextDiffcultyPercentChange": -0.02153946011009916, 
     "nextDifficultyChangeBlock": 0
   },
   "hashes": {
     "globalHashes": "92.89EH",
     "globalHashesPercentChange24h": -3.2471268000960922
   },
   "mine": { 
     "avgMineReward24h": 0, 
     "minerIncomePerUnit": 1.1923362838585598, 
     "minerIncomePerUnitCoin": 0.00001836567394501956
   },
   "reduceReward": {
     "nextReduceRewardTime": 1589821189000
     "nextReduceRewardHeight": 630000
   },
   "transaction": {
     "pendingTransactionCount": 3566
     "transactionValue24h": 0,
     "totalTransactionCount": 3815326,
     "tranRate": 3.56,
     "avgTransactionCount24h": 0, 
     "avgTransactionCount24hPercent": 0
   },
   "okchain": null, 
   "usdt": { 
     "fee": 23332, 
     "omiUsdtTotalSupply": 18018812.5,
     "trxUsdtTotalSupply": 0, 
     "ethUsdtTotalSupply": 0, 
     "weekAddCoin": 0, 
     "weekDestoryCoin": 0
   },
   "trxUsdtTotalSupply": 0, 
   "ethUsdtTotalSupply": 0, 
   "coreAlgorithm": null, 
   "platformId": null, 
   "platform": null
 }
}

Response Parameters

Parameters Types Description
id Long Id,unique identification
coinType String Coin type
name String Coin name
symbol String Symbol
coinName String Coin name
fullName String Full Name of coin
websiteSlug String Internet name of coin
iconPath String Icon links
rank Integer rank
mineable Boolean Mining or not
algorithm String Mining algorithm
netHashesPerSecond BigDecimal Difficulty of next mining
blockReward Double Block Award
blockPeriodTime BigDecimal Block period time
circulatingSupply Double Circulation
maxSupply Double Maximum supply
tokenAddress String Contract address
firstBlockTime Long First block time
firstBlockHeight Long First block height
firstHistoricalData Long Earliest transaction time
lastHistoricalData Long Latest transaction time
lastSyncTime Long Last synchronization time
createTime Long Creation time
updateTime Long Update time
icoPrice String ICO price
market Market Information
symbol String Symbol
marketSymbol String Symbol of fiat
price Double Price
volume24h Double 24 hour trading volume
percentChange1h Double Price rise in 1 hour
percentChange24h Double Price rise in 24 hour
percentChange7d Double Price rise in 7 days
marketCap Double Market cap
timestamp Long Time stamp
address Address information
validAddressCount Integer Number of addresses
newAddressCount24h Integer Number of new addresses in 24 hours
block Block information
height Integer Height
firstExchangeHistoricalTime Long First transaction time
firstBlockTime Long First block time
firstBlockHeight Long First block height
avgBlockInterval Long Average block time
avgBlockSize24h Double 24-hour average block size
avgBlockSize24hPercent Double Average block size increase over 24 hours
mediaBlockSize Double Median block size in one week
halveTime Long In half the time
fee Long Fee, unit satoshi
bestFeePerKbyte BigInteger Best handling charge per kByte
bestFeePerKwu BigDecimal Best handling charge per kilogram
bestFeePerKvbyte BigDecimal Best service charge per K virtual bytes
bestGasPrice BigInteger Best gas price
globalDifficulty Difficulty of the whole network
currentDiffculty String Current difficulty
currentDiffcultyPercentChange Double Last difficulty adjustment percentage
currentDiffcultyChangeTime Long Last difficulty adjustment time
currentDiffcultyChangeHeight Long Last difficulty adjustment height
nextDiffculty String Forecast the difficulty of next time
nextDiffcultyChangeTime Long Forecast the next difficulty adjustment time
nextDiffcultyChangeHeight Long Forecast the next difficulty and adjust the height
nextDiffcultyPercentChange Double Forecast next difficulty adjustment percentage
nextDifficultyChangeBlock Long Prediction of the next difficulty adjustment block
hashes Hashrate
globalHashes String Hashrate in the whole network
globalHashesPercentChange24h Double 24-hour change of hashrate in the whole network
mine mining
avgMineReward24h Double 24-hour average mining reward
minerIncomePerUnit Double Income per unit hashrate
minerIncomePerUnitCoin Double Coin of income per unit hashrate
reduceReward Half reward
nextReduceRewardTime Long Predict when the next production will be halved
nextReduceRewardHeight Long Forecast the height of the next production cut by half
transaction Transaction information
pendingTransactionCount Integer Number of unconfirmed transactions
transactionValue24h BigDecimal 24-hour trading volume on the chain
totalTransactionCount Integer Number of transactions on the chain
tranRate BigDecimal 50 blocks average TPS
avgTransactionCount24h Double Average number of transactions in 24 hours
avgTransactionCount24hPercent Double 24-hour average trading volume increase
pendingTransactionSize Double Pending transaction size

Basic Statistics of Query Chain

Query the summary information of supported blockchains.

HTTP Requests

GET /api/explorer/v1/info/summary

Request Example

GET https://www.oklink.com/api/explorer/v1/info/summary

Request Parameters

Example Response

{
 "code":0,
 "msg":"", 
 "detailMsg":"", 
 "data":[
   { 
     "symbol":"BTC",
     "price":72657,
     "lastBlockTime":1566991498, 
     "totalTransacationCount":449445678, 
     "totalSupply":17900250, 
     "totalSupplyPercent":0.8523928571428572, 
     "pendingTransactionCount":9890, 
     "runTime":1567001611630,
     "pricePercentChange24h":-0.007104239350452387,
     "height":592119
   } 
 ]
}

Response Parameters

Parameters Types Description
symbol String Symbol
price Double Price
lastBlockTime Long Last block time
totalTransacationCount Long Total transacation count
totalSupply Double Circulation
totalSupplyPercent Double Circulation ratio
pendingTransactionCount Integer Total number of unconfirmed
runTime Long Run Time
pricePercentChange24h Double 24-hour price change
height Integer Height

Statistical Interface

Inquire About Basic Statistics of Query Chain

Query the basic statistical information of a blockchain.

HTTP Requests

GET /api/explorer/v1/{chain}/statistic/common

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/statistic/common

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case of the symbol of the blockchain to be queried
QueryString Limit Integer No Return the number of items, the number of items required by the default home page chart

Example Response

{
 "code":0,
 "msg":"", 
 "detailMsg":"", 
 "data":[
   { 
     "day":1567000800000, 
     "activeAddressCount":10,
     "validAddressCount":10, 
     "newAddressCount":10, 
     "transactionCount":10, 
     "transactionValue":"12.12",
     "transactionValuePercent":"-1.0000", 
     "activeAddressPercent":"-1.0000", 
     "validAddressPercent":"0.23", 
     "newAddressPercent":"0.23", 
     "transactionCountPercent":"-1.0000", 
     "pricePercent":"-0.0099",
     "market":{
       "symbol":"USDT",
       "marketSymbol":"CNY", 
       "price":2193.58, 
       "volume24h":10047275360.93245, 
       "percentChange1h":0,
       "percentChange24h":-0.8763967208936047, 
       "percentChange7d":0, 
       "marketCap":39484526848.115005,
       "timestamp":1567000761
     },
     "price":"2193.5800"
   } 
 ]
}

Response Parameters

Parameters Types Description
day Long time
activeAddressCount String Number of active addresses
validAddressCount String Number of addresses with balance
newAddressCount Integer Number of new addresses
transactionCount Integer Number of transactions
transactionValue Double Number of currencies traded
transactionValuePercent Double The proportion of the number of coins traded in 24 hours
activeAddressPercent Double The proportion of active addresses in 24 hours
validAddressPercent Double The proportion of addresses with balance in 24 hours
newAddressPercent Double The proportion of new addresses in 24 hours
transactionCountPercent Double The proportion of transactions in 24 hours
pricePercent Double Proportion of price in 24 hours
market Market information
symbol String Symbol
marketSymbol String Symbol of fiat
price Double Price
volume24h Double 24-hour trading volume
percentChange1h Double Price increase in 1-hour
percentChange24h Double Price increase in 24-hour
percentChange7d Double Price rise in 7 days
marketCap Double Market cap
timestamp Long Time stamp
price Double Price

Query the Large Transaction

Query the 24-hour large amount transfer information of a blockchain.

HTTP Requests

GET /api/explorer/v1/{chain}/statistic/large/transfer/lastest

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/statistic/large/transfer/lastest

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case of the symbol of the blockchain to be queried

Example Response

{
 "code":0,
 "msg":"", 
 "detailMsg":"", 
 "data": [
   {
     "datetime": 1572505723,
     "transferRangeFrom": 2000, 
     "transferRangeTo": 0, 
     "transferCount": 0, 
     "transferValue": 0.0, 
     "transferAddressCount": 0, 
     "market": {
       "symbol": "BTC", 
       "marketSymbol": "CNY", 
       "price": 64922.0, 
       "volume24h": 1.908373490815128E11, 
       "percentChange1h": 0.0, 
       "percentChange24h": 0.5698582219203002,
       "percentChange7d": 0.0, 
       "marketCap": 1.1706731402081343E12, 
       "timestamp": 1572872407
     }
   } 
 ]
}

Response Parameters

Parameters Types Description
datetime Long Time
transferRangeFrom Integer Transfer starting point
transferRangeTo Integer Transfer end point
transferCount Integer Number of transfers
transferValue Double Total amount of coin transferred
transferAddressCount Integer Number of transfer addresses
market Market information
symbol String Symbol
marketSymbol String Symbol of fiat
price Double Price
volume24h Double 24-hour trading volume
percentChange1h Double Price increase in 1-hour
percentChange24h Double Price increase in 24-hour
percentChange7d Double Price rise in 7 days
marketCap Double Market cap
timestamp Long Time stamp

Query the Balance Distribution

Query the balance distribution statistics of the main chain currency or token of a blockchain.

HTTP Request

GET /api/explorer/v1/{chain}/statistic/richers/stat

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/statistic/richers/stat

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case of the symbol of the blockchain to be queried
queryString tokenId String No The token ID of the statistics, which is null by default, is used to count the currency of the main chain

Example Response

{
 "code":0,
 "msg":"", 
 "detailMsg":"", 
 "data": [ 
   { 
     "holderRangeFrom": 1,
     "holderRangeTo": 100, 
     "addressCount": 100, 
     "holdersValue": 2604892.0049283006,
     "percentRate": 0.1456
   } 
 ]
}

Response Parameters

Parameters Types Description
holderRangeTo Integer The end of the ranking
addressCount Integer Total address
holdersValue Double Total holding currency
percentRate Double Proportion

Block Interface

Query Block List

Query the block list of a blockchain, and the priority of blocks is the reverse of block height by default.

HTTP Request

GET /api/explorer/v1/{chain}/blocks

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/blocks

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case of the symbol of the blockchain to be queried
queryString offset Integer No Start position, default 0
queryString limit Integer No Return the number of items, the default is 20
queryString Sort String No Sort by field:desc/asc;The sorting fields supported are height and timestamp;Default height in reverse order

Example Response

{
 "code":0,
 "msg":"", 
 "detailMsg":"", 
 "data": { 
   "total": 590801,
   "hits": [ 
     { 
       "hash": "0000000000000000001b406f5ebabb45bb9d6d62d6992b343335188ce4c4ffc1", 
       "height": 580640, 
       "transactionCount": 2292,
       "previousBlockHash": "0000000000000000001f00b6c00780b8d3bbef6106e9c2f3781c747317abc8f2", 
       "nextBlockHash": "00000000000000000010784a6225f02f82a9e14b5e4087a37cc2fe7a7e1cb41b", 
       "blocktime": 1560494759, 
       "legalRate": 56874.531124,
       "size": 1149545, 
       "version": 536870912,
       "merkleRoot": "2731759ff86e9083cad7ea872178c3ab4c9e0836b123d4df1ab58c5537ef8435", 
       "inputsCount": 6146, 
       "outputsCount": 5486,
       "inputsValue": 3438.6456265, 
       "outputsValue": 3451.1456265, 
       "nonce": "0xb17d5e36", 
       "minerHash": "18cBEMRxXHqzWWCxZNtU91F5sbUNKhL5PX", 
       "reward": 1250000000, 
       "fee": 28423704, 
       "feePerKbyte": 24733, 
       "blockReward": 1278423704, 
       "aux": true, 
       "bits": "0x1725fd03", 
       "difficulty": 7409399249090.253, 
       "mineDifficulty": 10328557357853.107, 
       "chainwork": "000000000000000000000000000000000000000006abc18bcec54323d3aab079",
       "coinbaseDataHex": "0320dc08082f5669614254432f2cfabe6d6deda0cc7684dc7256d1f6797cad93768a da2eb953a3807c61826fdfa38906e4ef1000000000000000100459071037049bba43 377e3e3d280300", 
       "inputsValueSat": 343864562650, 
       "outputsValueSat": 345114562650, 
       "coindaysDestroyed": 2455583199983,
       "medianTime": 1560493002,
       "feePerKwu": 7120, 
       "witnessCount": 1829, 
       "weight": 3992777, 
       "strippedSize": 947744,
       "btcDifficulty": "7.41T", 
       "btcMineDifficulty": "10.33T", 
       "minepoolName": "aaa", 
       "minepoolCode": "bbb", 
       "minepoolLogoUrl": "ccc", 
       "minepoolUrl": "ddd"
     } 
   ]
 }
}

Response Parameters

Parameters Types Description
hash String Block hash
height Integer Height
size Integer size
timestamp Long Time to block
guessedMiner String Pool identification
guessedMinerName String Pool name
reward Long Mining reward, unit Satoshi
fee Long Cost, unit Satoshi
feePerKbyte Long Cost per kByte in Satoshi
feePerKwu Long Unit cost per K weight, unit Satoshi
blockReward Long Total reward, unit Satoshi
transactionCount Integer Number of transactions
wintnessCount Integer Number of isolated witness transactions
inputsCount Integer Number of VIN
outputsCount Integer Number of VOUTS
inputsValueSat Long Total input,unit Satoshi
inputsValue Double Total input
outputsValueSat Long Total output,unit satoshi
outputsValue Double Total output
coindaysDestroyed Long Number of coins destroyed per day, unit Satoshi
legalRate Double Exchange rate against fiat
sizeLevel Integer The level of block volume, from small to large, takes 256K as the base. Every increase of 256K means an increase of level, a total of 6 levels, 0-5. The front end can use this level to display color
minerName String Pool name
minerCode String Mine pool URL
minerLogoUrl String The address of the pool icon

Query Block Details

Query the block details of a blockchain.

HTTP Request

GET /api/explorer/v1/{chain}/blocks/{heightHash|lastest}

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/blocks/{heightHash|lastest}

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case of the symbol of the blockchain to be queried
Path height hash lastest Integer No Block height or block hash, which is the latest block

Example Response

{
 "code":0,
 "msg":"", 
 "detailMsg":"", 
 "data": { 
   "hash": "0000000000000000001b406f5ebabb45bb9d6d62d6992b343335188ce4c4ffc1",
   "height": 580640,
   "transactionCount": 2292,
   "previousBlockHash": "0000000000000000001f00b6c00780b8d3bbef6106e9c2f3781c747317abc8f2", 
   "nextBlockHash": "00000000000000000010784a6225f02f82a9e14b5e4087a37cc2fe7a7e1cb41b", 
   "blocktime": 1560494759,
   "legalRate": 56874.531124, 
   "size": 1149545, 
   "version": 536870912, 
   "merkleRoot": "2731759ff86e9083cad7ea872178c3ab4c9e0836b123d4df1ab58c5537ef8435",
   "inputsCount": 6146,
   "outputsCount": 5486,
   "inputsValue": 3438.6456265, 
   "outputsValue": 3451.1456265, 
   "nonce": "0xb17d5e36", 
   "minerHash": "18cBEMRxXHqzWWCxZNtU91F5sbUNKhL5PX", 
   "reward": 1250000000,
   "fee": 28423704, 
   "feePerKbyte": 24733,
   "blockReward": 1278423704,
   "aux": true, 
   "bits": "0x1725fd03",
   "difficulty": 7409399249090.253,
   "mineDifficulty": 10328557357853.107, 
   "chainwork": "000000000000000000000000000000000000000006abc18bcec54323d3aab079", 
   "coinbaseDataHex": "0320dc08082f5669614254432f2cfabe6d6deda0cc7684dc7256d1f6797cad93768a da2eb953a3807c61826fdfa38906e4ef1000000000000000100459071037049bba43 377e3e3d280300", 
   "inputsValueSat": 343864562650,
   "outputsValueSat": 345114562650,
   "coindaysDestroyed": 2455583199983, 
   "medianTime": 1560493002,
   "feePerKwu": 7120,
   "witnessCount": 1829, 
   "weight": 3992777,
   "strippedSize": 947744, 
   "btcDifficulty": "7.41T", 
   "btcMineDifficulty": "10.33T",
   "minepoolName": "aaa",
   "minepoolCode": "bbb",
   "minepoolLogoUrl": "ccc", 
   "minepoolUrl": "ddd"
 }
}

Response Parameters

Parameters Types Description
hash String Block hash
height Integer Height
size Integer size
timestamp Long Time to block
guessedMiner String Pool identification
guessedMinerName String Pool name
reward Long Mining reward, unit Satoshi
fee Long Cost, unit Satoshi
feePerKbyte Long Cost per kByte in Satoshi
feePerKwu Long Unit cost per K weight, unit Satoshi
blockReward Long Total reward, unit Satoshi
transactionCount Integer Number of transactions
wintnessCount Integer Number of isolated witness transactions
inputsCount Integer Number of VIN
outputsCount Integer Number of VOUTS
inputsValueSat Long Total input,unit Satoshi
inputsValue Double Total input
outputsValueSat Long Total output,unit satoshi
outputsValue Double Total output
coindaysDestroyed Long Number of coins destroyed per day, unit Satoshi
legalRate Double Exchange rate against fiat
sizeLevel Integer The level of block volume, from small to large, takes 256K as the base. Every increase of 256K means an increase of level, a total of 6 levels, 0-5. The front end can use this level to display color
minerName String Pool name
minerCode String Mine pool URL
minerLogoUrl String The address of the pool icon

Query Mine Pool Block List

Query a list of blocks from a block pool, default is block height reverse order.

HTTP Request

GET /api/explorer/v1/{chain}/blocks

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/blocks

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case of the symbol of the blockchain to be queried
queryString type String Yes Unique value: pool, which means query block based on ore pool
queryString pool String Yes Pool identification
queryString offset Integer No Start position, default 0
queryString limit Integer No Return the number of items, the default is 10
queryString sort String No Sort by field:desc/asc;The sorting fields supported are height and timestamp;Default height in reverse order

Example Response

{
 "code":0,
 "msg":"", 
 "detailMsg":"", 
 "data": {
   "total": 590801, 
   "hits": [ 
     { 
       "hash": "0000000000000000001b406f5ebabb45bb9d6d62d6992b343335188ce4c4ffc1", 
       "height": 580640,
       "transactionCount": 2292, 
       "previousBlockHash": "0000000000000000001f00b6c00780b8d3bbef6106e9c2f3781c747317abc8f2", 
       "nextBlockHash": "00000000000000000010784a6225f02f82a9e14b5e4087a37cc2fe7a7e1cb41b", 
       "blocktime": 1560494759, 
       "legalRate": 56874.531124, 
       "size": 1149545, 
       "version": 536870912, 
       "merkleRoot": "2731759ff86e9083cad7ea872178c3ab4c9e0836b123d4df1ab58c5537ef8435",
       "inputsCount": 6146,
       "outputsCount": 5486,
       "inputsValue": 3438.6456265,
       "outputsValue": 3451.1456265, 
       "nonce": "0xb17d5e36", 
       "minerHash": "18cBEMRxXHqzWWCxZNtU91F5sbUNKhL5PX", 
       "reward": 1250000000,
       "fee": 28423704,
       "feePerKbyte": 24733, 
       "blockReward": 1278423704,
       "aux": true, 
       "bits": "0x1725fd03",
       "difficulty": 7409399249090.253,
       "mineDifficulty": 10328557357853.107, 
       "chainwork": "000000000000000000000000000000000000000006abc18bcec54323d3aab079", 
       "coinbaseDataHex": "0320dc08082f5669614254432f2cfabe6d6deda0cc7684dc7256d1f6797cad93768a da2eb953a3807c61826fdfa38906e4ef1000000000000000100459071037049bba43 377e3e3d280300", 
       "inputsValueSat": 343864562650,
       "outputsValueSat": 345114562650,
       "coindaysDestroyed": 2455583199983, 
       "medianTime": 1560493002,
       "feePerKwu": 7120,
       "witnessCount": 1829, 
       "weight": 3992777, 
       "strippedSize": 947744,
       "btcDifficulty": "7.41T", 
       "btcMineDifficulty": "10.33T", 
       "minepoolName": "aaa", 
       "minepoolCode": "bbb",
       "minepoolLogoUrl": "ccc", 
       "minepoolUrl": "ddd"
     } 
   ]
 }
}

Response Parameters

Parameters Types Description
hash String Block hash
height Integer Height
size Integer size
timestamp Long Time to block
guessedMiner String Pool identification
guessedMinerName String Pool name
reward Long Mining reward, unit Satoshi
fee Long Cost, unit Satoshi
feePerKbyte Long Cost per kByte in Satoshi
feePerKwu Long Unit cost per K weight, unit Satoshi
blockReward Long Total reward, unit Satoshi
transactionCount Integer Number of transactions
wintnessCount Integer Number of isolated witness transactions
inputsCount Integer Number of VIN
outputsCount Integer Number of VOUTS
inputsValueSat Long Total input,unit Satoshi
inputsValue Double Total input
outputsValueSat Long Total output,unit satoshi
outputsValue Double Total output
coindaysDestroyed Long Number of coins destroyed per day, unit Satoshi
legalRate Double Exchange rate against fiat
sizeLevel Integer The level of block volume, from small to large, takes 256K as the base. Every increase of 256K means an increase of level, a total of 6 levels, 0-5. The front end can use this level to display color
minerName String Pool name
minerCode String Mine pool URL
minerLogoUrl String The address of the pool icon

Transaction Interface

Query Transaction List

Query the transaction list of a blockchain. The default order of query transaction is block height reverse order and index positive order. The home page transaction list is height reverse order and index reverse order.

HTTP Request

GET /api/explorer/v1/{chain}/transactions

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/transactions

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case of the symbol of the blockchain to be queried
queryString blockHash String No Block hash
queryString blockHeight Long No Block height
queryString offset Integer No Start position, default 0
queryString limit Integer No Return the number of items, the default is 20
queryString sort String No Sort by field:desc/asc;The sorting fields supported are height and timestamp;Default height in reverse order

Example Response

{
 "code":0,
 "msg":"", 
 "detailMsg":"", 
 "data": { 
   "total": 3196783, 
   "scrollId": null, 
   "hits": [ 
     {
       "hash": "3bbcf905c61831b7558936e03ff5257baa6f6dcc629796cea7bf7af16acfb9b7",
       "blocktime": 1573211898,
       "legalRate": 64922,
       "index": 2326, 
       "blockHash": "0000000000000000000645e30db580cc132ed096669a84dd5192c654e0950f65", 
       "blockHeight": 602850, 
       "coinbase": false,
       "size": 250,
       "version": 1, 
       "doubleSpend": false, 
       "fee": 500,
       "feePerKbyte": 2000,
       "inputsCount": 1, 
       "outputsCount": 2, 
       "inputsValue": 0.00354234, 
       "outputsValue": 0.00353734, 
       "realTransferValue": 0.00348017,
       "inputsValueSat": 354234,
       "outputsValueSat": 353734, 
       "realTransferValueSat": 348017, 
       "inputs": [ 
         { 
           "prevBlockHash": "0000000000000000000efd376141e80ec85b8c3b57cd0dde9739806321b0d730", 
           "prevAddresses": [ "325TBWEEv5dpBvCppYGKfoEshro6PP64np" ],
           "scriptType": "P2SH_P2WPKH", 
           "vinIndex": 0, 
           "prevBlockHeight": 602849, 
           "prevTxhash": "1b3dad3bc83b3d518ee1eb6d9ffa83275a550e66a4263b2daedbcd3dcb21783e", 
           "prevVoutIndex": 0,
           "prevValueSat": 354234, 
           "prevValue": 0.00354234, 
           "prevBlocktime": 1573211540,
           "prevScriptType": "P2SH",
           "scriptHex": "160014eaff5e6d6ce5fd8cbd2ee6cabc58c6e4973f046c", 
           "scriptData": "",
           "sequence": 4294967293,
           "lifespan": 358,
           "coindaysDestroyed": 1467,
           "witness": [ "3045022100c0a5b0e2708e42fbcc746e029da6616cfe78e8c5b2c 448b833381ba12a168da702204ab212d7856a90d88d3911671a8c973e42fd0b1984 2a86741475c9780b06403201", "02cb2dbdbcedbfb0bfd33a34f243a62122bd60739f3c465f0b44f3 e650bfa1be12"
           ]
         } 
       ],
       "outputs": [ 
         { 
           "addresses": [ 
             "1Ep36WYw8LctrT7XhQpYuzWVQZeQWZFi5q" 
           ],
           "scriptType": "P2PKH", 
           "voutIndex": 0, 
           "valueSat": 347517,
           "value": 0.00347517, 
           "fromCoinbase": false,
           "spent": false, 
           "spentBlockHeight": -1,
           "spentBlockHash": "", 
           "spentTxhash": "", 
           "spentVinIndex": -1, 
           "spentBlocktime": -1, 
           "scriptAsm": "OP_DUP OP_HASH160 977eef27fb7cec70417c9f0545a96e7fe5b3a1c6 OP_EQUALVERIFY OP_CHECKSIG", 
           "scriptHex": "76a914977eef27fb7cec70417c9f0545a96e7fe5b3a1c688ac", 
           "outputType": "Spendable"
         },
         {
           "addresses": [
             "325TBWEEv5dpBvCppYGKfoEshro6PP64np"
           ],
           "scriptType": "P2SH", 
           "voutIndex": 1,
           "valueSat": 6217,
           "value": 0.00006217,
           "fromCoinbase": false, 
           "spent": true,
           "spentBlockHeight": 602850,
           "spentBlockHash": "0000000000000000000645e30db580cc132ed096669a84dd5192c654e0950f65", 
           "spentTxhash": "d77a269946f72c61aff995e16b457e73bed23a424c0162147b34c262b8f0f4b3",
           "spentVinIndex": 0, 
           "spentBlocktime": 1573211898, 
           "scriptAsm": "OP_HASH160 043e3c4552688c5a4b5358bd50651457127a70fa OP_EQUAL", 
           "scriptHex": "a914043e3c4552688c5a4b5358bd50651457127a70fa87",
           "outputType": "Spendable"
         } 
       ],
       "lockTime": 0, 
       "coindaysDestroyed": 1467, 
       "sigops": 1, 
       "strippedSize": 140,
       "virtualSize": 168,
       "weight": 670, 
       "hasWitness": true, 
       "witnessHash": "f2191fdce43988b670f89e9cdedb71614a8163c18089e2f03a0f8da7717bb86a", 
       "feePerKwu": 746,
       "feePerKvbyte": 2976, 
       "confirm": 1,
       "realAddressBalance": 0
     } 
   ]
 }
}

Response Parameters

Parameters Types Description
hash String Block hash
blocktime Long Block time
legalRate Double Exchange rate against fiat
index Long Transaction index
blockHash String Block hash
blockHeight Integer Block height
coinbase Boolean A coinbase transaction or not
size Integer Transaction size
version Long Version
doubleSpend Boolean Double flower or not
fee Long Cost, unit Satoshi
feePerKbyte Long Cost per kByte, unit Satoshi
inputsCount Integer Number of VIN
outputsCount Integer Number of VOUTS
inputsValue Double Total input
outputsValue Double Total output
realTransferValue Double Actual transaction amount
inputsValueSat Long Total input, unit Satoshi
outputsValueSat Long Total output, unit Satoshi
realTransferValueSat Long Total transaction volume
inputs Array Input list
prevAddresses String Array Previous output address
scriptType String Script type
vinIndex Integer Position in the transaction
prevBlockHeight Integer Height of previous block
prevTxhash String Previous output transaction hash
prevVoutIndex Integer Position of previous output in the transaction
prevValueSat Long Previous output quantity,unit Satoshi
prevValue Double Previous output quantity
prevBlocktime Long Previous output transaction time
prevScriptType String Previous output script type
scriptHex String Script data
scriptData String Script display data
sequence Long Input sequence
lifespan Integer Output lifetime
coindaysDestroyed Long Number of coins destroyed per day, unit Satoshi
witness String array Isolate witness signature data
outputs Array Output list
addresses String array Output address
scriptType String Script type
voutIndex Integer output location
valueSat Long Output quantity, unit Satoshi
value Double Output quantity
fromCoinbase Boolean A coinbase output or not
spent Boolean Has it been spent
spentBlockHeight Integer The height of the cost block
spentBlockHash String The hash of the cost block
spentTxhash String The hash of the cost transaction
spentVinIndex Integer The position of the cost input
spentBlocktime Long The time of the cost block
scriptAsm String Script asm
scriptHex String Script data
ouputType String The types of output are: spendable, segwit, unknown
lockTime Long Lock time
coindaysDestroyed Long Number of coins destroyed per day, unit Satoshi
sigops Integer Number of signatures in the transaction
strippedSize Integer Basic transaction size
virtualSize Integer Virtual Size
weight Integer weight
hasWitness Boolean Does it include isolated witness transactions
witnessHash String Quarantine witness hash
feePerKwu Long Unit cost per K weight, unit Satoshi
feePerKvbyte Long Cost per K virtual bytes in Satoshi
confirm Integer Confirmation number
realAddressBalance Double Address balance

Query Transaction Details

To query the transaction details of a blockchain, the interface will support the query of both unconfirmed and confirmed transactions. The difference between unconfirmed and confirmed transactions is whether the returned block height data exists.

HTTP Request

GET /api/explorer/v1/{chain}/transactions/{hash}

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/transactions/{hash}

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case of the symbol of the blockchain to be queried
Path hash String Yes Transaction hash

Example Response

{
 "code":0,
 "msg":"", 
 "detailMsg":"", 
 "data": { 
   "hash": "5554fcec49e919347205aa6e7487d0d6b956ee505bbcf 43739153070b8da618e", 
   "blocktime": 1576355590,
   "legalRate": 10081.89, 
   "index": 181, 
   "blockHash": "0000000000000000000ff6ac728cedff8cbcd04e 4d77e54de0aa77d10d9996b1",
   "blockHeight": 608141, 
   "coinbase": false, 
   "size": 257, 
   "version": 2,
   "doubleSpend": false,
   "fee": 5140,
   "feePerKbyte": 20000,
   "inputsCount": 1, 
   "outputsCount": 2, 
   "inputsValue": 1499.0986048, 
   "outputsValue": 1499.0985534, 
   "realTransferValue": 1499.0986048, 
   "inputsValueSat": 149909860480, 
   "outputsValueSat": 149909855340,
   "realTransferValueSat": 149909860480, 
   "inputs": [
     {
       "prevAddresses": [ 
         "19tK9pC6ggFybYWwkGRcWDSKpT6MxsDWDJ" 
       ]
       "scriptType": "P2PKH",
       "vinIndex": 0, 
       "prevBlockHeight": 581174, 
       "prevTxhash": "0130cbdc86f81aedeb65afca20add3db8f92 c296e7c92cb07cfbf9ac91265f02",
       "prevVoutIndex": 0, 
       "prevValueSat": 149909860480,
       "prevValue": 1499.0986048,
       "prevBlocktime": 1560813252,
       "prevScriptType": "P2PKH",
       "scriptHex": "47304402201392300e8a660d34c4f98eab85 0874a574174a4868db9625ee9d8d244a54603002202d1e231724c5 0e3ed4e76567467ee24aeb2ed5bb78b62b225ebec674d7a2b7de014 10442b804899a46342d0668eb257ca7ac67aef3a91e5b9468b6747c 32e69ae661c925cc5869f6fa676c8960156688ab8551dda4757999ea 275765ae63a135bd295b", 
       "scriptData": "",
       "sequence": 4294967293,
       "lifespan": 15542338, 
       "coindaysDestroyed": 26967010661030
     } 
   ],
   "outputs": [
     { 
       "addresses": [ 
         "1AvtcQYQiwwJkHZsExVHmjf12qbCWR48t6" 
       ],
       "scriptType": "P2PKH", 
       "voutIndex": 0, 
       "valueSat": 4000000000, 
       "value": 40.0,
       "fromCoinbase": false, 
       "spent": true,
       "spentBlockHeight": 608143,
       "spentBlockHash": "0000000000000000000ca127a3835e 0e1dc6608801bbe5b3bd9f374d2b1d4ccc",
       "spentTxhash": "5f48c0f3c0cfcc88c263464841c74c4fd05 b6f5ca181b28b8f5c11a358b54a12",
       "spentVinIndex": 0,
       "spentBlocktime": 1576357017, 
       "scriptAsm": "OP_DUP OP_HASH160 6cea42a0638e3caf 79a1624a3649b8c996afba74 OP_EQUALVERIFY OP_CHECKSIG ", 
       "scriptHex": "76a9146cea42a0638e3caf79a1624a3649b8 c996afba7488ac", 
       "outputType": "Spendable"
     },
     { 
       "addresses": [
         "19HBfMyc7VpwWqk66NJFeHz4Dz3SWeznN2" 
       ],
       "scriptType": "P2PKH",
       "voutIndex": 1, 
       "valueSat": 145909855340,
       "value": 1459.0985534, 
       "fromCoinbase": false, 
       "spent": false,
       "spentBlockHeight": -1, 
       "spentBlockHash": "", 
       "spentTxhash": "",
       "spentVinIndex": -1,
       "spentBlocktime": -1, 
       "scriptAsm": "OP_DUP OP_HASH160 5ad08fb4e408998 7b68a20d681216ae8b3003963 OP_EQUALVERIFY OP_CHECKSI G", 
       "scriptHex": "76a9145ad08fb4e4089987b68a20d681216a e8b300396388ac", 
       "outputType": "Spendable"
     }
   ],
   "lockTime": 608140,
   "coindaysDestroyed": 26967010661030, 
   "sigops": 2, 
   "strippedSize": 257,
   "virtualSize": 257, 
   "weight": 1028, 
   "hasWitness": false, 
   "witnessHash": "",
   "feePerKwu": 5000,
   "feePerKvbyte": 20000,
   "confirm": 9769,
   "realAddressBalance": 0,
   "tagMap": { 
     "19tK9pC6ggFybYWwkGRcWDSKpT6MxsDWDJ": 
     ["tag": "huobi"]
   }
 }

Response Parameters

Parameters Types Description
hash String Block hash
blocktime Long Block time
legalRate Double Exchange rate against fiat
index Long Transaction index
blockHash String Block hash
blockHeight Integer Block height
coinbase Boolean A coinbase transaction or not
size Integer Transaction size
version Long Version
doubleSpend Boolean Double flower or not
fee Long Cost, unit Satoshi
feePerKbyte Long Cost per kByte, unit Satoshi
inputsCount Integer Number of VIN
outputsCount Integer Number of VOUTS
inputsValue Double Total input
outputsValue Double Total output
realTransferValue Double Actual transaction amount
inputsValueSat Long Total input, unit Satoshi
outputsValueSat Long Total output, unit Satoshi
realTransferValueSat Long Total transaction volume
inputs Array Input list
prevAddresses String Array Previous output address
scriptType String Script type
vinIndex Integer Position in the transaction
prevBlockHeight Integer Height of previous block
prevTxhash String Previous output transaction hash
prevVoutIndex Integer Position of previous output in the transaction
prevValueSat Long Previous output quantity,unit Satoshi
prevValue Double Previous output quantity
prevBlocktime Long Previous output transaction time
prevScriptType String Previous output script type
scriptHex String Script data
scriptData String Script display data
sequence Long Input sequence
lifespan Integer Output lifetime
coindaysDestroyed Long Number of coins destroyed per day, unit Satoshi
witness String array Isolate witness signature data
outputs Array Output list
addresses String array Output address
scriptType String Script type
voutIndex Integer output location
valueSat Long Output quantity, unit Satoshi
value Double Output quantity
fromCoinbase Boolean A coinbase output or not
spent Boolean Has it been spent
spentBlockHeight Integer The height of the cost block
spentBlockHash String The hash of the cost block
spentTxhash String The hash of the cost transaction
spentVinIndex Integer The position of the cost input
spentBlocktime Long The time of the cost block
scriptAsm String Script asm
scriptHex String Script data
ouputType String The types of output are: spendable, segwit, unknown
lockTime Long Lock time
coindaysDestroyed Long Number of coins destroyed per day, unit Satoshi
sigops Integer Number of signatures in the transaction
strippedSize Integer Basic transaction size
virtualSize Integer Virtual Size
weight Integer weight
hasWitness Boolean Does it include isolated witness transactions
witnessHash String Quarantine witness hash
feePerKwu Long Unit cost per K weight, unit Satoshi
feePerKvbyte Long Cost per K virtual bytes in Satoshi
confirm Integer Confirmation number
realAddressBalance Double Address balance
tagMap Map Label map, address hash as key, value as label array

Query Block Transaction List

Query the transaction list of a high block

HTTP Request

GET /api/explorer/v1/{chain}/transactionNoRestrict

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/transactionNoRestrict

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case of the symbol of the blockchain to be queried
queryString blockHeight Long No Block height
queryString offset Integer No Start position, default 0
queryString limit Integer No Return the number of items, the default is 20
queryString sort String No Sort by field:desc/asc;The sorting fields supported are height and timestamp;Default height in reverse order

Example Response

{
 "code":0,
 "msg":"", 
 "detailMsg":"", 
 "data": { 
    "total": 3196783,
         "scrollId": null,
         "hits": [
            {
                 "hash": "3bbcf905c61831b7558936e03ff5257baa6f6dcc629796cea7bf7af16acfb9b7",
                 "blocktime": 1573211898,
                 "legalRate": 64922,
                 "index": 2326,
                 "blockHash": "0000000000000000000645e30db580cc132ed096669a84dd5192c654e0950f65",
                 "blockHeight": 602850,
                 "coinbase": false,
                 "size": 250,
                 "version": 1,
                 "doubleSpend": false,
                 "fee": 500,
                 "feePerKbyte": 2000,
                 "inputsCount": 1,
                 "outputsCount": 2,
                 "inputsValue": 0.00354234,
                 "outputsValue": 0.00353734,
                 "realTransferValue": 0.00348017,
                 "inputsValueSat": 354234,
                 "outputsValueSat": 353734,
                 "realTransferValueSat": 348017,
                 "inputs": [
                    {
                         "prevBlockHash": "0000000000000000000efd376141e80ec85b8c3b57cd0dde9739806321b0d730",
                         "prevAddresses": [
                             "325TBWEEv5dpBvCppYGKfoEshro6PP64np"
                        ],
                         "scriptType": "P2SH_P2WPKH",
                         "vinIndex": 0,
                         "prevBlockHeight": 602849,
                         "prevTxhash": "1b3dad3bc83b3d518ee1eb6d9ffa83275a550e66a4263b2daedbcd3dcb21783e",
                         "prevVoutIndex": 0,
                         "prevValueSat": 354234,
                         "prevValue": 0.00354234,
                         "prevBlocktime": 1573211540,
                         "prevScriptType": "P2SH",
                         "scriptHex": "160014eaff5e6d6ce5fd8cbd2ee6cabc58c6e4973f046c",
                         "scriptData": "",
                         "sequence": 4294967293,
                         "lifespan": 358,
                         "coindaysDestroyed": 1467,
                         "witness": [
                             "3045022100c0a5b0e2708e42fbcc746e029da6616cfe78e8c5b2c448b833381ba12a168da702204ab212d7856a90d88d3911671a8c973e42fd0b19842a86741475c9780b06403201",
                             "02cb2dbdbcedbfb0bfd33a34f243a62122bd60739f3c465f0b44f3e650bfa1be12"
                        ]
                    }
                ],
                 "outputs": [
                    {
                         "addresses": [
                             "1Ep36WYw8LctrT7XhQpYuzWVQZeQWZFi5q"
                        ],
                         "scriptType": "P2PKH",
                         "voutIndex": 0,
                         "valueSat": 347517,
                         "value": 0.00347517,
                         "fromCoinbase": false,
                         "spent": false,
                         "spentBlockHeight": -1,
                         "spentBlockHash": "",
                         "spentTxhash": "",
                         "spentVinIndex": -1,
                         "spentBlocktime": -1,
                         "scriptAsm": "OP_DUP OP_HASH160 977eef27fb7cec70417c9f0545a96e7fe5b3a1c6 OP_EQUALVERIFY OP_CHECKSIG",
                         "scriptHex": "76a914977eef27fb7cec70417c9f0545a96e7fe5b3a1c688ac",
                         "outputType": "Spendable"
                    },
                    {
                         "addresses": [
                             "325TBWEEv5dpBvCppYGKfoEshro6PP64np"
                        ],
                         "scriptType": "P2SH",
                         "voutIndex": 1,
                         "valueSat": 6217,
                         "value": 0.00006217,
                         "fromCoinbase": false,
                         "spent": true,
                         "spentBlockHeight": 602850,
                         "spentBlockHash": "0000000000000000000645e30db580cc132ed096669a84dd5192c654e0950f65",
                         "spentTxhash": "d77a269946f72c61aff995e16b457e73bed23a424c0162147b34c262b8f0f4b3",
                         "spentVinIndex": 0,
                         "spentBlocktime": 1573211898,
                         "scriptAsm": "OP_HASH160 043e3c4552688c5a4b5358bd50651457127a70fa OP_EQUAL",
                         "scriptHex": "a914043e3c4552688c5a4b5358bd50651457127a70fa87",
                         "outputType": "Spendable"
                    }
                ],
                 "lockTime": 0,
                 "coindaysDestroyed": 1467,
                 "sigops": 1,
                 "strippedSize": 140,
                 "virtualSize": 168,
                 "weight": 670,
                 "hasWitness": true,
                 "witnessHash": "f2191fdce43988b670f89e9cdedb71614a8163c18089e2f03a0f8da7717bb86a",
                 "feePerKwu": 746,
                 "feePerKvbyte": 2976,
                 "confirm": 1,
                 "realAddressBalance": 0
            }
        ]

       "extend": {
            "19tK9pC6ggFybYWwkGRcWDSKpT6MxsDWDJ": 
                "okex"],
            "19HBfMyc7VpwWqk66NJFeHz4Dz3SWeznN2": 
                "huobi",
                "id": "19HBfMyc7VpwWqk66NJFeHz4Dz3SWeznN2"
            }
        }

    }
 }

Response Parameters

Parameters Types Description
hash String Block hash
blocktime Long Block time
legalRate Double Exchange rate against fiat
index Long Transaction index
blockHash String Block hash
blockHeight Integer Block height
coinbase Boolean A coinbase transaction or not
size Integer Transaction size
version Long Version
doubleSpend Boolean Double flower or not
fee Long Cost, unit Satoshi
feePerKbyte Long Cost per kByte, unit Satoshi
inputsCount Integer Number of VIN
outputsCount Integer Number of VOUTS
inputsValue Double Total input
outputsValue Double Total output
realTransferValue Double Actual transaction amount
inputsValueSat Long Total input, unit Satoshi
outputsValueSat Long Total output, unit Satoshi
realTransferValueSat Long Total transaction volume
inputs Array Input list
prevAddresses String Array Previous output address
scriptType String Script type
vinIndex Integer Position in the transaction
prevBlockHeight Integer Height of previous block
prevTxhash String Previous output transaction hash
prevVoutIndex Integer Position of previous output in the transaction
prevValueSat Long Previous output quantity,unit Satoshi
prevValue Double Previous output quantity
prevBlocktime Long Previous output transaction time
prevScriptType String Previous output script type
scriptHex String Script data
scriptData String Script display data
sequence Long Input sequence
lifespan Integer Output lifetime
coindaysDestroyed Long Number of coins destroyed per day, unit Satoshi
witness String array Isolate witness signature data
outputs Array Output list
addresses String array Output address
scriptType String Script type
voutIndex Integer output location
valueSat Long Output quantity, unit Satoshi
value Double Output quantity
fromCoinbase Boolean A coinbase output or not
spent Boolean Has it been spent
spentBlockHeight Integer The height of the cost block
spentBlockHash String The hash of the cost block
spentTxhash String The hash of the cost transaction
spentVinIndex Integer The position of the cost input
spentBlocktime Long The time of the cost block
scriptAsm String Script asm
scriptHex String Script data
ouputType String The types of output are: spendable, segwit, unknown
lockTime Long Lock time
coindaysDestroyed Long Number of coins destroyed per day, unit Satoshi
sigops Integer Number of signatures in the transaction
strippedSize Integer Basic transaction size
virtualSize Integer Virtual Size
weight Integer weight
hasWitness Boolean Does it include isolated witness transactions
witnessHash String Quarantine witness hash
feePerKwu Long Unit cost per K weight, unit Satoshi
feePerKvbyte Long Cost per K virtual bytes in Satoshi
confirm Integer Confirmation number
realAddressBalance Double Address balance
extend Map Label map, address hash as key, value as label array

Query Large Transaction List

Query the large transaction list of a blockchain, and the transaction order is block height reverse and index positive by default.

HTTP Request

GET /api/explorer/v1/{chain}/transactions

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/transactions

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case of the symbol of the blockchain to be queried
queryString type String Yes Unique value: large, which means to query large transactions
queryString upperBound Long Yes Large amount limit boundary
downBound
queryString offset Integer No Start position, default 0
queryString limit Integer No Return the number of items, the default is 20
queryString sort String No Sort by field:desc/asc;The sorting fields supported are height and timestamp;Default height in reverse order

Example Response

 {
     "code": 0,
     "msg": "",
     "detailMsg": "",
     "data": {
         "total": 3196783,
         "scrollId": null,
         "hits": [
             {
                 "hash": "3bbcf905c61831b7558936e03ff5257baa6f6dcc629796cea7bf7af16acfb9b7",
                 "blocktime": 1573211898,
                 "legalRate": 64922,
                 "index": 2326,
                 "blockHash": "0000000000000000000645e30db580cc132ed096669a84dd5192c654e0950f65",
                 "blockHeight": 602850,
                 "coinbase": false,
                 "size": 250,
                 "version": 1,
                 "doubleSpend": false,
                 "fee": 500,
                 "feePerKbyte": 2000,
                 "inputsCount": 1,
                 "outputsCount": 2,
                 "inputsValue": 0.00354234,
                 "outputsValue": 0.00353734,
                 "realTransferValue": 0.00348017,
                 "inputsValueSat": 354234,
                 "outputsValueSat": 353734,
                 "realTransferValueSat": 348017,
                 "inputs": [
                     {
                         "prevBlockHash": "0000000000000000000efd376141e80ec85b8c3b57cd0dde9739806321b0d730",
                         "prevAddresses": [
                             "325TBWEEv5dpBvCppYGKfoEshro6PP64np"
                         ],
                         "scriptType": "P2SH_P2WPKH",
                         "vinIndex": 0,
                         "prevBlockHeight": 602849,
                         "prevTxhash": "1b3dad3bc83b3d518ee1eb6d9ffa83275a550e66a4263b2daedbcd3dcb21783e",
                         "prevVoutIndex": 0,
                         "prevValueSat": 354234,
                         "prevValue": 0.00354234,
                         "prevBlocktime": 1573211540,
                         "prevScriptType": "P2SH",
                         "scriptHex": "160014eaff5e6d6ce5fd8cbd2ee6cabc58c6e4973f046c",
                         "scriptData": "",
                         "sequence": 4294967293,
                         "lifespan": 358,
                         "coindaysDestroyed": 1467,
                         "witness": [
                             "3045022100c0a5b0e2708e42fbcc746e029da6616cfe78e8c5b2c448b833381ba12a168da702204ab212d7856a90d88d3911671a8c973e42fd0b19842a86741475c9780b06403201",
                             "02cb2dbdbcedbfb0bfd33a34f243a62122bd60739f3c465f0b44f3e650bfa1be12"
                         ]
                     }
                 ],
                 "outputs": [
                     {
                         "addresses": [
                             "1Ep36WYw8LctrT7XhQpYuzWVQZeQWZFi5q"
                         ],
                         "scriptType": "P2PKH",
                         "voutIndex": 0,
                         "valueSat": 347517,
                         "value": 0.00347517,
                         "fromCoinbase": false,
                         "spent": false,
                         "spentBlockHeight": -1,
                         "spentBlockHash": "",
                         "spentTxhash": "",
                         "spentVinIndex": -1,
                         "spentBlocktime": -1,
                         "scriptAsm": "OP_DUP OP_HASH160 977eef27fb7cec70417c9f0545a96e7fe5b3a1c6 OP_EQUALVERIFY OP_CHECKSIG",
                         "scriptHex": "76a914977eef27fb7cec70417c9f0545a96e7fe5b3a1c688ac",
                         "outputType": "Spendable"
                     },
                     {
                         "addresses": [
                             "325TBWEEv5dpBvCppYGKfoEshro6PP64np"
                         ],
                         "scriptType": "P2SH",
                         "voutIndex": 1,
                         "valueSat": 6217,
                         "value": 0.00006217,
                         "fromCoinbase": false,
                         "spent": true,
                         "spentBlockHeight": 602850,
                         "spentBlockHash": "0000000000000000000645e30db580cc132ed096669a84dd5192c654e0950f65",
                         "spentTxhash": "d77a269946f72c61aff995e16b457e73bed23a424c0162147b34c262b8f0f4b3",
                         "spentVinIndex": 0,
                         "spentBlocktime": 1573211898,
                         "scriptAsm": "OP_HASH160 043e3c4552688c5a4b5358bd50651457127a70fa OP_EQUAL",
                         "scriptHex": "a914043e3c4552688c5a4b5358bd50651457127a70fa87",
                         "outputType": "Spendable"
                     }
                 ],
                 "lockTime": 0,
                 "coindaysDestroyed": 1467,
                 "sigops": 1,
                 "strippedSize": 140,
                 "virtualSize": 168,
                 "weight": 670,
                 "hasWitness": true,
                 "witnessHash": "f2191fdce43988b670f89e9cdedb71614a8163c18089e2f03a0f8da7717bb86a",
                 "feePerKwu": 746,
                 "feePerKvbyte": 2976,
                 "confirm": 1,
                 "realAddressBalance": 0
             }
         ]
     }
 }

Response Parameters

Parameters Types Description
hash String Block hash
blocktime Long Block time
legalRate Double Exchange rate against fiat
index Long Transaction index
blockHash String Block hash
blockHeight Integer Block height
coinbase Boolean A coinbase transaction or not
size Integer Transaction size
version Long Version
doubleSpend Boolean Double flower or not
fee Long Cost, unit Satoshi
feePerKbyte Long Cost per kByte, unit Satoshi
inputsCount Integer Number of VIN
outputsCount Integer Number of VOUTS
inputsValue Double Total input
outputsValue Double Total output
realTransferValue Double Actual transaction amount
inputsValueSat Long Total input, unit Satoshi
outputsValueSat Long Total output, unit Satoshi
realTransferValueSat Long Total transaction volume
inputs Array Input list
prevAddresses String Array Previous output address
scriptType String Script type
vinIndex Integer Position in the transaction
prevBlockHeight Integer Height of previous block
prevTxhash String Previous output transaction hash
prevVoutIndex Integer Position of previous output in the transaction
prevValueSat Long Previous output quantity,unit Satoshi
prevValue Double Previous output quantity
prevBlocktime Long Previous output transaction time
prevScriptType String Previous output script type
scriptHex String Script data
scriptData String Script display data
sequence Long Input sequence
lifespan Integer Output lifetime
coindaysDestroyed Long Number of coins destroyed per day, unit Satoshi
witness String array Isolate witness signature data
outputs Array Output list
addresses String array Output address
scriptType String Script type
voutIndex Integer output location
valueSat Long Output quantity, unit Satoshi
value Double Output quantity
fromCoinbase Boolean A coinbase output or not
spent Boolean Has it been spent
spentBlockHeight Integer The height of the cost block
spentBlockHash String The hash of the cost block
spentTxhash String The hash of the cost transaction
spentVinIndex Integer The position of the cost input
spentBlocktime Long The time of the cost block
scriptAsm String Script asm
scriptHex String Script data
ouputType String The types of output are: spendable, segwit, unknown
lockTime Long Lock time
coindaysDestroyed Long Number of coins destroyed per day, unit Satoshi
sigops Integer Number of signatures in the transaction
strippedSize Integer Basic transaction size
virtualSize Integer Virtual Size
weight Integer weight
hasWitness Boolean Does it include isolated witness transactions
witnessHash String Quarantine witness hash
feePerKwu Long Unit cost per K weight, unit Satoshi
feePerKvbyte Long Cost per K virtual bytes in Satoshi
confirm Integer Confirmation number
realAddressBalance Double Address balance

Query Unconfirmed Transaction List

Query the unconfirmed transaction list of a blockchain, and the default blocktime is in reverse order.

HTTP Request

GET /api/explorer/v1/{chain}/transactions

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/transactions

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case of the symbol of the blockchain to be queried
queryString offset Integer No Start position, default 0
queryString limit Integer No Return the number of items, the default is 20
queryString sort String No The sorting rules are as follows: field:desc/asc By default, the transaction is sorted in reverse time stamp order
queryString type String No Unique value,"pending"

Example Response

  {
     "code": 0,
     "msg": "",
     "detailMsg": "",
     "data": {
         "total": 3196783,
         "scrollId": null,
         "hits": [
             {
                 "hash": "3bbcf905c61831b7558936e03ff5257baa6f6dcc629796cea7bf7af16acfb9b7",
                 "blocktime": 1573211898,
                 "legalRate": 64922,
                 "index": 2326,
                 "blockHash": "0000000000000000000645e30db580cc132ed096669a84dd5192c654e0950f65",
                 "blockHeight": 602850,
                 "coinbase": false,
                 "size": 250,
                 "version": 1,
                 "doubleSpend": false,
                 "fee": 500,
                 "feePerKbyte": 2000,
                 "inputsCount": 1,
                 "outputsCount": 2,
                 "inputsValue": 0.00354234,
                 "outputsValue": 0.00353734,
                 "realTransferValue": 0.00348017,
                 "inputsValueSat": 354234,
                 "outputsValueSat": 353734,
                 "realTransferValueSat": 348017,
                 "inputs": [
                     {
                         "prevBlockHash": "0000000000000000000efd376141e80ec85b8c3b57cd0dde9739806321b0d730",
                         "prevAddresses": [
                             "325TBWEEv5dpBvCppYGKfoEshro6PP64np"
                         ],
                         "scriptType": "P2SH_P2WPKH",
                         "vinIndex": 0,
                         "prevBlockHeight": 602849,
                         "prevTxhash": "1b3dad3bc83b3d518ee1eb6d9ffa83275a550e66a4263b2daedbcd3dcb21783e",
                         "prevVoutIndex": 0,
                         "prevValueSat": 354234,
                         "prevValue": 0.00354234,
                         "prevBlocktime": 1573211540,
                         "prevScriptType": "P2SH",
                         "scriptHex": "160014eaff5e6d6ce5fd8cbd2ee6cabc58c6e4973f046c",
                         "scriptData": "",
                         "sequence": 4294967293,
                         "lifespan": 358,
                         "coindaysDestroyed": 1467,
                         "witness": [
                             "3045022100c0a5b0e2708e42fbcc746e029da6616cfe78e8c5b2c448b833381ba12a168da702204ab212d7856a90d88d3911671a8c973e42fd0b19842a86741475c9780b06403201",
                             "02cb2dbdbcedbfb0bfd33a34f243a62122bd60739f3c465f0b44f3e650bfa1be12"
                         ]
                     }
                 ],
                 "outputs": [
                     {
                         "addresses": [
                             "1Ep36WYw8LctrT7XhQpYuzWVQZeQWZFi5q"
                         ],
                         "scriptType": "P2PKH",
                         "voutIndex": 0,
                         "valueSat": 347517,
                         "value": 0.00347517,
                         "fromCoinbase": false,
                         "spent": false,
                         "spentBlockHeight": -1,
                         "spentBlockHash": "",
                         "spentTxhash": "",
                         "spentVinIndex": -1,
                         "spentBlocktime": -1,
                         "scriptAsm": "OP_DUP OP_HASH160 977eef27fb7cec70417c9f0545a96e7fe5b3a1c6 OP_EQUALVERIFY OP_CHECKSIG",
                         "scriptHex": "76a914977eef27fb7cec70417c9f0545a96e7fe5b3a1c688ac",
                         "outputType": "Spendable"
                     },
                     {
                         "addresses": [
                             "325TBWEEv5dpBvCppYGKfoEshro6PP64np"
                         ],
                         "scriptType": "P2SH",
                         "voutIndex": 1,
                         "valueSat": 6217,
                         "value": 0.00006217,
                         "fromCoinbase": false,
                         "spent": true,
                         "spentBlockHeight": 602850,
                         "spentBlockHash": "0000000000000000000645e30db580cc132ed096669a84dd5192c654e0950f65",
                         "spentTxhash": "d77a269946f72c61aff995e16b457e73bed23a424c0162147b34c262b8f0f4b3",
                         "spentVinIndex": 0,
                         "spentBlocktime": 1573211898,
                         "scriptAsm": "OP_HASH160 043e3c4552688c5a4b5358bd50651457127a70fa OP_EQUAL",
                         "scriptHex": "a914043e3c4552688c5a4b5358bd50651457127a70fa87",
                         "outputType": "Spendable"
                     }
                 ],
                 "lockTime": 0,
                 "coindaysDestroyed": 1467,
                 "sigops": 1,
                 "strippedSize": 140,
                 "virtualSize": 168,
                 "weight": 670,
                 "hasWitness": true,
                 "witnessHash": "f2191fdce43988b670f89e9cdedb71614a8163c18089e2f03a0f8da7717bb86a",
                 "feePerKwu": 746,
                 "feePerKvbyte": 2976,
                 "confirm": 1,
                 "realAddressBalance": 0
             }
         ]
     }
 }

Response Parameters

Parameters Types Description
hash String Block hash
blocktime Long Block time
legalRate Double Exchange rate against fiat
index Long Transaction index
blockHash String Block hash
blockHeight Integer Block height
coinbase Boolean A coinbase transaction or not
size Integer Transaction size
version Long Version
doubleSpend Boolean Double flower or not
fee Long Cost, unit Satoshi
feePerKbyte Long Cost per kByte, unit Satoshi
inputsCount Integer Number of VIN
outputsCount Integer Number of VOUTS
inputsValue Double Total input
outputsValue Double Total output
realTransferValue Double Actual transaction amount
inputsValueSat Long Total input, unit Satoshi
outputsValueSat Long Total output, unit Satoshi
realTransferValueSat Long Total transaction volume
inputs Array Input list
prevAddresses String Array Previous output address
scriptType String Script type
vinIndex Integer Position in the transaction
prevBlockHeight Integer Height of previous block
prevTxhash String Previous output transaction hash
prevVoutIndex Integer Position of previous output in the transaction
prevValueSat Long Previous output quantity,unit Satoshi
prevValue Double Previous output quantity
prevBlocktime Long Previous output transaction time
prevScriptType String Previous output script type
scriptHex String Script data
scriptData String Script display data
sequence Long Input sequence
lifespan Integer Output lifetime
coindaysDestroyed Long Number of coins destroyed per day, unit Satoshi
witness String array Isolate witness signature data
outputs Array Output list
addresses String array Output address
scriptType String Script type
voutIndex Integer output location
valueSat Long Output quantity, unit Satoshi
value Double Output quantity
fromCoinbase Boolean A coinbase output or not
spent Boolean Has it been spent
spentBlockHeight Integer The height of the cost block
spentBlockHash String The hash of the cost block
spentTxhash String The hash of the cost transaction
spentVinIndex Integer The position of the cost input
spentBlocktime Long The time of the cost block
scriptAsm String Script asm
scriptHex String Script data
ouputType String The types of output are: spendable, segwit, unknown
lockTime Long Lock time
coindaysDestroyed Long Number of coins destroyed per day, unit Satoshi
sigops Integer Number of signatures in the transaction
strippedSize Integer Basic transaction size
virtualSize Integer Virtual Size
weight Integer weight
hasWitness Boolean Does it include isolated witness transactions
witnessHash String Quarantine witness hash
feePerKwu Long Unit cost per K weight, unit Satoshi
feePerKvbyte Long Cost per K virtual bytes in Satoshi
confirm Integer Confirmation number
realAddressBalance Double Address balance

Large Transaction Push Interface with Label

Query the unconfirmed transaction list of a blockchain, and the default blocktime is in reverse order.

HTTP Request

GET /api/explorer/v1/{chain}/transactions/trade

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/transactions/trade

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case of the symbol of the blockchain to be queried
queryString tag String No Name of exchange
queryString offset integer No Start position, default 0
queryString limit integer No Return the number of items, the default is 20

Example Response

  {
    "code":0,
    "msg":"",
    "detailMsg":"",
    "data":{
            "total":100,
            "hits"[
                    {
                        "txHash":"asd23123354asdasd",
                        "txValue":21345.123,
                        "blocktime":27250301588841,
                        "from":"sasdsd1w3sds232423h",
                        "to":"23nn312n3msadasd31",
                        "fromTags":["okex"],
                        "toTags":["huobi"],
                        "fromLogoUrl":"https://sadasdasd.png",
                        "toLogoUrl":"https://sdaasda,png",
                        "oneFrom":true,
                        "oneTo":false,
                    } 
              ]  
    }
}

Response Parameters

Parameters Types Description
txhash String Transaction hash
txValue Double Transaction value
blocktime Long Block time
from String Enter the address
to String Output address
fromTags List<String> Enter address label
toTags List<String> Output address label
fromLogoUrl String Enter the address logo
toLogoUrl String Output address logo
oneFrom Boolean Is it an input address
oneTo Boolean Is it an output address

Address Interface

Query Address Information

Query the basic information of an address.

HTTP Requests

GET /api/explorer/v1/{chain}/addresses/{address}

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/addresses/{address}


Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case of the symbol of blockchain to be queried
Path address String Yes Address

Example Response

 {
     "code": 0,
     "msg": "",
     "detailMsg": "",
     "data": {
         "address": "bc1qn9enaxtnjhkypusvcmwqf5eg20nxss9gc90rnk",
         "balance": 0,
         "legalRate": 64922,
         "balanceSat": 0,
         "totalRecievedSat": 1099,
         "totalRecieved": 0.00001099,
         "totalSentSat": 1099,
         "totalSent": 0.00001099,
         "txCount": 2,
         "tags": 
         "unconfirmedTxCount": 0,
         "unconfirmedReceivedSat": 0,
         "unconfirmedSentSat": 0,
         "unspentTxCount": 0,
         "firstTransactionTime": 1570446359000,
         "lastTransactionTime": 1571840679000
     }
 }

Response Parameters

Parameters Types Description
address String Address hash
balance Double Balance
legalRate Double Exchange rate against fiat
balanceSat Long Transaction index
totalRecievedSat String Total reception (minimum accuracy)
totalRecieved Integer Total reception
totalSentSat Boolean Is it a coinbase transaction
totalSent Integer Total sending volume
txCount Long Number of transactions
tags Array Tag array
unconfirmedTxCount Boolean Number of unconfirmed transactions
unconfirmedReceivedSat Long Unacknowledged reception (minimum accuracy)
unconfirmedSentSat Long Unacknowledged sending (minimum accuracy)
unspentTxCount Long Numbers of transactions not spent
firstTransactionTime Long First transaction time
lastTransactionTime Long Last trading time

Query Address Transaction List

Query the transaction list of an address, including the unconfirmed transactions and confirmed transactions related to the address. The transaction sorting rule is that the unconfirmed transactions have high priority and are inverted according to the actual broadcast, and the confirmed transactions are inverted according to the block height.

HTTP Requests

GET /api/explorer/v1/{chain}/addresses/{address}/transactions

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/addresses/{address}/transactions


Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case of the symbol of blockchain to be queried
Path address String Yes Address
queryString offset Integer No Start position, default 0
queryString limit Integer No Return the number of items, the default is 20

Example Response

{
    "code": 0,
    "msg": "",
    "detailMsg": "",
    "data": {
        "total": 1,
        "hits": [
            {
                "hash": "5554fcec49e919347205aa6e7487d0d6b956ee505bbcf43739153070b8da618e",
                "blocktime": 1576355590,
                "legalRate": 10092.79,
                "index": 181,
                "blockHash": "0000000000000000000ff6ac728cedff8cbcd04e4d77e54de0aa77d10d9996b1",
                "blockHeight": 608141,
                "coinbase": false,
                "size": 257,
                "version": 2,
                "doubleSpend": false,
                "fee": 5140,
                "feePerKbyte": 20000,
                "inputsCount": 1,
                "outputsCount": 2,
                "inputsValue": 1499.0986048,
                "outputsValue": 1499.0985534,
                "realTransferValue": 1499.0986048,
                "inputsValueSat": 149909860480,
                "outputsValueSat": 149909855340,
                "realTransferValueSat": 149909860480,
                "inputs": [
                    {
                        "prevAddresses": [
                            "19tK9pC6ggFybYWwkGRcWDSKpT6MxsDWDJ"
                        ],
                        "scriptType": "P2PKH",
                        "vinIndex": 0,
                        "prevBlockHeight": 581174,
                        "prevTxhash": "0130cbdc86f81aedeb65afca20add3db8f92c296e7c92cb07cfbf9ac91265f02",
                        "prevVoutIndex": 0,
                        "prevValueSat": 149909860480,
                        "prevValue": 1499.0986048,
                        "prevBlocktime": 1560813252,
                        "prevScriptType": "P2PKH",
                        "scriptHex": "102301203",
                        "scriptData": "",
                        "sequence": 4294967293,
                        "lifespan": 15542338,
                        "coindaysDestroyed": 26967010661030
                    }
                ],
                "outputs": [
                    {
                        "addresses": [
                            "1AvtcQYQiwwJkHZsExVHmjf12qbCWR48t6"
                        ],
                        "scriptType": "P2PKH",
                        "voutIndex": 0,
                        "valueSat": 4000000000,
                        "value": 40.0,
                        "fromCoinbase": false,
                        "spent": true,
                        "spentBlockHeight": 608143,
                        "spentBlockHash": "0000000000000000000ca127a3835e0e1dc6608801bbe5b3bd9f374d2b1d4ccc",
                        "spentTxhash": "5f48c0f3c0cfcc88c263464841c74c4fd05b6f5ca181b28b8f5c11a358b54a12",
                        "spentVinIndex": 0,
                        "spentBlocktime": 1576357017,
                        "scriptAsm": "OP_DUP OP_HASH160 6cea42a0638e3caf79a1624a3649b8c996afba74 OP_EQUALVERIFY OP_CHECKSIG",
                        "scriptHex": "76a9146cea42a0638e3caf79a1624a3649b8c996afba7488ac",
                        "outputType": "Spendable"
                    },
                    {
                        "addresses": [
                            "19HBfMyc7VpwWqk66NJFeHz4Dz3SWeznN2"
                        ],
                        "scriptType": "P2PKH",
                        "voutIndex": 1,
                        "valueSat": 145909855340,
                        "value": 1459.0985534,
                        "fromCoinbase": false,
                        "spent": false,
                        "spentBlockHeight": -1,
                        "spentBlockHash": "",
                        "spentTxhash": "",
                        "spentVinIndex": -1,
                        "spentBlocktime": -1,
                        "scriptAsm": "OP_DUP OP_HASH160 5ad08fb4e4089987b68a20d681216ae8b3003963 OP_EQUALVERIFY OP_CHECKSIG",
                        "scriptHex": "76a9145ad08fb4e4089987b68a20d681216ae8b300396388ac",
                        "outputType": "Spendable"
                    }
                ],
                "lockTime": 608140,
                "coindaysDestroyed": 26967010661030,
                "sigops": 2,
                "strippedSize": 257,
                "virtualSize": 257,
                "weight": 1028,
                "hasWitness": false,
                "witnessHash": "",
                "feePerKwu": 5000,
                "feePerKvbyte": 20000,
                "confirm": 9769,
                "realAddressBalance": -149909860480
            }
        ],
        "extend": {
            "19tK9pC6ggFybYWwkGRcWDSKpT6MxsDWDJ": {
                "address": "19tK9pC6ggFybYWwkGRcWDSKpT6MxsDWDJ",
                "tag": "okex",
                "id": "19tK9pC6ggFybYWwkGRcWDSKpT6MxsDWDJ"
            },
            "19HBfMyc7VpwWqk66NJFeHz4Dz3SWeznN2": {
                "address": "19HBfMyc7VpwWqk66NJFeHz4Dz3SWeznN2",
                "tag": "huobi",
                "id": "19HBfMyc7VpwWqk66NJFeHz4Dz3SWeznN2"
            }
        }
    }
}

Response Parameters

Parameters Types Description
hash String Block hash
blocktime Long Block time
legalRate Double Exchange rate against fiat
index Long Transaction index
blockHash String Block hash
blockHeight Integer Block height
coinbase Boolean Is it a coinbase transaction
size Integer Transaction size
version Long Version
doubleSpend Boolean DoubleSpend or not
fee Long Fee, unit satoshi
feePerKbyte Long Fee per kByte, unit satoshi
inputsCount Integer Number of vin
outputsCount Integer Number of vout
inputsValue Double Total input
outputsValue Double Total output
realTransferValue Double Actual transaction amount
inputsValueSat Long Total input, unit satoshi
outputsValueSat Long Total output , unit satoshi
realTransferValueSat Long Total transaction volume
inputs Array Input list
prevAddresses String Array Previous output address
scriptType String Script type
vinIndex Integer Position in the transaction
prevBlockHeight Integer Height of previous block
prevTxhash String Transaction hash of previous output
prevVoutIndex Integer Position of previous output in the transaction
prevValueSat Long Previous output quantity ,unit Satoshi
prevValue Double Previous output quantity
prevBlocktime Long Previous output transaction time
prevScriptType String Previous output script type
scriptHex String Script data
scriptData String Script display data
sequence Long Input sequence
lifespan Integer Output lifetime
coindaysDestroyed Long Number of coins destroyed per day, unit Satoshi
witness String array Isolate witness signature data
outputs Array Output list
addresses String array Output address
scriptType String Script type
voutIndex Integer output location
valueSat Long Output quantity, unit satoshi
value Double Output quantity
fromCoinbase Boolean Is it a coinbase transaction
spent Boolean Has it been spent
spentBlockHeight Integer Cost block height
spentBlockHash String Cost block hash
spentTxhash String Spend transaction hash
spentVinIndex Integer Cost input location
spentBlocktime Long Block time spent
scriptAsm String Script asm
scriptHex String Script data
ouputType String The types of output are:spendable, segwit,unknow
lockTime Long Lock time
coindaysDestroyed Long The number of coins destroyed per day, unit satoshi
sigops Integer Number of signatures in the transaction
strippedSize Integer Basic transaction size
virtualSize Integer Virtual Size
weight Integer Weight
hasWitness Boolean Does it include isolated witness transactions
witnessHash String Quarantine witness hash
feePerKwu Long Unit cost per K weight, unit satoshi
feePerKvbyte Long Cost per K virtual bytes, unit satoshi
confirm Integer Confirmation
realAddressBalance Double Address balance
extend Map Label map, address hash is key

Query Rich Address Ranking Statistics

Query the address ranking information of a blockchain.

HTTP Requests

GET /api/explorer/v1/{chain}/richers

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/richers

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case of the symbol of blockchain to be queried
queryString offset Integer No Start position, default 0
queryString limit Integer No Return the number of items, the default is 20

Example Response

 {
     "code": 0,
     "msg": "",
     "detailMsg": "",
     "data": {
         "address": "bc1qn9enaxtnjhkypusvcmwqf5eg20nxss9gc90rnk",
         "balance": 0,
         "legalRate": 64922,
         "balanceSat": 0,
         "totalRecievedSat": 1099,
         "totalRecieved": 0.00001099,
         "totalSentSat": 1099,
         "totalSent": 0.00001099,
         "txCount": 2,
         "tags": ["okex"],
         "unconfirmedTxCount": 0,
         "unconfirmedReceivedSat": 0,
         "unconfirmedSentSat": 0,
         "unspentTxCount": 0,
         "firstTransactionTime": 1570446359000,
         "lastTransactionTime": 1571840679000,
         "richRank":1
     }
 }

Response Parameters

Parameters Types Description
address String Address hash
balance Double Balance
legalRate Double Exchange rate against fiat
balanceSat Long Transaction index
totalRecievedSat String Total reception (minimum accuracy)
totalRecieved Integer Total reception
totalSentSat Boolean Is it a coinbase transaction
totalSent Integer Total sending volume
txCount Long Number of transactions
tags Array Tag array
unconfirmedTxCount Boolean Number of unconfirmed transactions
unconfirmedReceivedSat Long Unacknowledged reception (minimum accuracy)
unconfirmedSentSat Long Unacknowledged sending (minimum accuracy)
unspentTxCount Long Numbers of transactions not spent
firstTransactionTime Long First transaction time
lastTransactionTime Long Last trading time
richRank Integer Address ranking

Query The List of Unused Transactions

Query a list of transactions whose addresses have not been spent.

HTTP Requests

v1/{chain}/addresses/{address}/unspent

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/addresses/{address}/unspent

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case of the symbol of blockchain to be queried
address address String Yes Address to be inquired
queryString offset Integer No Start position, default 0
queryString limit Integer No Return the number of items, the default is 20

Example Response

{
    "code":0,
    "msg":"",
    "detailMsg":"",
    "data":{
        "total":24,
        "hits":[
            {
                "txhash":"857986f3eb87b6eef6471e010f136d7dcdcf55bf0ffbe26a49fa293629f73639",
                "voutIndex":1,
                "blockHeightt":612057,
                "valueSat":848,
                "value":0.00000848,
                "address":"bc1qjl8uwezzlech723lpnyuza0h2cdkvxvh54v3dn",
                "scriptHex":"001497cfc76442fe717f2a3f0cc9c175f7561b661997",
                "fromCoinbase":false,
                "confirmations":10912
            }
        ],
        "extend":null
    }

Response Parameters

|Parameters | Types | Description | | | ----------- | -------- | ------------------------------------------------------------ | | txhash| String |Transaction hash |voutIndex |int| Index in trading |blockHeight |int| Block height |valueSat| Long| Address balance (minimum precision) |value| double| Address balance |address| String |Address |scriptHex| String |Script |fromCoinbase| Boolean |Is it from a coinbase transaction |confirmations| int|Number of confirmed transactions

Wallet Interface

Query Address Balance

Check the balance of the address according to the address.

HTTP Requests

GET /api/explorer/v1/{chain}/addresses/balance/{addresses}

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/addresses/balance/{addresses}


Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case symbol of blockchain to be queried
Path address String Yes Address to query balance (multiple addresses can be separated by commas)

Example Response

 {
     "code": 0,
     "msg": "",
     "detailMsg": "",
     "data": [
        {
            "address": "1FgM2PJkhuyeFQDz3jACiqgGezMFjQgasU",
            "balance": 0,
            "balanceSat": 0
        },
        {
            "address": "1UttWdiAd9PFrEnZc3tdjPafp4f7AAwnc",
            "balance": 0,
            "balanceSat": 0
        }
     ]
 }

Response Parameters

Parameters Types Description
address String Address to query balance
balance Double Balance
balanceSat BigInteger Minimum precision balance

Query the UTXO of the Address

Query the UTXO of the address according to the address.

HTTP Requests

GET /api/explorer/v1/{chain}/addresses/{address}/unspent

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/addresses/{address}/unspent


Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case symbol of blockchain to be queried
Path address String Yes Address to query balance
queryString offset Integer No Start position, default 0
queryString limit Integer No Return the number of items, 10 by default

Example Response

{
     "code": 0,
     "msg": "",
     "detailMsg": "",
     "data": {
        "total": 2,
        "hits":[
            {
                "txhash": "d77a269946f72c61aff995e16b457e73bed23a424c0162147b34c262b8f0f4b3",
                "voutIndex": 0,
                "blockHeight": 64922,
                "valueSat": 990000,
                "value": 0.99,
                "address": "bc1qn9enaxtnjhkypusvcmwqf5eg20nxss9gc90rnk",
                "scriptHex": "a914043e3c4552688c5a4b5358bd50651457127a70fa87",
                "fromCoinbase": false,
                "confirmations": 2
            },
            {
                "txhash": "d77a269946f72c61aff995e16b457e73bed23a424c0162147b34c262b8f0f4b3",
                "voutIndex": 0,
                "blockHeight": 64922,
                "valueSat": 990000,
                "value": 0.99,
                "address": "bc1qn9enaxtnjhkypusvcmwqf5eg20nxss9gc90rnk",
                "scriptHex": "a914043e3c4552688c5a4b5358bd50651457127a70fa87",
                "fromCoinbase": false,
                "confirmations": 2
            }
        ]
     }
 }

Response Parameters

Parameters Types Description
txhash String Transaction hash
voutIndex int Index in trading
valueSat Long Address balance (minimum precision)
blockHeight int Block height
value double Address balance
address String Address
scriptHex String Script
fromCoinbase Boolean Is it from a coinbase transaction
confirmations int Number of confirmed transactions

Broadcast Transaction

Broadcast transaction, synchronous interface.

HTTP Requests

POST /api/explorer/v1/{chain}/transaction/publish

Request Example

POST https://www.oklink.com/api/explorer/v1/{chain}/transaction/publish

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case symbol of blockchain to be queried
RequestBody signedTx String Yes Packaged transaction string
The form of json txHash String Optional Transaction hash

Example Response

 {
     "code": 0,
     "msg": "",
     "detailMsg": "",
     "data": {
        "txhash": d77a269946f72c61aff995e16b457e73bed23a424c0162147b34c262b8f0f4b3,
        "resultCode": 100,
        "resultMsg": "error info",
     }
 }

Response Parameters

Parameters Types Description
txhash String Transaction hash

Decode Transaction

Decode transaction

HTTP Requests

POST /api/explorer/v1/{chain}/transaction/decode

Request Example

POST https://www.oklink.com/api/explorer/v1/{chain}/transaction/decode

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case symbol of blockchain to be queried
RequestBody signedTx String Yes Packaged transaction string
The form of json txHash String Optional Transaction hash

Example Response

 {
    "code":0,
    "msg":"",
    "detailMsg":"",
    "data":{
        "m":{
            "txid":"81c8447bf780dacedf67c45908aafcde43c78ae108b3a06a278362ad306f7239",
            "hash":"81c8447bf780dacedf67c45908aafcde43c78ae108b3a06a278362ad306f7239",
            "version":1,
            "size":224,
            "vsize":224,
            "weight":896,
            "locktime":0,
            "vin":[
                {
                    "txid":"2555fe195e9de0a4725c9b76008e93bfb47d7a844309853a27a66a092ecf457c",
                    "vout":1,
                    "scriptSig":{
                        "asm":"12313[ALL]",
                        "hex":"12313"
                    },
                    "sequence":4294967295
                }
            ],
            "vout":[
                {
                    "value":0.00271,
                    "n":0,
                    "scriptPubKey":{
                        "asm":"OP_HASH160 7cfcfaae9ec7c505538c7bbfe23d6b3c9d7e0e0e OP_EQUAL",
                        "hex":"a9147cfcfaae9ec7c505538c7bbfe23d6b3c9d7e0e0e87",
                        "reqSigs":1,
                        "type":"scripthash",
                        "addresses":[
                            "3D5tmdpJe2tdNmosuLGNwMT9bcym34K3LT"
                        ]
                    }
                },
                {
                    "value":0.01981163,
                    "n":1,
                    "scriptPubKey":{
                        "asm":"OP_DUP OP_HASH160 de1f36251545fa30bb40d4d5288ceff3b25e2197 OP_EQUALVERIFY OP_CHECKSIG",
                        "hex":"76a914de1f36251545fa30bb40d4d5288ceff3b25e219788ac",
                        "reqSigs":1,
                        "type":"pubkeyhash",
                        "addresses":[
                            "1MFUQCaXzoQPkx6xrXbjrpmtnfZrStgQ3y"
                        ]
                    }
                }
            ]
        }
    }
} 

Response Parameters

Parameters Types Description
m object Returns a mapper object

Return to the list of defi items and basic lock information. At present, only Ethereum is supported.

GET /api/explorer/v1/{chain}/defi/list

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/defi/list

Parameter Scope Parameter Type Required Description
Path Chain String Yes eth
queryString category String No Return all items of this type, not all items

Example Response

{
    "code":0,
    "msg":"",
    "detailMsg":"",
    "data":{
        "total":10,
        "hits":[
            {
                "name":"Maker",
                "category":"Lending",
                "locked":1017144308,
                "lockedRate":0.41,
                "logoUrl":"http://static.bafang.com/cdn/explorer/defi/Maker.png",
                "totalLocked":null,
                "totalLend":null,
                "totalTxValue24h":null,
                "txValue24ChangeRate":null,
                "lendRate":0,
                "borrowRate":0.8935243138767099,
                "lockedDayChangeRate":4.83
            }
        ],
        "extend":{
            "totalLocked":2505455469
        }
    }
}
Parameters Types Description
name String Project name
category String Project category
secondCategory String Secondary classification(Mainly DEX projects)
underlyingAsset String Underlying asset(Mainly anchor assets)
locked Long Locked amount, unit dollar
lockedRate Double Locked rate
logoUrl String Logo URL
totalLocked Long Total locked
totalLend Double Total lend(Special field of mortgage loan item)
lendRate Double Interest rates on deposits(Special field of mortgage loan item)
borrowRate Double Borrowing rates(Special field of mortgage loan item)
timestamp Long Time stamp
lockedDayChangeRate Double Daily change rate of locked amount
lockedWeekChangeRate Double Weekly change rate of locked amount
lockedMonthChangeRate Double Monthly change rate of locked amount

Returns the details of a specific defi project.

GET /api/explorer/v1/{chain}/defi/info

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/defi/info

Parameter Scope Parameter Type Required Description
path chain String Yes eth
queryString name String Yes Returns the project information

Example Response

{
    "code":0,
    "msg":"",
    "detailMsg":"",
    "data":{
        "name":"Compound",
        "category":"Lending",
        "locked":782608208,
        "lockedRate":null,
        "logoUrl":"http://static.bafang.com/cdn/explorer/defi/Compound.png",
        "totalLocked":null,
        "totalLend":null,
        "totalTxValue24h":null,
        "txValue24ChangeRate":null,
        "lendRate":8.401478666154302,
        "borrowRate":10.780960217743807,
        "lockedDayChangeRate":8.33,
        "website":"https://compound.finance",
        "tokenSymbol":"COMP",
        "tokenAddress":"0xc00e94cb662c3520282e6f5717214004a7f26888",
        "tokenPrice":null,
        "tokenPriceChangeRate24h":null,
        "releaseTime":null,
        "location":"San Francisco, CA, US",
        "contractAddresses":[
            "0x5d3a536e4d6dbd6114cc1ead35777bab948e3643",
            "0x6c8c6b02e7b2be14d4fa6022dfd6d75921d90e4e",
            "0x39aa39c021dfbae8fac545936693ac917d5e7563",
            "0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b"
        ]
    }
}
Parameters Types Description
name String Project name
category String Project category
secondCategory String Secondary classification
underlyingAsset String Anchored assets
locked Long Locked amount, unit dollar
lockedRate Double Lock up proportion
userCount Long Number of users per day
txCount Long Number of transactions per day
logoUrl String Image URL
totalLocked Double Total locked
totalLend Double Total lend(Exclusive field of mortgage loan project)
txValue24h Double 24h trading volume
txValue24hChangeRate Double 24h trading volume change rate
lendRate Double Lend rate(Exclusive field of mortgage loan project)
borrowRate Double Borrow rate(Exclusive field of mortgage loan project)
liquidate24h Double 24h clearing volume
lockedRank Integer Locked ranking
lockedDayChangeRate Double Change rate of 24h locked
lockedWeekChangeRate Double Change rate of 7 days locked
lockedMonthChangeRate Double Change rate of 30 days locked
website String Website
tokenSymbol String Platform token symbol
tokenAddress String Platform token contract address
tokenPrice Double Platform token price
tokenPricePercentChange24h Double 24 hour price change rate
releaseTime Long Release time
logoUrl String Image URL
location String Location
contractAddresses List List of contract addresses
description String Project description
poster String Poster
movie String Movie links
twitter String Twitter group
discard String Discard group
telegram String Telegram group
github String GitHub links
auditOrganization String Audit organization
similarList List Similar projects

Returns the historical locked information of the DeFi project.

GET /api/explorer/v1/{chain}/defi/history

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/defi/history

Parameter Scope Parameter Type Required Description
Path Chain String Yes eth
queryString name String No Returns historical data for the corresponding time period of the project.
queryString category String No When name is empty, the historical data of this type of item is returned.
queryString period String No Return the corresponding historical data of the time period, which is 30 days by default.7 days return the data of each hour, others return the data of 8 points every day.1w=7 days, 1m=30 days, 3m=90 days, 1y= one year

Example Response

{
    "code":0,
    "msg":"",
    "detailMsg":"",
    "data":{
        "total":22,
        "hits":[
            {
                "projectName":"Compound",
                "type":"day",
                "category":"Lending",
                "lockedUsd":782608208,
                "lockedEth":149096258.17259303,
                "totalBtc":3755.163346,
                "totalEth":910045.728403,
                "totalDai":0,
                "userCount":0,
                "txCount":0,
                "timestamp":1595894400
            }
        ],
        "extend":{
            "totalLocked":782608208
        }
    }
}
Parameters Types Description
projectName String Project name
locked Long Locked amount, unit dollar
type String Type of statistics
timestamp Long Time stamp
totalLocked Double Total locked amount, when name!=Null, is the total locked amount of the project; When name=null, categrot=null, it represents the total locking amount of all projects; When name=null, category!=Null represents the total lock up amount of this type of project

Return to the list of items in the market value ranking, sorted by market value

GET /api/explorer/v1/{chain}/defi/marketcap/list

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/defi/marketcap/list

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case symbol of blockchain to be queried

Example Response

  {
    "code": 200,
    "msg": "success",
    "detailMsg": "",
    "data":[
        {
            "project" :"Chainlink",
            "symbol" :"LINK",
            "price" :23.3543,
            "marketCap" :234224211,
            "totalTxValue24h" :2342.234,
            "priceChange24h" : 0.1231,          
        }, 
        {
            "project" :"Chainlink",
            "symbol" :"LINK",
            "price" :23.3543,
            "marketCap" :234224211,
            "totalTxValue24h" :2342.234,
            "priceChange24h" : 0.1231,          
        }  
    ]
}
Parameters Types Description
code Integer Code
msg String Message
detailMsg String Information details
data List<Object> Data
> project String Project name
> symbol String Token type
> label String Label
> price double Price
> marketCap double Market cap
> totalTxValue24h double 24 hour trading value
> priceChange24h double 24 hour price change

Return to the list of various tokens of stable currency, sorted by circulation

GET /api/explorer/v1/{chain}/defi/stablecoin/list

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/defi/stablecoin/list

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case symbol of blockchain to be queried

Example Response

  {
    "code": 200,
    "msg": "success",
    "detailMsg": "",
    "data":[
        {
            "project" :"USDT",
            "circulation" :12361371,
            "addressCount" :1231231,
            "totalTxCount24h":1231,
            "totalTxValue24h" :2342123.234,
            "additional" : 1231.12       
        },
        {
            "project" :"USDT",
            "circulation" :12361371,
            "addressCount" :1231231,
            "totalTxCount24h":1231,
            "totalTxValue24h" :2342123.234,
            "additional" : 1231.12       
        }
    ]
}
Parameters Types Description
code Integer Code
msg String Message
detailMsg String Information details
data List<Object> Data
> project String Project name
> label String Label
> circulation Long Circulation
> addressCount Long Number of addresses holding currency
> totalTxCount24h Long 24 hour trading count
> totalTxValue24h Double 24 hour trading value
> additional Double Latest issuance
> additionalDate String Latest issuance time

Return the historical data statistics of total market cap of market value ranking

GET /api/explorer/v1/{chain}/defi/marketcap/chart

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/defi/marketcap/chart

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case symbol of blockchain to be queried
request period String No The time period of data displayed (1w/1m/3m/1y/all), default to one month (data of 7 days is displayed by hour)

Example Response

 {
    "code": 200,
    "msg": "success",
    "detailMsg": "",
    "data":[
        {
                "statisticDate":20200101,
                "marketCap":12352423.12341,
                "timestamp":123423424234
        },        
        {
                "statisticDate":20200101,
                "marketCap":12352423.12341,
                "timestamp":123423424234
        }   
    ]
}
Parameters Types Description
code Integer Code
msg String Message
detailMsg String Information details
data List<Object> Data
> statisticDate long Statistic date
> marketCap double Market cap
> timestamp long Time stamp

Return the line chart of historical data of the circulation of the stablecoin

GET /api/explorer/v1/{chain}/defi/stablecoin/chart

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/defi/stablecoin/chart

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case symbol of blockchain to be queried
request period String No The data time period displayed (1m/3m/1y/all) defaults 1m

Example Response

  {
    "code": 200,
    "msg": "success",
    "detailMsg": "",
    "data":[
        {
            "date": "20200810",
            "timestamp": 123123231,
            "totalCirculate": 123123123,
            "tokens":[
                {
                    "symbel":"ABC",
                    "project":"abc",
                    "circulation": 13213,
                    "percent": 0.1
                },
                {
                    "symbel":"ABCD",
                    "project":"abc",
                    "circulation": 13213,
                    "percent": 0.1
                },
                {
                    "symbel":"AODS",
                    "project":"ados",
                    "circulation": 13213,
                    "percent": 0.8
                }
            ]
        },
        {
            "date": "20200811",
            "timestamp": 123123231,
            "totalCirculate": 123123123,
            "tokens":[
                {
                    "symbel":"ABC",
                    "name":"abc",
                    "circulation": 13213,
                    "percent": 0.1
                },
                {
                    "symbel":"ABCD",
                    "name":"abc",
                    "circulation": 13213,
                    "percent": 0.1
                },
                {
                    "symbel":"AODS",
                    "name":"ados",
                    "circulation": 13213,
                    "percent": 0.8
                }
            ]
        }
    ]
}
Parameters Types Description
code Integer Code
msg String Message
detailMsg String Information details
data List<Object> Data
> date String Data
> timestamp Long Time stamp
> totalCirculate Long Total Circulation
> tokens List<Token> List of tokens
>> symbol String Symbol of tokens
>> project String Project name
>> circulation Long Circulation
>> percent Double Percentage

Returns a list of each token of the anchor currency, sorted by circulation

GET /api/explorer/v1/{chain}/defi/pegged/list

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/defi/pegged/list

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case symbol of blockchain to be queried

Example Response

  {
    "code": 200,
    "msg": "success",
    "detailMsg": "",
    "data":[
        {
            "project" :"Chainlink",
            "symbol" :"LINK",
            "circulation" :234224211,
            "marketCap" :2342.234,
            "additional" : 0.1231  
        },
        {
            "project" :"Chainlink",
            "symbol" :"LINK",
            "circulation" :234224211,
            "marketCap" :2342.234,
            "additional" : 0.1231  
        }
    ]
}
Parameters Types Description
code Integer Code
msg String Message
detailMsg String Information details
data List<Object> Data
> project String Project name
> symbol String Token type
> label String Label
> circulation Long Circulation
> marketCap Double Locked marketCap
> additional Double 24 hour change rate of circulation
> underlyingAsset String Underlying asset

Return the line chart of historical data of the circulation of each token of the anchor currency

GET /api/explorer/v1/{chain}/defi/anchor/chart

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/defi/anchor/chart

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case symbol of blockchain to be queried
request period String No The data time period displayed (1m/3m/1y/all) defaults 1m

Example Response

  {
    "code": 200,
    "msg": "success",
    "detailMsg": "",
    "data":[
        {
            "date": "20200810",
            "timestamp": 123123231,
            "totalCirculate": 123123123,
            "tokens":[
                {
                    "symbel":"ABC",
                    "project":"abc",
                    "circulation": 13213,
                    "percent": 0.1
                },
                {
                    "symbel":"ABCD",
                    "project":"abc",
                    "circulation": 13213,
                    "percent": 0.1
                },
                {
                    "symbel":"AODS",
                    "project":"ados",
                    "circulation": 13213,
                    "percent": 0.8
                }
            ]
        },
        {
            "date": "20200811",
            "timestamp": 123123231,
            "totalCirculate": 123123123,
            "tokens":[
                {
                    "symbel":"ABC",
                    "project":"abc",
                    "circulation": 13213,
                    "percent": 0.1
                },
                {
                    "symbel":"ABCD",
                    "project":"abc",
                    "circulate": 13213,
                    "percent": 0.1
                },
                {
                    "symbel":"AODS",
                    "project":"ados",
                    "circulation": 13213,
                    "percent": 0.8
                }
            ]
        }
    ]
}
Parameters Types Description
code Integer Code
msg String Message
detailMsg String Information details
data List<Object> Data
> date String Data
> timestamp Long Time stamp
> totalCirculate Long Total Circulation
> tokens List<Token> List of tokens
>> symbol String Symbol of tokens
>> project String Project name
>> circulation Long Circulation
>> percent Double Percentage

Returns the currency supported by each project and its deposit and borrowing interest rates.

GET /api/explorer/v1/{chain}/defi/project/rate

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/defi/project/rate


Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case symbol of blockchain to be queried
queryString name String No Project name, not transferred back to all mortgage loan project

Example Response

  {
    "code":0,
    "msg":"",
    "detailMsg":"",
    "data":[
        {
            "projectName":"Aave",
            "projectLogoUrl":"http://static.bafang.com/cdn/explorer/defi/Aave.png",
            "tokenList":[
                {
                    "symbol":"DAI",
                    "contractAddress":"0x6b175474e89094c44da98b954eedeac495271d0f",
                    "tokenLogoUrl":"https://oss.bafang.com/blockchain/ethToken/ETH_DAI_0x6b175474e89094c44da98b954eedeac495271d0f.jpg",
                    "borrowRate":null,
                    "supplyRate":null
                },
                {
                    "symbol":"USDC",
                    "contractAddress":"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
                    "tokenLogoUrl":"https://oss.bafang.com/blockchain/ethToken/ETH_USDC_0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.jpg",
                    "borrowRate":null,
                    "supplyRate":null
                }
            ]
        }
    ]
}
Parameters Types Description
projectName String Project name
projectLogoUrl String Project logo url
tokenList List Token list
symbol String Symbol
contractAddress String Contract address
tokenLogoUrl String Token logo
borrow_rate Double Borrowing interest rate
supply_rate Double Deposit interest rate

Returns the currency supported by each project and its deposit and borrowing interest rates.

GET /api/explorer/v1/{chain}/defi/token/rate

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/defi/token/rate

Parameter Scope Parameter Type Required Description
Path Chain String Yes Lower case symbol of blockchain to be queried
queryString symbol String No Token name, all token will not be returned

Example Response

  {
    "code": 0,
    "msg": "",
    "detailMsg": "",
    "data": {
        "ZRX": [
            "Compound":{
                "borrow_rate": 0.7975518197349599,
                "supply_rate": 0.059697601453138724,
                "logo_url": "http://static.bafang.com/cdn/explorer/defi/Compound.png"
            },
            "Aave":{
                "borrow_rate": 0.7975518197349599,
                "supply_rate": 0.059697601453138724,
                "logo_url": "http://static.bafang.com/cdn/explorer/defi/Aave.png"
            }
        ],
        "REP":[
            "Maker":{
                "borrow_rate": 0.7975518197349599,
                "supply_rate": 0.059697601453138724,
                "logo_url": "http://static.bafang.com/cdn/explorer/defi/Maker.png"
            },
            "Compound":{
                "borrow_rate": 0.7975518197349599,
                "supply_rate": 0.059697601453138724,
                "logo_url": "http://static.bafang.com/cdn/explorer/defi/Compound.png"
            },
            "Aave":{
                "borrow_rate": 0.7975518197349599,
                "supply_rate": 0.059697601453138724,
                "logo_url": "http://static.bafang.com/cdn/explorer/defi/Aave.png"
            }
        ]
    }
}
Parameters Types Description
borrow_rate Double Borrowing interest rate
supply_rate Double Deposit interest rate

GET /api/explorer/v1/{chain}/defi/farmings

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/defi/farmings

Parameter Scope Parameter Type Required Description
Path Chain String Yes eth
queryString project String No Filter project name
queryString sort String No Sort field:total_stake、daily_roi、yearly_roi
queryString order String No Sort order:asc/desc

Example Response

 {
    "code":0,
    "msg":"",
    "detailMsg":"",
    "data":{
        "total":4,
        "hits":[
            {
                "project":"Uniswap V2",
                "pairName":"ETH-WBTC",
                "rewards":[
                    "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984"
                ],
                "impermanentLoss":"High",
                "totalStake":640565761.9212956,
                "dailyRoi":0.04129808219178,
                "yearlyRoi":15.0738,
                "timestamp":1603879200,
                "projectLogo":"https://static.bafang.com/cdn/explorer/defi/uniswapv2
.png",
                "website":"https://app.uniswap.org",
                "rewardMap":{
                    "UNI":"0x1f9840a85d5af5bf1d1762f925bdaddc4201f984"
                }
            }
        ],
        "extend":null
    }
}
Parameters Types Description
project String Project name
pairName String Total locked amount
rewards
impermanentLoss String Risk level
totalStake Double Total stake
dailyRoi Double Daily yield
yearlyRoi Double Annual yield
timestamp Long Time stamp
projectLogo String Project logo
website Stiring Website
rewardMap Map Key rewards token, value is token contract

GET /api/explorer/v1/{chain}/defi/history

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/defi/history

Parameter Scope Parameter Type Required Description
Path Chain String Yes Eth
queryString category String Yes Fill in lending

Example Response

 {
    "code":0,
    "msg":"",
    "detailMsg":"",
    "data":[
        {
            "projectName":"Maker",
            "lockedUsd":132124.12,
            "totalLend":21313.21,
            "liquidate24h":213123.12,
            "timestamp":1599552000,
            "logo":"xxxxxxxxxxxx",
            "rank":1
        }
    ]
}
Parameters Types Description
projectName String Project Name
lockedUsd Double Total locked
totalLend Double Total borrowings
liquidate24h Double 24h Clearing volume
volume24h Double 24h Trading volume
logo String Logo url
rank int Rank

Download Interface

Download of Ordinary Transactions

HTTP Requests

GET /api/explorer/v1/{chain}/addresses/{hash}/transaction/download

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/addresses/{hash}/transaction/download


Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes ETH, currently only ETH is supported
path hash String Yes Address hash
queryString start long Yes Start timestamp 1601136000
queryString end long Yes End timestamp 1603814400

Response Parameters

Parameters Types Description
hash String Transaction hash
block Integer Block height
blocktime Long Block time
from String From address
to String To address
value Double Transaction amount ,unit ETH
fee Double Transaction handling fee, unit eth

Token Transfer Transaction Download

HTTP Requests

GET /api/explorer/v1/{chain}/addresses/{hash}/transfer/download

Request Example

Get https://www.oklink.com/api/explorer/v1/{chain}/addresses/{hash}/transfer/download

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes ETH, currently only ETH is supported
path hash String Yes Address hash (either a normal address or a contractual address)
queryString start long Yes Start timestamp 1601136000
queryString end long Yes End timestamp 1603814400

Response Parameters

Parameters Types Description
hash String Transaction hash
block Integer Block height
blocktime Long Block time
from String From address
to String To address
value Double Transaction value
symbol String Token of transaction

Internal Transaction Download

HTTP Requests

GET /api/explorer/v1/{chain}/addresses/{hash}/internal/download

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/addresses/{hash}/internal/download

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes ETH, currently only ETH is supported
path hash String Yes Address hash
queryString start long Yes Start timestamp 1601136000
queryString end long Yes End timestamp 1603814400

Response Parameters

Parameters Types Description
hash String Transaction hash
block Integer Block height
blocktime Long Block time
from String From address
to String To address
value Double Transaction value, unit$

Address Balance Download

HTTP Requests

GET /api/explorer/v1/{chain}/addresses/{hash}/held/download

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/addresses/{hash}/held/download

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes ETH, currently only ETH is supported
path hash String Yes Address hash, must be contract address

Response Parameters

Parameters Types Description
rank Integer Balance ranking
holder String Balance address
num Double Balance quantity
value Double Balance value, unit$
rate Double Balance proportion

ERC20 Token Transaction Transfer Download

HTTP Requests

GET /api/explorer/v1/{chain}/addresses/{hash}/erc20/download

Request Example

GET https://www.oklink.com/api/explorer/v1/{chain}/addresses/{hash}/erc20/download

Request Parameters

Parameter Scope Parameter Type Required Description
Path Chain String Yes ETH, currently only ETH is supported
path hash String Yes Address hash, must be ERC20 address
queryString start long Yes Start timestamp 1601136000
queryString end long Yes End timestamp 1601136000

Response Parameters

Parameters Types Description
hash String Transaction hash
block Integer Block height
blocktime Long Block time
from String From address
label String From label
to String To address
label String To label
value Double Number of token transfers
symbol String Erc20 token symbol

Query the Interface of the Supported Chain

HTTP Requests

GET /api/explorer/v1/info/summary

Request Example

GET https://www.oklink.com/api/explorer/v1/info/summary

Request Parameters

None

Example Response

{
    "code":0,
    "msg":"",
    "detailMsg":"",
    "data":[
        {
            "symbol":"BTC",
            "price":53343.47,
            "lastBlockTime":1619082444,
            "totalTransacationCount":635928118,
            "totalSupply":18687556.25,
            "totalSupplyPercent":0.889883630952381,
            "pendingTransactionCount":199857,
            "runTime":388076246392,
            "pricePercentChange24h":-0.03941595823549994,
            "height":680108
        },
        {
            "symbol":"OKEXCHAIN_TEST",
            "price":0,
            "lastBlockTime":1619053943000,
            "totalTransacationCount":45402317,
            "totalSupply":1002123882,
            "totalSupplyPercent":100.2123882,
            "pendingTransactionCount":0,
            "runTime":18796351405,
            "pricePercentChange24h":-0.060869565217391355,
            "height":2251099
        },
        {
            "symbol":"OKCHAIN_TEST",
            "price":0,
            "lastBlockTime":1619053943000,
            "totalTransacationCount":45402317,
            "totalSupply":1002123882,
            "totalSupplyPercent":100.2123882,
            "pendingTransactionCount":0,
            "runTime":18796351405,
            "pricePercentChange24h":-0.060869565217391355,
            "height":2251099
        },
        {
            "symbol":"OKEXCHAIN",
            "price":169.56,
            "lastBlockTime":1619053947000,
            "totalTransacationCount":403000,
            "totalSupply":11535930.5,
            "totalSupplyPercent":1.15359305,
            "pendingTransactionCount":0,
            "runTime":8399551419,
            "pricePercentChange24h":-0.060869565217391355,
            "height":2253726
        },
        {
            "symbol":"LTC",
            "price":262.013,
            "lastBlockTime":1619082664,
            "totalTransacationCount":67808152,
            "totalSupply":67488350,
            "totalSupplyPercent":0.8034327380952381,
            "pendingTransactionCount":141,
            "runTime":301110086429,
            "pricePercentChange24h":0.002582862040728691,
            "height":2039167
        },
        {
            "symbol":"BCH",
            "price":902.408,
            "lastBlockTime":1619081565,
            "totalTransacationCount":325615051,
            "totalSupply":18714825,
            "totalSupplyPercent":0.8911821428571428,
            "pendingTransactionCount":5668,
            "runTime":388076246439,
            "pricePercentChange24h":-0.03766755889221844,
            "height":684471
        },
        {
            "symbol":"BSV",
            "price":297.792,
            "lastBlockTime":1618240204,
            "totalTransacationCount":600813924,
            "totalSupply":18703187.5,
            "totalSupplyPercent":0.8906279761904762,
            "pendingTransactionCount":8,
            "runTime":388076246450,
            "pricePercentChange24h":-0.01566451041380894,
            "height":682609
        },
        {
            "symbol":"USDT",
            "price":1.00101,
            "lastBlockTime":1619082444,
            "totalTransacationCount":18973438,
            "totalSupply":37514219968.60655,
            "totalSupplyPercent":1,
            "pendingTransactionCount":1317,
            "runTime":0,
            "pricePercentChange24h":0.00033977235252381603,
            "height":680108
        },
        {
            "symbol":"ETH",
            "price":2437.138,
            "lastBlockTime":1619082725,
            "totalTransacationCount":1097831760,
            "totalSupply":115566627.59323,
            "totalSupplyPercent":1,
            "pendingTransactionCount":174805,
            "runTime":180884778480,
            "pricePercentChange24h":0.06192775378614413,
            "height":12289114
        },
        {
            "symbol":"DASH",
            "price":293.584,
            "lastBlockTime":1619082531,
            "totalTransacationCount":35291967,
            "totalSupply":10095037.70802254,
            "totalSupplyPercent":0.5341289792604519,
            "pendingTransactionCount":70,
            "runTime":228987133491,
            "pricePercentChange24h":-0.0835586582517616,
            "height":1458623
        },
        {
            "symbol":"ETC",
            "price":34.523,
            "lastBlockTime":1619082716,
            "totalTransacationCount":67656228,
            "totalSupply":127415605.83146189,
            "totalSupplyPercent":1,
            "pendingTransactionCount":8975,
            "runTime":183447978502,
            "pricePercentChange24h":0.04072711925720506,
            "height":12599046
        }
    ]
}

Response Parameters

Parameters Types Description
symbol String Symbol
price double Price
lastBlockTime long Last block time
totalTransacationCount Long Total transacation count
totalSupply double Total supply
totalSupplyPercent double Total supply percent
pendingTransactionCount Long Unsettled volume
pricePercentChange24h double Price percent change 24h
height Integer Height