> ## Documentation Index
> Fetch the complete documentation index at: https://cosmos-docs-sync-security-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# tx_search

> Search for transactions

Search for transactions w/ their results.

See /subscribe for the query syntax.



## OpenAPI

````yaml /cometbft/latest/api-reference/rpc/openapi.yaml get /tx_search
openapi: 3.0.0
info:
  title: CometBFT RPC
  contact:
    name: CometBFT
    url: https://docs.cosmos.network/cometbft
  description: >
    CometBFT supports the following RPC protocols:


    * URI over HTTP

    * JSONRPC over HTTP

    * JSONRPC over websockets


    ## Configuration


    RPC can be configured by tuning parameters under `[rpc]` table in the

    `$CMTHOME/config/config.toml` file or by using the `--rpc.X` command-line

    flags.


    The default RPC listen address is `tcp://127.0.0.1:26657`.

    To set another address, set the `laddr` config parameter to desired value.

    CORS (Cross-Origin Resource Sharing) can be enabled by setting

    `cors_allowed_origins`, `cors_allowed_methods`, `cors_allowed_headers`

    config parameters.


    If testing using a local RPC node, under the `[rpc]`

    section change the `cors_allowed_origins` property, please add the URL of

    the site where this OpenAPI document is running, for example:

      `cors_allowed_origins = ["http://localhost:8088"]`

    or if testing from the official documentation site:

      `cors_allowed_origins = ["https://docs.cosmos.network"]`

    ## Arguments


    Arguments which expect strings or byte arrays may be passed as quoted

    strings, like `"abc"` or as `0x`-prefixed strings, like `0x616263`.


    ## URI/HTTP


    A REST like interface.

        curl localhost:26657/block?height=5

    ## JSONRPC/HTTP


    JSONRPC requests can be POST'd to the root RPC endpoint via HTTP.

        curl --header "Content-Type: application/json" --request POST --data '{"method": "block", "params": ["5"], "id": 1}' localhost:26657

    ## JSONRPC/websockets


    JSONRPC requests can be also made via websocket.

    The websocket endpoint is at `/websocket`, e.g. `localhost:26657/websocket`.

    Asynchronous RPC functions like event `subscribe` and `unsubscribe` are

    only available via websockets.


    For example using the [websocat](https://github.com/vi/websocat) tool, you
    can subscribe for 'NewBlock` events

    with the following command:

        echo '{ "jsonrpc": "2.0","method": "subscribe","id": 0,"params": {"query": "tm.event='"'NewBlock'"'"} }' | websocat -n -t ws://127.0.0.1:26657/websocket
  version: v0.38.x
  license:
    name: Apache 2.0
    url: https://github.com/cometbft/cometbft/blob/v0.38.x/LICENSE
servers:
  - url: https://rpc.cosmos.directory/cosmoshub
    description: Interact with the CometBFT RPC from a public node in the Cosmos registry
  - url: http://localhost:26657
    description: Interact with CometBFT RPC node running locally
security: []
tags:
  - name: Info
    description: Informations about the node APIs
  - name: Tx
    description: Transactions broadcast APIs
  - name: ABCI
    description: ABCI APIs
  - name: Evidence
    description: Evidence APIs
  - name: Unsafe
    description: Unsafe APIs
paths:
  /tx_search:
    get:
      tags:
        - Info
      summary: tx_search
      description: |-
        Search for transactions

        Search for transactions w/ their results.

        See /subscribe for the query syntax.
      operationId: tx_search
      parameters:
        - in: query
          name: query
          description: Query
          required: true
          schema:
            type: string
            example: '"tx.height=1000"'
        - in: query
          name: prove
          description: Include proofs of the transactions inclusion in the block
          required: false
          schema:
            type: boolean
            default: false
            example: true
        - in: query
          name: page
          description: Page number (1-based)
          required: false
          schema:
            type: integer
            default: 1
            example: 1
        - in: query
          name: per_page
          description: 'Number of entries per page (max: 100)'
          required: false
          schema:
            type: integer
            example: 30
            default: 30
        - in: query
          name: order_by
          description: >-
            Order in which transactions are sorted ("asc" or "desc"), by height
            & index. If empty, default sorting will be still applied.
          required: false
          schema:
            type: string
            default: asc
            example: asc
      responses:
        '200':
          description: List of unconfirmed transactions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TxSearchResponse'
        '500':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    TxSearchResponse:
      type: object
      required:
        - jsonrpc
        - id
        - result
      properties:
        jsonrpc:
          type: string
          example: '2.0'
        id:
          type: integer
          example: 0
        result:
          required:
            - txs
            - total_count
          properties:
            txs:
              type: array
              items:
                type: object
                properties:
                  hash:
                    type: string
                    example: >-
                      D70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED
                  height:
                    type: string
                    example: '1000'
                  index:
                    type: integer
                    example: 0
                  tx_result:
                    required:
                      - log
                      - gas_wanted
                      - gas_used
                      - tags
                    properties:
                      log:
                        type: string
                        example: '[{"msg_index":"0","success":true,"log":""}]'
                      gas_wanted:
                        type: string
                        example: '200000'
                      gas_used:
                        type: string
                        example: '28596'
                      tags:
                        $ref: '#/components/schemas/Event'
                    type: object
                  tx:
                    type: string
                    example: >-
                      5wHwYl3uCkaoo2GaChQmSIu8hxpJxLcCuIi8fiHN4TMwrRIU/Af1cEG7Rcs/6LjTl7YjRSymJfYaFAoFdWF0b20SCzE0OTk5OTk1MDAwEhMKDQoFdWF0b20SBDUwMDAQwJoMGmoKJuta6YchAwswBShaB1wkZBctLIhYqBC3JrAI28XGzxP+rVEticGEEkAc+khTkKL9CDE47aDvjEHvUNt+izJfT4KVF2v2JkC+bmlH9K08q3PqHeMI9Z5up+XMusnTqlP985KF+SI5J3ZOIhhNYWRlIGJ5IENpcmNsZSB3aXRoIGxvdmU=
                  proof:
                    required:
                      - RootHash
                      - Data
                      - Proof
                    properties:
                      RootHash:
                        type: string
                        example: >-
                          72FE6BF6D4109105357AECE0A82E99D0F6288854D16D8767C5E72C57F876A14D
                      Data:
                        type: string
                        example: >-
                          5wHwYl3uCkaoo2GaChQmSIu8hxpJxLcCuIi8fiHN4TMwrRIU/Af1cEG7Rcs/6LjTl7YjRSymJfYaFAoFdWF0b20SCzE0OTk5OTk1MDAwEhMKDQoFdWF0b20SBDUwMDAQwJoMGmoKJuta6YchAwswBShaB1wkZBctLIhYqBC3JrAI28XGzxP+rVEticGEEkAc+khTkKL9CDE47aDvjEHvUNt+izJfT4KVF2v2JkC+bmlH9K08q3PqHeMI9Z5up+XMusnTqlP985KF+SI5J3ZOIhhNYWRlIGJ5IENpcmNsZSB3aXRoIGxvdmU=
                      Proof:
                        required:
                          - total
                          - index
                          - leaf_hash
                          - aunts
                        properties:
                          total:
                            type: string
                            example: '2'
                          index:
                            type: string
                            example: '0'
                          leaf_hash:
                            type: string
                            example: eoJxKCzF3m72Xiwb/Q43vJ37/2Sx8sfNS9JKJohlsYI=
                          aunts:
                            type: array
                            items:
                              type: string
                            example:
                              - eWb+HG/eMmukrQj4vNGyFYb3nKQncAWacq4HF5eFzDY=
                        type: object
                    type: object
            total_count:
              type: string
              example: '2'
          type: object
    ErrorResponse:
      description: Error Response
      allOf:
        - $ref: '#/components/schemas/JSONRPC'
        - type: object
          properties:
            error:
              type: string
              example: Description of failure
    Event:
      type: object
      properties:
        key:
          type: string
          example: action
        value:
          type: string
          example: send
        index:
          type: boolean
          example: false
    JSONRPC:
      type: object
      properties:
        id:
          type: integer
          example: 0
        jsonrpc:
          type: string
          example: '2.0'

````