Blocks
Blocks are added every eight seconds to the blockchain by a Delegate Node. Due to network/technical errors, a Delegate might miss a block. The time between two blocks is then 16 seconds, as the round continues to the next Delegate.
All state changes to the blockchain are in the form of blocks; they contain a set of transactions and metadata. A block is rejected if one or more of the transactions is invalid; or if the metadata is invalid. Thus a block returned from the Public API is always valid.
Endpoints
List All Blocks
The Public API may be used to query for blocks. This dataset contains millions of blocks; thus for analytical purposes, we recommend you query the database directly.
Endpoint
Query Parameters
Name | Description | Required | Example |
---|---|---|---|
page |
The number of the page that will be returned.
|
No | 1 |
limit |
The number of resources per page.
|
No | 100 |
offset |
The number of resources to be skipped.
|
No | |
transform |
The structure of response to be retrieved.
|
No | |
orderBy |
The column and order by which the resources will be sorted.
|
No | |
id |
The identifier of the block to be retrieved.
|
No | |
height |
The height of the block to be retrieved.
|
No | |
height.from |
The height from which blocks will be retrieved.
|
No | |
height.to |
The height to which blocks will be retrieved.
|
No | |
timestamp |
The timestamp of the block to be retrieved.
|
No | |
timestamp.from |
The timestamp from which blocks will be retrieved.
|
No | |
timestamp.to |
The timestamp to which blocks will be retrieved.
|
No |
Name | page |
Description |
The number of the page that will be returned.
|
Required | No |
Example | 1 |
Name | limit |
Description |
The number of resources per page.
|
Required | No |
Example | 100 |
Name | offset |
Description |
The number of resources to be skipped.
|
Required | No |
Example |
Name | transform |
Description |
The structure of response to be retrieved.
|
Required | No |
Example |
Name | orderBy |
Description |
The column and order by which the resources will be sorted.
|
Required | No |
Example |
Name | id |
Description |
The identifier of the block to be retrieved.
|
Required | No |
Example |
Name | height |
Description |
The height of the block to be retrieved.
|
Required | No |
Example |
Name | height.from |
Description |
The height from which blocks will be retrieved.
|
Required | No |
Example |
Name | height.to |
Description |
The height to which blocks will be retrieved.
|
Required | No |
Example |
Name | timestamp |
Description |
The timestamp of the block to be retrieved.
|
Required | No |
Example |
Name | timestamp.from |
Description |
The timestamp from which blocks will be retrieved.
|
Required | No |
Example |
Name | timestamp.to |
Description |
The timestamp to which blocks will be retrieved.
|
Required | No |
Example |
Retrieve first block
Retrieve first block.
Endpoint
Query Parameters
Name | Description | Required | Example |
---|---|---|---|
transform |
The structure of response to be retrieved.
|
No |
Name | transform |
Description |
The structure of response to be retrieved.
|
Required | No |
Example |
Retrieve last block
Retrieve last block.
Endpoint
Query Parameters
Name | Description | Required | Example |
---|---|---|---|
transform |
The structure of response to be retrieved.
|
No |
Name | transform |
Description |
The structure of response to be retrieved.
|
Required | No |
Example |
Retrieve a block
Blocks may be retrieved by ID or by height. The height is an incremental integer.
Endpoint
Path Parameters
Name | Description | Required | Example |
---|---|---|---|
id |
The identifier of the block to be retrieved.
|
No | |
height |
The height of the block to be retrieved.
|
No |
Name | id |
Description |
The identifier of the block to be retrieved.
|
Required | No |
Example |
Name | height |
Description |
The height of the block to be retrieved.
|
Required | No |
Example |
Query Parameters
Name | Description | Required | Example |
---|---|---|---|
transform |
The structure of response to be retrieved.
|
No |
Name | transform |
Description |
The structure of response to be retrieved.
|
Required | No |
Example |
List All Transactions in a Block
Instead of deserializing the block’s payload; you can also obtain the transactions of each block as proper transaction objects directly.
Endpoint
Path Parameters
Name | Description | Required | Example |
---|---|---|---|
blockId |
The identifier of the block to be retrieved.
|
No | |
height |
The height of the block to be retrieved.
|
No |
Name | blockId |
Description |
The identifier of the block to be retrieved.
|
Required | No |
Example |
Name | height |
Description |
The height of the block to be retrieved.
|
Required | No |
Example |
Query Parameters
Name | Description | Required | Example |
---|---|---|---|
page |
The number of the page that will be returned.
|
No | 1 |
limit |
The number of resources per page.
|
No | 100 |
offset |
The number of resources to be skipped.
|
No | |
transform |
The structure of response to be retrieved.
|
No | |
orderBy |
The column and order by which the resources will be sorted.
|
No | |
id |
The identifier of the transaction to be retrieved.
|
No | |
senderPublicKey |
The sender public key of the transactions to be retrieved.
|
No | |
recipientId |
The recipient address of the transactions to be retrieved.
|
No | |
vendorField |
The vendor field of the transactions to be retrieved.
|
No |
Name | page |
Description |
The number of the page that will be returned.
|
Required | No |
Example | 1 |
Name | limit |
Description |
The number of resources per page.
|
Required | No |
Example | 100 |
Name | offset |
Description |
The number of resources to be skipped.
|
Required | No |
Example |
Name | transform |
Description |
The structure of response to be retrieved.
|
Required | No |
Example |
Name | orderBy |
Description |
The column and order by which the resources will be sorted.
|
Required | No |
Example |
Name | id |
Description |
The identifier of the transaction to be retrieved.
|
Required | No |
Example |
Name | senderPublicKey |
Description |
The sender public key of the transactions to be retrieved.
|
Required | No |
Example |
Name | recipientId |
Description |
The recipient address of the transactions to be retrieved.
|
Required | No |
Example |
Name | vendorField |
Description |
The vendor field of the transactions to be retrieved.
|
Required | No |
Example |