?module=stats
This API is provided for developers transitioning applications from Etherscan to BlockScout and applications requiring general API and data support. It supports GET and POST requests.
The following modules are supported. Click through to see specific endpoints and parameters.
?module=account
?module=logs
?module=token
?module=stats
?module=block
?module=contract
?module=transaction
?module=token
getToken
Info on name, symbol, supply and type for a token contract address.
Example
https://fonscan.io/api
?module=token
&action=getToken
&contractaddress={contractaddressHash}getTokenHolders
Returns an array of token holder's accounts and amounts held for a specified token contract address.
Example
bridgedTokenList
Returns an array of bridged token information (uses native bridge application and only returns when applicable - depends on implementation).
Example
?module=logs
getLogs
Event logs for an address and topic. Use and/or with the topic operator to specify topic retrieval options when adding multiple topics. Up to a maximum of 1,000 event logs.
Example:
*=required field
offset
optional nonnegative integer representing the max number of records to return when paginating. 'page' must also be provided.
offset
optional nonnegative integer representing the max number of records to return when paginating. 'page' must also be provided.
contractaddress
string containing the contract address hash - a 160-bit code used for identifying contracts.
contractaddress
string containing the contract address hash of the ERC-20/ERC-721 token
page
chainID
nonnegative integer that represents the chain id where the original token exists.
page
{
"message": "OK",
"result": {
"cataloged": true,
"contractAddress": "0x0000000000000000000000000000000000000000",
"decimals": "18",
"name": "Example Token",
"symbol": "ET",
"totalSupply": "1000000000",
"type": "ERC-20"
},
"status": "1"
}optional nonnegative integer representing the page number used for pagination. 'offset' must also be provided.
optional nonnegative integer representing the page number used for pagination. 'offset' must also be provided.
{
"message": "OK",
"result": [
{
"address": "0x3887e82dbdbe8ec6db44e6298a2d48af572a3b78",
"value": "153737849289497644937838"
},
{
"address": "0xc894c5de34cb2a3615c737d1276876e44e9700a3",
"value": "77247336418828547887499"
}
],
"status": "1"
}{
"message": "OK",
"result": [
{
"foreignChainId": "1",
"foreignTokenContractAddressHash": "0x0ae055097c6d159879521c384f1d2123d1f195e6",
"homeContractAddressHash": "0xb7d311e2eb55f2f68a9440da38e7989210b9a05e",
"homeDecimals": "18",
"homeHolderCount": 393,
"homeName": "STAKE on xDai",
"homeSymbol": "STAKE",
"homeTotalSupply": "1484374.775044204093387391",
"homeUsdValue": "18807028.39981006586321824397"
},
{
"foreignChainId": "1",
"foreignTokenContractAddressHash": "0xf5581dfefd8fb0e4aec526be659cfab1f8c781da",
"homeContractAddressHash": "0xd057604a14982fe8d88c5fc25aac3267ea142a08",
"homeDecimals": "18",
"homeHolderCount": 73,
"homeName": "HOPR Token on xDai",
"homeSymbol": "HOPR",
"homeTotalSupply": "26600449.86076749062791602",
"homeUsdValue": "6638727.472651464170990256943"
}
],
"status": "1"
https://fonscan.io/api
?module=token
&action=getTokenHolders
&contractaddress={contractaddressHash}
&page={integer}
&offset={integer}https://fonscan.io/api
?module=token
&action=bridgedTokenList
&chainid={chainid}
&page={integer}
&offset={integer}fromBlock*
integer block number to start searching for logs. latest is also supported
toBlock*
integer block number to stop searching for logs. latest is also supported.
Note can be same as fromBlock if looking at logs for a single block
address*
string 160-bit code used for identifying contracts. An address and/or topic is required.
topic0*
string for first required topic.
{
"message": "OK",
"result": [
{
"address": "0x33990122638b9132ca29c723bdf037f1a891a70c",
"blockNumber": "0x5c958",
"data": "0x",
"gasPrice": "0xba43b7400",
"gasUsed": "0x10682",
"logIndex": "0x",
"timeStamp": "0x561d688c",
https://fonscan.io/api
?module=logs
&action=getLogs
&fromBlock=1379224
&toBlock=13792288
&address=0x33990122638b9132ca29c723bdf037f1a891a70c
&topic0=0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545
&topic1=0x72657075746174696f6e00000000000000000000000000000000000000000000
&topic0_1_opr=ortopic1
string for 2nd optional topic.
topic2
string for 3rd optional topic.
topic3
string for 4th optional topic.
topic0_1_opr
operator when topic 0 and 1 are used. Either and or or
topic0_2_opr
operator for topic 0 and topic 2. Either and or or
topic0_3_opr
operator for topic 0 and topic 3. Either and or or
topic1_2_opr
operator for topic 1 and topic 2. Either and or or
topic1_3_opr
the topic operator for topic 1 and topic 3. Either and or or
topic2_3_opr
the topic operator for topic 2 and topic 3. Either and or or
?module=transaction
gettxinfo
Information related to a specified transaction. Includes:
blockNumber
confirmations
from
gasLimit (in wei)
gasPrice (in wei)
gasUsed
hash
input
logs (array)
revert reason
success
timeStamp
to
value (in wei)
Example
gettxreceiptstatus
Also available through a GraphQL 'transaction' query. Status field return:
0 = failed transaction
1 = successful transaction
Example
getstatus
Also available through a GraphQL 'transaction' query. Includes the following:
errDescription: string with error message
isError
0 = pass, no error
1 = error
Example
https://fonscan.io/api
?module=transaction
&action=gettxinfo
&txhash={transactionHash}txhash
string containing the transaction hash
index
https://fonscan.io/api
?module=transaction
&action=gettxreceiptstatus
&txhash={transactionHash}txhash
string containing the transaction hash
{
"message": "OK",
"result": {
"status": "1"
},
"status": "1"
}https://fonscan.io/api
?module=transaction
&action=getstatus
&txhash={transactionHash}txhash
string containing the transaction hash
{
"message": "OK",
"result": {
"errDescription": "Out of gas",
"isError": "1"
},
"status": "1"
}optional nonnegative integer that represents the log index used for pagination.
{
"result": {
"revertReason": "No credit of that type",
"blockNumber": "3",
"confirmations": "0",
"from": "0x000000000000000000000000000000000000000c",
"gasLimit": "91966",
"gasPrice": "100000",
"gasUsed": "95123",
"hash": "0x0000000000000000000000000000000000000000000000000000000000000004",
"input": "0x04",
"logs": [
{
"address": "0x000000000000000000000000000000000000000e",
"data": "0x00",
"topics": [
"First Topic",
"Second Topic",
"Third Topic",
"Fourth Topic"
]
}
],
"success": true,
"timeStamp": "1541018182",
"to": "0x000000000000000000000000000000000000000d",
"value": "67612"
},
"status": "1"
}?module=contract
listcontracts
List sorted in ascending order based on the time a contact was first indexed by the explorer. With filters `not_decompiled`(`4`) or `not_verified(4)` the results will not be sorted for performance reasons.
Example:
https://fonscan.io/api
?module=contract
&action=listcontractsgetabi
Also available through a GraphQL addresses query.
Example:
getsourcecode
Also available through a GraphQL addresses query.
Example:
verify
Example:
Curl Post Example
verify_via_sourcify
if a smart contract is already verified on Sourcify, it will automatically fetch the data from the
otherwise you need to upload source files and JSON metadata file(s).
Example:
verify_vyper_contract
Example
curl POST example
verifysourcecode
Example
checkverifystatus
Example
verified_at_start_timestamp
optional unix timestamp Represents the starting timestamp for verified contracts. Only used with verified filter.
verified_at_end_timestamp
optional unix timestamp Represents the ending timestamp for verified contracts. Only used with verified filter.
name
string containing the name of the contract.
compilerVersion
string containing the compiler version for the contract.
optimization
enum whether or not compiler optimizations were enabled 0=false, 1=true
contractSourceCode
string containing the source code of the contract.
constructorArguments
optional string constructor argument data provided.
autodetectConstructorArguments
optional boolean whether or not automatically detect constructor argument.
evmVersion
optional EVM version for the contract.
optimizationRuns
optional number of optimization runs used during compilation
library1Name
optional string name of the first library used.
library1Address
optional string address of the first library used.
library2Name
optional string name of the second library used.
library2Address
optional string address of the second library used.
library3Name
optional string name of the third library used.
library3Address
optional string address of the third library used.
library4Name
optional string name of the fourth library used.
library4Address
optional string address of the fourth library used.
library5Name
optional string name of the fifth library used.
library5Address
optional string address of the fifth library used.
compilerVersion
string containing the compiler version for the contract.
contractSourceCode
string containing the source code of the contract.
constructorArguments
string constructor argument data provided.
string containing the address hash of the contract.
contractname
string name of the contract. It an be an empty string(""), just the contract name("ContractName"), or a filename and contract name("contracts/contract_1.sol:ContractName")
compilerversion
string containing the compiler version for the contract.
sourceCode
string standard input json
constructorArguments
optional string constructor argument data provided.
autodetectConstructorArguments
optional boolean whether or not automatically detect constructor argument.
page
optional nonnegative integer representing the page number used for pagination. 'offset' must also be provided.
offset
optional nonnegative integer representing the max number of records to return when paginating. 'page' must also be provided.
filter
optional string verified|decompiled|unverified|not_decompiled|empty, or 1|2|3|4|5 respectively. Returns contracts with the requested status.
not_decompiled_with_version
optional string ensures none of the returned contracts were decompiled with the provided version. Ignored unless filtering for decompiled contracts.
address
string containing the address hash.
address
string containing the address hash.
addressHash
string containing the address hash of the contract.
addressHash
string containing the address hash.
files
array with sources and metadata files
addressHash
string containing the address hash of the contract.
name
codeformat
Format of sourceCode (currently only supports solidity-standard-json-input)
guid
stringused for identifying verification attempt
{
"message": "OK",
"result": [
{
"ABI": "[{\n\"type\":\"event\",\n\"inputs\": [{\"name\":\"a\",\"type\":\"uint256\",\"indexed\":true},{\"name\":\"b\",\"type\":\"bytes32\",\"indexed\":false}],\n\"name\":\"Event\"\n}, {\n\"type\":\"event\",\n\"inputs\": [{\"name\":\"a\",\"type\":\"uint256\",\"indexed\":true},{\"name\":\"b\",\"type\":\"bytes32\",\"indexed\":false}],\n\"name\":\"Event2\"\n}, {\n\"type\":\"function\",\n\"inputs\": [{\"name\":\"a\",\"type\":\"uint256\"}],\n\"name\":\"foo\",\n\"outputs\": []\n}]\n",
"CompilerVersion": "v0.2.1-2016-01-30-91a6b35",
"ContractName": "Test",
"OptimizationUsed": "1",
"SourceCode": "pragma solidity >0.4.24;\n\ncontract Test {\nconstructor() public { b = hex\"12345678901234567890123456789012\"; }\nevent Event(uint indexed a, bytes32 b);\nevent Event2(uint indexed a, bytes32 b);\nfunction foo(uint a) public { emit Event(a, b); }\nbytes32 b;\n}\n"
}
],
"status": "1"
}On successful submission you will receive a guid as a receipt. Use this with checkverifystatusto view verification status.
guid is received as a receipt from the verifysourcecode method.
string containing the name of the contract.
contractaddress
{
"message": "OK",
"result": {
"ABI": "[{\n\"type\":\"event\",\n\"inputs\": [{\"name\":\"a\",\"type\":\"uint256\",\"indexed\":true},{\"name\":\"b\",\"type\":\"bytes32\",\"indexed\":false}],\n\"name\":\"Event\"\n}, {\n\"type\":\"event\",\n\"inputs\": [{\"name\":\"a\",\"type\":\"uint256\",\"indexed\":true},{\"name\":\"b\",\"type\":\"bytes32\",\"indexed\":false}],\n\"name\":\"Event2\"\n}, {\n\"type\":\"function\",\n\"inputs\": [{\"name\":\"a\",\"type\":\"uint256\"}],\n\"name\":\"foo\",\n\"outputs\": []\n}]\n",
"CompilerVersion": "v0.2.1-2016-01-30-91a6b35",
"ContractName": "Test",
"ImplementationAddress": "0x000000000000000000000000000000000000000e",
"IsProxy": "true",
"OptimizationUsed": "1",
"SourceCode": "pragma solidity >0.4.24;\n\ncontract Test {\nconstructor() public { b = hex\"12345678901234567890123456789012\"; }\nevent Event(uint indexed a, bytes32 b);\nevent Event2(uint indexed a, bytes32 b);\nfunction foo(uint a) public { emit Event(a, b); }\nbytes32 b;\n}\n"
},
"status": "1"
}{
"message": "OK",
"result": {
"ABI": "[{\n\"type\":\"event\",\n\"inputs\": [{\"name\":\"a\",\"type\":\"uint256\",\"indexed\":true},{\"name\":\"b\",\"type\":\"bytes32\",\"indexed\":false}],\n\"name\":\"Event\"\n}, {\n\"type\":\"event\",\n\"inputs\": [{\"name\":\"a\",\"type\":\"uint256\",\"indexed\":true},{\"name\":\"b\",\"type\":\"bytes32\",\"indexed\":false}],\n\"name\":\"Event2\"\n}, {\n\"type\":\"function\",\n\"inputs\": [{\"name\":\"a\",\"type\":\"uint256\"}],\n\"name\":\"foo\",\n\"outputs\": []\n}]\n",
"CompilerVersion": "v0.2.1-2016-01-30-91a6b35",
"ContractName": "Test",
"ImplementationAddress": "0x000000000000000000000000000000000000000e",
"IsProxy": "true",
"OptimizationUsed": "1",
"SourceCode": "pragma solidity >0.4.24;\n\ncontract Test {\nconstructor() public { b = hex\"12345678901234567890123456789012\"; }\nevent Event(uint indexed a, bytes32 b);\nevent Event2(uint indexed a, bytes32 b);\nfunction foo(uint a) public { emit Event(a, b); }\nbytes32 b;\n}\n"
},
"status": "1"
}{
"message": "OK",
"result": {
"ABI": "[{\n\"type\":\"event\",\n\"inputs\": [{\"name\":\"a\",\"type\":\"uint256\",\"indexed\":true},{\"name\":\"b\",\"type\":\"bytes32\",\"indexed\":false}],\n\"name\":\"Event\"\n}, {\n\"type\":\"event\",\n\"inputs\": [{\"name\":\"a\",\"type\":\"uint256\",\"indexed\":true},{\"name\":\"b\",\"type\":\"bytes32\",\"indexed\":false}],\n\"name\":\"Event2\"\n}, {\n\"type\":\"function\",\n\"inputs\": [{\"name\":\"a\",\"type\":\"uint256\"}],\n\"name\":\"foo\",\n\"outputs\": []\n}]\n",
"CompilerVersion": "v0.2.1-2016-01-30-91a6b35",
"ContractName": "Test",
"ImplementationAddress": "0x000000000000000000000000000000000000000e",
"IsProxy": "true",
"OptimizationUsed": "1",
"SourceCode": "pragma solidity >0.4.24;\n\ncontract Test {\nconstructor() public { b = hex\"12345678901234567890123456789012\"; }\nevent Event(uint indexed a, bytes32 b);\nevent Event2(uint indexed a, bytes32 b);\nfunction foo(uint a) public { emit Event(a, b); }\nbytes32 b;\n}\n"
},
"status": "1"
}
{
"message": "OK",
"result": "b080b96bd06ad1c9341c2afb7e3730311388544961acde94",
"status": "1"
}https://fonscan.io/api
?module=contract
&action=getabi
&address={addressHash}{
"message": "OK",
"result": "[{\"constant\":false,\"inputs\":[{\"name\":\"voucher_token\",\"type\":\"bytes32\"}],\"name\":\"burn\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"voucher_token\",\"type\":\"bytes32\"}],\"name\":\"is_expired\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"voucher_token\",\"type\":\"bytes32\"}],\"name\":\"is_burnt\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"voucher_token\",\"type\":\"bytes32\"},{\"name\":\"_lifetime\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}]",
"status": "1"
}https://fonscan.io/api
?module=contract
&action=getsourcecode
&address={addressHash}{
"message": "OK",
"result": {
"ABI": "[{\n\"type\":\"event\",\n\"inputs\": [{\"name\":\"a\",\"type\":\"uint256\",\"indexed\":true},{\"name\":\"b\",\"type\":\"bytes32\",\"indexed\":false}],\n\"name\":\"Event\"\n}, {\n\"type\":\"event\",\n\"inputs\": [{\"name\":\"a\",\"type\":\"uint256\",\"indexed\":true},{\"name\":\"b\",\"type\":\"bytes32\",\"indexed\":false}],\n\"name\":\"Event2\"\n}, {\n\"type\":\"function\",\n\"inputs\": [{\"name\":\"a\",\"type\":\"uint256\"}],\n\"name\":\"foo\",\n\"outputs\": []\n}]\n",
"CompilerVersion": "v0.2.1-2016-01-30-91a6b35",
"ContractName": "Test",
"FileName": "{sourcify path or empty}",
"ImplementationAddress": "0x000000000000000000000000000000000000000e",
"IsProxy": "true",
"OptimizationUsed": "1",
"SourceCode": "pragma solidity >0.4.24;\n\ncontract Test {\nconstructor() public { b = hex\"12345678901234567890123456789012\"; }\nevent Event(uint indexed a, bytes32 b);\nevent Event2(uint indexed a, bytes32 b);\nfunction foo(uint a) public { emit Event(a, b); }\nbytes32 b;\n}\n"
},
"status": "1"
}https://fonscan.io/api
?module=contract
&action=verify
&addressHash={addressHash}
&name={name}
&compilerVersion={compilerVersion}
&optimization={false}
&contractSourceCode={contractSourceCode}curl -d '{"addressHash":"0xc63BB6555C90846afACaC08A0F0Aa5caFCB382a1","compilerVersion":"v0.5.4+commit.9549d8ff", "contractSourceCode":"pragma solidity ^0.5.4; contract Test { }","name":"Test","optimization":false}' -H "Content-Type: application/json" -X POST "https://blockscout.com/poa/sokol/api?module=contract&action=verify"https://fonscan.io/api
?module=contract
&action=verify_via_sourcify
&addressHash={addressHash}--6e1e4c11657c62dc1e4349d024de9e28
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--https://fonscan.io/api
?module=contract
&action=verify_vyper_contract
&addressHash={addressHash}
&name={name}
&compilerVersion={compilerVersion}
&contractSourceCode={contractSourceCode}curl --location --request POST 'http://localhost:4000/api?module=contract&action=verify_vyper_contract' --form 'contractSourceCode="SOURCE_CODE"' --form 'name="Vyper_contract"' --form 'addressHash="0xE60B1B8bD493569a3E945be50A6c89d29a560Fa1"' --form 'compilerVersion="v0.2.12"'https://fonscan.io/api
?module=contract
&action=verifysourcecode
&codeformat={solidity-standard-json-input}
&contractaddress={contractaddress}
&contractname={contractname}
&compilerversion={compilerversion}
&sourceCode={sourceCode}https://fonscan.io/api
?module=contract
&action=checkverifystatus
&guid={identifierString}{
"message": "OK",
"result": "Pending in queue",
"status": "1"
}?module=block
getblockreward
Returns the block reward and 'uncle' block rewards when applicable.
Example:
https://fonscan.io/api
?module=block
&action=getblockreward
&blockno={blockNumber}getblocknobytime
Returns the block number created closest to a provided timestamp.
Example:
eth_block_number
Mimics Ethereum JSON RPC's eth_blockNumber.
Example:
More on .
blockno
integer block number to check block rewards for eg. 2165403
timestamp
integer representing the Unix timestamp in seconds.
closest
closest block to the provided timestamp, either before or after.
id
optional nonnegative integer that represents the json rpc request id.
{
"message": "OK",
"result": {
"blockMiner": "0x13a06d3dfe21e0db5c016c03ea7d2509f7f8d1e3",
"blockNumber": "2165403",
"blockReward": "5314181600000000000",
"timeStamp": "1472533979",
"uncleInclusionReward": null,
"uncles": null
},
"status": "1"
}{
"message": "OK",
"result": {
"blockNumber": "2165403"
},
"status": "1"
}https://fonscan.io/api
?module=block
&action=getblocknobytime
×tamp={blockTimestamp}
&closest={before/after}https://fonscan.io/api
?module=block
&action=eth_block_number{
"jsonrpc": "2.0",
"result": "0x103538a",
"id": 1
}?module=account
eth_get_balance
Mimics Ethereum JSON RPC's eth_getBalance
Example:
https://fonscan.io/api
?module=account
&action=eth_get_balance
&address={addressHash}balance
Many chains use their own native tokens. On Ethereum, this will return the result in "Ether", on Gnosis it will be "xDai", etc. Results are returned in wei.
Example:
balancemulti
Example:
pendingtxlist
Example:
txlist
Maximum of 10,000 transactions. Also available through a GraphQL 'address' query. For faster results, specify a smaller block range to search using the start_block and end_block parameters
Example:
txlistinternal
Up to a maximum of 10,000 internal transactions. Also available through a GraphQL 'transaction' query. For faster results, specify a smaller block range to search using the start_block and end_block parameters.
Example:
tokentx
Up to a maximum of 10,000 token transfer events. Also available through the GraphQL token_transfers query.
Example:
tokenbalance
Example:
tokenlist
Example:
getminedblocks
Example:
listaccounts
Lists accounts and native balances, sorted ascending by the time they were first seen by the explorer.
Example:
address
string containing the address hash.
block
optional. Block number as a string, or latest, earliest or pending
Latest is the latest balance in a consensus block. Earliest is the first recorded balance for the address. Pending is the latest balance in a consensus or nonconsensus block.
https://fonscan.io/api
?module=account
&action=balance
&address={addressHash}address
string containing the address hash.
{
"message": "OK",
"result": "663046792267785498951364",
"status": "1"
}https://fonscan.io/api
?module=account
&action=balancemulti
&address={addressHash1,addressHash2,addressHash3}address
string containing the address hash, comma separated. Max 20 addresses.
{
"message": "OK",
"result": [
{
"account": "0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a",
"balance": "40807168566070000000000",
"stale": true
},
{
"account": "0x63a9975ba31b0b9626b34300f7f627147df1f526",
"balance": "332567136222827062478",
"stale": false
},
{
"account": "0x198ef1ec325a96cc354c7266a038be8b5c558f67",
"balance": "185178830000000000",
"stale": false
}
],
"status": "1"
}https://fonscan.io/api
?module=account
&action=pendingtxlist
&address={addressHash}
&page=1
&offset=5address
string containing the address hash.
page
optional integer representing the page number used for pagination. 'offset' must also be provided.
https://fonscan.io/api
?module=account
&action=txlist
&address={addressHash}
&startblock=555555
&endblock=666666
&page=1
&offset=5
&sort=ascaddress
string containing the address hash.
sort
https://fonscan.io/api
?module=account
&action=txlistinternal
&txhash={transactionHash}
&startblock=555555
&endblock=666666
&page=1
&offset=5
&sort=asctxhash
string representing the transaction hash to check for internal transactions
address
https://fonscan.io/api
?module=account
&action=tokentx
&address={addressHash}
&page=1
&offset=10
&sort=ascaddress
string containing the address hash.
contract address
https://fonscan.io/api
?module=account
&action=tokenbalance
&contractaddress={contractAddressHash}
&address={addressHash}contract address
string containing the contract address hash.
address
string containing the account address hash to retrieve balance for.
https://fonscan.io/api
?module=account
&action=tokenlist
&address={addressHash}address
string containing the account address hash.
{
"message": "OK",
"result": [
{
"balance": "135499",
"contractAddress": "0x0000000000000000000000000000000000000000",
"decimals": "18",
"name": "Example Token",
"symbol": "ET",
"type": "ERC-20"
},
{
"balance": "1",
"contractAddress": "0x0000000000000000000000000000000000000001",
"decimals": "18",
"name": "Example ERC-721 Token",
"symbol": "ET7",
"type": "ERC-721"
}
],
"status": "1"
}https://fonscan.io/api
?module=account
&action=getminedblocks
&address={addressHash}contract address
string containing the contract address hash.
address
string containing the account address hash to retrieve balance for.
https://fonscan.io/api
?module=account
&action=listaccounts
&address={addressHash}
&page=1
&offset=3page
optional integer representing the page number used for pagination. 'offset' must also be provided.
offset
optional integer representing number of transactions returned per page. page must also be provided.
{
"id": 1,
"jsonrpc": "2.0",
"result": "0x0234c8a3397aab58"
}Also available through a GraphQL address query.
If the balance hasn't been updated recently, the node is double-checked 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 if there is a check 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.
Also available through a GraphQL 'addresses' query
If the balance hasn't been updated in a long time, the node is double checked to fetch the absolute latest balance. This is not reflected in the current request, but once it is updated, subsequent requests will show the updated balance. The stale attribute will be set to true if a new balance is being fetched.
If the balance hasn't been updated in a long time, the node is double checked to fetch the absolute latest balance. This is not reflected in the current request, but once it is updated, subsequent requests will show the updated balance. The stale attribute will be set to true if a new balance is being fetched.
offset
optional integer representing number of transactions returned per page. page must also be provided.
optional sorting preference, asc for ascending and desc for descending. Descending is default.
start_block
optional integer block number to start transaction search
end_block
optionalinteger block number to stop transaction search.
page
optional integer representing the page number used for pagination. offset must also be provided.
offset
optional integer representing number of transactions returned per page. page must also be provided.
filter_by
optional string representing the field to filter by. Values include to and from. If none provided returns transactions that match to, from, or contract address.
start_timestamp
optional starting block unix timestamp.
end_timestamp
optional ending block unix timestamp.
optional string containing the address hash.
sort
optional sorting preference, asc for ascending and desc for descending. Descending is default. Only available if 'address' is provided.
start_block
optional integer block number to start transaction search. Only available if 'address' is provided.
end_block
optionalinteger block number to stop transaction search. Only available if 'address' is provided.
page
optional integer representing the page number used for pagination. offset must also be provided. Only available if 'address' is provided.
offset
optional integer representing number of transactions returned per page. page must also be provided. Only available if 'address' is provided.
optional string with the token contract address to identify a contract.
sort
optional sorting preference, asc for ascending and desc for descending. Descending is default.
start_block
optional integer block number to start transaction search
end_block
optionalinteger block number to stop transaction search.
page
optional integer representing the page number used for pagination. offset must also be provided.
offset
optional integer representing number of transactions returned per page. page must also be provided.
"message": "OK",
"result": [
{
"contractAddress": "",
"cumulativeGasUsed": "122207",
"from": "0x3fb1cd2cd96c6d5c0b5eb3322d807b34482481d4",
"gas": "122261",
"gasPrice": "50000000000",
"gasUsed": "122207",
"hash": "0x98beb27135aa0a25650557005ad962919d6a278c4b3dde7f4f6a3a1e65aa746c",
"input": "0xf00d4b5d000000000000000000000000036c8cecce8d8bbf0831d840d7f29c9e3ddefa63000000000000000000000000c5a96db085dda36ffbe390f455315d30d6d3dc52",
"nonce": "0",
"to": "0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae",
"value": "0"
}
],
"status": "1"
}{
"message": "OK",
"result": [
{
"blockHash": "0x373d339e45a701447367d7b9c7cef84aab79c2b2714271b908cda0ab3ad0849b",
"blockNumber": "65204",
"confirmations": "5994246",
"contractAddress": "",
"cumulativeGasUsed": "122207",
"from": "0x3fb1cd2cd96c6d5c0b5eb3322d807b34482481d4",
"gas": "122261",
"gasPrice": "50000000000",
"gasUsed": "122207",
"hash": "0x98beb27135aa0a25650557005ad962919d6a278c4b3dde7f4f6a3a1e65aa746c",
"input": "0xf00d4b5d000000000000000000000000036c8cecce8d8bbf0831d840d7f29c9e3ddefa63000000000000000000000000c5a96db085dda36ffbe390f455315d30d6d3dc52",
"isError": "0",
"nonce": "0",
"timeStamp": "1439232889",
"to": "0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae",
"transactionIndex": "0",
"txreceipt_status": "1",
"value": "0"
}
],
"status": "1"
}{
"message": "OK",
"result": [
{
"blockNumber": "6153702",
"callType": "delegatecall",
"contractAddress": "0x883103875d905c11f9ac7dacbfc16deb39655361",
"errCode": "",
"from": "0x2ca1e3f250f56f1761b9a52bc42db53986085eff",
"gas": "814937",
"gasUsed": "536262",
"index": "0",
"input": "",
"isError": "0",
"timeStamp": "1534362606",
"to": "",
"transactionHash": "0xd65b788c610949704a5f9aac2228c7c777434dfe11c863a12306f57fcbd8cdbb",
"type": "call",
"value": "5488334153118633"
}
],
"status": "1"
}{
"message": "OK",
"result": [
{
"blockHash": "0x6169c5dc05d0051564ba3eae8ebfbdefda640c5f5ffc095846b8aed0b44f64ea",
"blockNumber": "5997843",
"confirmations": "199384",
"contractAddress": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
"cumulativeGasUsed": "1043649",
"from": "0x4e83362442b8d1bec281594cea3050c8eb01311c",
"gas": "44758",
"gasPrice": "7000000000",
"gasUsed": "37298",
"hash": "0xd65b788c610949704a5f9aac2228c7c777434dfe11c863a12306f57fcbd8cdbb",
"input": "0xa9059cbb00000000000000000000000021e21ba085289f81a86921de890eed30f1ad23750000000000000000000000000000000000000000000000008ac7230489e80000",
"logIndex": "0",
"nonce": "765",
"timeStamp": "1532086946",
"to": "0x21e21ba085289f81a86921de890eed30f1ad2375",
"tokenDecimal": "18",
"tokenName": "Maker",
"tokenSymbol": "MKR",
"transactionIndex": "27",
"value": "10000000000000000000"
}
],
"status": "1"
}{
"message": "OK",
"result": "135499",
"status": "1"
}{
"message": "OK",
"result": "135499",
"status": "1"
}{
"message": "OK",
"result": [
{
"address": "0x3870c57fbf1d7e49b154269331c7bc66c64d8857",
"balance": "3790064387342000000",
"stale": false
},
{
"address": "0x497d69ae30d7cca0aa84d647c6d85a59a82c16ef",
"balance": "2047176464264000000",
"stale": false
},
{
"address": "0x9233042b8e9e03d5dc6454bbbe5aee83818ff103",
"balance": "444111960222208758647",
"stale": false
}
],
"status": "1"
}