For a given block number, this endpoint returns block-level details
unmarshal.EVMApi
.getBlockDetailsByNumber(Chain.ethereum, 10000)
.then(({data}) => console.log(data))
curl -i -X GET \ 'https://api.unmarshal.com/v1/:chain/block/:blockNumber/details?chainId=false&auth_key=YOUR_API_KEY_HERE'
{- "hash": "0x2d7c24d91e115fb3d2eab2cd052bff62d5a50073dd183116bae052360e083866",
- "number": 17447728,
- "timestamp": 1651477438,
- "difficulty": 2,
- "gasLimit": 79119550,
- "gasUsed": 79119550,
- "miner": "0x3f349bbafec1551819b8be1efea2fc46ca749aa1",
- "nonce": 0,
- "parentHash": "0x1ca5549b95c6cd75b4b1bc817f7208fb2d39954da4ec5668d8298f6c163e667b",
- "receiptsRoot": "0x0bf8b62a4a72a8fd74c1f82f5775ea69b45cedcda7536e2ccd1062923cac38ad",
- "sha3Uncles": "",
- "size": 71571,
- "totalDifficulty": 34683994,
- "transactionsRoot": "0xeda083f4b4985b20fde93e4f04d485d6fa127dd0ff7dedf61fda8a20eaf2da54",
- "transactions": [
- "0xb7b9e674389e9cc38edd129be403cc07d19d6a2d36d10a39ac51998809a372f4"
]
}
For a given block hash, this endpoint returns block-level details
unmarshal.EVMApi
.getBlockDetailsByHash(Chain.ethereum, "block hash")
.then(({data}) => console.log(data))
curl -i -X GET \ 'https://api.unmarshal.com/v1/:chain/block-hash/:blockHash/details?auth_key=YOUR_API_KEY_HERE'
{- "hash": "0x2d7c24d91e115fb3d2eab2cd052bff62d5a50073dd183116bae052360e083866",
- "number": 17447728,
- "timestamp": 1651477438,
- "difficulty": 2,
- "gasLimit": 79119550,
- "gasUsed": 79119550,
- "miner": "0x3f349bbafec1551819b8be1efea2fc46ca749aa1",
- "nonce": 0,
- "parentHash": "0x1ca5549b95c6cd75b4b1bc817f7208fb2d39954da4ec5668d8298f6c163e667b",
- "receiptsRoot": "0x0bf8b62a4a72a8fd74c1f82f5775ea69b45cedcda7536e2ccd1062923cac38ad",
- "sha3Uncles": "",
- "size": 71571,
- "totalDifficulty": 34683994,
- "transactionsRoot": "0xeda083f4b4985b20fde93e4f04d485d6fa127dd0ff7dedf61fda8a20eaf2da54",
- "transactions": [
- "0xb7b9e674389e9cc38edd129be403cc07d19d6a2d36d10a39ac51998809a372f4"
]
}
**The transactions API fetches the list of all transactions for a given block number, along with their decoded log events.
unmarshal.EVMApi
.getTransactionByBlockNumber(Chain.ethereum, 10000)
.then(({data}) => console.log(data))
curl -i -X GET \ 'https://api.unmarshal.com/v1/:chain/block/:blockNumber/transactions?auth_key=YOUR_API_KEY_HERE'
[- {
- "txid": "0x9a15af750632b777747cd7f3eccf3322fb4e788af8de9ee1c2aef4dc87c43dfc",
- "vin": [
- {
- "addresses": [
- "0x4bad9f1a15bd17e78b59e086aa4092a3ce0de5c2"
]
}
], - "vout": [
- {
- "value": "0",
- "addresses": [
- "0x7393869b3317a81ac16305f549402ad57e1a7a26"
]
}
], - "blockHash": "0x2d7c24d91e115fb3d2eab2cd052bff62d5a50073dd183116bae052360e083866",
- "blockHeight": 17447728,
- "blockTime": 1651477438,
- "value": "0",
- "fees": "4738024609354904",
- "price": 0,
- "tokenTransfers": [
- {
- "from": "0x118ed46a6ea1ad0938cd637536d4351734ce16ee",
- "to": "0x7393869b3317a81ac16305f549402ad57e1a7a26",
- "token": "0xa4838122c683f732289805fc3c207febd55babdd",
- "value": "109977234255525880197",
- "price": 0
}, - {
- "from": "0x7393869b3317a81ac16305f549402ad57e1a7a26",
- "to": "0x118ed46a6ea1ad0938cd637536d4351734ce16ee",
- "token": "0xe9e7cea3dedca5984780bafc599bd69add087d56",
- "value": "437341824000000000000",
- "price": 0
}
], - "ethereumSpecific": {
- "status": 1,
- "nonce": 982646,
- "gasLimit": 220003,
- "gasUsed": 62024,
- "gasPrice": "76390181371",
- "data": "0x00001678000000000017b55647caad680000000000000005f022c10607d1c000118ed46a6ea1ad0938cd637536d4351734ce16eecedbbde9a63380b0f5ed63001319bb5f4f745f05cf3da478dd0b6550fa9451d2941b9600dd67a6fd9bd7fa129be9dd3d773ce0192fdc21fe1c05574832",
- "shard_id": 0,
- "to_shard_id": 0
}
}
]
Transaction API returns a list of all transactions for a given block hash, along with their decoded log events.
unmarshal.EVMApi
.getTransactionsByBlockHash(Chain.ethereum, "block hash")
.then(({data}) => console.log(data))
curl -i -X GET \ 'https://api.unmarshal.com/v1/:chain/block-hash/:blockHash/transactions?auth_key=YOUR_API_KEY_HERE'
[- {
- "txid": "0x9a15af750632b777747cd7f3eccf3322fb4e788af8de9ee1c2aef4dc87c43dfc",
- "vin": [
- {
- "addresses": [
- "0x4bad9f1a15bd17e78b59e086aa4092a3ce0de5c2"
]
}
], - "vout": [
- {
- "value": "0",
- "addresses": [
- "0x7393869b3317a81ac16305f549402ad57e1a7a26"
]
}
], - "blockHash": "0x2d7c24d91e115fb3d2eab2cd052bff62d5a50073dd183116bae052360e083866",
- "blockHeight": 17447728,
- "blockTime": 1651477438,
- "value": "0",
- "fees": "4738024609354904",
- "price": 0,
- "tokenTransfers": [
- {
- "from": "0x118ed46a6ea1ad0938cd637536d4351734ce16ee",
- "to": "0x7393869b3317a81ac16305f549402ad57e1a7a26",
- "token": "0xa4838122c683f732289805fc3c207febd55babdd",
- "value": "109977234255525880197",
- "price": 0
}, - {
- "from": "0x7393869b3317a81ac16305f549402ad57e1a7a26",
- "to": "0x118ed46a6ea1ad0938cd637536d4351734ce16ee",
- "token": "0xe9e7cea3dedca5984780bafc599bd69add087d56",
- "value": "437341824000000000000",
- "price": 0
}
], - "ethereumSpecific": {
- "status": 1,
- "nonce": 982646,
- "gasLimit": 220003,
- "gasUsed": 62024,
- "gasPrice": "76390181371",
- "data": "0x00001678000000000017b55647caad680000000000000005f022c10607d1c000118ed46a6ea1ad0938cd637536d4351734ce16eecedbbde9a63380b0f5ed63001319bb5f4f745f05cf3da478dd0b6550fa9451d2941b9600dd67a6fd9bd7fa129be9dd3d773ce0192fdc21fe1c05574832",
- "shard_id": 0,
- "to_shard_id": 0
}
}
]