Get Block by Hash or Height: API Migration (v3 to v4)

This guide covers the migration from legacy v3 chain-specific Get block by hash or height endpoints to the new unified Blockhains API endpoint Get block by hash


Endpoint Change Summary

Componentv3 (Legacy)v4 (New)
Standard Pattern/v3/{chain}/block/{hash}/v4/data/blockchains/block/{hash}

Deprecated v3 Endpoints

The following chain-specific endpoints have been consolidated:

Old v3 EndpointStatus
/v3/algorand/block/{roundNumber}Deprecated
/v3/arb/block/{hash}Deprecated
/v3/avalanche/block/{hash}Deprecated
/v3/base/block/{hash}Deprecated
/v3/bcash/block/{hash}Deprecated
/v3/bitcoin/block/{hash}Deprecated
/v3/bsc/block/{hash}Deprecated
/v3/celo/block/{hash}Deprecated
/v3/cronos/block/{hash}Deprecated
/v3/dogecoin/block/{hash}Deprecated
/v3/egld/block/{hash}Deprecated
/v3/ethereum/block/{hash}Deprecated
/v3/fantom/block/{hash}Deprecated
/v3/flare/block/{hash}Deprecated
/v3/kcs/block/{hash}Deprecated
/v3/klaytn/block/{hash}Deprecated
/v3/litecoin/block/{hash}Deprecated
/v3/one/block/{hash}Deprecated
/v3/optimism/block/{hash}Deprecated
/v3/polygon/block/{hash}Deprecated
/v3/solana/block/{hash}Deprecated
/v3/sonic/block/{hash}Deprecated
/v3/tron/block/{hash}Deprecated
/v3/vet/block/{hash}Deprecated
/v3/xdc/block/{hash}Deprecated
/v3/xrp/block/{hash}Deprecated

Migration Steps

1. Update Your Base URL

Standard endpoints:

- GET /v3/ethereum/block/{hash}
+ GET /v4/data/blockchains/block/{hash}?chain=ethereum-mainnet

2. Adjust Chain Identifiers

Ensure you're using the new chain identifier format (e.g., ethereum-mainnet instead of ethereum).

3. Update Response Handling

Review your code for any response schema changes between v3 and v4.

🚧

Attention

Mind potential breaking changes.