Get Blocks

Get block details by block Number and block hash

Details by number

For a given block number, this endpoint returns block-level details

unmarshal.EVMApi
    .getBlockDetailsByNumber(Chain.ethereum, 10000)
    .then(({data}) => console.log(data))
Request
Security:
path Parameters
chain
required
string

Chain name (example: bsc, ethereum, matic...)

Enum: "ethereum" "bsc" "matic" "kadena" "celo" "klaytn" "cronos" "velas" "arbitrum" "avalanche" "xinfin" "zilliqa" "fantom" "fuse" "aurora" "bsc-testnet" "matic-testnet" "rinkeby-testnet"
Example: bsc
blockNumber
required
string
Default: "15000000"

Valid block Number

Example: 15000000
query Parameters
chainId
string
Default: "false"

Return details for requested chain id (For Kadena chain)

Responses
200
401
get/v1/{chain}/block/{blockNumber}/details
Request samples
curl -i -X GET \
  'https://api.unmarshal.com/v1/:chain/block/:blockNumber/details?chainId=false&auth_key=YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "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": [
    ]
}

Details by hash

For a given block hash, this endpoint returns block-level details

unmarshal.EVMApi
    .getBlockDetailsByHash(Chain.ethereum, "block hash")
    .then(({data}) => console.log(data))
Request
Security:
path Parameters
chain
required
string

Chain name (example: bsc, ethereum, matic...)

Enum: "ethereum" "bsc" "matic" "celo" "klaytn" "cronos" "velas" "arbitrum" "avalanche" "xinfin" "zilliqa" "fantom" "fuse" "aurora" "bsc-testnet" "matic-testnet" "rinkeby-testnet"
Example: bsc
blockHash
required
string
Default: "0x2d7c24d91e115fb3d2eab2cd052bff62d5a50073dd183116bae052360e083866"

Valid block Hash

Example: 0x2d7c24d91e115fb3d2eab2cd052bff62d5a50073dd183116bae052360e083866
Responses
200
401
get/v1/{chain}/block-hash/{blockHash}/details
Request samples
curl -i -X GET \
  'https://api.unmarshal.com/v1/:chain/block-hash/:blockHash/details?auth_key=YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "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": [
    ]
}

Transactions By Number

**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))
Request
Security:
path Parameters
chain
required
string

Chain name (example: bsc, ethereum, matic...)

Enum: "ethereum" "bsc" "matic" "celo" "klaytn" "avalanche" "arbitrum" "xinfin" "cronos" "velas" "zilliqa" "fantom" "fuse" "aurora" "bsc-testnet" "matic-testnet" "rinkeby-testnet"
Example: bsc
blockNumber
required
string
Default: "15000000"

Valid block Number

Example: 15000000
Responses
200
401
get/v1/{chain}/block/{blockNumber}/transactions
Request samples
curl -i -X GET \
  'https://api.unmarshal.com/v1/:chain/block/:blockNumber/transactions?auth_key=YOUR_API_KEY_HERE'
Response samples
application/json
[
  • {
    }
]

Transactions By Hash

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))
Request
Security:
path Parameters
chain
required
string

Chain name (example: bsc, ethereum, matic...)

Enum: "ethereum" "bsc" "matic" "celo" "klaytn" "cronos" "velas" "arbitrum" "avalanche" "xinfin" "zilliqa" "fantom" "fuse" "aurora" "bsc-testnet" "matic-testnet" "rinkeby-testnet"
Example: bsc
blockHash
required
string
Default: "0x2d7c24d91e115fb3d2eab2cd052bff62d5a50073dd183116bae052360e083866"

Valid block Hash

Example: 0x2d7c24d91e115fb3d2eab2cd052bff62d5a50073dd183116bae052360e083866
Responses
200
401
get/v1/{chain}/block-hash/{blockHash}/transactions
Request samples
curl -i -X GET \
  'https://api.unmarshal.com/v1/:chain/block-hash/:blockHash/transactions?auth_key=YOUR_API_KEY_HERE'
Response samples
application/json
[
  • {
    }
]