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

> Get the raw hexadecimal representation of a Bitcoin transaction for parsing and analysis.

# Transaction Hex



## OpenAPI

````yaml bitcoin/esplora-api/openapi.json get /tx/{txid}/hex
openapi: 3.0.3
info:
  title: Bitcoin - Esplora API
  version: 1.0.0
  description: >
    OpenAPI spec for core Esplora endpoints: blocks, transactions, addresses,
    mempool, fees, UTXO data and more.
servers:
  - url: https://xbt-mainnet.gomaestro-api.org/v0/esplora
  - url: https://xbt-testnet.gomaestro-api.org/v0/esplora
security:
  - api-key: []
paths:
  /tx/{txid}/hex:
    get:
      tags:
        - Transactions
      summary: Transaction Hex
      description: Returns a transaction serialized as hex.
      parameters:
        - name: txid
          in: path
          required: true
          description: Transaction ID of the transaction to fetch.
          schema:
            type: string
            example: d78b1139140848e646cfd7eb95868d2e01c600c3922de88038c591d2fb55cf96
      responses:
        '200':
          description: Raw transaction hex string.
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/TransactionHex'
              example: 02000000000101ad0c...00000000
        '404':
          description: Transaction not found
components:
  schemas:
    TransactionHex:
      type: string
      description: Raw hexadecimal representation of the Bitcoin transaction.
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: api-key
      description: Project API Key

````