Skip To Content

Blockdaemon Documentation

Blocks

Overview
GET Current Block ID
GET Current Block Number
GET Block by Number/Hash
GET Block Identifier by Number/Hash
GET All Block Identifiers


Overview

The Ubiquity Universal API endpoints listed in this section allow the retrieval of information about blocks for a given protocol and network.

As with all Ubiquity Universal API endpoints, they provide a standard format to obtain consistent information across multiple protocols.


GET Current Block ID

https://{ubiquity_url}/{protocol}/{network}/sync/block_id

Returns the id (hash) of the current block.

Developer documentation: GET Current Block ID
Learn how to authorize your request: Authentication Guide

Ubiquity URL

To run a query, add your Ubiquity URL. For most users this will be:

  • svc.blockdaemon.com/universal/v1

An example of this is shown below:

https://svc.blockdaemon.com/universal/v1/{protocol}/{network}/sync/block_id

Note: If you created your Ubiquity API Key before September 2022, add the legacy Ubiquity URL:

  • ubiquity.api.blockdaemon.com/v1

An example of this is shown below:

https://ubiquity.api.blockdaemon.com/v1/{protocol}/{network}/sync/block_id

Path Parameters

You should specify a protocol and a network as path parameters, e.g.:

  • ethereum/mainnet

Supported Protocols and Networks

Here is a full list of supported protocols and networks with their path parameters:

Protocol Network Path parameters
Algorand Mainnet algorand/mainnet
Bitcoin Mainnet
Testnet
bitcoin/mainnet
bitcoin/testnet
Bitcoin Cash Mainnet
Testnet
bitcoincash/mainnet
bitcoincash/testnet
Dogecoin Mainnet
Testnet
dogecoin/mainnet
dogecoin/testnet
Ethereum Mainnet
Goerli
Ropsten
ethereum/mainnet
ethereum/goerli
ethereum/ropsten
Litecoin Mainnet
Testnet
litecoin/mainnet
litecoin/testnet
NEAR Mainnet near/mainnet
Oasis Mainnet oasis/mainnet
Polkadot Mainnet polkadot/mainnet
Solana Mainnet solana/mainnet
Stellar Mainnet stellar/mainnet
Tezos Mainnet tezos/mainnet
XRP Mainnet xrp/mainnet

Example Queries

The query in this section provides a useful example for GET Current Block ID.

To get the ID of the current block in the Ethereum Mainnet network, use the following query:

https://svc.blockdaemon.com/universal/v1/ethereum/mainnet/sync/block_id

GET Current Block Number

https://{ubiquity_url}/{protocol}/{network}/sync/block_number

Returns the number of the current block.

Developer documentation: GET Current Block Number
Learn how to authorize your request: Authentication Guide

Ubiquity URL

To run a query, add your Ubiquity URL. For most users this will be:

  • svc.blockdaemon.com/universal/v1

An example of this is shown below:

https://svc.blockdaemon.com/universal/v1/{protocol}/{network}/sync/block_number

Note: If you created your Ubiquity API Key before September 2022, add the legacy Ubiquity URL:

  • ubiquity.api.blockdaemon.com/v1

An example of this is shown below:

https://ubiquity.api.blockdaemon.com/v1/{protocol}/{network}/sync/block_number

Path Parameters

You should specify a protocol and a network as path parameters, e.g.:

  • ethereum/mainnet

Supported Protocols and Networks

Here is a full list of supported protocols and networks with their path parameters:

Protocol Network Path parameters
Algorand Mainnet algorand/mainnet
Bitcoin Mainnet
Testnet
bitcoin/mainnet
bitcoin/testnet
Bitcoin Cash Mainnet
Testnet
bitcoincash/mainnet
bitcoincash/testnet
Dogecoin Mainnet
Testnet
dogecoin/mainnet
dogecoin/testnet
Ethereum Mainnet
Goerli
Ropsten
ethereum/mainnet
ethereum/goerli
ethereum/ropsten
Litecoin Mainnet
Testnet
litecoin/mainnet
litecoin/testnet
NEAR Mainnet near/mainnet
Oasis Mainnet oasis/mainnet
Polkadot Mainnet polkadot/mainnet
Solana Mainnet solana/mainnet
Stellar Mainnet stellar/mainnet
Tezos Mainnet tezos/mainnet
XRP Mainnet xrp/mainnet

Example Queries

The query in this section provides a useful example for GET Current Block Number.

To get the number of the current block in the Ethereum Mainnet network, use the following query:

https://svc.blockdaemon.com/universal/v1/ethereum/mainnet/sync/block_number

GET Block by Number/Hash

https://{ubiquity_url}/{protocol}/{network}/block/{key}

Returns a block and all its transactions by a given block number or hash.

Developer documentation: GET Block by Number/Hash
Learn how to authorize your request: Authentication Guide

Ubiquity URL

To run a query, add your Ubiquity URL. For most users this will be:

  • svc.blockdaemon.com/universal/v1

An example of this is shown below:

https://svc.blockdaemon.com/universal/v1/{protocol}/{network}/block/{key}

Note: If you created your Ubiquity API Key before September 2022, add the legacy Ubiquity URL:

  • ubiquity.api.blockdaemon.com/v1

An example of this is shown below:

https://ubiquity.api.blockdaemon.com/v1/{protocol}/{network}/block/{key}

Path Parameters

You should specify a protocol and a network as path parameters, e.g.:

  • ethereum/mainnet

It is also is required to add a block number or block hash, e.g.:

  • 14621155
  • 0x2444165297806ad5598e4569e5823b3df0cde3e48b346781ab632fa6cef1a0ec

Note: In some networks you can get blocks only by number. See below to learn more.

Supported Protocols and Networks

Here is a full list of supported protocols and networks. It also includes their path parameters and the available ways to get blocks.

Protocol Network Path parameters Get block by
Algorand Mainnet algorand/mainnet block number
Bitcoin Mainnet
Testnet
bitcoin/mainnet
bitcoin/testnet
block number or hash
block number or hash
Bitcoin Cash Mainnet
Testnet
bitcoincash/mainnet
bitcoincash/testnet
block number or hash
block number or hash
Dogecoin Mainnet
Testnet
dogecoin/mainnet
dogecoin/testnet
block number or hash
block number or hash
Ethereum Mainnet
Goerli
Ropsten
ethereum/mainnet
ethereum/goerli
ethereum/ropsten
Litecoin Mainnet
Testnet
litecoin/mainnet
litecoin/testnet
block number or hash
block number or hash
NEAR Mainnet near/mainnet block number or hash
Oasis Mainnet oasis/mainnet block number
Polkadot Mainnet polkadot/mainnet block number or hash
Solana Mainnet solana/mainnet block number
Stellar Mainnet stellar/mainnet block number
Tezos Mainnet tezos/mainnet block number or hash
XRP Mainnet xrp/mainnet block number or hash

Example Queries

The queries in this section provide useful examples for GET Block by Number/Hash.

To get a block by number in the Ethereum Mainnet network, use the following query:

https://svc.blockdaemon.com/universal/v1/ethereum/mainnet/block/14621155

To get a block by ID in the Ethereum Mainnet network, use the following query:

https://svc.blockdaemon.com/universal/v1/ethereum/mainnet/block/0x2444165297806ad5598e4569e5823b3df0cde3e48b346781ab632fa6cef1a0ec

GET Block Identifier by Number/Hash

https://{ubiquity_url}/{protocol}/{network}/block_identifier/{key}

Returns a block identifier by a given block number or hash.

Developer documentation: GET Block Identifier by Number/Hash
Learn how to authorize your request: Authentication Guide

Ubiquity URL

To run a query, add your Ubiquity URL. For most users this will be:

  • svc.blockdaemon.com/universal/v1

An example of this is shown below:

https://svc.blockdaemon.com/universal/v1/{protocol}/{network}/block_identifier/{key}

Note: If you created your Ubiquity API Key before September 2022, add the legacy Ubiquity URL:

  • ubiquity.api.blockdaemon.com/v1

An example of this is shown below:

https://ubiquity.api.blockdaemon.com/v1/{protocol}/{network}/block_identifier/{key}

Path Parameters

You should specify a protocol and a network as path parameters, e.g.:

  • ethereum/mainnet

It is also is required to add a block number or block hash, e.g.:

  • 14621155
  • 0x2444165297806ad5598e4569e5823b3df0cde3e48b346781ab632fa6cef1a0ec

Note: In some networks you can get block identifiers only by number. See below to learn more.

Supported Protocols and Networks

Here is a full list of supported protocols and networks. It also includes their path parameters and the available ways to get block identifiers.

Protocol Network Path parameters Get block identifier by
Algorand Mainnet algorand/mainnet block number
Bitcoin Mainnet
Testnet
bitcoin/mainnet
bitcoin/testnet
block number or hash
block number or hash
Bitcoin Cash Mainnet
Testnet
bitcoincash/mainnet
bitcoincash/testnet
block number or hash
block number or hash
Dogecoin Mainnet
Testnet
dogecoin/mainnet
dogecoin/testnet
block number or hash
block number or hash
Ethereum Mainnet
Goerli
Ropsten
ethereum/mainnet
ethereum/goerli
ethereum/ropsten
Litecoin Mainnet
Testnet
litecoin/mainnet
litecoin/testnet
block number or hash
block number or hash
NEAR Mainnet near/mainnet block number
Oasis Mainnet oasis/mainnet block number
Polkadot Mainnet polkadot/mainnet block number or hash
Solana Mainnet solana/mainnet block number
Stellar Mainnet stellar/mainnet block number
Tezos Mainnet tezos/mainnet block number or hash
XRP Mainnet xrp/mainnet block number or hash

Example Queries

The queries in this section provide useful examples for GET Block Identifier by Number/Hash.

To get a block identifier by block number in the Ethereum Mainnet network, use the following query:

https://svc.blockdaemon.com/universal/v1/ethereum/mainnet/block_identifier/14621155

To get a block identifier by block ID in the Ethereum Mainnet network, use the following query:

https://svc.blockdaemon.com/universal/v1/ethereum/mainnet/block_identifier/0x2444165297806ad5598e4569e5823b3df0cde3e48b346781ab632fa6cef1a0ec

GET All Block Identifiers

https://{ubiquity_url}/{protocol}/{network}/block_identifiers

Returns all block identifiers in the network, starting with the oldest one.

The response is paginated — use a query parameter to get the next page (see below).

Developer documentation: GET All Block Identifiers
Learn how to authorize your request: Authentication Guide

Ubiquity URL

To run a query, add your Ubiquity URL. For most users this will be:

  • svc.blockdaemon.com/universal/v1

An example of this is shown below:

https://svc.blockdaemon.com/universal/v1/{protocol}/{network}/block_identifiers

Note: If you created your Ubiquity API Key before September 2022, add the legacy Ubiquity URL:

  • ubiquity.api.blockdaemon.com/v1

An example of this is shown below:

https://ubiquity.api.blockdaemon.com/v1/{protocol}/{network}/block_identifiers

Path Parameters

You should specify a protocol and a network as path parameters, e.g.:

  • ethereum/mainnet

Supported Protocols and Networks

Here is a full list of supported protocols and networks with their path parameters:

Protocol Network Path parameters
Bitcoin Mainnet
Testnet
bitcoin/mainnet
bitcoin/testnet
Bitcoin Cash Mainnet
Testnet
bitcoincash/mainnet
bitcoincash/testnet
Dogecoin Mainnet
Testnet
dogecoin/mainnet
dogecoin/testnet
Ethereum Mainnet
Goerli
Ropsten
ethereum/mainnet
ethereum/goerli
ethereum/ropsten
Litecoin Mainnet
Testnet
litecoin/mainnet
litecoin/testnet
Polkadot Mainnet polkadot/mainnet
Tezos Mainnet tezos/mainnet

Query Parameters

To set the sort order, use:

  • parameter: order
  • value: asc / desc

To set the maximum number of blocks returned on one page, use:

  • parameter: page_size
  • value: 25 by default, up to 100

To get the next page, use:

  • parameter: page_token
  • value: returned in the next_page_token field

Example Queries

The queries in this section provide useful examples for GET All Block Identifiers.

To get all block identifiers in the Ethereum Mainnet network, use the following query:

https://svc.blockdaemon.com/universal/v1/ethereum/mainnet/block_identifiers

To get all block identifiers in the Ethereum Mainnet network, sorted in descending order, use the following query:

https://svc.blockdaemon.com/universal/v1/ethereum/mainnet/block_identifiers?order=desc

We don't support Internet Explorer

Please use Chrome, Safari, Firefox, or Edge to view this site.