blocks_api

Module Group: Base
Parsing Order: 10
Data Source: Blocks
Database Size: 108.056 GB

The blocks_api provides access to block data, transactions, and operations from the Steem blockchain.


Configuration

Active Config

{
   "id": "blocks_api",
   "group_id": "base",
   "parsing_order": 10,
   "referenced_modules": ["chain_api"],
   "data_source_contents": ["blocks"],
   "parse_reversible": false,
   "parsed_virtual_ops": true,
   "blocks_per_row": 250,
   "request_limit": 250,
   "row_compression_alg": "lzma",
   "row_compression_level": 9,
   "block_compressor_config": {
      "is_active": true,
      "compress_content": true,
      "compress_ops": true
   }
}

Endpoints

getConfig

Returns this module's active configuration.

Endpoint

/blocks_api/getConfig

Example Response:

{
   "code": 0,
   "result": {
      "db_path": "~/sds_data1",
      "id": "blocks_api",
      "group_id": "base",
      "parsing_order": 10,
      "blocks_per_row": 250,
      "request_limit": 250
   }
}

getBlock

Returns the block for the given block number.

Endpoint

/blocks_api/getBlock/:blockNum/:withTransactions?/:withVirtualOps?

Example

/blocks_api/getBlock/50000001

Parameters

Name Type Optional Default Min Max
:blockNum int No - 1 Current
:withTransactions bool Yes true - -
:withVirtualOps bool Yes true - -

Example Response:

{
   "code": 0,
   "result": {
      "block_id": "02faf0817156fbe4752dd8de2b22b7a52dd37e2d",
      "timestamp": "2021-01-03T03:51:06",
      "witness": "steem-agora",
      "transactions": [
         {
            "expiration": "2021-01-03T04:01:00",
            "operations": [["vote", {"voter": "realviewpost", "author": "realchain", "permlink": "5gxrck", "weight": 10000}]],
            "transaction_id": "f82479f57ed9bda5f7640048844a5fcea06564b0"
         },
         {
            "expiration": "2021-01-03T03:52:02",
            "operations": [["comment", {"parent_author": "mendiz44", "author": "minnowvotes", "body": "You got a 100.00% upvote..."}]],
            "transaction_id": "3b2a98a0e8e0c1a0722fadebec534ca08144993c"
         },
         {
            "expiration": "2021-01-03T03:52:02",
            "operations": [["transfer", {"from": "tipu", "to": "abu.bakkar", "amount": "0.014 STEEM", "memo": "@tipU investor payout..."}]],
            "transaction_id": "818e05adf882a873c9822ab01aae840acf45d902"
         }
      ],
      "virtual_ops": [
         ["producer_reward", {"producer": "steem-agora", "vesting_shares": "489.955913 VESTS"}]
      ]
   }
}

getBlockById

Returns the block for the given block ID (hash).

Endpoint

/blocks_api/getBlockById/:blockId/:withTransactions?/:withVirtualOps?

Example

/blocks_api/getBlockById/02faf0817156fbe4752dd8de2b22b7a52dd37e2d

Parameters

Name Type Optional Default
:blockId hex_string (40) No -
:withTransactions bool Yes true
:withVirtualOps bool Yes true

Result: JSON Object


getBlocksInRange

Returns the blocks for the given range.

Endpoint

/blocks_api/getBlocksInRange/:fromBlockNum-:toBlockNum/:withTransactions?/:withVirtualOps?

Example

/blocks_api/getBlocksInRange/50000001-50000100

Max Limit: 250 blocks per request

Result: JSON Array


getTransactionsInBlock

Returns all transactions for the given block number.

Endpoint

/blocks_api/getTransactionsInBlock/:blockNum

Example

/blocks_api/getTransactionsInBlock/50000001

Example Response:

{
   "code": 0,
   "result": [
      {
         "expiration": "2021-01-03T04:01:00",
         "operations": [["vote", {"voter": "realviewpost", "author": "realchain", "permlink": "5gxrck", "weight": 10000}]],
         "transaction_id": "f82479f57ed9bda5f7640048844a5fcea06564b0"
      },
      {
         "expiration": "2021-01-03T03:52:02",
         "operations": [["transfer", {"from": "tipu", "to": "abu.bakkar", "amount": "0.014 STEEM"}]],
         "transaction_id": "818e05adf882a873c9822ab01aae840acf45d902"
      }
   ]
}

getTransactionsInBlockRange

Returns all transactions for the given block range.

Endpoint

/blocks_api/getTransactionsInBlockRange/:fromBlockNum-:toBlockNum

Max Limit: 250 blocks per request

Result: JSON Array


getOpsInBlock

Returns all operations for the given block number.

Endpoint

/blocks_api/getOpsInBlock/:blockNum/:withVirtualOps?/:opTypes?

Example

/blocks_api/getOpsInBlock/50000001

Example Response:

{
   "code": 0,
   "result": [
      ["vote", {"voter": "realviewpost", "author": "realchain", "permlink": "5gxrck", "weight": 10000}],
      ["comment", {"parent_author": "mendiz44", "author": "minnowvotes", "body": "You got a 100.00% upvote..."}],
      ["vote", {"voter": "minnowvotes", "author": "mendiz44", "permlink": "chatme-free-live-video-chat", "weight": 10000}],
      ["transfer", {"from": "tipu", "to": "abu.bakkar", "amount": "0.014 STEEM"}],
      ["producer_reward", {"producer": "steem-agora", "vesting_shares": "489.955913 VESTS"}]
   ]
}

getOpsInBlockRange

Returns all operations for the given block range.

Endpoint

/blocks_api/getOpsInBlockRange/:fromBlockNum-:toBlockNum/:withVirtualOps?/:opTypes?

Max Limit: 250 blocks per request

Result: JSON Array


getOpsInBlockRangeAsArray

Returns an array including all operations for the given block range.

Endpoint

/blocks_api/getOpsInBlockRangeAsArray/:fromBlockNum-:toBlockNum/:withVirtualOps?/:opTypes?

Example

/blocks_api/getOpsInBlockRangeAsArray/50000001-50000100/0/comment

Max Limit: 250 blocks per request

Result: JSON Array


getOpsInBlockRangeGrouped

Returns operations for the given block range grouped by operation type.

Endpoint

/blocks_api/getOpsInBlockRangeGrouped/:fromBlockNum-:toBlockNum/:withVirtualOps?/:opTypes?

Max Limit: 250 blocks per request

Result: JSON Object


getVirtualOpsInBlock

Returns all virtual operations for the given block number.

Endpoint

/blocks_api/getVirtualOpsInBlock/:blockNum

Example

/blocks_api/getVirtualOpsInBlock/50000001

Example Response:

{
   "code": 0,
   "result": [
      ["producer_reward", {"producer": "steem-agora", "vesting_shares": "489.955913 VESTS"}]
   ]
}

getVirtualOpsInBlockRange

Returns virtual operations for the given block range.

Endpoint

/blocks_api/getVirtualOpsInBlockRange/:fromBlockNum-:toBlockNum

Max Limit: 250 blocks per request

Result: JSON Array


getLastIrreversibleBlockNum

Returns the last (highest) available irreversible block number.

Endpoint

/blocks_api/getLastIrreversibleBlockNum

Example Response:

{
   "code": 0,
   "result": 102344125
}

getLastReversibleBlockNum

Returns the last (highest) available reversible block number.

Endpoint

/blocks_api/getLastReversibleBlockNum

Example Response:

{
   "code": 0,
   "result": 0
}

Allowed Operation Types

The :opTypes parameter accepts one or multiple comma-separated values from:

Account Operations

Content Operations

Transfer Operations

Reward Operations (Virtual)

Market Operations

Delegation Operations

Custom Operations


Back to Main Index