API文档
[ 基本网址: http:///api ]
该 API 是为将其应用程序从 Etherscan 过渡到 浏览器 的开发人员提供的。 它支持 GET 和 POST 请求。
Account ?module=account
Mimics Ethereum JSON RPC's eth_getBalance. Returns the balance as of the provided block (defaults to latest)
?module=account&action=eth_get_balance&address={addressHash}
eth_get_balance
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: account
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: eth_get_balance
address *必需
string (查询)
The address of the account.
block
string (查询)
Either the block number as a string, or one of latest, earliest or pending latest will be the latest balance in a *consensus* block. earliest will be the first recorded balance for the address. pending will be the latest balance in consensus *or* nonconcensus blocks.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- id
-
string
example: "1"
- jsonrpc
-
string
example: "2.0"
- result
-
string
example: "767969"
}
Get balance for address. Also available through a GraphQL 'addresses' query. If the balance hasn't been updated in a long time, we will double check with the node to fetch the absolute latest balance. This will not be reflected in the current request, but once it is updated, subsequent requests will show the updated balance. If you want to know whether or not we are checking for another balance, use the `balancemulti` action. That contains a property called `stale` that will let you know to recheck that balance in the near future.
?module=account&action=balance&address={addressHash}
balance
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: account
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: balance
address *必需
string (查询)
A 160-bit code used for identifying Accounts.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
-
wei
example: "663046792267785498951364"
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
error
Get balance for multiple addresses. Also available through a GraphQL 'addresses' query. If the balance hasn't been updated in a long time, we will double check with the node to fetch the absolute latest balance. This will not be reflected in the current request, but once it is updated, subsequent requests will show the updated balance. You can know that this is taking place via the `stale` attribute, which is set to `true` if a new balance is being fetched.
?module=account&action=balancemulti&address={addressHash1,addressHash2,addressHash3}
balancemulti
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: account
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: balancemulti
address *必需
string (查询)
A 160-bit code used for identifying Accounts. Separate addresses by comma. Maximum of 20 addresses.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
-
array
[AddressBalance]
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
AddressBalance {
- address
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- balance
-
wei
example: "663046792267785498951364"
- stale
-
boolean
example: true
}
error
Get pending transactions by address.
?module=account&action=pendingtxlist&address={addressHash}
pendingtxlist
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: account
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: pendingtxlist
address *必需
string (查询)
A 160-bit code used for identifying Accounts.
page
integer (查询)
A nonnegative integer that represents the page number to be used for pagination. 'offset' must be provided in conjunction.
offset
integer (查询)
A nonnegative integer that represents the maximum number of records to return when paginating. 'page' must be provided in conjunction.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
-
array
[Transaction]
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
Transaction {
- blockHash
-
block hash
example: "0xd3cabad6adab0b52eb632c386ea194036805713682c62cb589b5abcd76de2159"
- blockNumber
-
block number
example: "34092"
- confirmations
-
confirmations
example: "6005998"
- contractAddress
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- cumulativeGasUsed
-
gas
example: "122261"
- from
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- gas
-
gas
example: "122261"
- gasPrice
-
wei
example: "663046792267785498951364"
- gasUsed
-
gas
example: "122261"
- hash
-
transaction hash
example: "0x9c81f44c29ff0226f835cd0a8a2f2a7eca6db52a711f8211b566fd15d3e0e8d4"
- input
-
input
example: "0x797af627d02e23b68e085092cd0d47d6cfb54be025f37b5989c0264398f534c08af7dea9"
- isError
-
error
enum: ["0", "1"]
- enum
- interpretation
- "0"
- ok
- "1"
- error
- enum
- nonce
-
nonce
example: "0"
- timeStamp
-
timestamp
example: "1439232889"
- to
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- transactionIndex
-
transaction index
example: "0"
- txreceipt_status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
- value
-
wei
example: "663046792267785498951364"
}
error
Get transactions by address. Up to a maximum of 10,000 transactions. Also available through a GraphQL 'address' query.
?module=account&action=txlist&address={addressHash}
txlist
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: account
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: txlist
address *必需
string (查询)
A 160-bit code used for identifying Accounts.
sort
string (查询)
A string representing the order by block number direction. Defaults to descending order. Available values: asc, desc
start_block
integer (查询)
A nonnegative integer that represents the starting block number.
end_block
integer (查询)
A nonnegative integer that represents the ending block number.
page
integer (查询)
A nonnegative integer that represents the page number to be used for pagination. 'offset' must be provided in conjunction.
offset
integer (查询)
A nonnegative integer that represents the maximum number of records to return when paginating. 'page' must be provided in conjunction.
filter_by
string (查询)
A string representing the field to filter by. If none is given it returns transactions that match to, from, or contract address. Available values: to, from
start_timestamp
unix timestamp (查询)
Represents the starting block timestamp.
end_timestamp
unix timestamp (查询)
Represents the ending block timestamp.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
-
array
[Transaction]
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
Transaction {
- blockHash
-
block hash
example: "0xd3cabad6adab0b52eb632c386ea194036805713682c62cb589b5abcd76de2159"
- blockNumber
-
block number
example: "34092"
- confirmations
-
confirmations
example: "6005998"
- contractAddress
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- cumulativeGasUsed
-
gas
example: "122261"
- from
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- gas
-
gas
example: "122261"
- gasPrice
-
wei
example: "663046792267785498951364"
- gasUsed
-
gas
example: "122261"
- hash
-
transaction hash
example: "0x9c81f44c29ff0226f835cd0a8a2f2a7eca6db52a711f8211b566fd15d3e0e8d4"
- input
-
input
example: "0x797af627d02e23b68e085092cd0d47d6cfb54be025f37b5989c0264398f534c08af7dea9"
- isError
-
error
enum: ["0", "1"]
- enum
- interpretation
- "0"
- ok
- "1"
- error
- enum
- nonce
-
nonce
example: "0"
- timeStamp
-
timestamp
example: "1439232889"
- to
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- transactionIndex
-
transaction index
example: "0"
- txreceipt_status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
- value
-
wei
example: "663046792267785498951364"
}
error
Get internal transactions by transaction or address hash. Up to a maximum of 10,000 internal transactions. Also available through a GraphQL 'transaction' query.
?module=account&action=txlistinternal&txhash={transactionHash}
txlistinternal
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: account
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: txlistinternal
txhash *必需
string (查询)
Transaction hash. Hash of contents of the transaction. A transcation hash or address hash is required.
address
string (查询)
A 160-bit code used for identifying accounts. An address hash or transaction hash is required.
sort
string (查询)
A string representing the order by block number direction. Defaults to ascending order. Available values: asc, desc. WARNING: Only available if 'address' is provided.
start_block
integer (查询)
A nonnegative integer that represents the starting block number. WARNING: Only available if 'address' is provided.
end_block
integer (查询)
A nonnegative integer that represents the ending block number. WARNING: Only available if 'address' is provided.
page
integer (查询)
A nonnegative integer that represents the page number to be used for pagination. 'offset' must be provided in conjunction. WARNING: Only available if 'address' is provided.
offset
integer (查询)
A nonnegative integer that represents the maximum number of records to return when paginating. 'page' must be provided in conjunction. WARNING: Only available if 'address' is provided.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
-
array
[InternalTransaction]
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
InternalTransaction {
- blockNumber
-
block number
example: "34092"
- callType
-
type
example: "delegatecall"
- contractAddress
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- errCode
-
string
example: "Out of gas"
- from
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- gas
-
gas
example: "122261"
- gasUsed
-
gas
example: "122261"
- input
-
input
example: "0x797af627d02e23b68e085092cd0d47d6cfb54be025f37b5989c0264398f534c08af7dea9"
- isError
-
error
enum: ["0", "1"]
- enum
- interpretation
- "0"
- ok
- "1"
- rejected/cancelled
- enum
- timeStamp
-
timestamp
example: "1439232889"
- to
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- type
-
type
example: "create"
- value
-
wei
example: "663046792267785498951364"
}
error
Get token transfer events by address. Up to a maximum of 10,000 token transfer events. Also available through a GraphQL 'token_transfers' query.
?module=account&action=tokentx&address={addressHash}
tokentx
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: account
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: tokentx
address *必需
string (查询)
A 160-bit code used for identifying accounts.
contractaddress
string (查询)
A 160-bit code used for identifying contracts.
sort
string (查询)
A string representing the order by block number direction. Defaults to ascending order. Available values: asc, desc
start_block
integer (查询)
A nonnegative integer that represents the starting block number.
end_block
integer (查询)
A nonnegative integer that represents the ending block number.
page
integer (查询)
A nonnegative integer that represents the page number to be used for pagination. 'offset' must be provided in conjunction.
offset
integer (查询)
A nonnegative integer that represents the maximum number of records to return when paginating. 'page' must be provided in conjunction.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
-
array
[TokenTransfer]
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
TokenTransfer {
- blockHash
-
block hash
example: "0xd3cabad6adab0b52eb632c386ea194036805713682c62cb589b5abcd76de2159"
- blockNumber
-
block number
example: "34092"
- confirmations
-
confirmations
example: "6005998"
- contractAddress
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- cumulativeGasUsed
-
gas
example: "122261"
- from
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- gas
-
gas
example: "122261"
- gasPrice
-
wei
example: "663046792267785498951364"
- gasUsed
-
gas
example: "122261"
- hash
-
transaction hash
example: "0x9c81f44c29ff0226f835cd0a8a2f2a7eca6db52a711f8211b566fd15d3e0e8d4"
- input
-
input
example: "0x797af627d02e23b68e085092cd0d47d6cfb54be025f37b5989c0264398f534c08af7dea9"
- nonce
-
nonce
example: "0"
- timeStamp
-
timestamp
example: "1439232889"
- to
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- tokenDecimal
-
integer
example: "18"
- tokenID
-
integer
example: "0"
- tokenName
-
string
example: "Some Token Name"
- tokenSymbol
-
string
example: "SYMBOL"
- transactionIndex
-
transaction index
example: "0"
- value
-
integer
example: "663046792267785498951364"
}
error
Get token account balance for token contract address.
?module=account&action=tokenbalance&contractaddress={contractAddressHash}&address={addressHash}
tokenbalance
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: account
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: tokenbalance
contractaddress *必需
string (查询)
A 160-bit code used for identifying contracts.
address *必需
string (查询)
A 160-bit code used for identifying accounts.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
-
integer
example: "135499"
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
error
Get list of tokens owned by address.
?module=account&action=tokenlist&address={addressHash}
tokenlist
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: account
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: tokenlist
address *必需
string (查询)
A 160-bit code used for identifying accounts.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
-
array
[TokenBalance]
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
TokenBalance {
- balance
-
integer
example: "135499"
- contractAddress
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- decimals
-
integer
example: "18"
- name
-
string
example: "Some Token Name"
- symbol
-
string
example: "SYMBOL"
}
error
Get list of blocks mined by address.
?module=account&action=getminedblocks&address={addressHash}
getminedblocks
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: account
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: getminedblocks
address *必需
string (查询)
A 160-bit code used for identifying accounts.
page
integer (查询)
A nonnegative integer that represents the page number to be used for pagination. 'offset' must be provided in conjunction.
offset
integer (查询)
A nonnegative integer that represents the maximum number of records to return when paginating. 'page' must be provided in conjunction.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
-
array
[Block]
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
Block {
- blockNumber
-
block number
example: "34092"
- timeStamp
-
timestamp
example: "1480072029"
}
error
Get a list of accounts and their balances, sorted ascending by the time they were first seen by the explorer.
?module=account&action=listaccounts
listaccounts
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: account
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: listaccounts
page
integer (查询)
A nonnegative integer that represents the page number to be used for pagination. 'offset' must be provided in conjunction.
offset
integer (查询)
A nonnegative integer that represents the maximum number of records to return when paginating. 'page' must be provided in conjunction.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
-
array
[Account]
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
Account {
- address
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- balance
-
wei
example: "663046792267785498951364"
}
Logs ?module=logs
Get event logs for an address and/or topics. Up to a maximum of 1,000 event logs.
?module=logs&action=getLogs&fromBlock={blockNumber}&toBlock={blockNumber}&address={addressHash}&topic0={firstTopic}
getLogs
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: logs
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: getLogs
fromBlock *必需
integer (查询)
A nonnegative integer that represents the starting block number. The use of 'latest' is also supported.
toBlock *必需
integer (查询)
A nonnegative integer that represents the ending block number. The use of 'latest' is also supported.
address *必需
string (查询)
A 160-bit code used for identifying contracts. An address and/or topic{x} is required.
topic0 *必需
string (查询)
A string equal to the first topic. A topic{x} and/or address is required.
topic1
string (查询)
A string equal to the second topic. A topic{x} and/or address is required.
topic2
string (查询)
A string equal to the third topic. A topic{x} and/or address is required.
topic3
string (查询)
A string equal to the fourth topic. A topic{x} and/or address is required.
topic0_1_opr
string (查询)
A string representing the and|or operator for topic0 and topic1. Required if topic0 and topic1 is used. Available values: and, or
topic0_2_opr
string (查询)
A string representing the and|or operator for topic0 and topic2. Required if topic0 and topic2 is used. Available values: and, or
topic0_3_opr
string (查询)
A string representing the and|or operator for topic0 and topic3. Required if topic0 and topic3 is used. Available values: and, or
topic1_2_opr
string (查询)
A string representing the and|or operator for topic1 and topic2. Required if topic1 and topic2 is used. Available values: and, or
topic1_3_opr
string (查询)
A string representing the and|or operator for topic1 and topic3. Required if topic1 and topic3 is used. Available values: and, or
topic2_3_opr
string (查询)
A string representing the and|or operator for topic2 and topic3. Required if topic2 and topic3 is used. Available values: and, or
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
-
array
[Log]
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
Log {
- address
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- blockNumber
-
block number
example: "0x5c958"
- data
-
data
example: "0x"
- gasPrice
-
wei
example: "0xba43b7400"
- gasUsed
-
gas
example: "0x10682"
- logIndex
-
hexadecimal
example: "0x"
- timeStamp
-
timestamp
example: "0x561d688c"
- topics
-
topics
example: ["0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545"]
- transactionHash
-
transaction hash
example: "0x9c81f44c29ff0226f835cd0a8a2f2a7eca6db52a711f8211b566fd15d3e0e8d4"
- transactionIndex
-
hexadecimal
example: "0x"
}
error
Token ?module=token
Get ERC-20 or ERC-721 token by contract address.
?module=token&action=getToken&contractaddress={contractAddressHash}
getToken
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: token
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: getToken
contractaddress *必需
string (查询)
A 160-bit code used for identifying contracts.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
- Token
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
Token {
- cataloged
-
boolean
example: true
- contractAddress
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- decimals
-
integer
example: "18"
- name
-
string
example: "Some Token Name"
- symbol
-
string
example: "SYMBOL"
- totalSupply
-
integer
example: "1000000000"
- type
-
token type
enum: ["ERC-20", "ERC-721"]
- enum
- interpretation
- "ERC-20"
- ERC-20 token standard
- "ERC-721"
- ERC-721 token standard
- enum
}
error
Get token holders by contract address.
?module=token&action=getTokenHolders&contractaddress={contractAddressHash}
getTokenHolders
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: token
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: getTokenHolders
contractaddress *必需
string (查询)
A 160-bit code used for identifying contracts.
page
integer (查询)
A nonnegative integer that represents the page number to be used for pagination. 'offset' must be provided in conjunction.
offset
integer (查询)
A nonnegative integer that represents the maximum number of records to return when paginating. 'page' must be provided in conjunction.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
-
array
[Token holder Detail]
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
Token holder Detail {
- address
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- value
-
value
example: "1000000000000000000"
}
error
Stats ?module=stats
Get ERC-20 or ERC-721 token total supply by contract address.
?module=stats&action=tokensupply&contractaddress={contractAddressHash}
tokensupply
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: stats
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: tokensupply
contractaddress *必需
string (查询)
A 160-bit code used for identifying contracts.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
-
integer
example: "1000000000"
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
error
Get total supply in Wei from exchange.
?module=stats&action=ethsupplyexchange
ethsupplyexchange
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: stats
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: ethsupplyexchange
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
-
integer
example: "101959776311500000000000000"description: The total supply.
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
Get total supply in Wei from DB.
?module=stats&action=ethsupply
ethsupply
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: stats
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: ethsupply
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
-
integer
example: "101959776311500000000000000"description: The total supply in Wei from DB.
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
Get total coin supply from DB minus burnt number.
?module=stats&action=coinsupply
coinsupply
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: stats
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: coinsupply
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- result
-
integer
example: 101959776.3115description: The total supply from DB minus burnt number in coin dimension.
}
Get latest price of native coin in USD and BTC.
?module=stats&action=coinprice
coinprice
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: stats
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: coinprice
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
- CoinPrice
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
CoinPrice {
- coin_btc
-
coin_btc
example: "0.03161"
- coin_btc_timestamp
-
timestamp
example: "1537234460"
- coin_usd
-
coin_usd
example: "197.57"
- coin_usd_timestamp
-
timestamp
example: "1537234460"
}
Gets total transaction fees in Wei are paid by users to validators per day.
?module=stats&action=totalfees&date={date}
totalfees
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: stats
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: totalfees
date *必需
string (查询)
day in ISO 8601 format (yyyy-mm-dd)
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
- TotalFees
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
TotalFees {
- total_fees
-
total_fees
example: "75411956011480008034"
}
error
Block ?module=block
Get block reward by block number.
?module=block&action=getblockreward&blockno={blockNumber}
getblockreward
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: block
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: getblockreward
blockno *必需
integer (查询)
A nonnegative integer that represents the block number.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
- BlockReward
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
BlockReward {
- blockMiner
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- blockNumber
-
block number
example: "34092"
- blockReward
-
block reward
example: "5003251945421042780"
- timeStamp
-
timestamp
example: "1480072029"
- uncleInclusionReward
- null
- uncles
- null
}
error
Get Block Number by Timestamp.
?module=block&action=getblocknobytime×tamp={blockTimestamp}&closest={before/after}
getblocknobytime
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: block
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: getblocknobytime
timestamp *必需
integer (查询)
A nonnegative integer that represents the block timestamp (Unix timestamp in seconds).
closest *必需
string (查询)
Direction to find the closest block number to given timestamp. Available values: before/after.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
- BlockNo
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
BlockNo {
- blockNumber
-
block number
example: "34092"
}
error
Mimics Ethereum JSON RPC's eth_blockNumber. Returns the lastest block number
?module=block&action=eth_block_number
eth_block_number
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: block
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: eth_block_number
id
integer (查询)
A nonnegative integer that represents the json rpc request id.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful request
Result {
- id
-
string
example: "1"
- jsonrpc
-
string
example: "2.0"
- result
-
string
example: "767969"
}
Contract ?module=contract
Get a list of contracts, sorted ascending by the time they were first seen by the explorer. If you provide the filters `not_decompiled`(`4`) or `not_verified(4)` the results will not be sorted for performance reasons.
?module=contract&action=listcontracts
listcontracts
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: contract
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: listcontracts
page
integer (查询)
A nonnegative integer that represents the page number to be used for pagination. 'offset' must be provided in conjunction.
offset
integer (查询)
A nonnegative integer that represents the maximum number of records to return when paginating. 'page' must be provided in conjunction.
filter
string (查询)
verified|decompiled|unverified|not_decompiled|empty, or 1|2|3|4|5 respectively. This requests only contracts with that status.
not_decompiled_with_version
string (查询)
Ensures that none of the returned contracts were decompiled with the provided version. Ignored unless filtering for decompiled contracts.
verified_at_start_timestamp
unix timestamp (查询)
Represents the starting timestamp when contracts verified. Taking into account only with `verified` filter.
verified_at_end_timestamp
unix timestamp (查询)
Represents the ending timestamp when contracts verified. Taking into account only with `verified` filter.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
-
array
[Contract]
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
Contract {
- ABI
-
ABI
example: "[{ \"type\":\"event\", \"inputs\": [{\"name\":\"a\",\"type\":\"uint256\",\"indexed\":true},{\"name\":\"b\",\"type\":\"bytes32\",\"indexed\":false}], \"name\":\"Event\" }, { \"type\":\"event\", \"inputs\": [{\"name\":\"a\",\"type\":\"uint256\",\"indexed\":true},{\"name\":\"b\",\"type\":\"bytes32\",\"indexed\":false}], \"name\":\"Event2\" }, { \"type\":\"function\", \"inputs\": [{\"name\":\"a\",\"type\":\"uint256\"}], \"name\":\"foo\", \"outputs\": [] }]"
- Address
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- ContractName
-
string
example: "Some name"
- OptimizationUsed
-
optimization used
enum: ["0", "1"]
- enum
- interpretation
- "0"
- false
- "1"
- true
- enum
}
Get ABI for verified contract. Also available through a GraphQL 'addresses' query.
?module=contract&action=getabi&address={addressHash}
getabi
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: contract
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: getabi
address *必需
string (查询)
A 160-bit code used for identifying contracts.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
- abi
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
error
Get contract source code for verified contract. Also available through a GraphQL 'addresses' query.
?module=contract&action=getsourcecode&address={addressHash}
getsourcecode
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: contract
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: getsourcecode
address *必需
string (查询)
A 160-bit code used for identifying contracts.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
-
array
[Contract]
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
Contract {
- ABI
-
ABI
example: "[{ \"type\":\"event\", \"inputs\": [{\"name\":\"a\",\"type\":\"uint256\",\"indexed\":true},{\"name\":\"b\",\"type\":\"bytes32\",\"indexed\":false}], \"name\":\"Event\" }, { \"type\":\"event\", \"inputs\": [{\"name\":\"a\",\"type\":\"uint256\",\"indexed\":true},{\"name\":\"b\",\"type\":\"bytes32\",\"indexed\":false}], \"name\":\"Event2\" }, { \"type\":\"function\", \"inputs\": [{\"name\":\"a\",\"type\":\"uint256\"}], \"name\":\"foo\", \"outputs\": [] }]"
- Address
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- ContractName
-
string
example: "Some name"
- DecompiledSourceCode
-
contract decompiled source code
example: const name() = 'CryptoKitties' const GEN0_STARTING_PRICE() = 10^16 const GEN0_AUCTION_DURATION() = 86400 const GEN0_CREATION_LIMIT() = 45000 const symbol() = 'CK' const PROMO_CREATION_LIMIT() = 5000 def storage: ceoAddress is addr # mask(160, 0) at storage #0 cfoAddress is addr # mask(160, 0) at storage #1 stor1.768 is uint16 => uint256 # mask(256, 768) at storage #1 cooAddress is addr # mask(160, 0) at storage #2 stor2.0 is uint256 => uint256 # mask(256, 0) at storage #2 paused is uint8 # mask(8, 160) at storage #2 stor2.256 is uint256 => uint256 # mask(256, 256) at storage #2 stor3 is uint32 # ...<continues>
- DecompilerVersion
-
decompiler version
example: decompiler.version
- OptimizationUsed
-
optimization used
enum: ["0", "1"]
- enum
- interpretation
- "0"
- false
- "1"
- true
- enum
- SourceCode
-
contract source code
example: "pragma solidity >0.4.24; contract Test { constructor() public { b = hex"12345678901234567890123456789012"; } event Event(uint indexed a, bytes32 b); event Event2(uint indexed a, bytes32 b); function foo(uint a) public { emit Event(a, b); } bytes32 b; }"
}
error
Verify a contract with its source code and contract creation information.
curl POST example:
?module=contract&action=verify&addressHash={addressHash}&name={name}&compilerVersion={compilerVersion}&optimization={false}&contractSourceCode={contractSourceCode}
verify
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: contract
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: verify
addressHash *必需
string (查询)
The address of the contract.
name *必需
string (查询)
The name of the contract.
compilerVersion *必需
string (查询)
The compiler version for the contract.
optimization *必需
boolean (查询)
Whether or not compiler optimizations were enabled.
contractSourceCode *必需
string (查询)
The source code of the contract.
constructorArguments
string (查询)
The constructor argument data provided.
autodetectConstructorArguments
boolean (查询)
Whether or not automatically detect constructor argument.
evmVersion
string (查询)
The EVM version for the contract.
optimizationRuns
integer (查询)
The number of optimization runs used during compilation
library1Name
string (查询)
The name of the first library used.
library1Address
string (查询)
The address of the first library used.
library2Name
string (查询)
The name of the second library used.
library2Address
string (查询)
The address of the second library used.
library3Name
string (查询)
The name of the third library used.
library3Address
string (查询)
The address of the third library used.
library4Name
string (查询)
The name of the fourth library used.
library4Address
string (查询)
The address of the fourth library used.
library5Name
string (查询)
The name of the fourth library used.
library5Address
string (查询)
The address of the fourth library used.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Contract {
- ABI
-
ABI
example: "[{ \"type\":\"event\", \"inputs\": [{\"name\":\"a\",\"type\":\"uint256\",\"indexed\":true},{\"name\":\"b\",\"type\":\"bytes32\",\"indexed\":false}], \"name\":\"Event\" }, { \"type\":\"event\", \"inputs\": [{\"name\":\"a\",\"type\":\"uint256\",\"indexed\":true},{\"name\":\"b\",\"type\":\"bytes32\",\"indexed\":false}], \"name\":\"Event2\" }, { \"type\":\"function\", \"inputs\": [{\"name\":\"a\",\"type\":\"uint256\"}], \"name\":\"foo\", \"outputs\": [] }]"
- Address
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- ContractName
-
string
example: "Some name"
- OptimizationUsed
-
optimization used
enum: ["0", "1"]
- enum
- interpretation
- "0"
- false
- "1"
- true
- enum
}
error
Verify a contract through Sourcify.
a) if smart-contract already verified on Sourcify, it will automatically fetch the data from the repo
b) otherwise you have to upload source files and JSON metadata file(s).
POST body example:
Content-Disposition: form-data; name="addressHash"
0xb77b7443e0F32F1FEBf0BE0fBd7124D135d0a525
--6e1e4c11657c62dc1e4349d024de9e28
Content-Disposition: form-data; name="files[0]"; filename="contract.sol"
Content-Type: application/json
...Source code...
--6e1e4c11657c62dc1e4349d024de9e28
Content-Disposition: form-data; name="files[1]"; filename="metadata.json"
Content-Type: application/json
...JSON metadata...
--6e1e4c11657c62dc1e4349d024de9e28--
?module=contract&action=verify_via_sourcify&addressHash={addressHash}
verify_via_sourcify
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: contract
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: verify_via_sourcify
addressHash *必需
string (查询)
The address of the contract.
files
file[] (查询)
Array with sources and metadata files
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Contract {
- ABI
-
ABI
example: "[{ \"type\":\"event\", \"inputs\": [{\"name\":\"a\",\"type\":\"uint256\",\"indexed\":true},{\"name\":\"b\",\"type\":\"bytes32\",\"indexed\":false}], \"name\":\"Event\" }, { \"type\":\"event\", \"inputs\": [{\"name\":\"a\",\"type\":\"uint256\",\"indexed\":true},{\"name\":\"b\",\"type\":\"bytes32\",\"indexed\":false}], \"name\":\"Event2\" }, { \"type\":\"function\", \"inputs\": [{\"name\":\"a\",\"type\":\"uint256\"}], \"name\":\"foo\", \"outputs\": [] }]"
- Address
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- ContractName
-
string
example: "Some name"
- OptimizationUsed
-
optimization used
enum: ["0", "1"]
- enum
- interpretation
- "0"
- false
- "1"
- true
- enum
}
error
Verify a vyper contract with its source code and contract creation information.
curl POST example:
?module=contract&action=verify_vyper_contract&addressHash={addressHash}&name={name}&compilerVersion={compilerVersion}&contractSourceCode={contractSourceCode}
verify_vyper_contract
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: contract
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: verify_vyper_contract
addressHash *必需
string (查询)
The address of the contract.
name *必需
string (查询)
The name of the contract.
compilerVersion *必需
string (查询)
The compiler version for the contract.
contractSourceCode *必需
string (查询)
The source code of the contract.
constructorArguments
string (查询)
The constructor argument data provided.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Contract {
- ABI
-
ABI
example: "[{ \"type\":\"event\", \"inputs\": [{\"name\":\"a\",\"type\":\"uint256\",\"indexed\":true},{\"name\":\"b\",\"type\":\"bytes32\",\"indexed\":false}], \"name\":\"Event\" }, { \"type\":\"event\", \"inputs\": [{\"name\":\"a\",\"type\":\"uint256\",\"indexed\":true},{\"name\":\"b\",\"type\":\"bytes32\",\"indexed\":false}], \"name\":\"Event2\" }, { \"type\":\"function\", \"inputs\": [{\"name\":\"a\",\"type\":\"uint256\"}], \"name\":\"foo\", \"outputs\": [] }]"
- Address
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- ContractName
-
string
example: "Some name"
- OptimizationUsed
-
optimization used
enum: ["0", "1"]
- enum
- interpretation
- "0"
- false
- "1"
- true
- enum
}
error
Verify a contract with Standard input JSON file. Its interface the same as Etherscan's API endpoint
?module=contract&action=verifysourcecode&codeformat={solidity-standard-json-input}&contractaddress={contractaddress}&contractname={contractname}&compilerversion={compilerversion}&sourceCode={sourceCode}
verifysourcecode
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: contract
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: verifysourcecode
codeformat *必需
string (查询)
Format of sourceCode(supported only "solidity-standard-json-input")
contractaddress *必需
string (查询)
The address of the contract.
contractname *必需
string (查询)
The name of the contract. It could be empty string(""), just contract name("ContractName"), or filename and contract name("contracts/contract_1.sol:ContractName")
compilerversion *必需
string (查询)
The compiler version for the contract.
sourceCode *必需
string (查询)
Standard input json
constructorArguements
string (查询)
The constructor argument data provided.
autodetectConstructorArguments
boolean (查询)
Whether or not automatically detect constructor argument.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
UID {
- UID
-
string
example: b080b96bd06ad1c9341c2afb7e3730311388544961acde94
}
Return status of the verification attempt (works in addition to verifysourcecode method)
?module=contract&action=checkverifystatus&guid={identifierString}
checkverifystatus
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: contract
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: checkverifystatus
guid *必需
string (查询)
A string used for identifying verification attempt
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Status {
- status
-
string
example: `Pending in queue` | `Pass - Verified` | `Fail - Unable to verify` | `Unknown UID`
}
Transaction ?module=transaction
Get transaction info.
?module=transaction&action=gettxinfo&txhash={transactionHash}
gettxinfo
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: transaction
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: gettxinfo
txhash *必需
string (查询)
Transaction hash. Hash of contents of the transaction.
index
integer (查询)
A nonnegative integer that represents the log index to be used for pagination.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
- TransactionInfo
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
TransactionInfo {
- blockNumber
-
block number
example: "34092"
- confirmations
-
confirmations
example: "6005998"
- from
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- gasLimit
-
wei
example: "663046792267785498951364"
- gasPrice
-
wei
example: "663046792267785498951364"
- gasUsed
-
gas
example: "122261"
- hash
-
transaction hash
example: "0x9c81f44c29ff0226f835cd0a8a2f2a7eca6db52a711f8211b566fd15d3e0e8d4"
- input
-
input
example: "0x797af627d02e23b68e085092cd0d47d6cfb54be025f37b5989c0264398f534c08af7dea9"
- logs
-
array
[Log Detail]
- revertReason
-
revert_reason
example: "No credit of that type"
- success
-
boolean
example: true
- timeStamp
-
timestamp
example: "1439232889"
- to
-
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
- value
-
wei
example: "663046792267785498951364"
}
error
Get transaction receipt status. Also available through a GraphQL 'transaction' query.
?module=transaction&action=gettxreceiptstatus&txhash={transactionHash}
gettxreceiptstatus
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: transaction
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: gettxreceiptstatus
txhash *必需
string (查询)
Transaction hash. Hash of contents of the transaction.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
- TransactionReceiptStatus
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
TransactionReceiptStatus {
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- fail
- "1"
- pass
- enum
}
error
Get error status and error message. Also available through a GraphQL 'transaction' query.
?module=transaction&action=getstatus&txhash={transactionHash}
getstatus
参数
名称
描述
模块 *必需
字符串 (查询)
带有要调用的模块名称的字符串。
必须设置为: transaction
行动 *必需
字符串 (查询)
带有要调用的操作名称的字符串。
必须设置为: getstatus
txhash *必需
string (查询)
Transaction hash. Hash of contents of the transaction.
Curl
请求URL
服务器响应
代码
明细
响应体
响应
代码
描述
successful operation
Result {
- message
-
string
example: "OK"
- result
- TransactionStatus
- status
-
status
enum: ["0", "1"]
- enum
- interpretation
- "0"
- error
- "1"
- ok
- enum
}
TransactionStatus {
- errDescription
-
string
example: "Out of gas"
- isError
-
isError
enum: ["0", "1"]
- enum
- interpretation
- "0"
- pass
- "1"
- error
- enum
}
error