> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# getrawtransaction | Bitcoin

The `getrawtransaction` method retrieves a transaction by its ID. It can return either the hex-encoded transaction data or a detailed, decoded transaction object.

<Check>
  **Get your own node endpoint today**

  [Start for free](https://console.chainstack.com/) and get your app to production levels immediately. No credit card required.

  You can sign up with your GitHub, X, Google, or Microsoft account.
</Check>

## Parameters

* `txid` (required): The transaction ID.
* `verbose` (optional): A boolean indicating whether to return a detailed, decoded transaction object instead of the hex-encoded data. Defaults to false.

## Response

* `result` — depending on the `verbose` parameter, this is either a string containing the hex-encoded transaction or an object containing the decoded transaction details.
* `error` — an object containing an error message if an error occurred, otherwise `null`.
* `id` — an integer representing the ID of the request.

## Use case

The `getrawtransaction` method is essential for retrieving transaction data for analysis, debugging, or verification purposes. It allows users to access detailed information about a transaction, including its inputs, outputs, and metadata.


## OpenAPI

````yaml /openapi/bitcoin_node_api/getrawtransaction.json POST /788f110831fe13808302bd79796d55e8
openapi: 3.0.0
info:
  title: getrawtransaction example
  version: 1.0.0
  description: >-
    This is an API example for getrawtransaction, a method to get a hex-encoded
    transaction or transaction  details by its ID.
servers:
  - url: https://nd-202-842-353.p2pify.com
security: []
paths:
  /788f110831fe13808302bd79796d55e8:
    post:
      tags:
        - Blockchain Operations
      summary: getrawtransaction
      operationId: getRawTransaction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  default: '1.0'
                method:
                  type: string
                  default: getrawtransaction
                params:
                  type: array
                  items:
                    oneOf:
                      - type: string
                        description: The transaction ID.
                      - type: boolean
                        description: >-
                          Whether to return a detailed, decoded transaction
                          instead of a hex-encoded string.
                  default:
                    - >-
                      0bf82c1d62b73497de2d796636cb1ce64415d25982332436007c0f51b5a75a62
                    - false
                id:
                  type: integer
                  default: 1
      responses:
        '200':
          description: The hex-encoded transaction or transaction details.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    oneOf:
                      - type: string
                        description: The hex-encoded transaction.
                      - type: object
                        description: The decoded transaction details, if requested.
                  error:
                    type: object
                  id:
                    type: integer

````