For the complete documentation index, see llms.txt. This page is also available as Markdown.

tx_search - Cosmos

Example code for the tx_search JSON-RPC method. Complete guide on how to use tx_search JSON-RPC in GetBlock Web3 documentation.

Searches transactions matching a CometBFT event query. Queries use the Tendermint event query syntax (e.g. transfer.recipient='cosmos1...'). Paginated — use page and per_page to traverse large result sets.

Parameters

Parameter
Type
Required
Description

query

string

Yes

Event query string (see CometBFT query syntax)

prove

boolean

No

Include Merkle proofs (default: false)

page

integer

No

Page number (default: 1)

per_page

integer

No

Results per page (default: 30, max: 100)

order_by

string

No

Sort order: "asc" or "desc" (default: "asc")

Request Example

# JSON-RPC over HTTP POST (canonical)
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "tx_search",
    "params": {
        "query": "transfer.recipient='cosmos1t6rlgf80jd8tanpnnvmmxfqdcm9cn7wctrs7hk'",
        "prove": false,
        "page": 1,
        "per_page": 30,
        "order_by": "desc"
    },
    "id": "getblock.io"
}'

# URI over HTTP GET (alternate, for simple methods)
curl --location --request GET 'https://go.getblock.io/<ACCESS-TOKEN>/tx_search?query="transfer.recipient='cosmos1t6rlgf80jd8tanpnnvmmxfqdcm9cn7wctrs7hk'"&prove=false&page=1&per_page=30&order_by="desc"'

Response Example

Response Parameters

Field
Type
Description

result.txs

array

Matching transactions

result.txs[].hash

string

Transaction hash

result.txs[].height

string

Block height

result.txs[].tx_result.events

array

Events emitted by the transaction

result.total_count

string

Total matching transactions across all pages

Use Cases

  • Account activity history (queries like transfer.recipient='cosmos1...')

  • Staking event tracking (delegate.validator='cosmosvaloper1...')

  • IBC packet history (recv_packet.packet_src_channel='channel-N')

  • Gov proposal vote auditing (proposal_vote.proposal_id='123')

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

-32603

Internal error

Server-side error while processing the request

429

Too Many Requests

Rate limit exceeded for your plan

-32602

Invalid query

The event query string is malformed or references unknown event types

SDK Integration

Was this helpful?