Get table item

Get a table item at a specific ledger version from the table identified by {table_handle} in the path and the "key" (TableItemRequest) provided in the request body.

If the duration_secs param is provided, this endpoint will return a 200 if the following condition is true:

server_latest_ledger_info_timestamp >= server_current_time_timestamp - duration_secs

Path Parameters:

table_handle string required

Table handle hex encoded 32-byte string

Query Parameters:

ledger_version string<uint64>

Ledger version to get state of account. If not provided, it will be the latest version

Request Body

Table Item request for the GetTableItem API

key_type string

String representation of an on-chain Move type tag that is exposed in transaction payload. Values: - bool - u8 - u64 - u128 - address - signer - vector: vector<{non-reference MoveTypeId}> - struct: {address}::{module_name}::{struct_name}::<{generic types}>

value_type string

String representation of an on-chain Move type tag that is exposed in transaction payload. Values: - bool - u8 - u64 - u128 - address - signer - vector: vector<{non-reference MoveTypeId}> - struct: {address}::{module_name}::{struct_name}::<{generic types}>

key

The value of the table item's key

Response Header:

X-APTOS-BLOCK-HEIGHT integer

Current block height of the chain

X-APTOS-CHAIN-ID integer

Chain ID of the current chain

X-APTOS-EPOCH integer

Current epoch of the chain

X-APTOS-LEDGER-OLDEST-VERSION integer

Oldest non-pruned ledger version of the chain

X-APTOS-LEDGER-TIMESTAMPUSEC integer

Current timestamp of the chain

X-APTOS-LEDGER-VERSION integer

Current ledger version of the chain

X-APTOS-OLDEST-BLOCK-HEIGHT integer

Oldest non-pruned block height of the chain

Response Body:

object

An enum of the possible Move value types

Example:

// Request
curl -X POST -H 'Content-Type: application/json' https://aptos.blockpi.network/aptos/v1/your_api_key/v1/tables/table_handle/item
--data
{
  "key_type": "string",
  "value_type": "string",
  "key": "string"
}

// Result
{
    
}

Last updated