# Getrawtransaction

## getrawtransaction

> Retrieves a raw transaction by its txid.\
> If \`verbose\` is false or omitted, the result is a raw hex string.\
> If \`verbose\` is true, returns a JSON object with decoded transaction details.<br>

```json
{"openapi":"3.0.0","info":{"title":"BlockBook RES-API","version":"1.0.0"},"servers":[{"url":"https://firo.nownodes.io"}],"security":[{"api-keyAuth":[]}],"components":{"securitySchemes":{"api-keyAuth":{"type":"apiKey","in":"header","name":"api-key"}},"schemas":{"GetRawTransactionRequest":{"type":"object","required":["jsonrpc","id","method","params"],"properties":{"jsonrpc":{"type":"string"},"id":{"type":"string"},"method":{"type":"string","enum":["getrawtransaction"]},"params":{"type":"array","minItems":1,"maxItems":2,"description":"Parameters:\n1. `txid` (string, required) — The transaction ID.\n2. `verbose` (boolean, optional) — If true, return JSON; if false, return hex. Default: false.\n","items":{"oneOf":[{"type":"string"},{"type":"boolean"}]}}}},"GetRawTransactionHexResponse":{"type":"object","properties":{"result":{"type":"string","description":"Raw hex-encoded transaction string"},"error":{"type":"object","nullable":true},"id":{"type":"string"}}},"GetRawTransactionVerboseResponse":{"type":"object","properties":{"result":{"type":"object","description":"Decoded transaction (verbose = true)","properties":{"txid":{"type":"string","description":"Transaction ID"},"hash":{"type":"string","description":"Witness hash (if applicable)"},"version":{"type":"integer"},"size":{"type":"integer"},"vsize":{"type":"integer"},"locktime":{"type":"integer"},"vin":{"type":"array","items":{"type":"object","properties":{"txid":{"type":"string"},"vout":{"type":"integer"},"scriptSig":{"type":"object","properties":{"asm":{"type":"string"},"hex":{"type":"string"}}},"txinwitness":{"type":"array","items":{"type":"string"}},"sequence":{"type":"integer"}}}},"vout":{"type":"array","items":{"type":"object","properties":{"value":{"type":"number","format":"float"},"n":{"type":"integer"},"scriptPubKey":{"type":"object","properties":{"asm":{"type":"string"},"hex":{"type":"string"},"type":{"type":"string"},"reqSigs":{"type":"integer","nullable":true},"addresses":{"type":"array","items":{"type":"string"},"nullable":true}}}}}},"hex":{"type":"string","description":"The raw hex representation of the transaction"}}},"error":{"type":"object","nullable":true},"id":{"type":"string"}}}}},"paths":{"/":{"post":{"tags":["getrawtransaction"],"summary":"getrawtransaction","description":"Retrieves a raw transaction by its txid.\nIf `verbose` is false or omitted, the result is a raw hex string.\nIf `verbose` is true, returns a JSON object with decoded transaction details.\n","operationId":"getrawtransaction","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetRawTransactionRequest"}}}},"responses":{"200":{"description":"Transaction retrieved successfully","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GetRawTransactionHexResponse"},{"$ref":"#/components/schemas/GetRawTransactionVerboseResponse"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"string"}}}}}}}}}
```
