Get Current Block Height: API Migration (v3 to v4)

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


Endpoint Change Summary

Componentv3 (Legacy)v4 (New)
Standard Pattern/v3/{chain}/block/current/v4/data/blockchains/block/current
Tron Exception/v3/tron/info/v4/data/blockchains/block/current

Deprecated v3 Endpoints

The following chain-specific endpoints have been consolidated:

Old v3 EndpointStatus
/v3/algorand/block/currentDeprecated
/v3/arb/block/currentDeprecated
/v3/avalanche/block/currentDeprecated
/v3/base/block/currentDeprecated
/v3/egld/block/currentDeprecated
/v3/sonic/block/currentDeprecated
/v3/cronos/block/currentDeprecated
/v3/bsc/block/currentDeprecated
/v3/celo/block/currentDeprecated
/v3/kcs/block/currentDeprecated
/v3/ethereum/block/currentDeprecated
/v3/fantom/block/currentDeprecated
/v3/flare/block/currentDeprecated
/v3/one/block/currentDeprecated
/v3/klaytn/block/currentDeprecated
/v3/polygon/block/currentDeprecated
/v3/solana/block/currentDeprecated
/v3/optimism/block/currentDeprecated
/v3/xdc/block/currentDeprecated
/v3/vet/block/currentDeprecated
/v3/tron/infoDeprecated

Migration Steps

1. Update Your Base URL

Standard endpoints:

- GET /v3/ethereum/block/current
+ GET /v4/data/blockchains/block/current?chain=ethereum-mainnet

Tron endpoint:

- GET /v3/tron/info
+ GET /v4/data/blockchains/block/current?chain=tron-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.