abci_query - Cosmos

abci_query. Learn how to perform precise queries on the Cosmos blockchain

abci_query - Cosmos [Value: 20CU]
Performs precise queries on the Cosmos blockchain
Use cases

Use cases

  • Query specific data on the ABCI application using a path
  • Retrieve historical data from a specific block height
  • Verify the integrity of the data using proofs
Constraints

Constraints

  • Network latency can delay data retrieval
  • Requires access to a Cosmos RPC endpoint
  • Data may change frequently depending on network activity
Get started
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl --location 'https://cosmos-hub.drpc.org' \
--header 'Content-Type: application/json' \
--data '{
    "jsonrpc": "2.0",
    "method": "abci_query",
    "params": [
        "PATH_VALUE",
        "DATA_VALUE",
        HEIGHT,
        true
    ],
    "id": 1
}'
Copy
Response
200
{
  "jsonrpc": "2.0",
  "result": {
    "response": {
      "code": 0,
      "log": "",
      "info": "",
      "index": "0",
      "key": "data",
      "value": "value",
      "proof": {
        "ops": [
          {
            "type": "iavl:v",
            "key": "data",
            "data": "proof_data"
          }
        ]
      },
      "height": "1234567",
      "codespace": ""
    }
  },
  "id": 1
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersobject
object
pathstring
The specific path to the data you want to query.
datastring
The data you want to query for, usually a key or identifier.
heightinteger
The block height at which to perform the query. Setting this to 0 queries the latest block.
proveboolean
If set to true, it adds proof of the transaction's inclusion in the block. The default value is false.

Response

200
Queries specific information from the Cosmos blockchain

Response params

object
idinteger
jsonrpcstring
resultstring
object
errorobject
If there's an error with the query, this field will provide details.
responsestring
object
logstring
Status log of the requested data.
heightstring
Height of the block where the data resides.
proofstring
Proof of the existence of the data if prove is true.
valuestring
The value associated with the key.
keystring
The key of the requested data.
indexinteger
Index of the requested data.
codestring
Error code if any.