API Documentation
[ Base URL: https://localhost:4000/api ]
This API is provided for developers transitioning their applications from Etherscan to BlockScout. It supports GET and POST requests.
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
Parameters
Name
Description
Module *required
string (query)
A string with the name of the module to be invoked.
Must be set to: account
Action *required
string (query)
A string with the name of the action to be invoked.
Must be set to: eth_get_balance
address *required
string (query)
The address of the account.
block
string (query)
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
Request URL
Server Response
Code
Details
Response Body
Responses
Code
Description
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
Parameters
Name
Description
Module *required
string (query)
A string with the name of the module to be invoked.
Must be set to: account
Action *required
string (query)
A string with the name of the action to be invoked.
Must be set to: balance
address *required
string (query)
A 160-bit code used for identifying Accounts.
Curl
Request URL
Server Response
Code
Details
Response Body
Responses
Code
Description
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
Parameters
Name
Description
Module *required
string (query)
A string with the name of the module to be invoked.
Must be set to: account
Action *required
string (query)
A string with the name of the action to be invoked.
Must be set to: balancemulti
address *required
string (query)
A 160-bit code used for identifying Accounts. Separate addresses by comma. Maximum of 20 addresses.
Curl
Request URL
Server Response
Code
Details
Response Body
Responses
Code
Description
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
Parameters
Name
Description
Module *required
string (query)
A string with the name of the module to be invoked.
Must be set to: account
Action *required
string (query)
A string with the name of the action to be invoked.
Must be set to: pendingtxlist
address *required
string (query)
A 160-bit code used for identifying Accounts.
page
integer (query)
A nonnegative integer that represents the page number to be used for pagination. 'offset' must be provided in conjunction.
offset
integer (query)
A nonnegative integer that represents the maximum number of records to return when paginating. 'page' must be provided in conjunction.
Curl
Request URL
Server Response
Code
Details
Response Body
Responses
Code
Description
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
Parameters
Name
Description
Module *required
string (query)
A string with the name of the module to be invoked.
Must be set to: account
Action *required
string (query)
A string with the name of the action to be invoked.
Must be set to: txlist
address *required
string (query)
A 160-bit code used for identifying Accounts.
sort
string (query)
A string representing the order by block number direction. Defaults to descending order. Available values: asc, desc
start_block
integer (query)
A nonnegative integer that represents the starting block number.
end_block
integer (query)
A nonnegative integer that represents the ending block number.
page
integer (query)
A nonnegative integer that represents the page number to be used for pagination. 'offset' must be provided in conjunction.
offset
integer (query)
A nonnegative integer that represents the maximum number of records to return when paginating. 'page' must be provided in conjunction.
filter_by
string (query)
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 (query)
Represents the starting block timestamp.
end_timestamp
unix timestamp (query)
Represents the ending block timestamp.
Curl
Request URL
Server Response
Code
Details
Response Body
Responses
Code
Description
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
Parameters
Name
Description
Module *required
string (query)
A string with the name of the module to be invoked.
Must be set to: account
Action *required
string (query)
A string with the name of the action to be invoked.
Must be set to: txlistinternal
txhash *required
string (query)
Transaction hash. Hash of contents of the transaction. A transcation hash or address hash is required.
address
string (query)
A 160-bit code used for identifying accounts. An address hash or transaction hash is required.
sort
string (query)
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 (query)
A nonnegative integer that represents the starting block number. WARNING: Only available if 'address' is provided.
end_block
integer (query)
A nonnegative integer that represents the ending block number. WARNING: Only available if 'address' is provided.
page
integer (query)
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 (query)
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
Request URL
Server Response
Code
Details
Response Body
Responses
Code
Description
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
Parameters
Name
Description
Module *required
string (query)
A string with the name of the module to be invoked.
Must be set to: account
Action *required
string (query)
A string with the name of the action to be invoked.
Must be set to: tokentx
address *required
string (query)
A 160-bit code used for identifying accounts.
contractaddress
string (query)
A 160-bit code used for identifying contracts.
sort
string (query)
A string representing the order by block number direction. Defaults to ascending order. Available values: asc, desc
start_block
integer (query)
A nonnegative integer that represents the starting block number.
end_block
integer (query)
A nonnegative integer that represents the ending block number.
page
integer (query)
A nonnegative integer that represents the page number to be used for pagination. 'offset' must be provided in conjunction.
offset
integer (query)
A nonnegative integer that represents the maximum number of records to return when paginating. 'page' must be provided in conjunction.
Curl
Request URL
Server Response
Code
Details
Response Body
Responses
Code
Description
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"
- tokenIDs
-
array
[Token ID]
- tokenName
-
string
example: "Some Token Name"
- tokenSymbol
-
string
example: "SYMBOL"
- transactionIndex
-
transaction index
example: "0"
- value
-
integer
example: "663046792267785498951364"
- values
-
array
[Transferred amount]
}
error
Get token account balance for token contract address.
?module=account&action=tokenbalance&contractaddress={contractAddressHash}&address={addressHash}
tokenbalance
Parameters
Name
Description
Module *required
string (query)
A string with the name of the module to be invoked.
Must be set to: account
Action *required
string (query)
A string with the name of the action to be invoked.
Must be set to: tokenbalance
contractaddress *required
string (query)
A 160-bit code used for identifying contracts.
address *required
string (query)
A 160-bit code used for identifying accounts.
Curl
Request URL
Server Response
Code
Details
Response Body
Responses
Code
Description
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
Parameters
Name
Description
Module *required
string (query)
A string with the name of the module to be invoked.
Must be set to: account
Action *required
string (query)
A string with the name of the action to be invoked.
Must be set to: tokenlist
address *required
string (query)
A 160-bit code used for identifying accounts.
Curl
Request URL
Server Response
Code
Details
Response Body
Responses
Code
Description
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
Parameters
Name
Description
Module *required
string (query)
A string with the name of the module to be invoked.
Must be set to: account
Action *required
string (query)
A string with the name of the action to be invoked.
Must be set to: getminedblocks
address *required
string (query)
A 160-bit code used for identifying accounts.
page
integer (query)
A nonnegative integer that represents the page number to be used for pagination. 'offset' must be provided in conjunction.
offset
integer (query)
A nonnegative integer that represents the maximum number of records to return when paginating. 'page' must be provided in conjunction.
Curl
Request URL
Server Response
Code
Details
Response Body
Responses
Code
Description
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
Parameters
Name
Description
Module *required
string (query)
A string with the name of the module to be invoked.
Must be set to: account
Action *required
string (query)
A string with the name of the action to be invoked.
Must be set to: listaccounts
page
integer (query)
A nonnegative integer that represents the page number to be used for pagination. 'offset' must be provided in conjunction.
offset
integer (query)
A nonnegative integer that represents the maximum number of records to return when paginating. 'page' must be provided in conjunction.
Curl
Request URL
Server Response
Code
Details
Response Body
Responses
Code
Description
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
Parameters
Name
Description
Module *required
string (query)
A string with the name of the module to be invoked.
Must be set to: logs
Action *required
string (query)
A string with the name of the action to be invoked.
Must be set to: getLogs
fromBlock *required
integer (query)
A nonnegative integer that represents the starting block number. The use of 'latest' is also supported.
toBlock *required
integer (query)
A nonnegative integer that represents the ending block number. The use of 'latest' is also supported.
address *required
string (query)
A 160-bit code used for identifying contracts. An address and/or topic{x} is required.
topic0 *required
string (query)
A string equal to the first topic. A topic{x} and/or address is required.
topic1
string (query)
A string equal to the second topic. A topic{x} and/or address is required.
topic2
string (query)
A string equal to the third topic. A topic{x} and/or address is required.
topic3
string (query)
A string equal to the fourth topic. A topic{x} and/or address is required.
topic0_1_opr
string (query)
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 (query)
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 (query)
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 (query)
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 (query)
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 (query)
A string representing the and|or operator for topic2 and topic3. Required if topic2 and topic3 is used. Available values: and, or
Curl
Request URL
Server Response
Code
Details
Response Body
Responses
Code
Description
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
Parameters
Name
Description
Module *required
string (query)
A string with the name of the module to be invoked.
Must be set to: token
Action *required
string (query)
A string with the name of the action to be invoked.
Must be set to: getToken