Get Ether Balance for a Single Address
Returns the Ether balance of a given address.
https://api-goerli-optimism.etherscan.io/api
?module=account
&action=balance
&address=0x1fcc0de164a21362a7f169dfe356186a3c538abb
&tag=latest
&apikey=YourApiKeyToken
Sample Response
{
"status":"1",
"message":"OK",
"result":"9713393216673952357"
}
Get Ether Balance for Multiple Addresses in a Single Call
Returns the balance of the accounts from a list of addresses.
https://api-goerli-optimism.etherscan.io/api
?module=account
&action=balancemulti
&address=0xbb7a8f0da161b577e60611c687b5e9c8eb4cfd3a,0x87aa776a7686dfc124c1e7db4fd4fccfa368c18c,0x1fcc0de164a21362a7f169dfe356186a3c538abb
&apikey=YourApiKeyToken
Sample Response
{
"status":"1",
"message":"OK",
"result":[
{
"account":"0xbb7a8f0da161b577e60611c687b5e9c8eb4cfd3a",
"balance":"210067533940926602"
},
{
"account":"0x87aa776a7686dfc124c1e7db4fd4fccfa368c18c",
"balance":"1230349084445950560"
},
{
"account":"0x1fcc0de164a21362a7f169dfe356186a3c538abb",
"balance":"9713393216672792905"
}
]
}
Get a list of 'Normal' Transactions By Address
Returns the list of transactions performed by an address, with optional pagination.
https://api-goerli-optimism.etherscan.io/api
?module=account
&action=txlist
&address=0x87aa776a7686dfc124c1e7db4fd4fccfa368c18c
&startblock=0
&endblock=99999999
&page=1
&offset=10
&sort=asc
&apikey=YourApiKeyToken
Sample Response
{
"status":"1",
"message":"OK",
"result":[
{
"blockNumber":"768896",
"timeStamp":"1661954618",
"hash":"0xeb6d55b5b8344366946925f2c6af2892691304a998805fd64d2c2a03c6f1b4b4",
"nonce":"26",
"blockHash":"0xc5f7c06c67cbd25c9823ee9689c3fccef09b7f88579ce6b5dc261bb6ac6ebe7d",
"transactionIndex":"0",
"from":"0x70997970c51812dc3a010c7d01b50e0d17dc79c8",
"to":"0x87aa776a7686dfc124c1e7db4fd4fccfa368c18c",
"value":"12973745532714198",
"gas":"53000",
"gasPrice":"1",
"isError":"0",
"txreceipt_status":"1",
"input":"0x",
"contractAddress":"",
"cumulativeGasUsed":"21000",
"gasUsed":"21000",
"confirmations":"440544",
"methodId":"0x",
"functionName":""
},
{
"blockNumber":"768902",
"timeStamp":"1661954618",
"hash":"0x78cf054a6c5173f97d4e615b44bf2160404f83cdf87a0606d9be26547089948b",
"nonce":"79",
"blockHash":"0x959f6bfd49879041888d43badf7f0d21876c2f94fb06bfc6d664e698b0f7fcab",
"transactionIndex":"0",
"from":"0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc",
"to":"0x87aa776a7686dfc124c1e7db4fd4fccfa368c18c",
"value":"6250892293430946",
"gas":"53000",
"gasPrice":"1",
"isError":"0",
"txreceipt_status":"1",
"input":"0x",
"contractAddress":"",
"cumulativeGasUsed":"21000",
"gasUsed":"21000",
"confirmations":"440538",
"methodId":"0x",
"functionName":""
}
]
}
Get a list of 'Internal' Transactions by Address
Returns the list of internal transactions performed by an address, with optional pagination.
https://api-goerli-optimism.etherscan.io/api
?module=account
&action=txlistinternal
&address=0x8fabb5c876ca8413be90e4003de33dcf9c4e3424
&startblock=0
&endblock=99999999
&page=1
&offset=10
&sort=asc
&apikey=YourApiKeyToken
Sample Response
{
"status":"1",
"message":"OK",
"result":[
{
"blockNumber":"1194289",
"timeStamp":"1663452672",
"hash":"0x82154e91a8d0f9aacdb9f75f35b554ed159729fe34c2c8521499917b970d92cc",
"from":"0x8fabb5c876ca8413be90e4003de33dcf9c4e3424",
"to":"0xd566c704394431ddabb9534277488f56957ccd69",
"value":"0",
"contractAddress":"",
"input":"",
"type":"delegatecall",
"gas":"563490",
"gasUsed":"119574",
"traceId":"0_1",
"isError":"0",
"errCode":""
},
{
"blockNumber":"1194297",
"timeStamp":"1663452688",
"hash":"0x55e3713f1340912d1b97d77c7255201987834394e4ff3bb7e6dfbdce5b73ab7b",
"from":"0x8fabb5c876ca8413be90e4003de33dcf9c4e3424",
"to":"0xd566c704394431ddabb9534277488f56957ccd69",
"value":"0",
"contractAddress":"",
"input":"",
"type":"delegatecall",
"gas":"5445",
"gasUsed":"5445",
"traceId":"0_1",
"isError":"0",
"errCode":""
}
]
}
Get 'Internal Transactions' by Transaction Hash
Returns the list of internal transactions performed within a transaction.
Note : This API endpoint returns a maximum of 10000 records only.
https://api-goerli-optimism.etherscan.io/api
?module=account
&action=txlistinternal
&txhash=0xfcb103ed569191f8f41fdce678aaa432e443b6c8a65ac98ba8f14584defcf15d
&apikey=YourApiKeyToken
Sample Response
{
"status":"1",
"message":"OK",
"result":[
{
"blockNumber":"1204424",
"timeStamp":"1663488005",
"from":"0xd2aa7ce72c4809b9f3cc6ad699206bb7c99b8054",
"to":"0xe001c182522526d173fcd0b3f9a96df5f0a84f53",
"value":"10440000000000000",
"contractAddress":"",
"input":"",
"type":"call",
"gas":"0",
"gasUsed":"0",
"isError":"0",
"errCode":""
}
]
}
The isError
field returns 0
for successful transactions and 1
for rejected/cancelled transactions.
Get "Internal Transactions" by Block Range
Returns the list of internal transactions performed within a block range, with optional pagination.
https://api-goerli-optimism.etherscan.io/api
?module=account
&action=txlistinternal
&startblock=1203424
&endblock=1204424
&page=1
&offset=10
&sort=asc
&apikey=YourApiKeyToken
Sample Response
{
"status":"1",
"message":"OK",
"result":[
{
"blockNumber":"1203424",
"timeStamp":"1663484529",
"hash":"0xbe7084483e95249d97136aaa63ea256f0d32aea6d6bad96b739a38a2b7bfe68e",
"from":"0x566677cf84eb01b777a3bb52ff8ffe6f241c8127",
"to":"0x0406246704e8f1062918648e21833b318b26fa2a",
"value":"0",
"contractAddress":"",
"input":"",
"type":"delegatecall",
"gas":"4893979",
"gasUsed":"45599",
"traceId":"0_1",
"isError":"0",
"errCode":""
},
{
"blockNumber":"1203424",
"timeStamp":"1663484529",
"hash":"0xbe7084483e95249d97136aaa63ea256f0d32aea6d6bad96b739a38a2b7bfe68e",
"from":"0x566677cf84eb01b777a3bb52ff8ffe6f241c8127",
"to":"0x6da1b913ec691e22ee734eb5a6aa5c5889295eb1",
"value":"0",
"contractAddress":"",
"input":"",
"type":"call",
"gas":"4812487",
"gasUsed":"40455",
"traceId":"0_1_1",
"isError":"0",
"errCode":""
}
]
}
The isError
field returns 0
for successful transactions and 1
for rejected/cancelled transactions.
Get a list of 'ERC20 - Token Transfer Events' by Address
Returns the list of ERC-20 tokens transferred by an address, with optional filtering by token contract.
https://api-goerli-optimism.etherscan.io/api
?module=account
&action=tokentx
&contractaddress=0xa0564af79ffffe539482a309c07310cfbc3d6da2
&address=0x189367a0b4458445da6a69ee5b7f32673a968b3f
&page=1
&offset=100
&startblock=0
&endblock=99999999
&sort=asc
&apikey=YourApiKeyToken
Usage:
ERC-20 transfers from an address, specify the address
parameter
ERC-20 transfers from a contract address, specify the contract address
parameter
ERC-20 transfers from an address filtered by a token contract, specify both address
and contract address
parameters.
Sample Response
{
"status":"1",
"message":"OK",
"result":[
{
"blockNumber":"934432",
"timeStamp":"1662547406",
"hash":"0x627e2b549d36b25de88cb63fc6541ea5ac47558ba17f4ab5253075b66ed0e15b",
"nonce":"55",
"blockHash":"0xc91ee31c19971061935b1c03b974bc9ea399baed4a205fe7bf10afe2fb17b76c",
"from":"0x014e307273f98f032b8f3d029e8dfaa0d997dbac",
"contractAddress":"0xa0564af79ffffe539482a309c07310cfbc3d6da2",
"to":"0x189367a0b4458445da6a69ee5b7f32673a968b3f",
"value":"1000000000000000000000000",
"tokenName":"DAI TOKEN",
"tokenSymbol":"DAI",
"tokenDecimal":"18",
"transactionIndex":"0",
"gas":"3006698",
"gasPrice":"1",
"gasUsed":"2711564",
"cumulativeGasUsed":"2711564",
"input":"deprecated",
"confirmations":"275104"
},
{
"blockNumber":"981125",
"timeStamp":"1662734780",
"hash":"0xb2cc85413565d71fcc287c51bc47f4c4e91f8b948c781090b1147593007b7b08",
"nonce":"113",
"blockHash":"0x9527f98564e35032dc04fdf517d4b8bbe6498f3670c7b457b8bc5b0a001015da",
"from":"0x189367a0b4458445da6a69ee5b7f32673a968b3f",
"contractAddress":"0xa0564af79ffffe539482a309c07310cfbc3d6da2",
"to":"0x014e307273f98f032b8f3d029e8dfaa0d997dbac",
"value":"1196998567192715070",
"tokenName":"DAI TOKEN",
"tokenSymbol":"DAI",
"tokenDecimal":"18",
"transactionIndex":"0",
"gas":"158222",
"gasPrice":"1",
"gasUsed":"137990",
"cumulativeGasUsed":"137990",
"input":"deprecated",
"confirmations":"228411"
}
]
}
Get a list of 'ERC721 - Token Transfer Events' by Address
Returns the list of ERC-721 ( NFT ) tokens transferred by an address, with optional filtering by token contract
https://api-goerli-optimism.etherscan.io/api
?module=account
&action=tokennfttx
&contractaddress=0x70e24b976d21feea835fa445d9c837e5356faf83
&address=0x474bafa6db6c7c452422ff30c60538fece385332
&page=1
&offset=100
&startblock=0
&endblock=99999999
&sort=asc
&apikey=YourApiKeyToken
Usage:
ERC-721 transfers from an address, specify the address
parameter
ERC-721 transfers from a contract address, specify the contract address
parameter
ERC-721 transfers from an address filtered by a token contract, specify both address
and contract address
parameters.
Sample Response
{
"status":"1",
"message":"OK",
"result":[
{
"blockNumber":"1192356",
"timeStamp":"1663446782",
"hash":"0x7e72e1888cdd36ce44fee6304bc7198df3149c02a71dc134bcdf38d04806aa90",
"nonce":"9781",
"blockHash":"0xbefbeb1a6673e81c706c57134669342562d0b84be214ea73d60bac49dfbd5eed",
"from":"0x0000000000000000000000000000000000000000",
"contractAddress":"0x70e24b976d21feea835fa445d9c837e5356faf83",
"to":"0x474bafa6db6c7c452422ff30c60538fece385332",
"tokenID":"1",
"tokenName":"Chain Ballers Team",
"tokenSymbol":"CBT",
"tokenDecimal":"0",
"transactionIndex":"0",
"gas":"1000000",
"gasPrice":"0",
"gasUsed":"205472",
"cumulativeGasUsed":"205472",
"input":"deprecated",
"confirmations":"17196"
},
{
"blockNumber":"1192816",
"timeStamp":"1663448356",
"hash":"0x4dd684eaadbcc2a4f55af6a1049052f8fa5aaef1bd539510b6aac1a7579e721b",
"nonce":"9806",
"blockHash":"0xafd784ce0bc17a93a6b5605933b5dad5cae3637eb1f0a05ce117b176836d8525",
"from":"0x474bafa6db6c7c452422ff30c60538fece385332",
"contractAddress":"0x70e24b976d21feea835fa445d9c837e5356faf83",
"to":"0x0000000000000000000000000000000000000001",
"tokenID":"1",
"tokenName":"Chain Ballers Team",
"tokenSymbol":"CBT",
"tokenDecimal":"0",
"transactionIndex":"0",
"gas":"1000000",
"gasPrice":"0",
"gasUsed":"148167",
"cumulativeGasUsed":"148167",
"input":"deprecated",
"confirmations":"16736"
}
]
}