π¨βπ» Get Bitcoin transaction by hash
Code samples
GET /api/v1/btc/transactions/{hash}
Returns transaction details using the getrawtransaction method with verbose output.
π οΈ Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| hash | path | string | true | Bitcoin transaction hash (txid). |
Example responses
200 Response
{
"txid": "string",
"hash": "string",
"version": 0,
"size": 0,
"vsize": 0,
"weight": 0,
"locktime": 0,
"blockhash": "string",
"confirmations": 0,
"time": 0,
"blocktime": 0,
"hex": "string",
"vin": [
{
"txid": "string",
"vout": 0,
"coinbase": "string",
"scriptSig": {
"asm": "string",
"hex": "string"
},
"sequence": 0
}
],
"vout": [
{
"value": 0.1,
"n": 0,
"scriptPubKey": {
"asm": "string",
"hex": "string",
"type": "string",
"reqSigs": 0,
"addresses": [
"string"
]
}
}
]
}
404 Response
{
"error": "Transaction not found"
}
π Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Bitcoin transaction | Inline |
| 404 | Not Found | Transaction not found | Inline |
| 500 | Internal Server Error | Could not connect to BTC node | None |
π Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Β» txid | string | false | none | Transaction ID. |
| Β» hash | string | false | none | none |
| Β» version | integer | false | none | none |
| Β» size | integer | false | none | none |
| Β» vsize | integer | false | none | none |
| Β» weight | integer | false | none | none |
| Β» locktime | integer | false | none | none |
| » blockhash | string¦null | false | none | none |
| Β» confirmations | integer(int64)Β¦null | false | none | none |
| Β» time | integer(int64)Β¦null | false | none | none |
| Β» blocktime | integer(int64)Β¦null | false | none | none |
| Β» hex | string | false | none | Raw hex-encoded transaction. |
| Β» vin | [object] | false | none | none |
| »» txid | string¦null | false | none | none |
| »» vout | integer¦null | false | none | none |
| »» coinbase | string¦null | false | none | none |
| »» scriptSig | object¦null | false | none | none |
| »»» asm | string | false | none | none |
| »»» hex | string | false | none | none |
| »» sequence | integer(int64) | false | none | none |
| Β» vout | [object] | false | none | none |
| »» value | number(double) | false | none | Value in BTC. |
| »» n | integer | false | none | Output index. |
| »» scriptPubKey | object | false | none | none |
| »»» asm | string | false | none | none |
| »»» hex | string | false | none | none |
| »»» type | string | false | none | none |
| »»» reqSigs | integer¦null | false | none | none |
| »»» addresses | [string]¦null | false | none | none |
Status Code 404
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Β» error | string | false | none | none |