Get Transaction
Request details about a single Bitcoin transaction. Pass ?fees=1 to scan the previous outputs and compute the fees paid in this transaction. Pass ?rawHex=1 to return the raw transaction hex.
GET /tx/:txidGET /tx/:txid?fees=1GET /tx/:txid?rawHex=1Parameters
Section titled “Parameters”- txid -
string- The transaction ID - fees -
string- (optional) Scan previous outputs to compute fees - rawHex -
string- (optional) Return the raw transaction hex - at -
string(optional) - Access Token (json web token). Required if authentication is activated. Alternatively, the access token can be passed through theAuthorizationHTTP header (with theBearerscheme).
Examples
Section titled “Examples”GET /tx/abcdefGET /tx/abcdef?fees=1GET /tx/abcdef?rawHex=1Success
Section titled “Success”Status code 200 with JSON response:
{ "txid": "abcdef", "size": 250, "vsize": 125, "version": 1, "locktime": 0, "created": 1400000000, "confirmations": 5, "block": { "height": 100000, "hash": "abcdef", "time": 1400000000 }, "inputs": [ { "n": 0, "outpoint": { "txid": "abcdef", "vout": 2 }, "sig": "0a1b2c3d4e5f", "seq": 4294967295 }, { "n": 1, "outpoint": { "txid": "abcdef", "vout": 3 }, "sig": "", "seq": 4294967295, "witness": [ "aabbccddeeff", "00112233" ] } ], "outputs": [ { "n": 0, "value": 10000, "scriptpubkey": "0a1b2c3d4e5f", "type": "pubkeyhash", "address": "1xAddress" }, { "n": 1, "value": 0, "scriptpubkey": "0a1b2c3d4e5f", "type": "nulldata" }, { "n": 2, "value": 10000, "scriptpubkey": "0a1b2c3d4e5f", "type": "multisig", "addresses": [ "1xAddress", "1yAddress" ] }, { "n": 3, "value": 10000, "scriptpubkey": "000a1b2c3d4e5f", "type": "witness_v0_scripthash" }, { "n": 4, "value": 10000, "scriptpubkey": "000b1b2c3d4e5f", "type": "witness_v0_keyhash" } ]}Additional fields with ?fees=1:
{ "fees": 10000, "feerate": 50, "vfeerate": 75, "inputs": [ { "outpoint": { "value": 20000, "scriptpubkey": "0a1b2c3d4e5f" } } ], "outputs": ["..."]}Additional field with ?rawHex=1:
{ "hex": "rawTransactionInHexFormat"}Notes
blockdetails will be missing for unconfirmed transactionscreatedandconfirmationswill be missing for unconfirmed transactions- Input
sigis the raw hex, not ASM of script signature feeratehas units of Satoshi/bytevsizeandvfeerateare the virtual size and virtual fee rate and are different thansizeandfeeratefor SegWit transactions
Failure
Section titled “Failure”Status code 400 with JSON response:
{ "status": "error", "error": "<error message>"}