By height

Get blocks by height

This endpoint allows you to get the transactions in a block and the corresponding block information.

Transactions are limited by max default transactions size. If not all transactions are present, the user will need to query for the rest of the transactions via the get transactions API.

If the block is pruned, it will return a 410

GEThttps://apt.nownodes.io/v1/blocks/by_height/{block_height}
Path parameters
block_height*integer (uint64)

Block height to lookup. Starts at 0

Query parameters
Response
Headers
Body
block_height*U64 (string (uint64))

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

Example: "32425224034"
block_hash*HashValue (string)
block_timestamp*U64 (string (uint64))

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

Example: "32425224034"
first_version*U64 (string (uint64))

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

Example: "32425224034"
last_version*U64 (string (uint64))

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

Example: "32425224034"
transactionsarray of Transaction (object)

The transactions in the block in sequential order

Request
const response = await fetch('https://apt.nownodes.io/v1/blocks/by_height/{block_height}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "block_height": "32425224034",
  "block_hash": "text",
  "block_timestamp": "32425224034",
  "first_version": "32425224034",
  "last_version": "32425224034",
  "transactions": [
    {
      "type": "pending_transaction",
      "hash": "text",
      "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
      "sequence_number": "32425224034",
      "max_gas_amount": "32425224034",
      "gas_unit_price": "32425224034",
      "expiration_timestamp_secs": "32425224034",
      "payload": {
        "type": "entry_function_payload",
        "function": "0x1::aptos_coin::transfer",
        "type_arguments": [
          "text"
        ],
        "arguments": []
      },
      "signature": {
        "type": "ed25519_signature",
        "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
        "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 "
      }
    }
  ]
}

Last updated