false
false
0
The new Blockscout UI is now open source! Learn how to deploy it here

API Documentation

[ Base URL: ://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

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* nonconsensus blocks.

Curl

          
Request URL

          
Server Response

Code

Details

Response Body


            

Responses

Code

Description
200
successful operation

            

Result {

id
string
example: "1"
result
string
example: "767969"
jsonrpc
string
example: "2.0"

}

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
200
successful operation

            

Result {

message
string
example: "OK"
status
status
enum: ["0", "1"]
enum
interpretation
"0"
error
"1"
ok
result
wei
example: "663046792267785498951364"

}

200

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
200
successful operation

            

Result {

message
string
example: "OK"
status
status
enum: ["0", "1"]
enum
interpretation
"0"
error
"1"
ok
result
array
[AddressBalance]

}

AddressBalance {

address
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
balance
wei
example: "663046792267785498951364"
stale
boolean
example: true

}

200

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
200
successful operation

            

Result {

message
string
example: "OK"
status
status
enum: ["0", "1"]
enum
interpretation
"0"
error
"1"
ok
result
array
[Transaction]

}

Transaction {

input
input
example: "0x797af627d02e23b68e085092cd0d47d6cfb54be025f37b5989c0264398f534c08af7dea9"
value
wei
example: "663046792267785498951364"
hash
transaction hash
example: "0x9c81f44c29ff0226f835cd0a8a2f2a7eca6db52a711f8211b566fd15d3e0e8d4"
from
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
to
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
nonce
nonce
example: "0"
gas
gas
example: "122261"
blockHash
block hash
example: "0xd3cabad6adab0b52eb632c386ea194036805713682c62cb589b5abcd76de2159"
gasPrice
wei
example: "663046792267785498951364"
confirmations
confirmations
example: "6005998"
blockNumber
block number
example: "34092"
contractAddress
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
cumulativeGasUsed
gas
example: "122261"
gasUsed
gas
example: "122261"
isError
error
enum: ["0", "1"]
enum
interpretation
"0"
ok
"1"
error
timeStamp
timestamp
example: "1439232889"
transactionIndex
transaction index
example: "0"
txreceipt_status
status
enum: ["0", "1"]
enum
interpretation
"0"
error
"1"
ok

}

200

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

startblock

integer (query)

A nonnegative integer that represents the starting block number.

endblock

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
200
successful operation

            

Result {

message
string
example: "OK"
status
status
enum: ["0", "1"]
enum
interpretation
"0"
error
"1"
ok
result
array
[Transaction]

}

Transaction {

input
input
example: "0x797af627d02e23b68e085092cd0d47d6cfb54be025f37b5989c0264398f534c08af7dea9"
value
wei
example: "663046792267785498951364"
hash
transaction hash
example: "0x9c81f44c29ff0226f835cd0a8a2f2a7eca6db52a711f8211b566fd15d3e0e8d4"
from
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
to
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
nonce
nonce
example: "0"
gas
gas
example: "122261"
blockHash
block hash
example: "0xd3cabad6adab0b52eb632c386ea194036805713682c62cb589b5abcd76de2159"
gasPrice
wei
example: "663046792267785498951364"
confirmations
confirmations
example: "6005998"
blockNumber
block number
example: "34092"
contractAddress
address hash
example: "0x95426f2bc716022fcf1def006dbc4bb81f5b5164"
cumulativeGasUsed
gas
example: "122261"
gasUsed
gas
example: "122261"
isError
error
enum: ["0", "1"]
enum
interpretation
"0"
ok
"1"
error
timeStamp
timestamp
example: "1439232889"
transactionIndex
transaction index
example: "0"
txreceipt_status
status
enum: ["0", "1"]
enum
interpretation
"0"
error
"1"
ok

}

200

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

string (query)

Transaction hash. Hash of contents of the transaction. Optional parameter to filter results by a specific transaction hash.

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.

startblock

integer (query)

A nonnegative integer that represents the starting block number. WARNING: Only available if 'address' is provided.

endblock

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
200</